:root { --pilot-blue: #0a697d; --pilot-dark: #064e61; --pilot-pale: #eaf5f7; }
.pilot-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem max(1rem, calc((100vw - 1450px)/2)); background: #073e4d; color: white; box-shadow: 0 3px 12px #0002; font: 600 1rem/1.3 Arial,sans-serif; }
.pilot-bar-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pilot-report-group { display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; }
.pilot-credit { display: inline-block; padding: .52rem .65rem; border: 1px solid #9bc4cc; border-radius: 3px; font-variant-numeric: tabular-nums; }
.pilot-bar button, .pilot-admin button, .pilot-report button, .pilot-login button { border: 1px solid currentColor; border-radius: 3px; padding: .6rem .9rem; cursor: pointer; font: inherit; font-weight: 700; }
.pilot-bar button { background: white; color: #073e4d; }
.pilot-bar button:disabled { opacity: .5; cursor: not-allowed; }
.pilot-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: #102b32bc; }
.pilot-overlay[hidden] { display: none; }
.pilot-overlay-card { width: min(100%, 30rem); padding: 2rem; background: white; border-radius: 8px; text-align: center; box-shadow: 0 12px 45px #0004; }
.pilot-overlay-card h2 { margin-top: 0; }
.pilot-overlay-card button { background: var(--pilot-blue); border: 0; color: white; padding: .8rem 1.5rem; font: 700 1rem Arial,sans-serif; cursor: pointer; }
.pilot-error { color: #a52b2b; min-height: 1.4em; }
.pilot-login, .pilot-admin, .pilot-report { margin: 0; background: #f4f3f1; color: #252525; font: 16px/1.5 Arial,sans-serif; }
.pilot-login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card, .pilot-admin main, .pilot-report main { background: white; border: 1px solid #ddd; padding: clamp(1.5rem, 4vw, 3rem); }
.login-card { width: min(100%, 30rem); }
.brand-logo { display: block; width: 9rem; height: auto; background: white; padding: .2rem; border-radius: 3px; }
.login-logo { width: min(100%, 14rem); margin: 0 auto 1.25rem; }
.header-brand { display: flex; align-items: center; gap: 1rem; }
.login-card h1 { font-size: 2.2rem; margin: .3rem 0; }
.login-card form { display: grid; gap: 1rem; margin: 2rem 0; }
.login-card label { display: grid; gap: .3rem; font-weight: 700; }
.login-card input { box-sizing: border-box; width: 100%; padding: .8rem; border: 1px solid #aaa; font: inherit; }
.login-card button, .pilot-admin button, .pilot-report button { background: var(--pilot-blue); color: white; }
.login-card .eyebrow { color: #9c2b2b; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.pilot-note { color: #555; font-size: .9rem; }
#login-error { color: #a52b2b; min-height: 1.3em; }
.pilot-admin header, .pilot-report header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem max(1rem, calc((100vw - 1150px)/2)); background: #073e4d; color: white; }
.pilot-admin header h1, .pilot-report header h1 { font-size: 1.4rem; margin: 0; }
.pilot-admin header button { background: white; color: #073e4d; }
.pilot-admin main, .pilot-report main { max-width: 1100px; margin: 2rem auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.openai-card, .student-management { border: 1px solid #a5c8cf; border-left: 4px solid var(--pilot-blue); background: #f5fbfc; }
.openai-card { margin-bottom: 1.25rem; padding: .8rem 1rem; }
.openai-card-row { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(16rem, 1.65fr) auto; align-items: center; gap: 1rem; }
.openai-card-heading h2 { margin: 0; font-size: 1.2rem; }
.openai-card-heading p { margin: .2rem 0 0; color: #47575b; font-size: .82rem; line-height: 1.3; }
.openai-consumption { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: .75rem; padding: .5rem .7rem; border: 2px solid #bacbd0; border-radius: 4px; background: white; }
.openai-consumption > span:first-child { font-size: .85rem; font-weight: 700; }
.openai-consumption small { display: block; font-weight: 400; }
.openai-consumption strong { font-size: 1.15rem; white-space: nowrap; }
.openai-threshold-status { grid-column: 1 / -1; font-size: .78rem; }
.openai-consumption.is-orange { border-color: #bb6d0d; background: #fff2df; color: #663900; }
.openai-consumption.is-red { border-color: #aa2b2b; background: #ffebeb; color: #851919; }
.openai-actions { display: flex; align-items: stretch; gap: .35rem; }
.openai-billing-link { display: inline-flex; align-items: center; padding: .55rem .7rem; border-radius: 3px; background: var(--pilot-blue); color: white; font-size: .85rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.openai-actions .openai-settings-button { display: grid; place-items: center; min-width: 2.6rem; padding: .35rem; background: white; border-color: var(--pilot-blue); color: var(--pilot-dark); font-size: 1.35rem; line-height: 1; }
.openai-actions .openai-settings-button:disabled { opacity: .5; cursor: not-allowed; }
.openai-actions :is(a, button):focus-visible { outline: 3px solid #252525; outline-offset: 2px; }
.openai-settings-dialog { box-sizing: border-box; width: min(28rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); padding: 1.5rem; border: 1px solid #8db4bd; border-radius: 8px; box-shadow: 0 15px 45px #0004; color: #252525; font: 16px/1.5 Arial,sans-serif; }
.openai-settings-dialog::backdrop { background: #102b32a8; }
.openai-alert-settings { display: grid; gap: .85rem; }
.openai-alert-settings h2, .openai-alert-settings p { margin: 0; }
.openai-alert-settings label { display: grid; gap: .25rem; font-weight: 700; }
.openai-alert-settings input { box-sizing: border-box; width: 100%; padding: .55rem; border: 1px solid #aaa; font: inherit; }
#openai-alert-save-status { color: #a52b2b; }
#openai-alert-save-status:empty { display: none; }
.openai-dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.openai-dialog-actions button { border: 1px solid var(--pilot-blue); border-radius: 3px; padding: .55rem .8rem; background: var(--pilot-blue); color: white; font: 700 1rem Arial,sans-serif; cursor: pointer; }
.openai-dialog-actions button[type="button"] { background: white; color: var(--pilot-dark); }
.openai-dialog-actions button:disabled { opacity: .55; cursor: not-allowed; }
.student-management { padding: 1rem 1.25rem; }
.student-management h2 { margin: 0 0 .8rem; font-size: 1.25rem; }
.student-management h3 { margin: 0 0 .55rem; font-size: 1rem; }
.student-management-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.5rem; }
.student-management-grid > div { min-width: 0; }
.student-management-grid > div + div { padding-left: 1.5rem; border-left: 1px solid #c4d8dc; }
.admin-form { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem; }
.admin-form label { display: grid; gap: .25rem; font-weight: 700; }
.admin-form input { padding: .55rem; font: inherit; border: 1px solid #aaa; }
.pilot-admin main > .student-search { display: grid; gap: .3rem; max-width: 28rem; margin: 1rem 0; font-weight: 700; }
.pilot-admin main > .student-search input { box-sizing: border-box; width: 100%; height: 3rem; padding: .7rem; font: inherit; border: 1px solid #aaa; }
.student-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(7rem, 10rem); align-items: end; gap: .75rem; }
.student-filters > label { display: grid; gap: .3rem; min-width: 0; font-weight: 700; }
.student-filters input, .student-filters select { box-sizing: border-box; width: 100%; height: 3rem; padding: .7rem; font: inherit; border: 1px solid #aaa; background: white; }
.student-card[hidden] { display: none; }
#new-credentials { display: grid; gap: .5rem; padding: 1rem; margin: 1.5rem 0; border: 2px solid var(--pilot-blue); background: #eaf6f8; font-size: 1.1rem; overflow-wrap: anywhere; }
#new-credentials:empty { display: none; }
#new-credentials strong { font-size: 1.2rem; }
.student-card { border: 1px solid #ccc; border-left: 5px solid var(--pilot-blue); padding: 1.25rem; margin: 1rem 0; }
.student-card[data-status="archived"] { border-left-color: #777; background: #fafafa; }
.student-card h3 { margin: 0 0 .5rem; }
.student-card h4 { margin-bottom: .4rem; }
.student-actions, .print-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.student-actions { align-items: end; }
.student-actions > .admin-form { flex-wrap: nowrap; }
.student-actions > .admin-form input { box-sizing: border-box; width: 8rem; }
.pilot-admin .student-actions button { white-space: nowrap; }
.pilot-admin .student-actions .action-positive { background: #216b3a; color: white; border-color: #216b3a; }
.pilot-admin .student-actions .action-report { background: var(--pilot-blue); color: white; border-color: var(--pilot-blue); }
.pilot-admin .student-actions .action-neutral { background: #58636b; color: white; border-color: #58636b; }
.pilot-admin .student-actions .action-warning { background: #985000; color: white; border-color: #985000; }
.pilot-admin .student-actions .action-danger { background: #a52b2b; color: white; border-color: #a52b2b; }
.pilot-admin .student-actions button:disabled { opacity: .55; cursor: not-allowed; }
.pilot-admin .student-actions button:focus-visible { outline: 3px solid #252525; outline-offset: 2px; }
.credit-history { list-style: none; padding: 0; margin: 0; }
.credit-history li { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; border-top: 1px solid #ddd; padding: .45rem 0; }
.credit-history button { padding: .35rem .6rem; background: white; color: #8d2525; }
.print-actions a { color: var(--pilot-dark); font-weight: 700; }
.report-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.report-stats p { margin: 0; padding: 1rem; background: var(--pilot-pale); }
.report-stats strong, .report-stats span { display: block; }
.report-stats strong { font-size: 1.4rem; }
.pilot-report table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.pilot-report th, .pilot-report td { border: 1px solid #bbb; padding: .55rem; text-align: left; vertical-align: top; }
.pilot-report thead { background: var(--pilot-pale); }
@media (max-width: 900px) { .openai-card-row { grid-template-columns: minmax(0, 1fr) auto; } .openai-consumption { grid-column: 1 / -1; grid-row: 2; } .student-management-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; } .student-management-grid > div + div { padding: 1rem 0 0; border-left: 0; border-top: 1px solid #c4d8dc; } }
@media (max-width: 650px) { .pilot-bar, .pilot-admin header, .pilot-report header { flex-direction: column; align-items: stretch; } .header-brand { flex-wrap: wrap; } .openai-card-row { grid-template-columns: minmax(0, 1fr); } .openai-consumption { grid-column: 1; grid-row: auto; } .openai-actions { grid-row: 3; } .openai-billing-link { flex: 1; justify-content: center; white-space: normal; text-align: center; } .student-filters { grid-template-columns: minmax(0, 1fr); } .student-actions { align-items: stretch; } .student-actions > .admin-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; } .student-actions > .admin-form input { width: 100%; } .pilot-admin .student-actions > button { width: 100%; white-space: normal; } .report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pilot-report table { font-size: .75rem; } }
@media print { .pilot-report { background: white; font-size: 11px; } .pilot-report header { background: white; color: black; padding: 0; } .pilot-report main { border: 0; margin: 0; padding: 0; max-width: none; } .print-actions { display: none; } .pilot-report th, .pilot-report td { padding: .3rem; } }
.pilot-report-link{display:inline-flex;align-items:center;padding:.6rem .9rem;background:#fff;border-radius:3px;color:#073e4d;text-decoration:none;font-weight:700}
.pilot-report-link:focus-visible{outline:3px solid #fff;outline-offset:3px}
.pilot-admin .admin-form select{padding:.55rem;border:1px solid #aaa;background:#fff;font:inherit}
.access-message{margin:0;padding:.75rem;background:#fff;border:1px solid #a5c8cf;font:inherit;white-space:pre-wrap;overflow-wrap:anywhere}
#new-credentials button{justify-self:start}
.category-form{align-items:end;margin:.5rem 0 .9rem}
.pilot-admin .category-form .action-neutral{background:#58636b;color:#fff;border-color:#58636b}
.report-connections{break-before:page;page-break-before:always}
.report-connections h2{color:#073e4d}
.pilot-report header .print-actions a{color:#fff}
.report-table-wrap{max-width:100%;overflow-x:auto}
@media (max-width:650px){.pilot-report .report-table-wrap table{min-width:650px}.pilot-bar-actions{justify-content:space-between}.pilot-report-link{font-size:.9rem}.pilot-bar{gap:.4rem}.pilot-bar-actions{gap:.4rem}.pilot-bar-actions button,.pilot-report-link{padding:.45rem .65rem;font-size:.83rem}}
@media print{.report-connections{break-before:page;page-break-before:always}.pilot-report table{font-size:10px}.pilot-report .report-table-wrap{overflow:visible}.pilot-report header .print-actions a{display:none}}

/* Tableau de suivi des élèves et fiche détaillée. */
.student-heading{display:flex;align-items:start;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.student-heading h2{margin:.1rem 0}
.student-heading .eyebrow{margin:0;color:#0a697d;text-transform:uppercase;font-size:.75rem;font-weight:800;letter-spacing:.08em}
#student-count{margin:.2rem 0;color:#58636b}
.student-create{min-width:min(100%,290px);background:#fff;border:1px solid #b8d3d9;border-radius:10px;padding:.4rem .8rem}
.student-create summary{cursor:pointer;font-weight:800;color:#075360;padding:.5rem}
.student-create[open]{width:min(100%,650px)}
.student-create .admin-form{margin-top:1rem}
.student-filters{margin-top:1.2rem}
.student-table-wrap{overflow-x:auto;border:1px solid #d0dfe4;border-radius:12px;background:#fff}
.student-table{width:100%;border-collapse:collapse;min-width:700px}
.student-table th,.student-table td{padding:.75rem .8rem;text-align:left;border-bottom:1px solid #e0e8eb;vertical-align:middle}
.student-table thead{background:#edf5f7;color:#173858}
.student-row:hover{background:#f6fafb}
.student-row[data-status="archived"]{color:#65717a}
.student-open{white-space:nowrap;background:#fff;color:#075360;border:1px solid #78aab5;border-radius:7px;padding:.45rem .75rem;font-weight:700}
.student-open[aria-expanded="true"]{background:#075360;color:#fff}
.student-detail-row>td{padding:0;background:#f3f8fa}
.student-detail-card{margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:1rem 1.25rem!important}
.student-detail-row[hidden],.student-row[hidden]{display:none}
.statement-week-picker{display:flex;align-items:end;gap:.7rem;margin:1rem 0;flex-wrap:wrap}
.statement-week-picker label{display:grid;gap:.35rem}
.statement-week-picker input{padding:.5rem;font:inherit}
.weekly-statement main{max-width:850px}
.weekly-statement tfoot{background:#edf5f7}
@media print{.statement-week-picker{display:none}.weekly-statement .report-table-wrap table{min-width:0}}
