/* Unified course-component allocation */
.manual-exam-allocation-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}.manual-exam-allocation-actions button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:36px;padding:7px 10px;border:1px solid var(--border-strong);border-radius:6px;background:var(--surface-1);color:var(--text);font:700 9.5px var(--font);white-space:nowrap}.manual-exam-allocation-actions button:last-child{border-color:var(--accent);color:var(--accent-text)}
.manual-exam-card-weight small{margin-top:3px;color:var(--text-muted);font-size:8px}.online-allocation-card{border-left:4px solid #0B7285}.online-allocation-card .manual-exam-card-actions{justify-content:center}.online-allocation-card .btn-ghost{display:inline-flex;align-items:center;gap:5px;text-decoration:none}.manual-exam-auto-weight{display:flex;align-items:center;gap:10px;padding:10px 11px;border:1px solid color-mix(in srgb,var(--accent) 35%,var(--border));border-radius:7px;background:color-mix(in srgb,var(--accent) 7%,var(--surface-1))}.manual-exam-auto-weight>i{color:var(--accent);font-size:22px}.manual-exam-auto-weight b,.manual-exam-auto-weight small{display:block}.manual-exam-auto-weight small{margin-top:2px;color:var(--text-muted);font-size:9px;line-height:1.4}
.fig-modal-inner:has(.assessment-allocation-modal){width:min(1060px,calc(100vw - 40px));max-width:none}.assessment-allocation-modal{padding:4px 4px 8px}.assessment-allocation-modal .assessment-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:22px}.assessment-allocation-modal .assessment-modal-head h2{margin:4px 0 6px}.assessment-allocation-modal .assessment-modal-head p{max-width:720px;margin:0;color:var(--text-muted);font-size:10.5px;line-height:1.55}.assessment-allocation-course{display:grid;place-items:center;flex:0 0 100px;min-height:76px;border-left:4px solid var(--accent);background:var(--surface-2)}.assessment-allocation-course b{color:var(--accent-text);font-size:22px}.assessment-allocation-course small{color:var(--text-muted);font-size:8px;text-transform:uppercase}.assessment-allocation-columns,.assessment-allocation-row{display:grid;grid-template-columns:minmax(280px,1fr) 160px 125px;align-items:center;gap:18px}.assessment-allocation-columns{padding:0 16px 8px;color:var(--text-muted);font-size:8px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}.assessment-allocation-list{display:grid;gap:10px}.assessment-allocation-row{padding:14px 16px;border:1px solid var(--border);border-radius:7px;background:var(--surface-1)}.assessment-allocation-source{display:flex;align-items:center;gap:11px;min-width:0}.assessment-allocation-source>i{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;border-radius:6px;background:var(--surface-2);color:var(--accent);font-size:19px}.assessment-allocation-source b,.assessment-allocation-source small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.assessment-allocation-source b{font-size:11px}.assessment-allocation-source small{margin-top:3px;color:var(--text-muted);font-size:8.5px}.assessment-allocation-input{position:relative}.assessment-allocation-input input{width:100%;min-height:42px;padding:8px 32px 8px 11px;border:1px solid var(--border-strong);border-radius:6px;background:var(--surface-1);color:var(--text);font:700 12px var(--font)}.assessment-allocation-input i{position:absolute;right:11px;top:50%;transform:translateY(-50%);color:var(--text-muted);font-style:normal}.assessment-allocation-row>strong{color:var(--accent-text);font-size:12px}.assessment-allocation-summary{display:grid;grid-template-columns:auto minmax(160px,1fr) auto;align-items:center;gap:18px;margin-top:18px;padding:15px 16px;border-top:1px solid var(--border);background:var(--surface-2)}.assessment-allocation-summary>div:first-child{min-width:130px}.assessment-allocation-summary span,.assessment-allocation-summary b,.assessment-allocation-summary small{display:block}.assessment-allocation-summary span{font-size:8px;font-weight:800;text-transform:uppercase}.assessment-allocation-summary b{font-size:20px}.assessment-allocation-summary small{color:var(--text-muted);font-size:8.5px}.assessment-allocation-track{height:9px;border-radius:999px;background:var(--surface-3);overflow:hidden}.assessment-allocation-track i{display:block;height:100%;background:#23805B;transition:width .18s ease}.assessment-allocation-track i.invalid{background:#C66A18}

/* Grade roster: separate, sortable identity fields */
.manual-score-table{min-width:1050px}.manual-score-table th:nth-child(1){width:112px}.manual-score-table th:nth-child(2),.manual-score-table th:nth-child(3){width:120px}.manual-score-table th:nth-child(4){width:150px}.manual-score-table th:nth-child(5){width:105px}.manual-score-table th:nth-child(6){width:92px}.manual-score-table td:first-child b,.manual-score-table td:first-child small{display:block}.manual-score-table td:first-child small{max-width:150px;margin-top:2px;overflow:hidden;color:var(--text-muted);font-size:8px;text-overflow:ellipsis;white-space:nowrap}.manual-score-sort{display:inline-flex;align-items:center;gap:4px;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-transform:inherit;cursor:pointer}.manual-score-sort.active{color:var(--accent-text)}

/* User roster and Excel import */
.student-import-modal .btn-accent:disabled{border-color:var(--border);background:var(--surface-2);color:var(--text-muted);box-shadow:none;cursor:not-allowed;opacity:1}
.admin-create .admin-form{grid-template-columns:150px repeat(5,minmax(125px,1fr)) auto}.student-import-card{display:flex;align-items:center;justify-content:space-between;gap:20px}.student-import-card p{max-width:760px;margin:4px 0 0;font-size:11px}.student-import-card>button{flex:0 0 auto}.um-search{position:relative;display:block;flex:1;min-width:260px}.um-search>i{position:absolute;z-index:1;top:50%;left:11px;transform:translateY(-50%);color:var(--text-muted);font-size:17px}.um-bar .um-search input[type=search]{width:100%;min-width:0;padding-left:38px}.um-table{min-width:1280px}.fig-modal-inner:has(.student-import-modal){width:min(1220px,calc(100vw - 40px));max-width:none}.student-import-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.student-import-head h2{margin:4px 0}.student-import-head p{max-width:760px;margin:0;color:var(--text-muted);font-size:10.5px}.student-import-safe{display:inline-flex;align-items:center;gap:6px;padding:7px 9px;border:1px solid #A9D8BE;border-radius:999px;background:#EAF7F0;color:#176B3A;font-size:9px;font-weight:800;white-space:nowrap}.student-import-format{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:15px 0 10px;padding:11px 13px;border-left:4px solid var(--accent);background:var(--surface-2)}.student-import-format b,.student-import-format span{display:block}.student-import-format>div:first-child span{margin-top:2px;color:var(--text-muted);font-size:9px}.student-import-column-list{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.student-import-column-list span{padding:5px 7px;border:1px solid var(--border);border-radius:5px;background:var(--surface-1);font-size:8.5px;font-weight:800}.student-import-controls{display:grid;grid-template-columns:minmax(240px,.8fr) minmax(360px,1.4fr) minmax(230px,.8fr);gap:10px}.student-import-file,.student-import-controls fieldset,.student-import-options{padding:11px;border:1px solid var(--border);border-radius:7px;background:var(--surface-1)}.student-import-file>span,.student-import-controls legend{font-size:9px;font-weight:800;text-transform:uppercase}.student-import-file input{display:block;width:100%;margin-top:9px;font-size:10px}.student-import-controls fieldset{display:grid;grid-template-columns:1fr 1fr;margin:0}.student-import-controls fieldset label{display:flex;align-items:flex-start;gap:7px;padding:4px 7px}.student-import-controls fieldset input{margin-top:3px}.student-import-controls fieldset b,.student-import-controls fieldset small{display:block}.student-import-controls fieldset b{font-size:10px}.student-import-controls fieldset small{margin-top:2px;color:var(--text-muted);font-size:8px}.student-import-options{display:grid;align-content:center;gap:8px;font-size:9px}.student-import-options label{display:flex;align-items:flex-start;gap:6px}.student-import-preview-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:14px 0 8px}.student-import-preview-head b,.student-import-preview-head span{display:block}.student-import-preview-head span{margin-top:2px;color:var(--text-muted);font-size:9px}.student-import-preview{min-height:170px;border:1px solid var(--border);border-radius:7px;background:var(--surface-1)}.student-import-empty{display:grid;min-height:170px;place-items:center;align-content:center;gap:7px;color:var(--text-muted);font-size:10px}.student-import-empty i{color:var(--accent);font-size:31px}.student-import-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-bottom:1px solid var(--border)}.student-import-summary span{display:flex;align-items:baseline;gap:6px;padding:9px 11px;border-right:1px solid var(--border);font-size:9px}.student-import-summary span:last-child{border-right:0}.student-import-summary b{font-size:18px}.student-import-summary .add b,.student-import-summary .update b{color:#176B3A}.student-import-summary .conflict b{color:#B6382E}.student-import-errors,.student-import-ready{margin:9px;padding:10px 12px}.student-import-errors{border-left:4px solid #C34E3F;background:#FCEDEA;color:#84291F;font-size:9px}.student-import-errors>b{display:flex;align-items:center;gap:6px}.student-import-errors ul{max-height:110px;margin:7px 0 0;padding-left:20px;overflow:auto}.student-import-ready{display:flex;align-items:center;gap:9px;border-left:4px solid #23805B;background:#EAF7F0;color:#176B3A}.student-import-ready>i{font-size:23px}.student-import-ready b,.student-import-ready small{display:block}.student-import-ready small{margin-top:2px;font-size:8.5px}.student-import-table-wrap{max-height:310px;overflow:auto;border-top:1px solid var(--border)}.student-import-table{width:100%;min-width:900px;border-collapse:collapse;font-size:9px}.student-import-table th{position:sticky;top:0;padding:7px 8px;background:var(--surface-3);color:var(--text-muted);text-align:left;text-transform:uppercase}.student-import-table td{padding:7px 8px;border-top:1px solid var(--border)}.student-import-action{display:inline-flex;padding:4px 6px;border-radius:999px;background:var(--surface-3);font-size:8px;font-weight:800}.student-import-action.add,.student-import-action.update{background:#EAF7F0;color:#176B3A}.student-import-action.conflict{background:#FCEDEA;color:#84291F}.student-import-more{margin:7px 10px;font-size:8.5px}

@media(max-width:1080px){.admin-create .admin-form{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-create .admin-form button{grid-column:1/-1}.student-import-controls{grid-template-columns:1fr 1fr}.student-import-options{grid-column:1/-1}.assessment-allocation-columns,.assessment-allocation-row{grid-template-columns:minmax(220px,1fr) 130px 100px}}
@media(max-width:760px){.manual-exam-allocation-actions{justify-content:stretch}.manual-exam-allocation-actions button{flex:1}.assessment-allocation-modal .assessment-modal-head,.student-import-head,.student-import-format,.student-import-preview-head,.student-import-card{align-items:stretch;flex-direction:column}.assessment-allocation-course{display:flex;min-height:48px;justify-content:center;gap:7px;border-left:0;border-top:4px solid var(--accent)}.assessment-allocation-columns{display:none}.assessment-allocation-row{grid-template-columns:minmax(0,1fr) 105px}.assessment-allocation-row>strong{grid-column:2}.assessment-allocation-input{grid-column:2;grid-row:1}.assessment-allocation-summary{grid-template-columns:1fr}.student-import-card>button{width:100%;justify-content:center}.student-import-controls{grid-template-columns:1fr}.student-import-options{grid-column:auto}.student-import-controls fieldset{grid-template-columns:1fr}.student-import-format{gap:9px}.student-import-column-list{justify-content:flex-start}.student-import-summary{grid-template-columns:1fr 1fr}.student-import-summary span:nth-child(2){border-right:0}.student-import-summary span:nth-child(-n+2){border-bottom:1px solid var(--border)}.manual-score-table{min-width:0}.manual-score-table tr{grid-template-columns:repeat(2,minmax(0,1fr))}.manual-score-table td:first-child,.manual-score-table td:nth-child(4),.manual-score-table td:last-child{grid-column:1/-1}.manual-score-table td:first-child::before{display:block}.manual-score-table td:first-child{padding-bottom:0;border-bottom:0}.um-search{min-width:100%}}

/* User creation: keep controls and action contained at every viewport. */
.admin-create .admin-form{
  grid-template-columns:minmax(150px,.85fr) repeat(3,minmax(0,1fr));
  grid-template-areas:
    "role first last number"
    "department email email action";
  align-items:stretch;
}
.admin-create .admin-form>input,.admin-create .admin-form>select{width:100%;min-width:0}
#adminNewRole{grid-area:role}
#adminNewName{grid-area:first}
#adminNewSurname{grid-area:last}
#adminNewNo{grid-area:number}
#adminNewDepartment{grid-area:department}
#adminNewEmail{grid-area:email}
#adminCreateUser{grid-area:action;min-width:220px;justify-content:center;white-space:nowrap}
.admin-create #adminCreateMsg{min-height:1.2em;margin-top:8px}
@media(max-width:1080px){
  .admin-create .admin-form{
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-areas:
      "role first"
      "last number"
      "department email"
      "action action";
  }
  #adminCreateUser{width:100%;min-width:0}
}
@media(max-width:620px){
  .admin-create .admin-form{
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"role" "first" "last" "number" "department" "email" "action";
  }
}

