:root{font-family:Segoe UI,Arial,sans-serif;color:#233d47;background:#f3f6f6;font-size:15px}*{box-sizing:border-box}body{margin:0;display:flex}aside{width:250px;position:fixed;inset:0 auto 0 0;background:#133e43;color:white;padding:34px 23px}.brand{font-size:30px;font-weight:750;display:flex;align-items:center;gap:12px}.brand span{font-size:12px;font-weight:500;letter-spacing:.08em}aside h2{margin:37px 0 3px}aside p{color:#bad0d0;margin-top:0}nav{display:grid;gap:10px;margin-top:38px}button{font:inherit;cursor:pointer;border:0;border-radius:8px;padding:11px 15px;font-weight:600}nav button{text-align:left;color:#dbe8e8;background:transparent}nav button.active,nav button:hover{background:#2b5b60;color:white}.aside-foot{position:absolute;bottom:28px;font-size:12px;line-height:1.9;color:#bad0d0}main{margin-left:250px;padding:38px 42px;width:calc(100% - 250px);max-width:1600px}header{display:flex;align-items:center;justify-content:space-between;gap:15px}h1{font-size:30px;margin:7px 0 27px;letter-spacing:-.025em}h2{font-size:21px}.eyebrow{font-size:11px;letter-spacing:.12em;color:#53767a;font-weight:700}.notice{background:#e5efee;padding:14px 18px;border-radius:9px;font-size:13px;line-height:1.6}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin:25px 0}.stat{background:white;padding:20px;border:1px solid #dfe8e7;border-radius:12px}.stat strong{display:block;font-size:30px;color:#174b50}.stat span{color:#667e83;font-size:13px}.toolbar{display:flex;gap:18px;align-items:end;margin:27px 0 20px}.search{flex:1}label{display:block;font-size:13px;font-weight:600;margin:12px 0}input,select,textarea{display:block;width:100%;padding:11px;border:1px solid #cbd9d8;border-radius:7px;font:inherit;color:#233d47;background:white;margin-top:7px}textarea{resize:vertical}.cards{display:grid;gap:16px}.card,.panel{background:white;border:1px solid #dfe8e7;border-radius:12px;padding:23px}.card-top{display:flex;justify-content:space-between;gap:15px}.card h2{margin:0 0 6px}.muted{color:#6a7e83;font-size:13px}.badge{display:inline-block;background:#e5f1eb;color:#285f43;border-radius:20px;padding:6px 11px;font-size:12px;height:fit-content}.badge.warning{background:#fff0d6;color:#885c1d}.equipment{display:flex;gap:24px;flex-wrap:wrap;padding:18px 0;line-height:1.8;font-size:13px}.equipment span{display:block}.actions{display:flex;gap:10px;flex-wrap:wrap}.primary{background:#196c70;color:white}.secondary{background:#edf3f2;color:#244c51;border:1px solid #d4e2df}.text-button{background:transparent;color:#426a6d;font-size:12px;padding:8px}footer{display:flex;justify-content:space-between;margin-top:30px;color:#718489;font-size:12px;align-items:center}dialog{border:0;border-radius:15px;padding:28px;width:690px;max-width:94vw;max-height:90vh;box-shadow:0 20px 80px #1238;color:#233d47}dialog::backdrop{background:#163e4777}.dialog-heading{display:flex;align-items:center;justify-content:space-between}.component{display:grid;grid-template-columns:1fr 1fr;gap:15px;border-top:1px solid #e3eae9;padding:8px 0}.check{display:flex;align-items:center;gap:8px}.check input{width:18px;height:18px;margin:0}.error{color:#a72b2b}.event{padding:14px 0;border-bottom:1px solid #e2e9e8;line-height:1.7}.upload{padding:0;margin:0}.upload input{font-size:12px}.empty{padding:36px;color:#6a7e83;text-align:center}[hidden]{display:none!important}@media(max-width:900px){aside{position:static;width:100%;padding:18px}.brand{font-size:23px}aside h2,aside p,.aside-foot{display:none}nav{display:flex;margin-top:15px;flex-wrap:wrap}body{display:block}main{margin:0;width:100%;padding:22px}.stats{grid-template-columns:repeat(2,1fr)}header,.toolbar{align-items:stretch;flex-direction:column}.component{grid-template-columns:1fr}.equipment{gap:10px}h1{font-size:25px}}
/* Identidade do agrupamento: azul das ondas, branco e dourado do castelo. */
:root{color:#203d59;background:#f3f6fb}aside{background:#123c65;border-right:4px solid #f5b635}.brand{background:#fff;border-radius:14px;padding:13px 9px;min-height:115px;justify-content:center}.brand img{width:100%;max-width:185px;height:auto;display:block}aside h2{margin-top:25px}nav button.active,nav button:hover{background:#285b8c;box-shadow:inset 3px 0 #ffc957}aside p,.aside-foot{color:#c0d6eb}.eyebrow{color:#476d92}.notice{background:#e8f1fc;border-left:4px solid #edb142}.stat strong{color:#174e83}.stat,.card,.panel{border-color:#dce5f0}.primary{background:#175d98;color:#fff}.secondary{background:#edf3fb;color:#194f7c;border-color:#cedeee}.badge{background:#e6f2fa;color:#1b597d}.badge.warning{background:#fff0d2;color:#80530e}input:focus,select:focus,textarea:focus,button:focus-visible{outline:3px solid #ffc957;outline-offset:2px}.dialog-heading .eyebrow{color:#527599}.import-table{width:100%;border-collapse:collapse;font-size:13px;margin:16px 0}.import-table th,.import-table td{text-align:left;border-bottom:1px solid #dce5f0;padding:10px;vertical-align:top}.table-scroll{overflow:auto}.import-summary{padding:16px;background:#fff6df;border-radius:9px;margin:15px 0}button:disabled{opacity:.55;cursor:wait}@media(max-width:900px){.brand{min-height:0;width:145px}.brand img{max-height:75px;object-fit:contain}aside{border-right:0;border-bottom:4px solid #f5b635}}
.login-page{display:block}.login-main{margin:6vh auto;width:460px;max-width:94vw;padding:20px}.login-logo{width:170px;display:block;margin:0 auto 25px}
.report-filters{flex-wrap:wrap}.report-filters label{min-width:110px;flex:1}.report-tile{text-align:left;cursor:pointer;font-weight:400}.report-tile.selected{border-color:#175d98;box-shadow:0 0 0 2px #175d98}.selected{outline:2px solid #175d98}#report-states{margin:18px 0}#report-title{flex:1}#report-totals{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}@media print{aside,header,footer,.stats,#inventory,#pending,#history,#imports,#mode-notice,.report-filters,#report-states,#report-source,#report-csv,#report-print,.muted{display:none!important}body,main{display:block;margin:0;padding:0;width:100%;background:white}#reports{display:block!important}.panel{border:0;padding:0}.table-scroll{overflow:visible}table{font-size:10px!important}tr{break-inside:avoid}thead{display:table-header-group}#reports h3,#reports label{display:none}}
.student-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.student-fieldset{border:0;padding:0;margin:0}#student-dialog{width:900px}#students-page{padding:11px}aside{overflow-y:auto}.aside-foot{position:static;margin-top:28px}@media(max-width:650px){.student-grid{grid-template-columns:1fr}}
.comparison-panel{margin:18px 0}.comparison-group{margin:12px 0;border:1px solid #dce5f0;border-radius:8px;padding:14px}.comparison-group summary{cursor:pointer;font-weight:600}
.maintenance-notes{white-space:pre-wrap}

tr.repair-conflict td { background: #fff4db; }
.menu-toggle{display:none}
@media(max-width:900px){
 .menu-toggle{display:block;margin-top:15px;background:#285b8c;color:white;border:1px solid #92b2d1;text-align:left;width:100%}
 #main-menu{display:none;margin-top:8px}
 .menu-toggle[aria-expanded="true"]+#main-menu{display:grid;grid-template-columns:minmax(0,1fr);gap:5px}
 #main-menu button{width:100%;text-align:left}
}

/* Conteúdo variável: séries, nomes e documentos devem caber no ecrã. */
main,.panel,.card,.student-grid>*{min-width:0}
.card,.notice,.event,.comparison-group,.maintenance-notes{overflow-wrap:anywhere}
.card-top{flex-wrap:wrap}
.check input{flex-shrink:0}
.dialog-heading{gap:12px}
.dialog-heading h2{min-width:0;overflow-wrap:anywhere}
.dialog-heading button{flex-shrink:0}
input,select,textarea{min-width:0;max-width:100%}
@media(max-width:650px){
 main{padding:16px}
 .card,.panel{padding:16px}
 dialog{padding:18px}
 .toolbar>label,.toolbar>.search{width:100%}
 footer{gap:12px;flex-wrap:wrap}
 nav{gap:6px}
 nav button{padding:10px;font-size:13px}
 .stat{padding:15px}
}
