/* ── Переменные ─────────────────────────────────────────────── */
:root {
  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --primary-light:#e0e7ff;
  --accent:       #10b981;
  --bg:           #0f172a;
  --bg2:          #1e293b;
  --bg3:          #334155;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --border:       #334155;
  --danger:       #ef4444;
  --warning:      #f59e0b;
  --success:      #10b981;
  --radius:       10px;
}

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.logo img { height: 36px; border-radius: 6px; }
.logo .brand-code { color: var(--primary); }
.logo .brand-bracket { color: var(--accent); }

nav { display: flex; gap: 0.3rem; }
nav a {
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all .15s;
}
nav a:hover, nav a.active { color: var(--text); background: var(--bg3); }

/* ── Container / Layout ──────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem; flex: 1; }
main { flex: 1; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background .15s, transform .1s;
  text-decoration: none;
}
.btn:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger  { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--accent); }
.btn-ghost   { background: var(--bg3); color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 5rem 1rem 3rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 1rem;
  line-height: 1.15;
}
.hero h1 span { color: var(--primary); }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Courses grid ────────────────────────────────────────────── */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.course-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color .2s, transform .2s;
}
.course-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.course-card h3 { margin-bottom: 0.5rem; color: var(--text); }
.course-card p  { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.course-meta { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--primary); }

/* ── Section title ───────────────────────────────────────────── */
.section-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.3rem; }
.section-sub   { color: var(--text-muted); margin-bottom: 2rem; }

/* ── Schedule (public) ───────────────────────────────────────── */
.schedule-list { display: flex; flex-direction: column; gap: 0.8rem; }
.schedule-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.schedule-item .date-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-weight: 600;
  font-size: 0.85rem;
}
.book-form-inline { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.book-form-inline input {
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg3);
  color: var(--text);
  font-size: 0.9rem;
  min-width: 160px;
}
.book-form-inline input::placeholder { color: var(--text-muted); }

/* ── Contacts ────────────────────────────────────────────────── */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.contact-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s;
}
.contact-item:hover { border-color: var(--primary); }
.contact-icon { font-size: 1.5rem; }
.contact-item small { color: var(--text-muted); font-size: 0.8rem; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.form-group label { font-size: 0.85rem; color: var(--text-muted); }
.form-group input, .form-group textarea, .form-group select {
  padding: 0.6rem 0.9rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  width: 100%;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-max { max-width: 480px; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert { padding: 0.8rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.2rem; font-size: 0.9rem; }
.alert-success { background: #064e3b; color: #6ee7b7; border: 1px solid #065f46; }
.alert-error   { background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }
.alert-info    { background: #1e1b4b; color: #a5b4fc; border: 1px solid #312e81; }

/* ── Admin layout ────────────────────────────────────────────── */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.admin-header h1 { font-size: 1.5rem; font-weight: 700; }
.admin-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.admin-nav a {
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  background: var(--bg2);
  color: var(--text-muted);
  font-size: 0.85rem;
  border: 1px solid var(--border);
}
.admin-nav a:hover, .admin-nav a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── CRM Расписание (таблица-сетка) ──────────────────────────── */
.crm-table-wrap { overflow-x: auto; }
.crm-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}
.crm-table th {
  background: var(--bg3);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.6rem 0.5rem;
  text-align: center;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.crm-table th.time-col { width: 110px; color: var(--text); }
.crm-table td {
  border: 1px solid var(--border);
  padding: 0.4rem;
  vertical-align: top;
  min-width: 110px;
}
.crm-cell {
  min-height: 70px;
  border-radius: 6px;
  padding: 0.4rem;
  cursor: pointer;
  transition: background .15s;
  position: relative;
}
.crm-cell.empty { background: var(--bg); }
.crm-cell.empty:hover { background: var(--bg3); }
.crm-cell.permanent { background: #1e3a5f; border: 1px solid #3b82f6; }
.crm-cell.free      { background: #064e3b; border: 1px solid var(--accent); }
.crm-cell.trial     { background: #451a03; border: 1px solid var(--warning); }
.crm-cell .cell-type  { font-size: 0.7rem; font-weight: 600; opacity: 0.8; margin-bottom: 0.2rem; }
.crm-cell .cell-name  { font-size: 0.8rem; font-weight: 600; }
.crm-cell .cell-course{ font-size: 0.7rem; color: var(--text-muted); }
.crm-cell .cell-del {
  position: absolute; top: 3px; right: 3px;
  font-size: 0.65rem; opacity: 0.5; cursor: pointer;
  background: var(--danger); color: #fff; border: none;
  border-radius: 3px; padding: 1px 4px; line-height: 1;
}
.crm-cell .cell-del:hover { opacity: 1; }
.time-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem;
  text-align: right;
}

/* ── Dashboard week view ──────────────────────────────────────── */
.week-nav { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.week-nav span { font-weight: 600; font-size: 1rem; }

/* Для ячеек в дашборде (с реальными датами) */
.lesson-pill {
  display: block;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  margin-bottom: 0.3rem;
}
.pill-permanent { background: #1e3a5f; border-left: 3px solid #3b82f6; }
.pill-free      { background: #064e3b; border-left: 3px solid var(--accent); }
.pill-trial     { background: #451a03; border-left: 3px solid var(--warning); }
.pill-completed { opacity: 0.45; }
.pill-cancelled { opacity: 0.3; text-decoration: line-through; }

/* ── Data table ───────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; background: var(--bg2); border-radius: var(--radius); overflow: hidden; }
.data-table th { background: var(--bg3); color: var(--text-muted); font-size: 0.8rem; text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); }
.data-table td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg3); }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 380px;
  max-width: 95vw;
}
.modal h3 { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-permanent { background: #1e3a5f; color: #93c5fd; }
.badge-free      { background: #064e3b; color: #6ee7b7; }
.badge-trial     { background: #451a03; color: #fcd34d; }
.badge-completed { background: var(--bg3); color: var(--text-muted); }
.badge-cancelled { background: #450a0a; color: #fca5a5; }

/* ── Login ────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 360px;
  max-width: 95vw;
}
.login-box h2 { margin-bottom: 1.5rem; text-align: center; }

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header { padding: 0 1rem; }
  .container   { padding: 1rem; }
  nav a span   { display: none; }
  .hero { padding: 3rem 1rem 2rem; }
}

/* ── Недельная таблица (общая база для публичной и CRM) ──────── */
.week-table-wrap { overflow-x: auto; }

.week-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  min-width: 620px;
}
.week-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 4px;
  white-space: nowrap;
}
.week-table th.col-time { text-align: left; width: 68px; }
.week-table .time-cell {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px;
  vertical-align: top;
  padding-top: 12px;
  white-space: nowrap;
}
.week-table .time-cell span { font-size: 9px; opacity: .55; display: block; }

/* Базовая ячейка */
.wslot {
  height: 76px;
  border-radius: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wslot-inner {
  width: 100%;
  height: 100%;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
}
.wslot-inner.left { align-items: flex-start; text-align: left; }

/* Пустая */
.wslot-empty {
  background: var(--bg2);
  border: 1.5px dashed var(--border);
}
.wslot-empty .dash { color: var(--text-muted); font-size: 16px; opacity: .2; }

/* ── Публичное расписание: свободный слот ────────────────────── */
.wslot-free {
  background: #063d2a;
  border: 1.5px solid #0F6E56;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.wslot-free:hover { background: #0a5237; }
.wslot-free.selected {
  box-shadow: 0 0 0 2.5px #10b981;
  background: #0a5237;
}
.wslot-free .slot-tag {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #10b981;
}
.wslot-free .slot-time {
  font-size: 12px;
  font-weight: 600;
  color: #e2faf2;
}

/* Подсказка над таблицей */
.hint-bar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 11px;
  margin-bottom: 16px;
}
.hint-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}

/* Бейдж "сегодня" */
.today-badge {
  display: inline-block;
  background: rgba(99,102,241,.18);
  color: #a5b4fc;
  font-size: 9px;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 3px;
  vertical-align: middle;
}

/* Навигация по неделям */
.week-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.week-nav-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ── Боковая панель (общая) ──────────────────────────────────── */
.side-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.side-layout .table-col { flex: 1; min-width: 0; }

.side-panel {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 80px;
}
.side-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 180px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}
.side-panel-empty i { font-size: 28px; opacity: .3; }

.side-section {
  padding-bottom: 12px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}
.side-section:last-child { border-bottom: none; padding-bottom: 0; }

.side-title { font-size: 14px; font-weight: 600; color: var(--text); }
.side-sub   { font-size: 12px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.side-dur   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.side-field-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 4px;
}
.side-input {
  width: 100%;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 12px;
}
.side-input::placeholder { color: var(--text-muted); }
.side-textarea {
  width: 100%;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 12px;
  resize: none;
  font-family: inherit;
}
.side-textarea::placeholder { color: var(--text-muted); }

.btn-book {
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-book:hover { background: #059669; }
.side-note {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ── CRM-ячейки (шаблон недели) ──────────────────────────────── */
.wslot-perm {
  background: #1e3a5f;
  border: 1.5px solid #3b82f6;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.wslot-perm:hover { background: #1e4a7a; }
.wslot-crm-free {
  background: #063d2a;
  border: 1.5px solid #0F6E56;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.wslot-crm-free:hover { background: #0a5237; }
.wslot-add {
  background: var(--bg);
  border: 1.5px dashed var(--border);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.wslot-add:hover { border-color: var(--primary); background: var(--bg2); }
.wslot-add .plus { font-size: 20px; color: var(--text-muted); opacity: .3; transition: opacity .15s; }
.wslot-add:hover .plus { opacity: .7; }
.wslot.selected { box-shadow: 0 0 0 2.5px var(--primary); }

.crm-tag {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.crm-tag.perm { color: #93c5fd; }
.crm-tag.free { color: #6ee7b7; }
.crm-name { font-size: 12px; font-weight: 600; color: var(--text); }
.crm-course { font-size: 10px; color: var(--text-muted); }
.lesson-badge {
  position: absolute;
  top: 5px; right: 5px;
  font-size: 9px;
  font-weight: 600;
  color: #93c5fd;
  background: rgba(59,130,246,.15);
  border-radius: 4px;
  padding: 1px 5px;
  border: 1px solid rgba(59,130,246,.25);
}

/* CRM: карточка ученика в панели */
.student-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ava-row { display: flex; align-items: center; gap: 9px; }
.ava {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(99,102,241,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #a5b4fc;
  flex-shrink: 0;
}
.ava-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; }
.ava-course { font-size: 11px; color: var(--text-muted); }
.contact-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-muted);
}
.contact-row i { font-size: 13px; flex-shrink: 0; }
.contact-val { color: var(--text); font-weight: 500; }

/* Счётчик уроков */
.lesson-counter {
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lc-left .lc-label { font-size: 11px; color: var(--text-muted); }
.lc-left .lc-sub   { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.lc-num { font-size: 22px; font-weight: 700; color: var(--primary); }

/* Кнопки типа в панели */
.type-btns-crm { display: flex; gap: 5px; }
.type-btn-crm {
  flex: 1; padding: 6px 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
}
.type-btn-crm.active-perm { background: #1e3a5f; border-color: #3b82f6; color: #93c5fd; }
.type-btn-crm.active-free { background: #063d2a; border-color: #0F6E56; color: #6ee7b7; }

@media (max-width: 700px) {
  .side-layout { flex-direction: column; }
  .side-panel { width: 100%; position: static; }
}

/* ── Большое модальное окно курса ───────────────────────────────── */
/* old modal styles removed */
.course-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  margin: auto;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}

.course-modal-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.course-modal-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}
.course-modal-close {
  background: var(--bg3);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.course-modal-close:hover { background: var(--border); color: var(--text); }

.course-modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.course-modal-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.course-modal-meta-item {
  background: var(--bg3);
  border-radius: 8px;
  padding: .5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.course-modal-meta-item .meta-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 600;
}
.course-modal-meta-item .meta-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.course-section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--primary);
  margin-bottom: .5rem;
}
.course-text {
  font-size: .95rem;
  line-height: 1.7;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.course-program-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.course-program-list li {
  display: flex;
  gap: .8rem;
  align-items: baseline;
  font-size: .9rem;
  color: var(--text-muted);
  padding: .4rem .6rem;
  border-radius: 6px;
  background: var(--bg);
}
.course-program-list li .prog-num {
  font-weight: 700;
  color: var(--primary);
  min-width: 2rem;
  flex-shrink: 0;
  font-size: .8rem;
}

.course-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: .8rem;
  justify-content: flex-end;
}

/* Таблица курсов на главной */
#coursesTable tbody tr:hover td { background: var(--bg3); }
#coursesTable tbody tr.active-row td { background: var(--bg3); }

/* ── Большое окно редактирования курса в админке ─────────────────── */
.course-edit-modal {
  max-width: 800px;
}
.course-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.course-edit-grid .span2 { grid-column: 1 / -1; }
.course-edit-modal textarea {
  min-height: 100px;
  resize: vertical;
}
.course-edit-modal textarea.tall { min-height: 160px; }

/* ── ФИКС: модальные окна должны быть поверх всего ─────────────── */
.course-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  background: rgba(0, 0, 0, 0.8) !important;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 2rem 1rem;
}
.course-modal-overlay.open {
  display: flex !important;
}
.course-modal {
  position: relative;
  background: var(--bg2) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  margin: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,.7);
  flex-shrink: 0;
}
.course-edit-modal { max-width: 800px; }
