/* Student list only. No global table/export styles. */
#studentsTable { border-collapse:separate; border-spacing:0; isolation:isolate; }
#studentsTable .st-name-col { position:sticky; left:0; z-index:3; min-width:240px; width:240px; max-width:280px; box-shadow:none; border-right:0; white-space:normal; }
#studentsTable th.st-name-col { position:sticky !important; z-index:5; top:-1px; }
#studentsTable .st-name-main { display:block; font-weight:600; line-height:1.35; overflow-wrap:anywhere; }
#studentsTable .st-actions-col { position:sticky; right:0; z-index:3; min-width:130px; width:130px; box-shadow:none; border-left:0; text-align:right; }
#studentsTable th.st-actions-col { position:sticky !important; top:-1px; z-index:5; }
#studentsTable .st-row-actions { display:flex; flex-wrap:nowrap; gap:4px; justify-content:flex-end; }
#studentsTable .st-row-actions .btn { padding:6px; flex:0 0 34px; min-width:34px; min-height:34px; }
#studentsTable .st-row-actions .material-icons-round { font-size:19px; }
#studentsTable thead th:hover { background:var(--bg-card); }
#studentsTable .st-doc-col { min-width:180px; }
#studentsTable .st-row-number { opacity:.6; text-align:right; min-width:38px; }
#studentsTable .sdoc-table-button { display:inline-flex; gap:7px; align-items:center; border:1px solid rgba(246,199,47,.6); border-radius:9px; background:rgba(246,199,47,.13); color:var(--text-main); font:inherit; font-size:13px; font-weight:600; padding:7px 9px; cursor:pointer; }
#studentsTable .sdoc-table-button:hover { background:rgba(246,199,47,.26); }
#studentsTable .sdoc-count { display:block; font-size:11px; margin-top:4px; color:var(--text-muted); }
#view-students .st-display-note { font-size:12px; line-height:1.5; padding:9px 15px; border-bottom:1px solid var(--border-color); flex-shrink:0; color:var(--text-muted); }
#st_col_dropdown .st-cols-title { font-size:12px; font-weight:700; margin:9px 0; }
#st_col_dropdown .st-cols-note { font-size:12px; line-height:1.45; color:var(--text-muted); margin:8px 0; }
#st_col_dropdown .st-cols-controls { display:flex; gap:8px; margin:8px 0; }
#st_col_dropdown label { white-space:normal; }
/* Native dialog: independent top layer, scrolling content, fixed header and footer. */
#student-documents-dialog { --doc-danger:#b3261e; --doc-success:#1b6c35; --doc-warning:#805b00; padding:0; margin:auto; width:min(1000px,calc(100vw - 32px)); max-width:none; height:min(830px,calc(100vh - 40px)); height:min(830px,calc(100dvh - 40px)); max-height:none; border:1px solid var(--border-color); border-radius:18px; background:var(--bg-card); color:var(--text-main); box-shadow:0 25px 85px rgba(0,0,0,.3); overflow:hidden; }
#student-documents-dialog::backdrop { background:rgba(15,20,29,.62); backdrop-filter:blur(3px); }
#student-documents-dialog:not([open]) { display:none; }
.sdoc-shell { height:100%; display:flex; flex-direction:column; min-height:0; }
.sdoc-header { display:flex; align-items:flex-start; gap:16px; padding:22px 24px 18px; border-top:4px solid var(--accent-primary); border-bottom:1px solid var(--border-color); flex-shrink:0; }
.sdoc-heading { flex:1; min-width:0; }
.sdoc-eyebrow { display:block; font-size:10px; font-weight:700; letter-spacing:1.4px; color:var(--text-muted); margin-bottom:7px; }
.sdoc-heading h2 { margin:0; font-size:22px; font-weight:650; line-height:1.3; overflow-wrap:anywhere; }
.sdoc-heading p { margin:6px 0 0; font-size:13px; color:var(--text-muted); }
.sdoc-toolbar { padding:12px 24px; display:flex; align-items:center; gap:12px; justify-content:space-between; flex-shrink:0; }
.sdoc-summary,.sdoc-badges { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.sdoc-body { padding:4px 24px 20px; overflow-y:auto; overflow-x:hidden; min-height:0; flex:1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; align-content:start; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
.sdoc-card { padding:16px; border:1px solid var(--border-color); border-radius:13px; min-width:0; background:var(--bg-card); box-shadow:0 2px 8px rgba(0,0,0,.03); display:flex; flex-direction:column; gap:9px; }
.sdoc-card.is-dirty { border-color:var(--accent-primary); }
.sdoc-card-top { display:flex; justify-content:space-between; gap:10px; }
.sdoc-card h3 { margin:0 0 9px; font-size:16px; line-height:1.35; }
.sdoc-doc-icon { font-size:24px; color:var(--text-muted); opacity:.6; }
.sdoc-badge { display:inline-flex; align-items:center; border-radius:6px; padding:4px 7px; font-size:11px; font-weight:600; line-height:1.3; }
.sdoc-success { color:var(--doc-success,#1b6c35); background:rgba(30,142,62,.09); }
.sdoc-danger { color:var(--doc-danger,#b3261e) !important; background:rgba(217,48,37,.08); }
.sdoc-warning { color:var(--doc-warning,#805b00) !important; background:rgba(246,199,47,.18); }
.sdoc-neutral { background:rgba(128,128,128,.09); color:var(--text-muted); }
.sdoc-date-note { font-size:11px; color:var(--text-muted); }
.sdoc-file-name { font-size:13px; line-height:1.5; overflow-wrap:anywhere; word-break:break-word; margin-top:2px; }
.sdoc-file-detail { font-size:11px; color:var(--text-muted); line-height:1.5; }
.sdoc-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.sdoc-fields label { display:block; font-size:12px; font-weight:600; color:var(--text-muted); }
.sdoc-fields input { width:100%; min-width:0; margin-top:6px; font-size:14px; color:var(--text-main); }
.sdoc-card-actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-top:auto; padding-top:7px; }
#student-documents-dialog .btn { font-size:12px; gap:6px; padding:8px 10px; text-decoration:none; }
.sdoc-icon-button { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; width:38px; height:38px; border:1px solid var(--border-color); border-radius:9px; color:var(--text-main); background:transparent; cursor:pointer; }
.sdoc-icon-button:hover { background:rgba(128,128,128,.08); }
.sdoc-delete { margin-left:auto; color:var(--doc-danger); border-color:rgba(217,48,37,.25); }
.sdoc-save-row { display:flex; align-items:center; justify-content:space-between; gap:10px; border-top:1px solid var(--border-color); padding-top:10px; margin-top:4px; }
.sdoc-save-row > span { font-size:11px; color:var(--text-muted); }
#student-documents-dialog button:disabled { opacity:.45; cursor:not-allowed; }
#student-documents-dialog [hidden] { display:none !important; }
.sdoc-pending { display:flex; align-items:flex-start; gap:8px; font-size:12px; line-height:1.5; padding:9px; border-radius:8px; background:rgba(246,199,47,.12); }
.sdoc-pending > span { flex:1; min-width:0; overflow-wrap:anywhere; }
.sdoc-text-button { border:none; font:inherit; color:var(--text-main); text-decoration:underline; background:transparent; cursor:pointer; }
.sdoc-status { padding:9px 14px; margin:0 24px 12px; font-size:13px; line-height:1.5; border-radius:9px; flex-shrink:0; }
.sdoc-status.error { color:var(--doc-danger); background:rgba(217,48,37,.08); }
.sdoc-status.success { color:var(--doc-success); background:rgba(30,142,62,.08); }
.sdoc-status.info { color:var(--text-main); background:rgba(246,199,47,.14); }
.sdoc-footer { padding:14px 24px; border-top:1px solid var(--border-color); display:flex; gap:18px; justify-content:space-between; align-items:center; flex-shrink:0; }
.sdoc-footer p { color:var(--text-muted); font-size:11px; line-height:1.5; margin:0; max-width:690px; }
.sdoc-empty { grid-column:1/-1; padding:40px 10px; text-align:center; color:var(--text-muted); font-size:14px; }
body.dark-theme #student-documents-dialog { --doc-danger:#ffb4ab; --doc-success:#91d4a7; --doc-warning:#f6c72f; }
body.dark-theme #studentsTable .sdoc-danger { color:#ffb4ab !important; }
body.dark-theme #studentsTable .sdoc-warning { color:#f6c72f !important; }
@media(max-width:767px) {
  #studentsTable .st-name-col { min-width:min(38vw,175px); width:min(38vw,175px); max-width:min(38vw,175px); padding-left:9px; padding-right:9px; }
  #studentsTable .st-name-main { font-size:12px; }
  #studentsTable .st-actions-col { min-width:112px; width:112px; max-width:112px; padding:8px 4px; }
  #studentsTable .st-row-actions { gap:2px; }
  #studentsTable .st-row-actions .btn { padding:5px; flex-basis:32px; min-width:32px; min-height:36px; }
  #studentsTable .st-doc-col { min-width:165px; }
  #view-students .st-display-note { font-size:11px; padding:8px 10px; }
  #student-documents-dialog { width:100vw; height:100vh; height:100dvh; border-radius:0; border:none; }
  .sdoc-header { padding:14px 16px 12px; padding-top:calc(14px + env(safe-area-inset-top,0px)); }
  .sdoc-heading h2 { font-size:18px; }
  .sdoc-heading p { font-size:12px; }
  .sdoc-toolbar { padding:10px 16px; gap:8px; align-items:flex-start; }
  .sdoc-body { grid-template-columns:1fr; padding:2px 12px 16px; gap:12px; }
  .sdoc-card { padding:14px; }
  .sdoc-fields { grid-template-columns:1fr; }
  .sdoc-fields input { font-size:16px; }
  #student-documents-dialog .btn,.sdoc-icon-button { min-height:42px; }
  .sdoc-status { margin:0 12px 10px; font-size:12px; }
  .sdoc-footer { padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px)); gap:10px; }
}

/* Sticky columns are functional only: visually identical to the rest of the students table. */
#studentsTable thead th.st-name-col,
#studentsTable thead th.st-actions-col {
  background:var(--bg-card) !important;
  box-shadow:none !important;
  border-left:0 !important;
  border-right:0 !important;
}
body.light-theme #studentsTable tbody td.st-name-col,
body.light-theme #studentsTable tbody td.st-actions-col {
  background:var(--bg-light) !important;
  box-shadow:none !important;
  border-left:0 !important;
  border-right:0 !important;
}
body.dark-theme #studentsTable tbody td.st-name-col,
body.dark-theme #studentsTable tbody td.st-actions-col {
  background:var(--bg-dark) !important;
  box-shadow:none !important;
  border-left:0 !important;
  border-right:0 !important;
}

@media print { #studentsTable .st-name-col,#studentsTable .st-actions-col { position:static !important; box-shadow:none; } #studentsTable .st-name-col { border-right:0; } #studentsTable .st-actions-col { border-left:0; } #student-documents-dialog { display:none !important; } }
.sdoc-toolbar-actions{display:flex;gap:8px;flex-wrap:wrap}.sdoc-history{overflow:auto;padding:16px 20px 22px;display:flex;flex-direction:column;gap:18px}.sdoc-history[hidden]{display:none!important}.sdoc-history-section h3{margin:0 0 10px;font-size:.95rem}.sdoc-history-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 12px;border:1px solid var(--border-light);border-radius:11px;margin-bottom:8px;background:rgba(128,128,128,.025)}.sdoc-history-file{font-size:.82rem;margin-top:3px;word-break:break-word}.sdoc-history-row small{display:block;margin-top:3px;opacity:.62}.sdoc-history-side{display:flex;gap:7px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.sdoc-event{display:flex;gap:10px;align-items:flex-start;padding:9px 4px;border-bottom:1px solid var(--border-light);font-size:.8rem}.sdoc-event>.material-icons-round{font-size:18px;color:var(--accent-primary);margin-top:1px}.sdoc-event strong{display:block;font-size:.82rem}.sdoc-event div div{opacity:.62;margin-top:2px}.sdoc-history-error{color:var(--danger,#d93025)}
@media(max-width:700px){.sdoc-toolbar-actions{width:100%}.sdoc-toolbar-actions .btn{flex:1}.sdoc-history{padding:12px 14px 18px}.sdoc-history-row{align-items:stretch;flex-direction:column}.sdoc-history-side{justify-content:flex-start}.sdoc-history-side .btn{flex:1;justify-content:center}}
