/* =====================================================================
   Онлайн Күндөлүк — дизайн-система
   ===================================================================== */
:root {
  --bg: #f5f6fb; --surface: #ffffff; --surface-2: #f3f4fa; --surface-3: #e9ebf4;
  --text: #0f172a; --text-2: #334155; --muted: #64748b; --border: #e4e7f0;
  --primary: #5b5bf6; --primary-2: #8b5cf6; --primary-soft: #eef0ff;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --p-c: #10b981; --a-c: #ef4444; --l-c: #f59e0b; --e-c: #3b82f6; --n-c: #94a3b8;
  --p-s: #e7f8f1; --a-s: #fdecec; --l-s: #fef4e2; --e-s: #e8f0fe; --n-s: #f1f5f9;
  --radius: 18px; --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, .05), 0 12px 28px -6px rgba(15, 23, 42, .09);
  --shadow-lg: 0 24px 60px -12px rgba(30, 27, 75, .25);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --topbar-h: 64px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a0c18; --surface: #121527; --surface-2: #181c33; --surface-3: #232848;
  --text: #e8eaf6; --text-2: #c4c9e0; --muted: #8b93b5; --border: #242a47;
  --primary: #7c7cff; --primary-2: #a78bfa; --primary-soft: #1d1f45;
  --p-s: rgba(16, 185, 129, .14); --a-s: rgba(239, 68, 68, .15); --l-s: rgba(245, 158, 11, .15); --e-s: rgba(59, 130, 246, .16); --n-s: rgba(148, 163, 184, .1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 10px 30px -8px rgba(0, 0, 0, .55);
  --shadow-lg: 0 30px 70px -10px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; transition: background .3s, color .3s;
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 8px; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
mark { background: rgba(139, 92, 246, .22); color: inherit; border-radius: 4px; padding: 0 2px; }
[hidden] { display: none !important; }
.ic { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; } .sm { font-size: 13px; }
.center { text-align: center; justify-content: center; }
.pre { white-space: pre-line; }
.pad { padding: 18px; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .03em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.clamp2, .clamp3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp2 { -webkit-line-clamp: 2; } .clamp3 { -webkit-line-clamp: 3; }
.row-gap { display: flex; gap: 8px; align-items: center; } .wrap { flex-wrap: wrap; }
::selection { background: rgba(124, 124, 255, .3); }

/* ---------- Фон ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35; animation: float 22s var(--ease) infinite alternate; }
.b1 { width: 520px; height: 520px; background: #818cf8; top: -160px; left: -120px; }
.b2 { width: 460px; height: 460px; background: #f0abfc; top: 30%; right: -160px; animation-delay: -7s; }
.b3 { width: 380px; height: 380px; background: #67e8f9; bottom: -140px; left: 30%; animation-delay: -14s; opacity: .22; }
[data-theme="dark"] .blob { opacity: .16; }
@keyframes float { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(60px, 40px) scale(1.08); } 100% { transform: translate(-40px, 70px) scale(.95); } }

/* ---------- Загрузка ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--muted); }
.boot-logo .logo-mark { width: 64px; height: 64px; border-radius: 20px; animation: pop .6s var(--ease); }
.boot-logo svg { width: 34px; height: 34px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--primary); animation: spin .8s linear infinite; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Кнопки ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 14px;
  white-space: nowrap; user-select: none; transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s, border-color .2s;
  background: var(--surface-2); color: var(--text);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; gap: 6px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--grad); background-size: 160% 160%; color: #fff; box-shadow: 0 8px 20px -6px rgba(99, 102, 241, .55); }
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 12px 26px -6px rgba(139, 92, 246, .6); }
.btn-ghost { background: var(--surface); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--a-c); color: #fff; box-shadow: 0 8px 18px -6px rgba(239, 68, 68, .5); }
.btn-danger-ghost { background: transparent; color: var(--a-c); border-color: color-mix(in srgb, var(--a-c) 35%, transparent); }
.btn-danger-ghost:hover { background: var(--a-s); }
.btn-soft-p { background: var(--p-s); color: #059669; }
[data-theme="dark"] .btn-soft-p { color: #34d399; }
.btn-light { background: #fff; color: #4338ca; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .3); }
.btn-glass { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .3); backdrop-filter: blur(8px); }
.btn-google { background: var(--surface); border-color: var(--border); height: 50px; font-size: 15px; box-shadow: var(--shadow-sm); }
.btn-google:hover { border-color: #4285f4; box-shadow: 0 8px 20px -8px rgba(66, 133, 244, .5); }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-ghost.loading::after, .btn-google.loading::after { border-color: var(--surface-3); border-top-color: var(--primary); }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .25; transform: scale(0); animation: ripple .6s ease-out; pointer-events: none; }
.btn-primary .ripple, .btn-danger .ripple { background: #fff; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); transition: all .2s var(--ease); flex: none;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn.danger:hover { color: var(--a-c); border-color: var(--a-c); background: var(--a-s); }
.link-btn { background: none; border: 0; color: var(--primary); padding: 6px 0; font-weight: 500; font-size: 14px; }
.link-btn:hover { text-decoration: underline; } .link-btn.danger { color: var(--a-c); }
.link { font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.link:hover { text-decoration: underline; }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field.inline { flex-direction: row; align-items: center; margin: 0; } .field.inline > span { white-space: nowrap; }
.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface);
  outline: none; transition: border-color .2s, box-shadow .2s, background .2s; font-size: 15px;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.input.sm { height: 36px; font-size: 14px; }
.input::placeholder { color: var(--muted); opacity: .75; }
.hint { font-size: 12.5px; color: var(--muted); } .hint .ok { color: var(--p-c); font-weight: 600; } .hint .warn { color: var(--l-c); font-weight: 600; }
.pw-wrap { position: relative; display: flex; gap: 8px; }
.pw-eye { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border: 0; background: transparent; }
.check { display: flex; gap: 10px; align-items: center; margin: 10px 0; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.form-grid .full { grid-column: 1 / -1; }
.radio-card { display: flex; gap: 12px; padding: 14px; border: 1.5px solid var(--border); border-radius: 14px; margin-bottom: 8px; cursor: pointer; transition: all .2s; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-card input { accent-color: var(--primary); margin-top: 3px; }
.radio-card small { display: block; color: var(--muted); font-size: 13px; }

/* ---------- Сегменты / чипы ---------- */
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: 14px; border: 1px solid var(--border); }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); transition: all .25s var(--ease); white-space: nowrap; }
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg.sm .seg-btn { padding: 6px 10px; font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip-ok { background: var(--p-s); color: #059669; } .chip-warn { background: var(--l-s); color: #b45309; } .chip-err { background: var(--a-s); color: #dc2626; }
.chip-primary { background: var(--primary-soft); color: var(--primary); }
[data-theme="dark"] .chip-ok { color: #34d399; } [data-theme="dark"] .chip-warn { color: #fbbf24; } [data-theme="dark"] .chip-err { color: #f87171; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.chip-st { display: inline-flex; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; font-style: normal; }
.st-p.chip-st, .chip-st.st-p { background: var(--p-s); color: var(--p-c); }
.chip-st.st-a { background: var(--a-s); color: var(--a-c); } .chip-st.st-l { background: var(--l-s); color: #d97706; }
.chip-st.st-e { background: var(--e-s); color: var(--e-c); } .chip-st.st-n { background: var(--n-s); color: var(--n-c); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: inherit; }
.tag { padding: 3px 10px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 12.5px; font-weight: 600; }
.tag.sm { font-size: 11.5px; padding: 2px 8px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; } .chips-wrap.sm { margin-top: 8px; gap: 6px; }
.g-chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 14px; transition: all .2s var(--ease); animation: fadeUp .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); cursor: pointer; }
.g-chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.g-chip.sm { padding: 5px 10px; font-size: 13px; border-radius: 9px; }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.card.narrow { max-width: 640px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 14px; margin-bottom: 14px; font-weight: 500; }

/* ---------- Анимации появления ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.view-enter { animation: fadeUp .5s var(--ease); }
.lesson-grid > *, .stats-grid > *, .group-grid > *, .teacher-grid > *, .works-grid > *, .repeat-grid > *, .search-results > * {
  animation: fadeUp .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms);
}
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- Скелетоны ---------- */
.skel { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; height: 150px; }
.skel + .skel { margin-top: 0; }
.lesson-grid .skel, .group-grid .skel, .works-grid .skel, .teacher-grid .skel { height: 170px; }
.skel.stat-skel { height: 88px; } .skel.row-skel { height: 56px; margin-bottom: 10px; } .skel.chip-skel { height: 38px; width: 100px; border-radius: 12px; }
.skel.title-skel { height: 64px; margin-bottom: 18px; max-width: 420px; } .skel.table-skel { height: 420px; }
.skel.cal-skel { height: 340px; } .skel.cover-skel { height: 240px; margin-bottom: 20px; } .skel.rep-skel { height: 80px; } .skel.g-skel, .skel.t-skel { height: 140px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Пустые состояния ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); grid-column: 1 / -1; animation: fadeIn .4s; }
.empty-ic { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ---------- Вход ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 40px 24px; position: relative; }
.floating { position: absolute; top: 18px; right: 20px; display: flex; gap: 8px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--text); letter-spacing: -.02em; }
.brand.big { font-size: 20px; margin-bottom: 28px; }
.logo-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 8px 18px -6px rgba(139, 92, 246, .6); flex: none; }
.auth-title { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.08; margin-bottom: 16px; animation: fadeUp .7s var(--ease); }
.auth-sub { font-size: 17px; color: var(--muted); max-width: 520px; animation: fadeUp .7s .08s var(--ease) both; }
.feat { list-style: none; padding: 0; margin: 26px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feat li { display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: 14.5px; animation: fadeUp .6s var(--ease) both; }
.feat li:nth-child(2) { animation-delay: .12s; } .feat li:nth-child(3) { animation-delay: .18s; } .feat li:nth-child(4) { animation-delay: .24s; }
.feat li span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.mock { max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 10px; box-shadow: var(--shadow-lg); transform: perspective(1000px) rotateX(6deg) rotateY(-8deg); animation: mockIn 1s .3s var(--ease) both; }
@keyframes mockIn { from { opacity: 0; transform: perspective(1000px) rotateX(20deg) rotateY(-20deg) translateY(30px); } }
.mock-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; border-radius: 10px; font-size: 14px; }
.mock-row + .mock-row { border-top: 1px dashed var(--border); }
.mchip { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.mchip.p { background: var(--p-s); color: var(--p-c); } .mchip.a { background: var(--a-s); color: var(--a-c); } .mchip.l { background: var(--l-s); color: #d97706; }
.auth-card { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 26px; padding: 32px; box-shadow: var(--shadow-lg); animation: fadeUp .7s .1s var(--ease) both; }
.auth-card h2 { font-size: 26px; margin-bottom: 18px; }
.auth-card .seg { width: 100%; margin-bottom: 22px; } .auth-card .seg-btn { flex: 1; justify-content: center; padding: 10px; }
.auth-panel { animation: fadeIn .35s; display: flex; flex-direction: column; gap: 4px; }
.auth-panel .btn-block { margin: 10px 0 6px; }
.auth-card-wrap > .tiny { margin-top: 16px; }

/* ---------- Статус-экраны ---------- */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.status-card { max-width: 460px; text-align: center; padding: 36px; animation: fadeUp .6s var(--ease); }
.status-card h2 { margin: 14px 0 8px; } .status-card .row-gap { margin-top: 20px; }
.status-ic { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; margin: 0 auto; }
.status-ic.warn { background: var(--l-s); color: var(--l-c); } .status-ic.err { background: var(--a-s); color: var(--a-c); }

/* ---------- Шапка ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.6) blur(18px); border-bottom: 1px solid var(--border); }
.topbar-in { max-width: 1280px; margin: 0 auto; height: var(--topbar-h); padding: 0 20px; display: flex; align-items: center; gap: 18px; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav-link { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 11px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; transition: all .2s var(--ease); position: relative; }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.net-off { color: var(--a-c); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--a-s); animation: pulse 2s infinite; }
.lang-sw { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.lang-b { border: 0; background: transparent; padding: 6px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .03em; transition: all .2s; }
.lang-b.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.umenu { position: relative; }
.umenu-btn { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); transition: all .2s; }
.umenu-btn:hover { border-color: var(--primary); }
.um-name { font-weight: 600; font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.umenu-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 270px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; animation: popIn .22s var(--ease); z-index: 60; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.um-head { display: flex; gap: 12px; padding: 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.um-head b { display: block; font-size: 14px; } .um-head small { display: block; color: var(--muted); font-size: 12px; word-break: break-all; }
.um-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 10px; border: 0; background: none; color: var(--text); font-weight: 500; font-size: 14px; text-align: left; }
.um-item:hover { background: var(--surface-2); } .um-item.danger { color: var(--a-c); }
.role-badge { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); }
.role-badge.r-admin { background: linear-gradient(135deg, #fde68a, #fca5a5); color: #7c2d12; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; }
.av-txt { color: #fff; font-weight: 700; letter-spacing: .02em; }
.announce { background: var(--grad); color: #fff; animation: fadeIn .4s; }
.announce-in { max-width: 1280px; margin: 0 auto; padding: 9px 20px; display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; }
.announce-in span { flex: 1; } .announce .icon-btn { background: rgba(255, 255, 255, .15); border-color: transparent; color: #fff; }
.container { max-width: 1280px; margin: 0 auto; padding: 26px 20px 110px; }
.bottom-nav { display: none; }

/* ---------- Заголовки страниц ---------- */
.page-head { margin-bottom: 22px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 10px; transition: color .2s, gap .2s; }
.back:hover { color: var(--primary); gap: 8px; }
.ph-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ph-title-wrap { display: flex; align-items: center; gap: 14px; }
.ph-sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.ph-sub a { font-weight: 600; }
.ph-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-avatar { width: 54px; height: 54px; border-radius: 16px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; box-shadow: 0 10px 22px -8px rgba(139, 92, 246, .6); flex: none; }
.title-input { font: inherit; font-size: clamp(22px, 3vw, 28px); font-weight: 800; letter-spacing: -.02em; border: 1.5px dashed transparent; background: transparent; border-radius: 10px; padding: 2px 8px; margin-left: -8px; width: 100%; max-width: 420px; outline: none; }
.title-input:hover { border-color: var(--border); } .title-input:focus { border-color: var(--primary); background: var(--surface); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 30px 0 14px; flex-wrap: wrap; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.block { margin-top: 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.tb-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.search-mini { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search-mini .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-mini .input { padding-left: 38px; height: 40px; }

/* ---------- Hero / поиск ---------- */
.hero { text-align: center; padding: 44px 0 26px; position: relative; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.hero-title { font-size: clamp(30px, 5vw, 52px); line-height: 1.08; margin-bottom: 12px; }
.hero-sub { color: var(--muted); font-size: 17px; margin-bottom: 28px; }
.search-box { position: relative; max-width: 620px; margin: 0 auto; display: flex; align-items: center; }
.search-box > .ic { position: absolute; left: 20px; color: var(--muted); }
.search-input { width: 100%; height: 64px; border-radius: 20px; border: 2px solid var(--border); background: var(--surface); padding: 0 64px 0 54px; font-size: 18px; font-weight: 500; outline: none; box-shadow: var(--shadow); transition: all .25s var(--ease); }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 14%, transparent), var(--shadow-lg); }
.search-box kbd { position: absolute; right: 18px; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font: 600 13px/1.3 inherit; }
.search-results { max-width: 620px; margin: 10px auto 0; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; display: none; }
.search-results.open { display: block; animation: popIn .25s var(--ease); }
.sr-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; color: var(--text); transition: background .15s; }
.sr-item + .sr-item { border-top: 1px solid var(--border); }
.sr-item:hover, .sr-item:focus { background: var(--primary-soft); outline: none; }
.sr-item:hover > .ic:last-child { transform: translateX(3px); color: var(--primary); }
.sr-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.sr-name { flex: 1; font-weight: 700; font-size: 16px; } .sr-meta { color: var(--muted); font-size: 13px; }
.sr-empty, .sr-loading { padding: 18px; color: var(--muted); display: flex; gap: 10px; align-items: center; }

/* ---------- Группа: календарь + занятия ---------- */
.group-layout { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
.side { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 16px; }
.side .card + .card { margin-top: 0; }
.fav-btn.on { color: #d97706; border-color: #fcd34d; background: var(--l-s); } .fav-btn.on .ic { fill: currentColor; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 16px; }
.cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-day { position: relative; aspect-ratio: 1; border: 0; border-radius: 11px; background: transparent; font-weight: 600; font-size: 14px; color: var(--text-2); display: grid; place-items: center; transition: all .18s var(--ease); }
.cal-day:hover { background: var(--surface-2); transform: scale(1.06); }
.cal-day.future { color: var(--muted); opacity: .55; }
.cal-day.has { color: var(--text); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--primary); color: var(--primary); }
.cal-day.sel { background: var(--grad); color: #fff; box-shadow: 0 8px 18px -6px rgba(139, 92, 246, .6); transform: scale(1.04); }
.cal-dots { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.cal-dots b { width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.cal-dots.c-a b { background: var(--a-c); } .cal-dots.c-l b { background: var(--l-c); } .cal-dots.c-e b { background: var(--e-c); } .cal-dots.c-p b { background: var(--p-c); }
.cal-day.sel .cal-dots b { background: #fff; }
.cal-legend { display: flex; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-lg { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); } .cal-lg.c-a { background: var(--a-c); }
.child-card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.child-stat { display: flex; align-items: center; gap: 16px; margin: 16px 0 10px; }
.cs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.cs-grid small { grid-column: 1 / -1; }
.ring-v { transition: stroke-dashoffset 1.2s var(--ease); animation: ringIn 1.2s var(--ease); }
@keyframes ringIn { from { stroke-dashoffset: var(--c); } }
.ring-t { font-weight: 800; font-size: 19px; fill: var(--text); }
.miss-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; margin-top: 8px; }
.miss { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center; text-align: left; padding: 9px 11px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; transition: all .15s; }
.miss:hover { border-color: var(--primary); }
.miss small { grid-column: 1 / -1; color: var(--muted); }
.ok-note { display: flex; gap: 8px; align-items: center; color: var(--p-c); font-weight: 600; font-size: 14px; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.day-head h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 21px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--p-c); font-weight: 600; margin-top: 4px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--p-c); animation: pulse 1.8s infinite; color: var(--p-c); }
.day-nav { display: flex; gap: 6px; align-items: center; }

/* ---------- Карточки занятий ---------- */
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.lesson-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; color: var(--text); overflow: hidden; }
.lesson-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--grad); opacity: 0; transition: opacity .25s; }
.lesson-card:hover, .lesson-card.clickable:focus { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; outline: none; }
.lesson-card:hover::before { opacity: 1; }
.lesson-card.clickable { cursor: pointer; }
.lc-link { position: absolute; inset: 0; z-index: 1; }
.lc-actions { position: relative; z-index: 2; margin-top: 6px; }
.lc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.pair-badge { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 3px 9px; border-radius: 8px; }
.lesson-card h3 { font-size: 18px; }
.lc-group { font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; }
.lc-topic { color: var(--muted); font-size: 14px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin: 0; }
.att-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--surface-3); margin-top: 8px; }
.att-bar .seg { height: 100%; transition: width 1s var(--ease); animation: grow 1s var(--ease); transform-origin: left; padding: 0; border: 0; border-radius: 0; background: none; }
@keyframes grow { from { transform: scaleX(0); } }
.att-bar .seg.p { background: var(--p-c); } .att-bar .seg.l { background: var(--l-c); } .att-bar .seg.e { background: var(--e-c); } .att-bar .seg.a { background: var(--a-c); }
.lc-foot { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 13px; font-weight: 700; }
.sl.p { color: var(--p-c); } .sl.a { color: var(--a-c); } .sl.l { color: var(--l-c); } .sl.e { color: var(--e-c); } .sl.n { color: var(--n-c); }
.sl.rate { margin-left: auto; color: var(--text); background: var(--surface-2); padding: 0 8px; border-radius: 6px; }
.child-badge { margin-top: 8px; padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.child-badge.st-p { background: var(--p-s); color: var(--p-c); } .child-badge.st-a { background: var(--a-s); color: var(--a-c); }
.child-badge.st-l { background: var(--l-s); color: #d97706; } .child-badge.st-e { background: var(--e-s); color: var(--e-c); } .child-badge.st-n { background: var(--n-s); color: var(--muted); }

/* ---------- Модалка посещаемости ---------- */
.lm-head { display: flex; gap: 22px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.donut { width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; flex: none; animation: pop .6s var(--ease); }
.donut > div { width: 92px; height: 92px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; align-content: center; }
.donut b { font-size: 24px; font-weight: 800; } .donut small { color: var(--muted); font-size: 12px; }
.lm-info { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.lm-info > div { display: flex; align-items: center; gap: 8px; }
.lm-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.tile { border-radius: 14px; padding: 12px; text-align: center; }
.tile b { display: block; font-size: 24px; font-weight: 800; } .tile span { font-size: 12.5px; font-weight: 600; }
.tile.p { background: var(--p-s); color: var(--p-c); } .tile.a { background: var(--a-s); color: var(--a-c); } .tile.l { background: var(--l-s); color: #d97706; } .tile.e { background: var(--e-s); color: var(--e-c); }
.lm-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; } .lm-tools .input { flex: 1; min-width: 160px; }
.lm-list { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; max-height: 46vh; overflow-y: auto; }
.lm-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.lm-row + .lm-row { border-top: 1px solid var(--border); }
.lm-row.mine { background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); }
.lm-row .num { width: 26px; color: var(--muted); font-size: 13px; text-align: right; }
.lm-row .nm { flex: 1; font-weight: 600; } .lm-row .nm small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }

/* ---------- Главная учителя ---------- */
.welcome { position: relative; overflow: hidden; border-radius: 26px; padding: 30px; background: var(--grad); background-size: 200% 200%; animation: gradMove 12s ease infinite, fadeUp .6s var(--ease); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; box-shadow: 0 24px 50px -18px rgba(139, 92, 246, .65); }
@keyframes gradMove { 0%, 100% { background-position: 0 50%; } 50% { background-position: 100% 50%; } }
.welcome h1 { color: #fff; margin: 6px 0; } .welcome p { opacity: .9; margin: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; opacity: .9; }
.w-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.w-text { position: relative; z-index: 1; }
.w-deco { position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.w-deco::after { content: ""; position: absolute; left: -120px; top: 160px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 20px; }
.stat { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; color: var(--text); transition: transform .25s var(--ease), box-shadow .25s; }
a.stat:hover, .stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.c1 .stat-ic { background: var(--primary-soft); color: var(--primary); } .c2 .stat-ic { background: var(--p-s); color: var(--p-c); }
.c3 .stat-ic { background: var(--e-s); color: var(--e-c); } .c4 .stat-ic { background: #fce7f3; color: #db2777; } .c5 .stat-ic { background: var(--l-s); color: var(--l-c); }
[data-theme="dark"] .c4 .stat-ic { background: rgba(219, 39, 119, .16); }
.repeat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.repeat-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; transition: all .2s var(--ease); }
.repeat-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.repeat-card b { display: block; } .repeat-card span { display: block; font-size: 14px; color: var(--text-2); } .repeat-card small { display: block; font-size: 12px; }

/* ---------- Комбобокс ---------- */
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 5; max-height: 240px; overflow: auto; padding: 4px; animation: popIn .18s var(--ease); }
.combo-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px; border: 0; background: none; border-radius: 9px; text-align: left; font-weight: 600; }
.combo-item:hover { background: var(--primary-soft); color: var(--primary); }
.combo-item small { margin-left: auto; color: var(--muted); font-weight: 500; }

/* ---------- Журнал отметок ---------- */
.lock-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--p-s); color: #047857; margin-bottom: 16px; animation: fadeUp .4s var(--ease); }
[data-theme="dark"] .lock-banner { color: #6ee7b7; }
.meta-card { display: grid; grid-template-columns: 1.1fr 2fr .9fr .55fr; gap: 0 12px; padding: 16px 16px 2px; margin-bottom: 16px; }
.meta-ro { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; padding: 14px 18px; }
.table-card { padding: 0; overflow: hidden; }
.att-table, .data-table { width: 100%; border-collapse: collapse; }
.att-table th, .data-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.att-table td, .data-table td { padding: 8px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.att-table tr:last-child td, .data-table tr:last-child td { border-bottom: 0; }
.att-table .num { width: 44px; color: var(--muted); font-weight: 600; text-align: right; }
.att-table tr.row { transition: background .2s; outline: none; }
.att-table tr.row:focus { background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); }
.att-table tr.st-p td:first-child { box-shadow: inset 4px 0 0 var(--p-c); } .att-table tr.st-a td:first-child { box-shadow: inset 4px 0 0 var(--a-c); }
.att-table tr.st-l td:first-child { box-shadow: inset 4px 0 0 var(--l-c); } .att-table tr.st-e td:first-child { box-shadow: inset 4px 0 0 var(--e-c); }
.att-table tr.st-a { background: color-mix(in srgb, var(--a-s) 55%, transparent); }
.att-table .name { font-weight: 600; min-width: 180px; }
.cell-input { width: 100%; border: 1.5px solid transparent; background: transparent; padding: 7px 9px; border-radius: 9px; font-weight: 600; outline: none; transition: all .15s; }
.cell-input:hover { border-color: var(--border); } .cell-input:focus { border-color: var(--primary); background: var(--surface); }
.cell-input.note { font-weight: 400; font-size: 14px; }
.note-sm, .reason-sm { display: block; font-size: 12px; font-weight: 500; color: var(--muted); padding-left: 2px; }
.reason-sm { color: var(--e-c); display: flex; align-items: center; gap: 4px; padding-left: 9px; }
.st-group { display: flex; gap: 6px; }
.st-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 11px; border: 1.5px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 700; font-size: 13px; transition: all .18s var(--ease); }
.st-btn b { font-size: 14px; } .st-btn:not(:disabled):hover { transform: translateY(-2px); }
.st-btn.st-p:hover, .st-btn.st-p.on { border-color: var(--p-c); color: var(--p-c); } .st-btn.st-a:hover, .st-btn.st-a.on { border-color: var(--a-c); color: var(--a-c); }
.st-btn.st-l:hover, .st-btn.st-l.on { border-color: var(--l-c); color: #d97706; } .st-btn.st-e:hover, .st-btn.st-e.on { border-color: var(--e-c); color: var(--e-c); }
.st-btn.on { animation: tick .3s var(--ease); }
.st-btn.st-p.on { background: var(--p-c); color: #fff; box-shadow: 0 6px 14px -4px rgba(16, 185, 129, .55); }
.st-btn.st-a.on { background: var(--a-c); color: #fff; box-shadow: 0 6px 14px -4px rgba(239, 68, 68, .55); }
.st-btn.st-l.on { background: var(--l-c); color: #fff; box-shadow: 0 6px 14px -4px rgba(245, 158, 11, .55); }
.st-btn.st-e.on { background: var(--e-c); color: #fff; box-shadow: 0 6px 14px -4px rgba(59, 130, 246, .55); }
.st-btn:disabled { cursor: default; } .st-btn:disabled:not(.on) { opacity: .35; }
@keyframes tick { 50% { transform: scale(1.12); } }
.add-row { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
.kbd-hint { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12.5px; margin: 12px 4px; }
.sticky-foot { position: sticky; bottom: 16px; z-index: 20; margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px 12px 18px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); animation: fadeUp .5s .1s var(--ease) both; }
.sticky-foot.ro { justify-content: center; }
.counters { display: flex; gap: 14px; flex-wrap: wrap; }
.cn { display: flex; align-items: baseline; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.cn b { font-size: 20px; font-weight: 800; }
.cn.p b { color: var(--p-c); } .cn.a b { color: var(--a-c); } .cn.l b { color: var(--l-c); } .cn.e b { color: var(--e-c); } .cn.n b { color: var(--n-c); }
.cn.n.warn { color: #d97706; } .cn.n.warn b { color: #d97706; }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); padding: 5px 10px; border-radius: 9px; background: var(--surface-2); }
.save-state.s-saved { color: var(--p-c); } .save-state.s-saving .ic { animation: spin 1s linear infinite; } .save-state.s-error { color: var(--a-c); } .save-state.s-offline { color: var(--l-c); }
.dd { position: relative; }
.dd-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; animation: popIn .2s var(--ease); }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 10px 12px; border-radius: 9px; font-weight: 500; font-size: 14px; text-align: left; }
.dd-item:hover { background: var(--surface-2); } .dd-item.danger { color: var(--a-c); }
.reason-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.reason-btn { padding: 12px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 600; font-size: 14px; text-align: left; transition: all .18s var(--ease); }
.reason-btn:hover, .reason-btn.on { border-color: var(--e-c); background: var(--e-s); color: var(--e-c); transform: translateY(-2px); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .6; } }

/* ---------- Группы ---------- */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.group-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; transition: all .25s var(--ease); }
.group-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.gc-main { display: flex; gap: 14px; align-items: center; color: var(--text); }
.gc-main .g-avatar { width: 48px; height: 48px; font-size: 16px; border-radius: 14px; }
.gc-actions { display: flex; gap: 8px; } .gc-actions .btn-primary { flex: 1; }
.two-col { display: grid; grid-template-columns: 1.05fr 1fr; gap: 22px; align-items: start; }
.st-list { list-style: none; counter-reset: s; padding: 0; margin: 0; max-height: 560px; overflow: auto; }
.st-list li { counter-increment: s; display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.st-list li::before { content: counter(s); width: 28px; text-align: right; color: var(--muted); font-size: 13px; font-weight: 600; flex: none; }
.st-list li span { padding: 7px 9px; font-weight: 600; }
.st-list + .add-row { margin: 12px -20px 0; border-radius: 0; }
.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 14px; transition: all .18s; }
a.mini-row:hover { border-color: var(--primary); transform: translateX(3px); }
.mini-row b { min-width: 90px; font-size: 13px; } .mini-row span { flex: 1; min-width: 0; } .mini-row span small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row em { font-style: normal; font-weight: 800; color: var(--primary); }
.day-block { margin-bottom: 26px; } .day-block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }

/* ---------- Учителя / профиль / работы ---------- */
.teacher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.teacher-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 0 18px 20px; text-align: center; color: var(--text); overflow: hidden; transition: all .3s var(--ease); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.teacher-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.tc-cover { align-self: stretch; height: 70px; margin: 0 -18px -38px; background: var(--grad); opacity: .85; }
.teacher-card .avatar { border: 4px solid var(--surface); box-shadow: var(--shadow); position: relative; }
.teacher-card .tags { justify-content: center; }
.profile-hero { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; overflow: hidden; margin: 6px 0 10px; box-shadow: var(--shadow-sm); animation: fadeUp .5s var(--ease); }
.ph-cover { height: 150px; background: var(--grad); background-size: 200% 200%; animation: gradMove 14s ease infinite; }
.ph-body { display: flex; gap: 22px; align-items: flex-end; padding: 0 26px 24px; margin-top: -56px; flex-wrap: wrap; }
.ph-body .avatar { border: 5px solid var(--surface); box-shadow: var(--shadow); }
.ph-info { flex: 1; min-width: 240px; } .ph-info h1 { margin-bottom: 8px; } .bio { color: var(--text-2); margin-top: 10px; white-space: pre-line; }
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.work-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; cursor: pointer; transition: all .3s var(--ease); display: flex; flex-direction: column; }
.work-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.wc-img { aspect-ratio: 16/10; background: var(--surface-2); overflow: hidden; }
.wc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.work-card:hover .wc-img img { transform: scale(1.06); }
.wc-ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--primary); background: linear-gradient(135deg, var(--primary-soft), var(--surface-2)); }
.wc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.work-big { width: 100%; border-radius: 14px; margin-bottom: 14px; max-height: 60vh; object-fit: contain; background: var(--surface-2); }
.avatar-edit { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.avatar-edit label.btn { cursor: pointer; }
.pw-box { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.pw-box summary { cursor: pointer; font-weight: 600; display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.img-pick { position: relative; border: 2px dashed var(--border); border-radius: 14px; min-height: 140px; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); overflow: hidden; transition: border-color .2s; }
.img-pick:hover { border-color: var(--primary); }
.img-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.img-pick img { width: 100%; max-height: 240px; object-fit: cover; }
.img-pick.loading::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.cred { background: var(--surface-2); padding: 16px; border-radius: 12px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; white-space: pre-wrap; word-break: break-all; border: 1px solid var(--border); }

/* ---------- Админ ---------- */
.admin { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: start; }
.admin-nav { position: sticky; top: calc(var(--topbar-h) + 16px); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.an-head { display: flex; gap: 8px; align-items: center; font-weight: 800; padding: 10px 12px 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.an-head .ic { color: var(--primary); }
.an-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; color: var(--text-2); font-weight: 600; font-size: 14px; transition: all .18s var(--ease); }
.an-link:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.an-link.active { background: var(--primary-soft); color: var(--primary); }
.admin-main { min-width: 0; animation: fadeUp .45s var(--ease); }
.am-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.am-head p { margin: 4px 0 0; }
.data-table tbody tr { transition: background .15s; } .data-table tbody tr:hover { background: var(--surface-2); }
.data-table .actions { text-align: right; white-space: nowrap; } .data-table .actions > * { margin-left: 4px; }
.u-cell { display: flex; gap: 10px; align-items: center; min-width: 0; }
.u-cell b { display: block; font-size: 14px; } .u-cell small { display: block; color: var(--muted); font-size: 12.5px; word-break: break-all; }
.table-card { overflow-x: auto; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 18px; }
.grid-cards .card { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.grid-cards h3, .danger-zone h3 { display: flex; gap: 8px; align-items: center; }
.danger-zone { border-color: color-mix(in srgb, var(--a-c) 35%, var(--border)); }
.danger-zone h3 { color: var(--a-c); }
.dz-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.dz-row b { display: block; } .dz-row small { color: var(--muted); font-size: 13px; }
.dz-row.big b { color: var(--a-c); }

/* ---------- Модалки ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 200; background: rgba(10, 12, 30, .45); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .25s; }
.modal-wrap.open { opacity: 1; }
.modal { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-lg); transform: translateY(18px) scale(.97); transition: transform .3s var(--ease); }
.modal-wrap.open .modal { transform: none; }
.modal.md { max-width: 620px; } .modal.lg { max-width: 780px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 22px 8px; }
.modal-head h3 { font-size: 19px; }
.modal-head .icon-btn { border: 0; background: var(--surface-2); }
.modal-body { padding: 10px 22px 6px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; flex-wrap: wrap; }

/* ---------- Тосты ---------- */
#toasts { position: fixed; z-index: 400; top: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 440px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 500; font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-14px) scale(.96); transition: all .35s var(--ease); pointer-events: auto; max-width: 100%; }
.toast.show { opacity: 1; transform: none; }
.toast-ic { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .15); }
.toast-success .toast-ic { background: var(--p-c); color: #fff; } .toast-error .toast-ic { background: var(--a-c); color: #fff; } .toast-warn .toast-ic { background: var(--l-c); color: #fff; }

/* ---------- Адаптив ---------- */
@media (max-width: 1360px) {
  .topbar-in > .brand span:last-child { display: none; }
  .nav-link { padding: 8px 10px; gap: 6px; }
}
@media (max-width: 1100px) {
  .group-layout { grid-template-columns: 300px 1fr; }
  .meta-card { grid-template-columns: 1fr 1fr; }
  .admin { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 6px; }
  .an-head { display: none; } .an-link { white-space: nowrap; }
}
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; gap: 26px; padding-top: 70px; }
  .mock { display: none; } .feat { grid-template-columns: 1fr; }
  .group-layout, .two-col { grid-template-columns: 1fr; }
  .group-layout .main-col { order: -1; }  /* на телефоне сначала занятия сегодняшнего дня */
  .side { position: static; }
  .nav { display: none; }
  .bottom-nav { display: flex; position: fixed; z-index: 60; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px); border: 1px solid var(--border); border-radius: 22px; padding: 6px; box-shadow: var(--shadow-lg); overflow-x: auto; scrollbar-width: none; gap: 2px; }
  .bottom-nav .nav-link { flex: 1 0 auto; flex-direction: column; gap: 2px; padding: 7px 10px; font-size: 11px; min-width: 62px; justify-content: center; }
  .sticky-foot { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .um-name { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .container { padding: 18px 14px 120px; }
  .topbar-in { padding: 0 14px; gap: 10px; }
  .topbar .brand span:last-child { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .auth-page { padding: 64px 16px 24px; gap: 18px; }
  .feat { display: none; }
  .brand.big { margin-bottom: 16px; }
  .auth-sub { font-size: 15px; }
  .auth-card { padding: 22px; border-radius: 22px; }
  .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .field:nth-child(n) { grid-column: span 1; } .form-grid .full { grid-column: 1 / -1; }
  .hide-sm { display: none; }
  .st-btn span { display: none; } .st-btn { flex: 1; height: 42px; padding: 0; justify-content: center; }
  .st-btn b { font-size: 16px; }
  .att-table thead { display: none; }
  .att-table tbody { display: block; }
  .att-table tr.row { display: grid; grid-template-columns: 30px 1fr auto; grid-template-areas: "num name del" "st st st"; align-items: center; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); }
  .att-table tr.row td { border: 0; padding: 0; }
  .att-table tr.row td.num { grid-area: num; width: auto; text-align: left; box-shadow: none !important; }
  .att-table tr.row td.name { grid-area: name; min-width: 0; }
  .att-table tr.row td:nth-child(3) { grid-area: st; padding-top: 6px; }
  .att-table tr.row td:last-child:not(.name):not(:nth-child(3)) { grid-area: del; }
  .att-table tr.st-p { box-shadow: inset 4px 0 0 var(--p-c); } .att-table tr.st-a { box-shadow: inset 4px 0 0 var(--a-c); }
  .att-table tr.st-l { box-shadow: inset 4px 0 0 var(--l-c); } .att-table tr.st-e { box-shadow: inset 4px 0 0 var(--e-c); }
  .st-group { width: 100%; }
  .kbd-hint { display: none; }
  .st-group { gap: 5px; }
  .att-table td, .att-table th { padding: 8px; } .att-table .num { width: 28px; } .att-table .name { min-width: 120px; }
  .lm-tiles { grid-template-columns: repeat(2, 1fr); }
  .welcome { padding: 22px; } .w-actions { width: 100%; } .w-actions .btn { flex: 1; }
  .sticky-foot { padding: 10px; border-radius: 16px; } .sticky-foot .btn-lg { width: 100%; }
  .counters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; width: 100%; }
  .cn { flex-direction: column; align-items: center; gap: 0; font-size: 10px; text-align: center; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .cn b { font-size: 18px; }
  .sticky-foot { gap: 8px; } .sticky-foot .btn-lg { height: 46px; }
  .ph-actions { width: 100%; } .ph-actions .dd { margin-left: auto; }
  .dd-pop { right: 0; }
  .search-input { height: 56px; font-size: 16px; border-radius: 16px; } .search-box kbd { display: none; }
  .ph-row { align-items: flex-start; }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { border-radius: 24px 24px 0 0; max-height: 92vh; } .modal-foot .btn { flex: 1; }
  .reason-grid { grid-template-columns: 1fr; }
  .meta-card { grid-template-columns: 1fr 1fr; }
  .meta-card .field.grow { grid-column: 1 / -1; order: -1; }
  .lang-b { padding: 6px 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .bottom-nav, .sticky-foot .btn, .toolbar, .bg, .announce { display: none !important; }
  .container { padding: 0; }
}
