/* =========================================================
   ОйLA! — teacher cabinet
   ========================================================= */
.t-body { background: #F4F7FC; min-height: 100vh; }
.t-app { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: 100vh; }
.t-app.login { display: grid; place-items: center; grid-template-columns: 1fr; padding: 20px;
  background: radial-gradient(900px 600px at 10% 0%, #DCEBFF, transparent 60%), radial-gradient(700px 500px at 100% 100%, #FFF0CC, transparent 60%), #F6F9FF; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.w100 { width: 100%; }
.form-err { color: #B4382B; font-weight: 600; font-size: .9rem; }
.form-err:empty { display: none; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ""; position: absolute; width: 1.1em; height: 1.1em; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.5); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* login */
.login-wrap { width: min(920px, 100%); display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 30px; overflow: hidden; box-shadow: var(--sh-3); }
.login-art { position: relative; padding: 40px; color: #fff; display: grid; align-content: start; gap: 16px;
  background: radial-gradient(120% 70% at 85% 0%, rgba(80,150,255,.8), transparent 55%), linear-gradient(160deg, #1546B8, #0B2A6F 60%, #081E52); overflow: hidden; }
.la-logo { font-family: var(--font-display); font-weight: 900; font-size: 3rem; letter-spacing: -.04em; line-height: 1; }
.la-logo b { color: #8EC1FF; font-weight: 900; } .la-logo i { color: var(--yellow); font-style: normal; }
.la-oi { width: 150px; height: 150px; justify-self: center; filter: drop-shadow(0 16px 24px rgba(0,0,0,.35)); animation: oiBob 3.2s ease-in-out infinite; }
@keyframes oiBob { 50% { transform: translateY(-8px) rotate(-2deg); } }
.la-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-weight: 600; font-size: .95rem; }
.la-list li { display: flex; gap: 10px; align-items: center; }
.la-list .i { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: rgba(255,255,255,.16); color: var(--yellow); flex: none; }
.login-form { padding: 44px 40px; display: grid; gap: 16px; align-content: center; }
.login-form h1 { font-family: var(--font-display); font-weight: 800; color: var(--navy); font-size: 2rem; margin: 0; letter-spacing: -.02em; }
.login-form p { margin: 0; }
.kicker { font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--blue); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; justify-self: center; }
.back-link .i { width: 16px; height: 16px; }
@media (max-width: 760px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } .login-form { padding: 32px 24px; } }

/* sidebar */
.t-side { position: sticky; top: 0; height: 100vh; overflow: auto; padding: 22px 16px; display: flex; flex-direction: column; gap: 14px; color: #E6EEFF;
  background: radial-gradient(120% 50% at 100% 0%, rgba(80,150,255,.5), transparent 60%), linear-gradient(180deg, #0F3489, #0A2768 60%, #081E52); }
.t-logo { font-family: var(--font-display); font-weight: 900; font-size: 1.7rem; color: #fff; text-decoration: none; letter-spacing: -.04em; display: flex; align-items: baseline; gap: 0; }
.t-logo b { color: #8EC1FF; font-weight: 900; } .t-logo i { color: var(--yellow); font-style: normal; }
.t-logo span { font-family: var(--font-ui); font-weight: 700; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: #9EBEF0; margin-left: 10px; }
.t-hello { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.08); border-radius: 16px; padding: 10px; }
.t-oi { width: 46px; height: 46px; flex: none; }
.t-hello small { display: block; color: #9EBEF0; font-size: .75rem; }
.t-hello b { color: #fff; font-size: .95rem; }
.t-side-h { font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #8FAEDF; margin: 6px 6px 0; }
.t-classes { display: grid; gap: 4px; }
.t-class { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 8px; border: 0; background: transparent; color: #DCE7FF; text-align: left; padding: 9px 12px; border-radius: 12px; font-weight: 650; }
.t-class:hover { background: rgba(255,255,255,.08); }
.t-class.on { background: #fff; color: var(--navy); }
.t-class.arch { opacity: .55; }
.tc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-code { grid-column: 1; font-family: var(--font-display); font-size: .72rem; letter-spacing: .14em; color: #8FAEDF; font-weight: 700; }
.t-class.on .tc-code { color: var(--blue); }
.tc-badge { grid-column: 2; grid-row: 1 / span 2; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--yellow); color: #3D2A00; font-weight: 800; font-size: .78rem; display: grid; place-items: center; }
.tc-badge:empty { display: none; }
.t-new { justify-content: center; }
.t-side-foot { margin-top: auto; display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.t-link { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: #C5D6F5; text-decoration: none; font-weight: 600; font-size: .9rem; padding: 8px 10px; border-radius: 10px; text-align: left; }
.t-link .i { width: 18px; height: 18px; }
.t-link:hover { background: rgba(255,255,255,.08); color: #fff; }

/* main */
.t-main { padding: 26px clamp(16px, 3vw, 40px) 40px; min-width: 0; }
.t-head-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.t-title { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--navy); margin: 4px 0 0; letter-spacing: -.02em; }
.code-card { display: flex; align-items: center; gap: 16px; background: #fff; border-radius: 18px; padding: 10px 12px 10px 18px; box-shadow: var(--sh-2); }
.cc-l small { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cc-code { font-family: var(--font-display); font-weight: 900; font-size: 1.7rem; letter-spacing: .12em; color: var(--blue); }
.cc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.t-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0 18px; }
.t-stat { border: 0; text-align: left; background: #fff; border-radius: 18px; padding: 16px 18px; box-shadow: var(--sh-1); display: grid; gap: 2px; position: relative; overflow: hidden; transition: transform .15s var(--ease), box-shadow .2s; }
.t-stat:not(:disabled):hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.t-stat b { font-family: var(--font-display); font-weight: 900; font-size: 2rem; line-height: 1; color: var(--navy); }
.t-stat span { color: var(--muted); font-weight: 600; font-size: .85rem; }
.t-stat::after { content: ""; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px; border-radius: 50%; opacity: .14; }
.t-stat.k-sent::after { background: var(--blue); } .t-stat.k-sent b { color: var(--blue); }
.t-stat.k-checked::after { background: var(--green); } .t-stat.k-checked b { color: var(--green); }
.t-stat.k-students::after { background: var(--yellow); }
.t-stat.k-classes::after { background: var(--violet); }
.t-stat:disabled { cursor: default; }
.t-tabs { display: flex; gap: 4px; background: #E8EEF8; border-radius: 14px; padding: 4px; width: max-content; max-width: 100%; overflow: auto; }
.t-tab { border: 0; background: transparent; padding: 9px 16px; border-radius: 11px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.t-tab[aria-selected="true"] { background: #fff; color: var(--navy); box-shadow: var(--sh-1); }
.t-content { margin-top: 16px; }
.t-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.t-filter { display: grid; gap: 4px; font-size: .75rem; font-weight: 700; color: var(--muted); }
.t-filter .select { min-width: 150px; max-width: 240px; padding: .55em .8em; font-size: .9rem; }
.t-export { margin-left: auto; }
.t-table-wrap { background: #fff; border-radius: 18px; box-shadow: var(--sh-1); overflow: auto; }
.t-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.t-table th { text-align: left; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; background: #FAFCFF; }
.t-table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t-table tbody tr { cursor: pointer; transition: background .15s; }
.t-table tbody tr:hover { background: #F6F9FF; }
.t-table tbody tr.st-row-sent { box-shadow: inset 3px 0 0 var(--blue); }
.t-table tbody tr:last-child td { border-bottom: 0; }
.t-stu { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.t-ava { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--azure), var(--blue)); color: #fff; font-weight: 800; flex: none; }
.t-les { display: flex; align-items: center; gap: 10px; }
.t-les-n { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; color: var(--accent); background: var(--accent-soft); flex: none; }
.t-auto { font-family: var(--font-display); font-weight: 800; color: var(--ink-2); background: #F1F4FA; padding: 3px 9px; border-radius: 8px; }
.t-auto.full { background: var(--green-soft); color: #13834F; }
.t-grade { font-family: var(--font-display); color: var(--green); font-size: 1.05rem; }
.t-foot-note { font-size: .8rem; color: var(--muted); margin: 10px 4px; }
.t-empty { text-align: center; background: #fff; border-radius: 22px; padding: 40px 20px; box-shadow: var(--sh-1); display: grid; justify-items: center; gap: 8px; }
.t-empty-oi { width: 110px; height: 110px; }
.t-empty h3 { font-family: var(--font-display); color: var(--navy); margin: 0; }
.t-empty p { margin: 0 0 8px; color: var(--muted); max-width: 460px; }
.pin-mask { border: 0; background: var(--yellow-soft); color: #6A4700; font-family: var(--font-display); font-weight: 800; letter-spacing: .2em; padding: 4px 10px; border-radius: 8px; min-width: 74px; }
.t-prog { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.t-prog-bar { width: 110px; height: 8px; border-radius: 9px; background: var(--line-2); overflow: hidden; }
.t-prog-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--azure), var(--green)); border-radius: inherit; }

/* matrix */
.matrix { border-collapse: separate; border-spacing: 3px; font-size: .78rem; }
.matrix th { font-weight: 700; color: var(--muted); padding: 4px; text-align: center; }
.matrix th[scope="row"] { text-align: left; white-space: nowrap; color: var(--ink); padding-right: 12px; position: sticky; left: 0; background: #fff; }
.mx { width: 26px; height: 26px; border-radius: 7px; border: 0; background: #EEF2F8; display: inline-grid; place-items: center; font-size: .62rem; font-weight: 800; color: #fff; padding: 0; vertical-align: middle; }
i.mx { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.mx.st-draft { background: #A9D5FF; } .mx.st-sent { background: var(--blue); } .mx.st-checked { background: var(--green); } .mx.st-redo { background: var(--coral); }
.mx:not(:disabled):hover { transform: scale(1.15); }
.matrix-wrap .t-table-wrap { padding: 12px; }
.mx-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.mx-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* drawer */
.drawer-ov { position: fixed; inset: 0; z-index: 60; background: rgba(11,26,70,.3); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s; }
.drawer-ov.in { opacity: 1; }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(860px, 100%); background: #FBF9F4; display: grid; grid-template-rows: auto 1fr auto; box-shadow: var(--sh-3); transform: translateX(40px); transition: transform .35s var(--ease); }
.drawer-ov.in .drawer { transform: none; }
.drawer-load { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 40px; color: var(--muted); grid-row: 1 / -1; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--sky); border-top-color: var(--blue); animation: spin .8s linear infinite; }
.dr-head { display: flex; gap: 16px; align-items: center; padding: 22px 64px 18px 26px; background: #fff; border-bottom: 1px solid var(--line-2); position: relative; }
.dr-head .modal-x { position: absolute; top: 16px; right: 16px; border: 0; background: var(--sky-3); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.dr-head .modal-x .i { width: 18px; height: 18px; }
.dr-les { width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 900; font-size: 1.6rem; color: var(--accent); background: var(--accent-soft); flex: none; }
.dr-meta h2 { font-family: var(--font-display); font-weight: 800; color: var(--navy); margin: 2px 0 6px; font-size: 1.45rem; }
.dr-meta .kicker { color: var(--accent); }
.dr-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .88rem; color: var(--muted); }
.dr-sub b { color: var(--ink); }
.dr-body { overflow: auto; padding: 20px 26px 30px; display: grid; gap: 22px; align-content: start; font-size: 15px; }
.dr-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dr-sum { background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: var(--sh-1); }
.dr-sum b { display: block; font-family: var(--font-display); color: var(--navy); font-size: 1.15rem; }
.dr-sum span { font-size: .78rem; color: var(--muted); }
.dr-body .sec { background: #fff; border-radius: 18px; padding: 16px 18px; box-shadow: var(--sh-1); }
.dr-body .sec + .sec { margin-top: 0; border-top: 0; padding-top: 16px; }
.dr-review { background: #fff; border-top: 1px solid var(--line-2); padding: 14px 26px 18px; display: grid; gap: 10px; box-shadow: 0 -10px 30px -20px rgba(11,42,111,.3); }
.rv-grid { display: grid; grid-template-columns: 220px 1fr; gap: 14px; }
.rv-grid .textarea { min-height: 3.4em; }
.grade-in { font-family: var(--font-display); font-weight: 700; }
.qchips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.qchip { border: 0; background: var(--sky-3); color: var(--blue-2); font-weight: 650; font-size: .76rem; padding: 4px 9px; border-radius: 999px; }
.qchip:hover { background: var(--sky-2); }
.rv-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* dialogs (shared with book modal styles) */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(11,26,70,.3); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.modal.in { opacity: 1; }
.modal-card { position: relative; width: min(440px, 100%); background: #fff; border-radius: 26px; padding: 28px; box-shadow: var(--sh-3); transform: translateY(12px); transition: transform .3s var(--ease); }
.modal.in .modal-card { transform: none; }
.modal-x { position: absolute; top: 14px; right: 14px; border: 0; background: var(--sky-3); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.modal-x .i { width: 18px; height: 18px; }
.dlg-form { display: grid; gap: 14px; }
.dlg-form h2, .qr-dlg h2 { font-family: var(--font-display); color: var(--navy); margin: 0; }
.dlg-form p { margin: 0; }
.qr-dlg { text-align: center; display: grid; gap: 10px; justify-items: center; }
.qr-dlg p { margin: 0; }
.qr-svg { width: 260px; height: 260px; }
.qr-code { font-family: var(--font-display); font-weight: 900; font-size: 2rem; letter-spacing: .16em; color: var(--blue); }
.qr-link { font-size: .8rem; color: var(--muted); word-break: break-all; }

@media (max-width: 900px) {
  .t-app { grid-template-columns: 1fr; }
  .t-side { position: relative; height: auto; }
  .t-classes { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .t-side-foot { flex-direction: row; display: flex; flex-wrap: wrap; }
  .t-stats { grid-template-columns: repeat(2, 1fr); }
  .rv-grid { grid-template-columns: 1fr; }
  .dr-summary { grid-template-columns: 1fr; }
  .t-export { margin-left: 0; }
}
