/* Administration and teaching: layout and task-specific components. */
.app { display:flex; min-height:100dvh; }
.sidebar { width:280px; position:fixed; inset:0 auto 0 0; z-index:50; background:var(--sidebar-bg); padding:22px 14px; border-right:1px solid rgba(216,163,58,.18); box-shadow:18px 0 46px rgba(0,0,0,.22); display:flex; flex-direction:column; color:var(--sidebar-text); overflow-y:auto; scrollbar-width:thin; }
.sidebar .brand { display:none; }
.workspace { margin-left:280px; width:calc(100% - 280px); min-width:0; display:flex; flex-direction:column; }
.topbar { min-height:76px; padding:14px 36px; background:var(--panel); border-bottom:1px solid var(--line); display:flex; align-items:center; gap:20px; }
.breadcrumb { display:flex; align-items:center; gap:10px; min-width:0;  }
.breadcrumb span { color:var(--muted); }
.breadcrumb strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap;  }
.breadcrumb .slash { color:var(--subtle); }
.account { display:flex; align-items:center; gap:12px; margin-left:0; }
.account select { padding:7px 9px; min-height:36px;  width:auto; max-width:155px; }
.account-name { display:flex; flex-direction:column; text-align:right;  max-width:180px; }
.account-name>span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-name small { color:var(--muted);  }
.avatar { width:34px; height:34px; display:grid; place-items:center; background:var(--accent-soft); color:var(--brand-light); border:1px solid var(--line); border-radius:50%;   flex-shrink:0; }
#menu-toggle { display:none; flex-shrink:0; }
#main { width:100%; max-width:1660px; margin:0 auto; padding:32px 34px 64px; flex:1; outline:none; }
.app-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 36px;  color:var(--muted); border-top:1px solid var(--line); }
.workspace-label { color:var(--sidebar-muted);   margin:14px 12px 10px;  }
#navigation button { display:flex; align-items:center; gap:11px; width:100%; margin:3px 0; min-height:44px; padding:11px 13px; border:1px solid transparent; border-radius:var(--radius); background:rgba(255,255,255,.01); color:var(--sidebar-text); text-align:left;   }
#navigation button:hover { background:#ffffff0b; color:white; }
#navigation button.active { background:linear-gradient(90deg,rgba(36,78,145,.46),rgba(36,78,145,.16));border-color:rgba(111,162,255,.24);color:var(--text);box-shadow:inset 3px 0 var(--gold),0 10px 24px rgba(36,78,145,.18); }
.nav-icon { display:grid;place-items:center;width:28px;height:28px;flex:0 0 28px;border-radius:var(--radius-sm);background:rgba(151,169,205,.08); }
.nav-icon svg { width:18px; height:18px; }
.sidebar-bottom { margin-top:auto; padding:28px 9px 0; }
.workspace-note { color:var(--sidebar-muted); display:flex; align-items:center; gap:8px;  padding:12px 3px; }
.status-dot { width:6px; height:6px; border-radius:50%; background:var(--green); }
.portal-link { display:flex; align-items:center; gap:10px; padding:14px 3px; border-top:1px solid #ffffff18; color:var(--sidebar-muted);  }
.portal-link svg { width:17px; height:17px; }
.page-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:22px; margin-bottom:28px; }
.page-heading>div:first-child { min-width:0; }
.page-heading h1 { overflow-wrap:anywhere; }
.page-heading p:not(.eyebrow) { color:var(--muted);   margin-bottom:0; max-width:720px; }
.page-heading>.actions { flex-shrink:0; padding-top:5px; }
.back { margin-bottom:17px; }
.back>.button { min-height:30px; padding:0; }
.detail-meta { display:flex; gap:20px; flex-wrap:wrap; color:var(--muted); margin-bottom:24px;  }
.detail-meta>span { display:inline-flex; align-items:center; gap:7px; }
.detail-meta svg { width:16px; height:16px; }
.columns { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(280px,1fr); gap:22px; align-items:start; }
.panel { margin-bottom:24px; overflow:clip; }
.columns>.panel { margin-bottom:0; }
.table-wrap { width:100%; overflow-x:auto; scrollbar-width:thin; }
.table-wrap:focus-visible { outline-offset:-3px; }
table { width:100%; border-collapse:collapse; text-align:left;  }
th { background:var(--panel-2); color:var(--muted);   padding:13px 20px; border-bottom:1px solid var(--line); white-space:normal; vertical-align:middle; }
td { border-bottom:1px solid var(--line); padding:17px 20px; vertical-align:middle; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover { background:var(--panel-2); }
.cell-value { min-width:0; overflow-wrap:anywhere; }
.table-title {   color:var(--text); }
.link-button { background:none; border:0; color:var(--blue); font:inherit; padding:4px 0; text-align:left; min-height:30px; }
.link-button:hover { text-decoration:underline; }
.table-sub { display:block; margin-top:4px; color:var(--muted);   }
.table-count { padding:14px 20px; border-top:1px solid var(--line); color:var(--muted);  }
.row-action { min-width:100px; }
.row-action .actions { gap:6px; }
.filters { padding:18px 20px; display:flex; flex-wrap:wrap; gap:12px; align-items:center; border-bottom:1px solid var(--line); background:var(--panel); }
.filters select { min-width:180px;  }
.search-wrap { position:relative; display:block; flex:1; min-width:170px; max-width:530px; }
.search-wrap>svg { position:absolute; top:13px; left:13px; width:18px; height:18px; color:var(--muted); pointer-events:none; }
.search-wrap input { width:100%; padding-left:41px;  }
.tabs { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin:0 0 24px; padding:5px; border:1px solid var(--line); background:var(--panel); border-radius:10px; }
.tabs button, .tabs>a { min-height:39px; display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:9px 14px; border-radius:7px; border:0; background:none; color:var(--muted); width:auto; margin:0;   }
.tabs button.active { background:var(--accent-soft); color:var(--brand-light);  }
.tabs button:hover { background:var(--panel-2); }
.tabs>a { margin-left:auto; color:var(--brand-light); border-left:1px solid var(--line); border-radius:0; }
.empty { padding:46px 24px; text-align:center; }
.empty-icon { width:54px; height:54px; display:grid; place-items:center; margin:0 auto 16px; border:1px solid var(--line); background:var(--panel-2); color:var(--muted); border-radius:14px; }
.empty>svg { width:34px; height:34px; color:var(--muted); margin-bottom:16px; }
.empty h3 {  margin-bottom:8px; }
.empty p { color:var(--muted);  max-width:440px; margin:0 auto 19px; }
.empty>.button { margin-top:4px; }
.steps { list-style:none; padding:0; margin:0; counter-reset:steps; }
.steps li { display:flex; gap:13px; padding:0 0 23px; counter-increment:steps; }
.steps li::before { content:counter(steps); display:grid; place-items:center; width:27px; height:27px; background:var(--accent-soft); border-radius:50%; color:var(--brand-light); flex-shrink:0;   }
.steps li:last-child { padding-bottom:0; }
.steps strong {  }
.steps p { margin:4px 0 0;  color:var(--muted); }
.lesson-list, .material-list, .person-list, .selected-team-list { list-style:none; padding:0; margin:0; }
.lesson-card, .material-card { display:flex; align-items:center; gap:18px; padding:22px 24px; border-bottom:1px solid var(--line); }
.lesson-card:last-child, .material-card:last-child { border-bottom:0; }
.lesson-date { display:flex; flex-direction:column; align-items:center; justify-content:center; color:var(--brand-light); background:var(--accent-soft); border-radius:10px; min-width:54px; min-height:60px;   }
.lesson-date small {   margin-top:3px; }
.lesson-content, .material-content { flex:1; min-width:0; }
.lesson-content h3, .material-content h3 { margin:0 0 5px; }
.lesson-content small, .lesson-content p, .material-content p { color:var(--muted);  margin:5px 0 0; }
.material-icon { color:var(--brand-light); background:var(--accent-soft); width:40px; height:40px; border-radius:10px; display:grid; place-items:center; flex-shrink:0; }
.description { color:var(--muted);   white-space:pre-line; margin:0; }
.result-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; margin:0; }
.result-grid dt { color:var(--muted);  margin-bottom:7px; }
.result-grid dd { margin:0;   }
.result-actions { padding-top:24px; }
.result-actions p { margin-bottom:0; }
.progress { background:var(--panel-2); height:6px; overflow:hidden; border-radius:6px; margin-top:8px; }
.progress>span { display:block; background:var(--accent); height:100%; }
.curriculum-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
.curriculum-hint { padding:14px 18px; color:var(--muted);   background:var(--panel); border:1px solid var(--line); border-radius:8px; margin:0 0 24px; }
.team-person { display:block; padding:2px 0;  }
.more-actions { position:relative; }
.more-actions>summary { list-style:none; min-height:36px; padding:8px 11px; border:1px solid var(--line); border-radius:7px; color:var(--muted); cursor:pointer;  text-align:center; background:var(--panel); }
.more-actions>summary::-webkit-details-marker { display:none; }
.more-actions>summary::after { content:'⌄'; margin-left:7px; }
.more-actions[open]>summary { color:var(--brand-light); background:var(--accent-soft); }
.more-actions>div { display:flex; flex-direction:column; gap:7px; padding:9px 0 0; }
.more-actions>div>.button { justify-content:flex-start; }
.score-editor { display:flex; align-items:center; gap:8px; }
.score-input { width:90px; }
dialog { width:650px; max-width:calc(100% - 32px); max-height:calc(100dvh - 48px); color:var(--text); background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:0; box-shadow:0 24px 90px #10252e35; }
dialog::backdrop { background:#102b3b90; }
.dialog-header { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:20px 24px; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--panel); z-index:2; }
.dialog-header h2 {  margin:0; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:19px 16px; padding:24px; }
.field { min-width:0; }
.field.wide, .form-hint, .attendance-row, .score-editor { grid-column:1/-1; }
.field label { display:block; color:var(--text);   margin-bottom:7px; }
.field input, .field textarea, .field select { width:100%;  }
.field small { display:block;  color:var(--muted); margin-top:6px;  }
.form-hint { margin:0; }
.form-error { background:var(--red-bg); color:var(--red); padding:13px 16px; border-radius:8px;  margin:0 24px 20px; }
.dialog-actions { position:sticky; bottom:0; display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:10px; padding:18px 24px; background:var(--panel); border-top:1px solid var(--line); z-index:2; }
.attendance-row { display:flex; justify-content:space-between; align-items:center; gap:16px; border-bottom:1px solid var(--line); padding:12px 0; }
.attendance-row label {  }
.attendance-row small { display:block; color:var(--muted);  margin-top:4px; }
.attendance-row select { max-width:200px; }
.person-list li, .selected-team-list li { display:flex; justify-content:space-between; align-items:center; gap:13px; padding:14px 0; border-bottom:1px solid var(--line); }
.person-list small, .selected-team-list small { display:block;  color:var(--muted); }
.team-options { max-height:340px; overflow:auto; border:1px solid var(--line); border-radius:8px; }
.checkbox-row { display:flex; align-items:center; gap:12px; min-height:64px; padding:12px 16px; border-bottom:1px solid var(--line); cursor:pointer; }
.checkbox-row small { display:block; color:var(--muted);  }
.access-screen { min-height:100dvh; display:grid; place-items:center; padding:24px; background:var(--bg); }
.access-card { text-align:center; padding:44px 32px; border:1px solid var(--line); border-radius:16px; background:var(--panel); max-width:470px; width:100%; box-shadow:var(--shadow); }
.access-card .brand-mark { margin:0 auto 23px; display:grid; place-items:center; width:54px; height:54px; border-radius:14px; background:var(--accent-soft); color:var(--brand-light);   }
.access-card h1 {  }
.access-card>p:not(.eyebrow) { color:var(--muted); }
.access-card>.button { margin-top:16px; }
.loading { display:flex; align-items:center; justify-content:center; gap:13px; min-height:300px; color:var(--muted);  }
.spinner { width:23px; height:23px; border:2px solid var(--line); border-top-color:var(--brand-light); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
#toast { position:fixed; bottom:24px; left:calc(50% + 100px); transform:translateX(-50%); z-index:100; padding:14px 20px; background:var(--green-bg); color:var(--green); border:1px solid var(--green); border-radius:10px;  box-shadow:0 7px 32px #10252e18; max-width:calc(100% - 32px); }
#toast.error { color:var(--red); background:var(--red-bg); border-color:var(--red); }
.error-panel { padding:24px; color:var(--red); }
@media(max-width:1200px) { .topbar { gap:12px; padding:14px 26px; } #main { padding:28px 26px 40px; } .account-name { max-width:125px; } .columns { grid-template-columns:minmax(0,1.4fr) minmax(260px,1fr); } .page-heading>.actions { flex-shrink:1; } th,td { padding-left:15px; padding-right:15px; } }
@media(max-width:1000px) { .columns { grid-template-columns:1fr; } .account-name { display:none; } }
@media(max-width:1100px) {
  .sidebar { transform:translateX(-100%); transition:transform .16s ease; width:264px; }
  .sidebar.open { transform:translateX(0); }
  .workspace { margin-left:0; width:100%; }
  #menu-toggle { display:inline-flex; }
  .topbar { padding:12px 22px; gap:12px; }
  #toast { left:50%; }
}
@media(max-width:650px) {
  #main { padding:24px 16px 35px; }
  .topbar { padding:11px 16px; min-height:68px; gap:9px; flex-wrap:wrap; }
  .breadcrumb { flex:1;  }
  .account { margin-left:0; gap:8px; }
  .account select { max-width:120px; min-height:40px; }
  .account .avatar { display:none; }
  .topbar>[data-ui-tools] { margin-left:auto; }
  .ui-top-tools { gap:5px; }
  .ui-top-tools .ui-tool { min-width:36px; min-height:36px; padding:7px; }
  .page-heading { flex-direction:column; gap:15px; margin-bottom:22px; }
  .page-heading>.actions { padding:0; width:100%; }
  .page-heading p:not(.eyebrow) {  }
  .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:24px; }
  .stat { padding:17px 15px; }
  .stat-value {  margin-top:9px; }
  .stat-top {  }
  .panel-head, .panel-body { padding:18px; }
  .tabs { gap:4px; padding:5px; }
  .tabs button, .tabs>a { flex:1 1 auto; padding:9px 10px; min-height:42px; }
  .tabs>a { border-left:0; }
  .filters { padding:15px; }
  .filters>label, .filters>select { flex:1; width:100%; min-width:100%; }
  .filters input, .filters select {  }
  table.mobile-cards, table.mobile-cards tbody, table.mobile-cards tr { display:block; }
  table.mobile-cards thead { display:none; }
  table.mobile-cards tr { padding:15px 18px; border-bottom:1px solid var(--line); }
  table.mobile-cards tr:last-child { border-bottom:0; }
  table.mobile-cards td { display:grid; grid-template-columns:93px minmax(0,1fr); gap:12px; border:0; padding:7px 0; width:100%; }
  table.mobile-cards td::before { content:attr(data-label); color:var(--muted);  padding-top:2px; }
  table.mobile-cards td.row-action { padding-top:12px; }
  .lesson-card, .material-card { padding:18px; gap:12px; flex-wrap:wrap; }
  .lesson-content, .material-content { min-width:140px; }
  .lesson-card>.actions, .material-card>.actions { width:100%; }
  .result-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
  .form-grid { padding:20px; grid-template-columns:1fr; }
  .dialog-header, .dialog-actions { padding:16px 20px; }
  .dialog-actions>.button { flex:1; }
  .attendance-row { flex-wrap:wrap; }
  .attendance-row select { width:100%; max-width:none; }
  .app-footer { padding:18px 16px; flex-wrap:wrap; }
}
@media(pointer:coarse) { .button.small, .icon-button, .link-button, .more-actions>summary { min-height:44px; } }

/* Keep short status labels and names readable in compact tables. */
.badge{overflow-wrap:normal;word-break:normal;white-space:nowrap}
@media(min-width:651px){table.mobile-cards td:first-child .cell-value{min-width:110px}table.mobile-cards td:first-child .table-title{overflow-wrap:break-word}}
.reader-agenda .week-topbar h1{margin:0 0 6px}.reader-agenda .week-topbar{align-items:flex-start}

#coord-switch-area{margin-bottom:14px}#coord-switch-area .button{width:100%;color:var(--sidebar-text);background:#ffffff09;border-color:#ffffff20}
.teacher-section-title{margin-bottom:12px}.teacher-subject-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:14px}
.teacher-subject-card{padding:17px;background:var(--panel-2);border:1px solid var(--line);border-radius:9px}
.teacher-subject-title{display:block;margin-bottom:4px}.teacher-subject-caption{color:var(--muted);margin:8px 0 12px}
.ui-progress{display:block;appearance:none;width:100px;height:6px;margin-top:8px;border:0;border-radius:5px;background:var(--panel-2)}
.ui-progress::-webkit-progress-bar{background:var(--panel-2);border-radius:5px}.ui-progress::-webkit-progress-value{background:var(--accent);border-radius:5px}.ui-progress::-moz-progress-bar{background:var(--accent);border-radius:5px}
.ui-spaced-actions{margin-top:12px}

.topbar>[data-ui-tools]{margin-left:auto}

#navigation button.active .nav-icon{background:rgba(216,163,58,.16);color:var(--gold)}
#navigation button:hover{background:var(--primary-wash)}
.tabs button.active{background:var(--primary-wash);color:var(--text);box-shadow:inset 0 -2px var(--gold)}
.topbar{background:rgba(16,21,31,.92)}
.access-screen{background:transparent}.access-card{background:linear-gradient(180deg,rgba(29,36,49,.96),rgba(18,23,33,.98));border-radius:var(--radius)}
