.teacher-layout{display:grid;grid-template-columns:238px minmax(0,1fr);min-height:100dvh}.teacher-sidebar{padding:24px 14px;background:var(--bg-sidebar);border-right:1px solid var(--border-default)}.teacher-sidebar nav{display:grid;gap:5px;margin:25px 0}.teacher-main{padding:44px clamp(20px,5vw,80px);max-width:1400px;min-width:0;width:100%;margin:auto}.teacher-main h1{font-size:34px;margin:0}.teacher-main h2{font-size:21px}.teacher-toolbar{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:25px}.teacher-toolbar .input{width:auto;max-width:100%}.teacher-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px}.teacher-card{padding:22px;border:1px solid var(--border-default);border-radius:8px;background:var(--bg-primary)}.teacher-card strong.count{display:block;font-size:35px}.teacher-row{display:flex;gap:15px;align-items:center;justify-content:space-between;padding:17px 0;border-bottom:1px solid var(--border-default)}.teacher-row>div{min-width:0;overflow-wrap:anywhere}.teacher-row p{margin:4px 0}.teacher-actions{display:flex;gap:8px;flex-wrap:wrap}.teacher-main .btn-primary,.teacher-actions .btn-primary{width:auto}.teacher-table-wrap{overflow:auto}.teacher-table{border-collapse:collapse;width:100%;text-align:left}.teacher-table th,.teacher-table td{padding:14px 12px;border-bottom:1px solid var(--border-default)}.teacher-table th{color:var(--text-muted);font-size:12px;text-transform:uppercase;letter-spacing:.05em}.teacher-empty{padding:35px 15px;text-align:center;color:var(--text-muted)}.teacher-badge{display:inline-block;padding:3px 9px;background:var(--blue-bg);color:var(--blue-text);border-radius:5px;font-size:12px}.teacher-dialog{width:min(600px,calc(100% - 28px));border:1px solid var(--border-default);border-radius:12px;padding:25px;background:var(--bg-primary);color:var(--text-primary);max-height:90dvh;overflow:auto}.teacher-dialog::backdrop{background:#0008}.teacher-dialog textarea{min-height:120px;font:inherit}.teacher-dialog h2{margin-top:0}.teacher-dialog .teacher-actions{justify-content:flex-end;margin-top:20px}.teacher-notice{padding:12px 16px;border-radius:5px;background:var(--green-bg);color:var(--green-text);margin:15px 0}.teacher-error{background:var(--red-bg);color:var(--red-text)}.teacher-channel-tabs{display:flex;gap:8px;border-bottom:1px solid var(--border-default);padding:10px 0}.teacher-channel-tabs button[aria-pressed=true]{color:var(--accent-blue);background:var(--blue-bg)}.teacher-chat{height:55dvh;display:flex;flex-direction:column}.teacher-messages{flex:1;overflow:auto;padding:10px 0}.teacher-message{margin:12px 0;padding:14px;background:var(--gray-bg);border-radius:7px;white-space:pre-wrap;overflow-wrap:anywhere}.teacher-message small{display:block;color:var(--text-muted);margin-bottom:6px}.teacher-composer{display:flex;gap:10px;padding:10px 0;background:var(--bg-primary)}.teacher-composer .input{flex:1}.teacher-mobile-label{display:none}button:disabled{opacity:.55;cursor:wait}button:focus-visible,a:focus-visible{outline:2px solid var(--accent-blue);outline-offset:3px}.teacher-body-text{white-space:pre-wrap;overflow-wrap:anywhere}.teacher-profile dl{display:grid;grid-template-columns:120px 1fr;gap:12px}.teacher-profile dd{margin:0;overflow-wrap:anywhere}
@media(max-width:760px){.teacher-layout{display:block}.teacher-sidebar{padding:12px 16px;border-right:0;border-bottom:1px solid var(--border-default)}.teacher-sidebar nav{display:flex;overflow:auto;margin:12px 0 0;gap:6px}.teacher-sidebar .nav-item{width:auto;white-space:nowrap;padding:9px 12px}.teacher-sidebar .sidebar-head{padding:0}.teacher-sidebar .sidebar-subtitle{font-size:11px}.teacher-sidebar .signout{position:absolute;right:14px;top:14px}.teacher-main{padding:24px 16px}.teacher-main h1{font-size:29px}.teacher-row{align-items:flex-start}.teacher-grid{grid-template-columns:1fr 1fr}.teacher-card{padding:15px}.channel-open .teacher-sidebar{display:none}.channel-open .teacher-main{height:100dvh;padding:14px 14px 0;display:flex;flex-direction:column}.channel-open .teacher-toolbar{flex:none;margin-bottom:12px}.channel-open #page-content{display:flex;flex-direction:column;flex:1;min-height:0;padding-bottom:calc(62px + env(safe-area-inset-bottom))}.channel-open .teacher-channel-tabs{position:fixed;bottom:0;left:0;right:0;z-index:10;background:var(--bg-sidebar);justify-content:space-around;border-top:1px solid var(--border-default);padding:8px 12px calc(8px + env(safe-area-inset-bottom));min-height:58px}.channel-open .teacher-chat{height:auto;flex:1;min-height:0}.channel-open .teacher-composer{flex:none;margin-bottom:0}.channel-open .teacher-files{overflow:auto;flex:1}.teacher-dialog{padding:20px}.teacher-table td,.teacher-table th{padding:12px 8px}}
.term-card{text-align:left;color:var(--text-primary);cursor:pointer}.term-card:hover{background:var(--hover-bg)}.gradebook input{min-width:100px;max-width:150px}.gradebook th{min-width:180px;text-transform:none}.gradebook tbody th{position:sticky;left:0;background:var(--bg-primary);z-index:1}.gradebook-save{padding:15px 0;position:sticky;bottom:0;background:var(--bg-primary)}.mail-row{width:100%;text-align:left;background:transparent;color:var(--text-primary);cursor:pointer}.mail-row:hover{background:var(--hover-bg)}#dialog-error{color:var(--red-text)}
.compose-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding-bottom:14px;border-bottom:1px solid var(--border-default)}.compose-card-head h2,.compose-card-head p{margin:0}.compose-card-form{display:grid;gap:0}.compose-card-form .field{margin:0;padding:13px 0;border-bottom:1px solid var(--border-default)}.compose-card-form .field>span{font-size:12px}.compose-card-form .input{border:0;background:transparent;padding:8px 0;box-shadow:none}.compose-body textarea{min-height:210px;resize:vertical}.compose-card-actions{display:flex;align-items:center;gap:12px;padding-top:14px}.compose-card-actions .btn-primary{margin-left:auto}.attach-button{display:inline-flex;align-items:center;gap:8px;padding:9px 12px;border:1px solid var(--border-default);border-radius:999px;cursor:pointer}.compose-files,.mail-attachments{display:flex;flex-wrap:wrap;gap:8px;padding-top:12px}.compose-file-chip,.mail-attachment{display:inline-flex;align-items:center;gap:8px;padding:8px 11px;border:1px solid var(--border-default);border-radius:10px;background:var(--bg-primary);color:var(--text-primary)}.mail-attachment{text-align:left;cursor:pointer}.mail-attachment span:last-child{display:grid}.mail-attachment small{color:var(--text-muted)}@media(max-width:600px){.teacher-dialog{width:100%;height:100dvh;max-height:none;border-radius:0}.compose-body textarea{min-height:38dvh}.compose-card-actions{position:sticky;bottom:0;background:var(--bg-primary);flex-wrap:wrap}.compose-card-actions .muted{display:none}}
.teacher-files{margin-top:14px}.teacher-file-manager{grid-template-columns:1fr}.teacher-files .file-browser{min-width:0}.teacher-files .file-card{position:relative}.teacher-files .file-actions{position:absolute;right:8px;top:8px}.teacher-files .file-menu{right:0;left:auto;z-index:8}.teacher-files .drop-zone.active{border-color:var(--accent-blue);background:var(--blue-bg)}.teacher-file-note{margin:10px 0 0}.teacher-mobile-files{display:none}.mobile-file-main{display:flex;align-items:center;gap:12px;min-width:0;flex:1;border:0;background:transparent;color:inherit;text-align:left}.mobile-file-main>span:nth-child(2){display:grid;min-width:0}.mobile-file-main strong,.mobile-file-main small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-file-actions{display:flex;gap:6px}.mobile-file-actions button{border:0;background:transparent;color:var(--text-muted);padding:7px}.mobile-file-actions .danger{color:var(--red-text)}
@media(max-width:760px){.teacher-file-manager,.teacher-files .drop-zone{display:none}.teacher-mobile-files{display:grid}.teacher-files .panel-title-row{position:sticky;top:0;z-index:3;background:var(--bg-primary);padding-bottom:12px}.teacher-file-note{font-size:12px}}

.teacher-library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}.teacher-library-grid .teacher-card{display:flex;flex-direction:column;gap:9px}.teacher-library-grid .teacher-card h2,.teacher-library-grid .teacher-card p{margin:0}.teacher-library-grid .teacher-card .btn{margin-top:auto}.teacher-library-grid [hidden]{display:none}

.catalog-pagination{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:18px 0 8px;flex-wrap:wrap}.catalog-page-summary{color:var(--muted,#667085);font-size:13px}.catalog-page-buttons{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.catalog-page-buttons .btn{min-width:40px}.catalog-page-buttons .btn.active{border-color:#0175c2;background:#0175c2;color:#fff}.catalog-page-buttons .btn:disabled{cursor:not-allowed;opacity:.45}@media(max-width:700px){.catalog-pagination{align-items:stretch;flex-direction:column}.catalog-page-buttons{justify-content:center}.catalog-page-buttons .btn{flex:1 1 auto}}

/* Library catalog covers */
.teacher-library-cover{display:grid;place-items:center;overflow:hidden;width:100%;aspect-ratio:3/4;border-radius:8px;background:var(--gray-bg);color:var(--text-muted);font-size:12px;font-weight:700}
.teacher-library-cover img{display:block;width:100%;height:100%;object-fit:cover}
.teacher-library-cover span{padding:12px;text-align:center}
