/* Statistiche (Dati globali e scheda studente): classi st-* per non toccare il resto. */
.st-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.st-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.st-tab { padding: 8px 14px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--text-gray); background: #fff; border: 1px solid var(--border-color); cursor: pointer; }
.st-tab.active { background: #1B2140; color: #fff; border-color: #1B2140; }
.st-period-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 14px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.st-period-label { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-gray); }
.st-tiles.st-fixed { grid-template-columns: repeat(auto-fill, minmax(200px, 260px)); }
.st-period { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.st-period button { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border-color); background: #fff; font-weight: 700; font-size: 13px; color: var(--text-gray); cursor: pointer; }
.st-period button.active { background: var(--primary-blue); border-color: var(--primary-blue); color: #fff; }
.st-period input { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border-color); font-size: 13px; }
.st-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.st-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.st-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.st-g21 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.st-tiles { display: grid; gap: 14px; margin-bottom: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.st-card { background: #fff; border-radius: 12px; border: 1px solid var(--border-color); padding: 14px 16px; min-width: 0; overflow-x: auto; }
.st-h { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; color: var(--text-gray); text-transform: uppercase; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.st-h span { text-transform: none; letter-spacing: 0; font-weight: 600; }
.st-h + .st-desc { margin-top: -6px; }
.st-desc { font-size: 12.5px; font-weight: 500; line-height: 1.45; color: #5b6274; margin-bottom: 12px; }
.st-tile .l { font-size: 12px; font-weight: 700; color: var(--text-gray); }
.st-tile .v { font-size: 26px; font-weight: 800; line-height: 1.2; color: var(--text-dark); font-variant-numeric: tabular-nums; }
.st-tile .s { font-size: 12.5px; font-weight: 600; color: #52514e; }
.st-good { color: #0a7a0a !important; }
.st-bad { color: #d03b3b !important; }
.st-warn { color: #a86a00 !important; }
.st-muted { color: var(--text-gray); }
.st-note { font-size: 12px; color: var(--text-gray); font-weight: 600; margin-top: 8px; }
.st-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.st-table th { font-size: 10.5px; font-weight: 800; color: var(--text-gray); text-transform: uppercase; letter-spacing: .05em; text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--border-color); background: none; white-space: nowrap; }
.st-table td { padding: 7px 8px; border-bottom: 1px solid #EDEFF4; text-align: right; font-weight: 600; }
.st-table th.l, .st-table td.l { text-align: left; }
.st-table td:not(.l) { white-space: nowrap; }
.st-table tr:hover { background: #fafbfd; }
.st-q { max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tag { font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.st-tag.bad { background: #FBE7E7; color: #d03b3b; }
.st-tag.ok { background: #E3F4E3; color: #0a7a0a; }
.st-tag.warn { background: #FFF3D6; color: #8a5a00; }
.st-tag.n { background: #EDEFF4; color: #52514e; }
.st-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.st-signal { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid #EDEFF4; font-size: 14px; font-weight: 600; line-height: 1.35; }
.st-signal:first-child { border-top: 0; }
.st-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 14px; }
.st-avatar { width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, #7aa2ff, #2F5BEA); color: #fff; font-weight: 800; font-size: 19px; display: flex; align-items: center; justify-content: center; }
.st-name { font-size: 22px; font-weight: 800; }
.st-sub { font-size: 13px; color: var(--text-gray); font-weight: 600; }
.st-empty { padding: 30px; text-align: center; color: var(--text-gray); font-weight: 600; }
.st-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.st-filters input, .st-filters select { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-color); font-size: 13px; }
.st-pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: 13px; font-weight: 600; }
.st-svg { display: block; width: 100%; height: auto; }
.st-svg text { font-family: inherit; font-weight: 600; }
.st-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; font-weight: 700; color: #52514e; text-transform: none; letter-spacing: 0; }
.st-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
@media (max-width: 1100px) { .st-g2, .st-g3, .st-g21 { grid-template-columns: minmax(0, 1fr); } }

/* Barre orizzontali (HTML) */
.st-hbars.with-ref { padding-top: 18px; }
.st-hbar-reflabel { position: absolute; top: -17px; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: #52514e; white-space: nowrap; }
.st-hbars { display: flex; flex-direction: column; gap: 9px; padding: 4px 0; }
.st-hbar-row { position: relative; display: grid; grid-template-columns: min(var(--st-label), 42%) minmax(40px, 1fr) min(var(--st-text), 34%); align-items: center; gap: 10px; font-size: 12.5px; }
.st-hbar-label { font-weight: 600; color: #0b0b0b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-hbar-track { position: relative; height: 13px; border-radius: 4px; background: #EDEFF4; }
.st-hbar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.st-hbar-ref { position: absolute; top: -4px; bottom: -4px; border-left: 1.5px dashed #52514e; }
.st-hbar-text { font-weight: 800; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tip { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); z-index: 5; width: max-content; max-width: 100%; padding: 4px 9px; border-radius: 5px; background: #0A254D; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.35; white-space: normal; pointer-events: none; }
.st-empty-inline { padding: 12px 0; text-align: center; color: #7a7f93; font-weight: 600; font-size: 13px; }

/* Controllo salvataggi */
.sc-tile { cursor: pointer; border-left: 5px solid #cfd4e0; }
.sc-tile.ok { border-left-color: #1baf7a; }
.sc-tile.warn { border-left-color: #e0a100; }
.sc-tile.bad { border-left-color: #d03b3b; }
.sc-tile .v { font-size: 19px; }
.sc-desc { font-size: 13px; color: #52514e; font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
.sc-row.bad td { background: #FDF3F3; }
.sc-row.warn td { background: #FFF9EA; }
.sc-row td:first-child { white-space: nowrap; }
.sc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: #cfd4e0; }
.sc-dot.ok { background: #1baf7a; }
.sc-dot.warn { background: #e0a100; }
.sc-dot.bad { background: #d03b3b; }
.sc-missing { margin-top: 14px; padding: 12px; border-radius: 10px; background: #F6F7FB; }
.sc-note { margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--text-gray); background: #EDEFF4; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.sc-btn { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border-color); background: #fff; color: #1B2140; font-weight: 700; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.sc-btn:hover, .sc-btn:focus { background: #EDEFF4; color: #1B2140; outline: none; }
.sc-detail { font-size: 12.5px; color: #52514e; max-width: 420px; overflow-wrap: anywhere; }

/* Telefono: riquadri due per riga, tabelle come schede verticali (etichette da js/stats.js) */
@media (max-width: 640px) {
    .st-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .st-tile .v { font-size: 21px; }
    .st-card { padding: 12px; overflow-x: visible; }
    .st-h { flex-wrap: wrap; }
    .st-table, .st-table tbody, .st-table tr, .st-table td { display: block; width: 100%; }
    .st-table tr:first-child:has(th) { display: none; }
    .st-table tr { padding: 8px 0; border-bottom: 1px solid var(--border-color); }
    .st-table tr:hover { background: none; }
    .st-table td, .st-table td.l { border: 0; padding: 3px 0; text-align: right; white-space: normal; overflow-wrap: anywhere; }
    .st-table td::before { content: attr(data-label); float: left; margin-right: 12px; font-size: 10.5px; font-weight: 800; color: var(--text-gray); text-transform: uppercase; letter-spacing: .04em; line-height: 20px; }
    .st-table td:first-child { text-align: left; font-weight: 800; font-size: 14.5px; }
    .st-table td:first-child::before { display: none; }
    .st-table td:empty { display: none; }
    .st-q { max-width: none; white-space: normal; }
}
