/* V3.3.2.16 — Assiduité */
.attendance-board {margin-top:1.1rem;}
.attendance-alert {display:flex; align-items:center; gap:1rem; justify-content:space-between; border-top:1px solid #dfe6df; padding:1rem 0;}
.attendance-alert small {display:block; color:#586960; margin-top:.3rem;}
.attendance-seen {opacity:.7;}
.attendance-actions {display:flex; flex-wrap:wrap; gap:.4rem;}
.attendance-actions button {font-size:.85rem; padding:.5rem .7rem;}
.attendance-stats {display:grid; grid-template-columns:repeat(3,minmax(0,1fr));gap:.6rem;margin:1.2rem 0;}
.attendance-stats>div {background:#f3f6f0;border-radius:10px;padding:.9rem;}
.attendance-stats strong {display:block;font-size:1.6rem;}
.attendance-stats span {font-size:.8rem;color:#54675e;}
.attendance-history {max-height:55vh;overflow-y:auto;}
.attendance-row {display:flex;align-items:center;justify-content:space-between;gap:.8rem;border-bottom:1px solid #dfe6df;padding:.7rem 0;}
.attendance-row>div {flex:1;min-width:0;}
.attendance-row small {display:block;color:#576960;margin-top:.2rem;}
.attendance-status {font-size:.8rem;white-space:nowrap;background:#f2f2ee;border-radius:1rem;padding:.3rem .6rem;}
.attendance-status.present {background:#d9efdf;color:#165d34;}
.attendance-status.absent {background:#ffeddb;color:#795019;}
.attendance-grid {max-width:100%;max-height:65vh;overflow:auto;border:1px solid #c6d2c8;}
.attendance-grid table {border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;}
.attendance-grid th,.attendance-grid td {padding:.6rem;min-width:4.1rem;text-align:center;border-right:1px solid #ccd5cc;border-bottom:1px solid #ccd5cc;}
.attendance-grid th {background:#f3f6f0;}
.attendance-grid thead th {position:sticky;top:0;z-index:2;}
.attendance-grid thead th:first-child {z-index:3;}
.attendance-grid th:first-child {position:sticky;left:0;z-index:1;text-align:left;min-width:9rem;max-width:13rem;overflow-wrap:anywhere;}
.attendance-grid th small {display:block;font-size:.75rem;}
.attendance-dialog {width:96vw;max-width:1200px;max-height:94vh;padding:1rem;}
.attendance-cell.present {background:#d9efdf;color:#165d34;}
.attendance-cell.absent {background:#ffe1e1;color:#842525;}
.attendance-cell.unknown {background:#e9ece9;color:#334438;}
.attendance-cell.off,.attendance-cell.cancelled,.attendance-cell.report {background:#f1eadb;color:#51442c;}
.attendance-cell.outside,.attendance-cell.not_expected {background:#fafafa;color:#555;}
.attendance-cell.future {background:#e5effa;color:#234a72;}
.attendance-cell.conflict {background:#fff0c1;color:#694800;font-weight:700;}
.attendance-legend {display:flex;flex-wrap:wrap;gap:.5rem;font-size:.85rem;}
.attendance-legend span {padding:.3rem;border:1px solid #cad1ca;border-radius:5px;}
.attendance-enrollment {max-width:14rem;white-space:normal;text-align:left;min-height:44px;}
.workshop-note-text {white-space:pre-wrap;overflow-wrap:anywhere;}
#workshop-notes details {border-top:1px solid #cdd8cd;padding:.7rem 0;}
#workshop-notes summary {cursor:pointer;min-height:44px;}
@media(max-width:620px){.attendance-alert,.attendance-row{align-items:stretch;flex-direction:column;}.attendance-stats{grid-template-columns:repeat(3,minmax(0,1fr));}.attendance-stats>div{padding:.5rem;}.attendance-stats strong{font-size:1.2rem;}.attendance-actions button{flex:1;}}

.attendance-cell.pause{background:#ededeb;color:#444;font-weight:600}

/* V43: one shared HTML viewer; frozen identities remain readable at every scale. */
.attendance-viewer-tools{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;margin:.7rem 0}
.attendance-viewer-tools button,.attendance-key summary{min-height:44px}
.attendance-grid table{--attendance-name-width:9rem;--attendance-total-width:4.5rem;--attendance-frozen-font:1rem}
.attendance-grid tr>th:first-child{width:var(--attendance-name-width);min-width:var(--attendance-name-width);max-width:var(--attendance-name-width);box-sizing:border-box;font-size:var(--attendance-frozen-font)}
.attendance-grid .attendance-total{position:sticky;left:var(--attendance-name-width);z-index:2;background:#edf3e9;width:var(--attendance-total-width);min-width:var(--attendance-total-width);max-width:var(--attendance-total-width);box-sizing:border-box;font-size:var(--attendance-frozen-font);font-weight:700;padding:.35em}
.attendance-grid thead th:first-child,.attendance-grid thead .attendance-total{z-index:5}
.attendance-grid tfoot th,.attendance-grid tfoot td{position:sticky;bottom:0;background:#e7eee3;font-weight:700;z-index:3;border-top:2px solid #56715e}
.attendance-grid tfoot th:first-child,.attendance-grid tfoot .attendance-total{z-index:5}
.attendance-grid.attendance-touch{touch-action:pan-x pan-y;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
/* Mobile is a single free-moving document: no overlaying row, column or footer. */
.attendance-grid.attendance-touch table tr>:is(th,td){position:static!important;left:auto;top:auto;bottom:auto;z-index:auto}
.attendance-expanded{position:fixed!important;inset:0!important;margin:0!important;width:100vw!important;width:100dvw!important;height:100vh!important;height:100dvh!important;max-width:none!important;max-height:none!important;box-sizing:border-box;background:#fff;overflow:auto}
.attendance-viewer-tools [data-grid-close]{display:none}
.attendance-dialog.attendance-expanded{border:0;display:flex;flex-direction:column;padding:max(4px,env(safe-area-inset-top)) max(4px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left));overflow:hidden}
.attendance-expanded>h2,.attendance-expanded>label,.attendance-expanded>form,.attendance-expanded .attendance-viewer>p,.attendance-expanded .attendance-key{display:none}
.attendance-expanded>[data-grid-body],.attendance-expanded .attendance-viewer{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0}
.attendance-expanded .attendance-viewer-tools{display:flex;flex-wrap:nowrap;align-items:center;gap:3px;margin:0;padding:2px;flex:none}
.attendance-expanded .attendance-viewer-tools button{font-size:.85rem;padding:.4rem;min-height:40px;white-space:nowrap}
.attendance-expanded .attendance-viewer-tools output{font-size:.8rem;min-width:3rem;text-align:center}
.attendance-expanded .attendance-viewer-tools [data-grid-close]{display:inline-flex;align-items:center;justify-content:center;min-width:40px;font-size:1.3rem}
.attendance-expanded .attendance-grid{flex:1;min-height:0;max-height:none;max-width:100%;width:100%;box-sizing:border-box}
.attendance-links{margin-top:1.5rem;border-top:1px solid #c6d2c8;padding-top:.75rem}
.attendance-links summary{min-height:44px;cursor:pointer;font-weight:600}
.attendance-links>div{display:grid;gap:.25rem}
.attendance-links button{display:block;width:100%;text-align:left;min-height:44px;font-size:.95rem;padding:.6rem;border:0;border-bottom:1px solid #dfe6df;border-radius:0;background:transparent}
@media(min-width:821px) and (pointer:fine){.attendance-viewer-tools{display:none}.attendance-key{margin:.5rem 0}}

.attendance-dialog{box-sizing:border-box}

/* Keep a mobile scrollport inside the visible dialog, rather than below its fold. */
.attendance-dialog.attendance-mobile{display:flex;flex-direction:column;height:94vh;height:94dvh;overflow:hidden}
.attendance-mobile>h2,.attendance-mobile>label,.attendance-mobile>form{flex:none}
.attendance-mobile>h2{font-size:1.2rem;margin:.25rem 0}
.attendance-mobile>[data-grid-body],.attendance-mobile .attendance-viewer{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0}
.attendance-mobile .attendance-viewer>p{display:none}
.attendance-mobile .attendance-key,.attendance-mobile .attendance-viewer-tools{flex:none}
.attendance-mobile .attendance-key[open] .attendance-legend{max-height:25dvh;overflow:auto}
.attendance-mobile .attendance-grid{flex:1;min-height:0;max-height:none;box-sizing:border-box;width:100%}

.attendance-dialog-header{position:sticky;top:0;z-index:6;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;padding:6px 0;flex:none}.attendance-dialog-header h2{margin:0;font-size:1.2rem}.attendance-dialog-header button{min-width:44px;min-height:44px;font-size:1.5rem}.attendance-expanded>.attendance-dialog-header{display:none}

/* V45: consultation only, shared by Gestion and Appel. */
.pedagogical-readonly article{padding:.75rem 0;border-top:1px solid #dce6dc}.pedagogical-note-text{white-space:pre-wrap;overflow-wrap:anywhere}.pedagogical-session{margin:1rem 0;padding:1rem;border:1px solid #dce6dc;border-radius:12px;background:white}.pedagogical-controls{display:flex;flex-wrap:wrap;gap:.75rem;align-items:end}.pedagogical-controls label{flex:1;min-width:10rem}.pedagogical-controls select{width:100%;min-height:44px}
