/* =====================================================================
   Платформа на курса — стилове върху styles.css (същите цветове и шрифтове)
   ===================================================================== */

body.app { min-height: 100vh; display: flex; flex-direction: column; }
.app-main { flex: 1; padding: clamp(28px, 4vw, 56px) 0 clamp(80px, 8vw, 110px); }
.wrap--narrow { max-width: 820px; }

/* ------------------------------ Header ------------------------------ */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5,5,5,.74);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-header__in { display: flex; align-items: center; gap: 28px; height: 66px; }
.app-header .brand img { height: 15px; width: auto; display: block; }
.app-nav { display: flex; gap: 4px; margin-left: 12px; }
.app-nav__link {
  position: relative; padding: 8px 14px; border-radius: 999px;
  font-size: 15px; color: var(--ink-2); text-decoration: none;
  transition: color .2s ease, background-color .2s ease;
}
.app-nav__link:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.app-nav__link.is-active { color: var(--ink); background: rgb(var(--ember-rgb) / .14); box-shadow: inset 0 0 0 1px rgb(var(--glow-rgb) / .35); }
.app-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.app-user form { margin: 0; }
.app-user__chip { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }

/* ------------------------------ Аватари ------------------------------ */
.avatar {
  --s: 44px;
  width: var(--s); height: var(--s); flex: none;
  border-radius: 50%; overflow: hidden;
  display: inline-grid; place-items: center;
  background: linear-gradient(140deg, var(--grad-start), var(--ember) 55%, var(--btn-end));
  color: #fff; font: 700 calc(var(--s) * .36)/1 var(--font-display); letter-spacing: .02em;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar--sm { --s: 32px; }
.avatar--lg { --s: 72px; }
.avatar--xl { --s: 96px; box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 20px 60px -20px rgb(var(--ember-rgb) / .6); }

/* ------------------------------ Типография ------------------------------ */
.display--app { font-size: clamp(34px, 5vw, 64px); line-height: 1; margin: 0 0 18px; }
.dash__lead { font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2); max-width: 52ch; margin: 0; }
.kicker a { color: inherit; }
.hint { font-size: 14px; color: var(--muted); margin: 0 0 16px; }
.muted-note { font-size: 13px; color: var(--muted); }

/* ------------------------------ Съобщения ------------------------------ */
.flashes { margin-bottom: 22px; }
.flash { margin: 0 0 12px; padding: 12px 16px; border-radius: 12px; font-size: 15px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); }
.flash--ok { border-color: rgba(80, 200, 120, .4); background: rgba(80, 200, 120, .08); }
.flash--err { border-color: rgb(var(--glow-rgb) / .55); background: rgb(var(--ember-rgb) / .1); }
.flash--info { border-color: rgb(var(--amber-rgb) / .35); }
.flash a { color: var(--ink); }

/* ------------------------------ Форми ------------------------------ */
.form { display: grid; gap: 16px; }
.form__row { display: flex; gap: 12px; flex-wrap: wrap; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.field input, .field textarea, .search input, .lesson-rows input {
  width: 100%;
  font: 400 16px/1.45 var(--font-body); color: var(--ink);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line-2); border-radius: 12px;
  padding: 13px 15px;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.field input:focus, .field textarea:focus, .search input:focus, .lesson-rows input:focus {
  outline: none; border-color: rgb(var(--glow-rgb) / .8);
  box-shadow: 0 0 0 4px rgb(var(--ember-rgb) / .16); background: rgba(255,255,255,.05);
}
.field input:disabled { opacity: .55; }
.field textarea { resize: vertical; min-height: 90px; }
.field textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ember); flex: none; }
.check a { color: var(--ink); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }
.inline-form { margin: -6px 0 10px; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ------------------------------ Вход / регистрация ------------------------------ */
.app--auth { align-items: center; justify-content: center; }
.glow--auth {
  width: min(900px, 130vw); height: 700px; left: 50%; top: -260px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgb(var(--ember-rgb) / .45), rgb(var(--red-rgb) / .2) 40%, transparent 70%);
}
.auth { width: 100%; max-width: 480px; padding: 48px 20px 40px; display: grid; gap: 26px; }
.auth__brand { justify-self: center; }
.auth__brand img { height: 17px; width: auto; display: block; }
.auth__card {
  background: rgba(17,16,16,.86);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line-2); border-radius: 24px;
  padding: clamp(26px, 5vw, 40px);
  box-shadow: 0 50px 140px -60px rgb(var(--ember-rgb) / .65);
}
.auth__card .eyebrow { margin-bottom: 20px; font-size: 12px; }
.auth__title { font: 800 clamp(30px, 6vw, 40px)/1 var(--font-display); text-transform: uppercase; letter-spacing: -.02em; margin: 0 0 12px; }
.auth__lead { color: var(--ink-2); margin: 0 0 24px; font-size: 16px; }
.auth__links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 22px; font-size: 14px; color: var(--muted); }
.auth__links a { color: var(--ink); }
.auth__foot { text-align: center; margin: 0; font-size: 14px; }
.auth__foot a { color: var(--muted); text-decoration: none; }
.auth__foot a:hover { color: var(--ink); }

/* ------------------------------ Табло на курса ------------------------------ */
.dash__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: clamp(24px, 4vw, 56px); align-items: end; margin-bottom: clamp(32px, 4vw, 52px); }
.progress-card {
  display: flex; align-items: center; gap: 22px;
  padding: 22px; border-radius: var(--radius);
  background: linear-gradient(150deg, var(--warm-dark), #0f0d0d 70%);
  border: 1px solid rgb(var(--glow-rgb) / .3);
  box-shadow: 0 40px 120px -50px rgb(var(--ember-rgb) / .55);
}
.progress-card__text { display: grid; gap: 8px; justify-items: start; }
.progress-card__text .label { margin: 0; color: var(--amber); }
.progress-card__text strong { font-size: 16px; line-height: 1.35; }
.progress-card__text s { color: var(--muted); text-decoration-color: var(--red); font-weight: 500; }
.ring {
  --p: 0; --size: 104px;
  width: var(--size); height: var(--size); flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(closest-side, #120e0d 78%, transparent 80% 100%),
    conic-gradient(var(--ember) calc(var(--p) * 1%), rgba(255,255,255,.08) 0);
}
.ring span { font: 800 28px/1 var(--font-display); }
.ring small { font-size: 14px; color: var(--muted); margin-left: 2px; }
.lock-badge { width: 64px; height: 64px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgb(var(--ember-rgb) / .14); border: 1px solid rgb(var(--glow-rgb) / .4); }
.lock-badge svg { width: 26px; height: 26px; fill: none; stroke: var(--amber); stroke-width: 1.8; stroke-linecap: round; }

.cmods { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cmod {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 2.4vw, 28px);
  transition: border-color .3s ease, transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease;
}
.cmod::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(120% 80% at 0% 0%, rgb(var(--glow-rgb) / .22), transparent 55%), linear-gradient(150deg, var(--warm-dark), #121010 65%);
}
@media (hover: hover) {
  .cmod:hover { border-color: rgb(var(--glow-rgb) / .5); transform: translateY(-3px); box-shadow: 0 30px 80px -40px rgb(var(--ember-rgb) / .5); }
  .cmod:hover::before { opacity: 1; }
}
.cmod.is-done { border-color: rgb(var(--glow-rgb) / .35); }
.cmod--bonus, .cmod--project { grid-column: span 1; }
.cmod__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.cmod__n {
  font: 800 clamp(30px, 3vw, 40px)/.9 var(--font-display);
  background: linear-gradient(180deg, var(--amber), var(--ember) 60%, var(--red));
  -webkit-background-clip: text; background-clip: text; color: transparent; min-width: 1.6ch;
}
.cmod__label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.cmod__title { margin: 4px 0 0; font: 700 clamp(16px, 1.5vw, 19px)/1.2 var(--font-display); text-transform: uppercase; }
.cmod__count { font: 600 13px/1 var(--font-display); color: var(--muted); padding-top: 4px; }
.cmod__bar { height: 3px; border-radius: 3px; background: rgba(255,255,255,.07); margin: 18px 0 6px; overflow: hidden; }
.cmod__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--grad-start), var(--ember), var(--amber)); border-radius: inherit; transition: width .6s ease; }
.clessons { list-style: none; margin: 0; padding: 0; }
.clesson {
  display: grid; grid-template-columns: 20px 46px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 11px 0; border-bottom: 1px solid var(--line);
  color: var(--ink-2); text-decoration: none; font-size: 15px; line-height: 1.4;
  transition: color .2s ease;
}
.clessons li:last-child .clesson { border-bottom: 0; padding-bottom: 0; }
a.clesson:hover { color: var(--ink); }
.clesson__code { font: 600 13px/1.6 var(--font-display); color: var(--muted); }
.clesson__state { width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--line-2); position: relative; }
.clesson.is-done .clesson__state { border-color: var(--ember); background: var(--ember); }
.clesson.is-done .clesson__state::after { content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.clesson.is-locked { opacity: .55; }
.clesson.is-locked .clesson__state { border-style: dashed; }

/* ------------------------------ Урок ------------------------------ */
.lesson__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(24px, 3vw, 44px); align-items: start; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.lesson__title { font: 800 clamp(26px, 3.4vw, 42px)/1.05 var(--font-display); text-transform: uppercase; letter-spacing: -.015em; margin: 0 0 22px; }
.lesson__code { display: block; font-size: .42em; letter-spacing: .1em; color: var(--amber); margin-bottom: 10px; }
.player {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(ellipse at 70% 20%, rgb(var(--glow-rgb) / .25), transparent 60%), linear-gradient(160deg, var(--warm-dark), #0a0908 60%);
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 120px -50px rgb(var(--ember-rgb) / .55);
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; color: var(--ink-2); }
.player__empty strong { font: 700 16px/1.2 var(--font-display); text-transform: uppercase; color: var(--ink); }
.player__empty span:last-child { font-size: 14px; }
.lesson__actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 22px 0 34px; }
.lesson__nav { display: flex; gap: 10px; }
.btn.is-done { border-color: rgb(var(--glow-rgb) / .55); color: var(--ink); }

.prose { font-size: 17px; line-height: 1.7; color: var(--ink-2); max-width: 72ch; }
.prose h2 { font: 800 clamp(20px, 2.2vw, 26px)/1.2 var(--font-display); text-transform: uppercase; color: var(--ink); margin: 1.8em 0 .6em; }
.prose h3 { font: 700 clamp(16px, 1.6vw, 19px)/1.3 var(--font-display); color: var(--ink); margin: 1.7em 0 .5em; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1em; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--ember); }
.prose a { color: var(--ink); text-decoration-color: var(--ember); text-underline-offset: 3px; }

.lesson__chat-cta {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 40px; padding: 20px 22px; border-radius: 18px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.02);
}
.lesson__chat-cta div { display: grid; gap: 4px; }
.lesson__chat-cta span { font-size: 14px; color: var(--muted); }

.side-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.lesson__side { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow: auto; }
.side-card .label { margin-bottom: 12px; }
.side-mod { border-top: 1px solid var(--line); }
.side-mod summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 34px 1fr; gap: 8px;
  padding: 12px 0; font: 700 13px/1.3 var(--font-display); text-transform: uppercase; color: var(--ink-2);
}
.side-mod summary::-webkit-details-marker { display: none; }
.side-mod summary span { color: var(--amber); }
.side-mod[open] summary { color: var(--ink); }
.side-mod ol { list-style: none; margin: 0 0 10px; padding: 0; }
.side-mod a {
  display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 7px 8px 7px 0;
  font-size: 14px; line-height: 1.35; color: var(--muted); text-decoration: none; border-radius: 8px;
}
.side-mod a span { font: 600 12px/1.6 var(--font-display); }
.side-mod a:hover { color: var(--ink); }
.side-mod a.is-done { color: var(--ink-2); }
.side-mod a.is-done span { color: var(--ember); }
.side-mod a.is-current { color: var(--ink); background: rgb(var(--ember-rgb) / .12); box-shadow: inset 2px 0 0 var(--ember); padding-left: 10px; }

/* ------------------------------ Профил ------------------------------ */
.profile__grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; margin-top: 10px; }
.profile-card {
  position: sticky; top: 86px;
  padding: 26px; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--warm-dark), #0e0c0c 70%);
  border: 1px solid rgb(var(--glow-rgb) / .28);
}
.profile-card__top { display: flex; gap: 18px; align-items: center; }
.profile-card__top > div { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.profile-card__name { font: 800 22px/1.1 var(--font-display); text-transform: uppercase; margin: 0; overflow-wrap: anywhere; }
.profile-card__ig { color: var(--ink-2); font-size: 14px; text-decoration: none; overflow-wrap: anywhere; }
.profile-card__ig:hover { color: var(--ink); }
.profile-card__bio { color: var(--ink-2); font-size: 15px; margin: 18px 0 0; }
.profile-card__since { font-size: 13px; color: var(--muted); margin: 18px 0 0; line-height: 1.6; }
.profile-stats { list-style: none; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.profile-stats li { display: grid; gap: 4px; }
.profile-stats b { font: 800 24px/1 var(--font-display); }
.profile-stats span { font-size: 12px; color: var(--muted); }
.profile__forms { display: grid; gap: 18px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.tag--on { color: var(--ink); border-color: rgb(var(--glow-rgb) / .5); background: rgb(var(--ember-rgb) / .12); }
.tag--err { color: #ffb4a8; border-color: rgba(255, 120, 100, .5); }
.avatar-field { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar-field .hint { margin: 0; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 2.6vw, 30px); }
.panel + .panel { margin-top: 18px; }
.panel__title { font: 800 18px/1.2 var(--font-display); text-transform: uppercase; margin: 0 0 6px; }
.panel__bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }

/* ------------------------------ Чат ------------------------------ */
.chat-page__grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.chat {
  display: flex; flex-direction: column;
  height: calc(100vh - 66px - 120px); min-height: 520px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.chat__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(150deg, var(--warm-dark), transparent 70%); }
.chat__head .kicker { margin: 0 0 6px; }
.chat__title { font: 800 clamp(17px, 2vw, 22px)/1.15 var(--font-display); text-transform: uppercase; margin: 0; }
.chat__live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }
.chat__live .dot { animation: live-pulse 2s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }
.chat__list { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 4px; scroll-behavior: smooth; }
.chat__empty { margin: auto; text-align: center; color: var(--muted); max-width: 34ch; }
.chat__day { align-self: center; font-size: 12px; color: var(--muted); padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; margin: 14px 0 8px; }
.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 8px 10px; margin: 0 -10px; border-radius: 12px; animation: msg-in .35s ease both; }
.msg:hover { background: rgba(255,255,255,.025); }
.msg.is-cont { padding-top: 0; }
.msg.is-cont .avatar { visibility: hidden; height: 0; }
.msg .avatar { --s: 36px; }
.msg__meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg__name { font-weight: 700; font-size: 15px; }
.msg__time { font-size: 12px; color: var(--muted); }
.msg__body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); line-height: 1.5; }
.msg.is-me .msg__name { color: var(--amber); }
.msg__del { margin-left: auto; opacity: 0; font-size: 12px; }
.msg:hover .msg__del, .msg__del:focus { opacity: 1; }
.msg.is-deleted .msg__body { font-style: italic; color: var(--muted); }
.badge { font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); background: rgb(var(--ember-rgb) / .3); border-radius: 6px; padding: 2px 6px; vertical-align: 1px; }
@keyframes msg-in { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
.chat__form { display: flex; gap: 10px; align-items: flex-end; padding: 14px 16px; border-top: 1px solid var(--line); background: rgba(0,0,0,.2); }
.chat__form textarea {
  flex: 1; resize: none; max-height: 160px;
  font: 400 16px/1.45 var(--font-body); color: var(--ink);
  background: rgba(255,255,255,.04); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px;
}
.chat__form textarea:focus { outline: none; border-color: rgb(var(--glow-rgb) / .8); box-shadow: 0 0 0 4px rgb(var(--ember-rgb) / .14); }
.chat__hint { font-size: 12px; color: var(--muted); margin: 0; padding: 0 16px 12px; background: rgba(0,0,0,.2); }
.chat__locked { margin: auto; display: grid; justify-items: center; gap: 10px; text-align: center; padding: 30px; color: var(--ink-2); }
.chat__locked strong { font: 700 17px/1.2 var(--font-display); text-transform: uppercase; color: var(--ink); }
.members { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow: auto; }
.members ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.members li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--ink-2); }
.members li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online { width: 8px; height: 8px; border-radius: 50%; background: #3ccf73; box-shadow: 0 0 8px rgba(60,207,115,.7); margin-left: auto; flex: none; }

/* ------------------------------ Админ ------------------------------ */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 26px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.admin-tabs a { padding: 9px 16px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 15px; border: 1px solid var(--line); }
.admin-tabs a:hover { color: var(--ink); border-color: var(--line-2); }
.admin-tabs a.is-active { color: var(--ink); border-color: rgb(var(--glow-rgb) / .5); background: rgb(var(--ember-rgb) / .12); }
.stat-row { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-row li { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; display: grid; gap: 6px; }
.stat-row b { font: 800 34px/1 var(--font-display); }
.stat-row span { font-size: 13px; color: var(--muted); }
.search input { padding: 10px 14px; min-width: 260px; }
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; padding: 10px 6px; border-bottom: 1px solid var(--line-2); }
.table td { padding: 12px 6px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.table td.empty { text-align: center; color: var(--muted); padding: 30px; }
.user-cell { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.user-cell span { display: grid; }
.user-cell strong { color: var(--ink); }
.user-cell small { color: var(--muted); }
.user-cell:hover strong { text-decoration: underline; }
.row-form { display: flex; align-items: center; gap: 10px; margin: 0; flex-wrap: wrap; }
.mini-check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.mini-check input { accent-color: var(--ember); }
.admin-mod { font: 700 14px/1.3 var(--font-display); text-transform: uppercase; color: var(--amber); margin: 26px 0 8px; }
.lesson-rows { list-style: none; margin: 0 0 8px; padding: 0; }
.lesson-rows li { display: grid; grid-template-columns: 54px minmax(0, 1fr) 220px 64px 90px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.lesson-rows__code { font: 600 13px/1 var(--font-display); color: var(--muted); }
.lesson-rows__title { color: var(--ink-2); }
.lesson-rows input { padding: 9px 12px; font-size: 14px; }
.admin-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.admin-cols .panel + .panel { margin-top: 0; }
.mail-log { list-style: none; margin: 0; padding: 0; }
.mail-log li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mail-log small { color: var(--muted); }
.mod-progress { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.mod-progress li { display: grid; grid-template-columns: minmax(0, 1fr) 140px 40px; gap: 12px; align-items: center; font-size: 14px; color: var(--ink-2); }
.mod-progress i { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.mod-progress b { display: block; height: 100%; background: linear-gradient(90deg, var(--grad-start), var(--ember)); }
.mod-progress em { font-style: normal; font-size: 12px; color: var(--muted); text-align: right; }

/* ------------------------------ Footer ------------------------------ */
.app-footer { border-top: 1px solid var(--line); padding: 22px 0; font-size: 13px; color: var(--muted); }
.app-footer__in { display: flex; gap: 20px; flex-wrap: wrap; }
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--ink); }

/* ------------------------------ Мобилна навигация ------------------------------ */
.tabbar { display: none; }

@media (max-width: 1080px) {
  .lesson__grid { grid-template-columns: minmax(0, 1fr); }
  .lesson__side { position: static; max-height: none; }
  .chat-page__grid { grid-template-columns: minmax(0, 1fr); }
  .members { display: none; }
}

@media (max-width: 900px) {
  .dash__head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .cmods { grid-template-columns: minmax(0, 1fr); }
  .profile__grid { grid-template-columns: minmax(0, 1fr); }
  .profile-card { position: static; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-cols { grid-template-columns: minmax(0, 1fr); }
  .lesson-rows li { grid-template-columns: 46px minmax(0, 1fr) 70px; }
  .lesson-rows input { grid-column: 2 / 4; }
  .lesson-rows .tag { display: none; }
  .lesson-rows .link-btn { grid-column: 3; grid-row: 1; justify-self: end; }
}

@media (max-width: 760px) {
  .app-nav, .app-user__chip span { display: none; }
  .app-header__in { height: 58px; }
  body.app:not(.app--auth) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .app-main { padding-bottom: 40px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(10, 9, 9, .92);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .tabbar__link { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 6px 0; font-size: 11px; color: var(--muted); text-decoration: none; border-radius: 12px; }
  .tabbar__link svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar__link.is-active { color: var(--ink); }
  .tabbar__link.is-active svg { stroke: var(--ember); }
  .chat { height: calc(100vh - 58px - 64px - 70px); height: calc(100dvh - 58px - 64px - 70px); min-height: 420px; }
  .chat__hint { display: none; }
  .chat__head { padding: 14px 16px 12px; }
  .chat__head .kicker { display: none; }
  .chat__title { font-size: 15px; }
  .chat__list { padding: 14px 16px; }
  .chat__form { padding: 10px 12px; }
  .chat__form .btn { padding: 0 18px; }
  .player__empty { gap: 8px; }
  .player__empty .video-slot__play { display: none; }
  .player__empty strong { font-size: 14px; }
  .player__empty span:last-child { font-size: 13px; }
  .progress-card { padding: 18px; gap: 16px; }
  .ring { --size: 86px; }
  .ring span { font-size: 22px; }
  .lesson__actions .btn--lg { width: 100%; }
  .lesson__nav { width: 100%; }
  .lesson__nav .btn { flex: 1; }
  .search input { min-width: 0; width: 100%; }
  .search { width: 100%; }
  .stat-row b { font-size: 28px; }
  .mail-log li { grid-template-columns: auto minmax(0, 1fr); }
  .mail-log small { grid-column: 2; }
  .mod-progress li { grid-template-columns: minmax(0, 1fr) 70px 34px; }
}
