:root {
  --bg-main: #0b0f17;
  --bg-surface: #131b2e;
  --bg-card: #1a243b;
  --bg-card-hover: #22304d;
  --border-subtle: rgba(148, 163, 184, 0.16);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-secondary);
  font-size: 12px;
}

/* Вход */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
}

.login-card__logo {
  font-size: 22px;
  font-weight: 800;
}

.login-card__sub {
  color: var(--text-secondary);
  margin: 8px 0 20px;
}

.login-divider {
  margin: 18px 0 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Шапка */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar__brand {
  font-weight: 800;
  font-size: 16px;
  margin-right: 8px;
}

.topbar__tabs {
  display: flex;
  gap: 6px;
}

.nav-tab {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.nav-tab.is-active {
  background: rgba(59, 130, 246, 0.2);
  color: #fff;
  border-color: var(--accent-blue);
}

.nav-tab__badge {
  background: var(--accent-blue);
  color: #fff;
  border-radius: 99px;
  padding: 1px 6px;
  font-size: 11px;
  margin-left: 4px;
}

.topbar__clock {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Канбан (9 колонок) */
.main-area {
  padding: 14px;
  height: calc(100vh - 58px);
  overflow: auto;
}

.kanban-board {
  display: flex;
  gap: 12px;
  height: 100%;
  min-height: 560px;
  align-items: stretch;
}

.kanban-col {
  width: 270px;
  min-width: 270px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.kanban-col.is-collapsed {
  width: 48px;
  min-width: 48px;
}

.kanban-col.is-collapsed .kanban-col__body,
.kanban-col.is-collapsed .kanban-col__title {
  display: none;
}

.kanban-col__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
  font-size: 13px;
}

.kanban-col__collapse-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 4px;
}

.kanban-col__title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-col__count {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 11px;
}

.kanban-col__body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-col__body.is-drag-over {
  background: rgba(59, 130, 246, 0.1);
  outline: 2px dashed var(--accent-blue);
}

.kanban-col__empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 24px 8px;
  font-size: 12px;
}

/* Карточка ученика */
.student-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: grab;
  transition: transform 0.12s, background 0.12s;
}

.student-card:hover {
  background: var(--bg-card-hover);
}

.student-card--upgrade {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.student-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.student-card__name {
  font-weight: 700;
  font-size: 13.5px;
}

.student-card__tz {
  font-size: 11px;
  color: var(--text-secondary);
}

.student-card__sub {
  margin-top: 2px;
  font-size: 12px;
}

.student-card__sub a {
  color: #60a5fa;
  text-decoration: none;
}

.student-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.student-card__snippet {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 6px;
}

/* Бейджи и кнопки */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.badge--emerald {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge--blue {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge--amber,
.badge--warn {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge--red {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge--muted {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
}

.badge--gold-pulse {
  display: block;
  margin-bottom: 6px;
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
  border: 1px solid var(--accent-amber);
}

.btn {
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn--sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn--primary {
  background: var(--accent-blue);
  color: #fff;
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn--danger {
  background: var(--accent-red);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}

.input-text,
.input-select,
.input-textarea {
  width: 100%;
  background: #0f1626;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

/* Модалка ученика */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1000;
}

.modal-card {
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-card__title {
  margin: 0 0 6px;
  font-size: 18px;
}

.modal-card__meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.modal-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-subtle);
}

.control-group label {
  display: block;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.control-group--highlight select {
  border-color: var(--accent-amber);
}

.modal-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 20px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
}

.tab-btn.is-active {
  color: #fff;
  border-bottom-color: var(--accent-blue);
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.composer-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.composer-box__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.history-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
}

.history-item--hunt {
  border-left: 3px solid var(--accent-emerald);
}

.history-item--live {
  border-left: 3px solid var(--accent-blue);
}

.history-item__meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.history-item__text {
  white-space: pre-wrap;
  line-height: 1.45;
}

/* Программа и Очередь эфиров */
.week-selector-bar,
.queue-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.week-pill {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}

.week-pill.is-active {
  background: var(--accent-blue);
  color: #fff;
}

.curriculum-card,
.settings-card,
.live-banner,
.queue-card,
.unit-editor-card,
.progress-week-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.curriculum-card__top,
.unit-editor-card__header,
.live-banner__top,
.queue-card__header,
.progress-week-card__header,
.unit-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.unit-editor-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.live-banner--ready {
  border-color: rgba(16, 185, 129, 0.45);
}

.live-banner--warn {
  border-color: rgba(239, 68, 68, 0.55);
}

.live-banner__controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.mode-switch {
  display: flex;
  gap: 6px;
}

.mode-switch__btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
}

.mode-switch__btn.is-active {
  background: var(--accent-blue);
  color: #fff;
}

.vr-links-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.vr-links-row code {
  display: inline-block;
  background: #0b0f17;
  padding: 4px 8px;
  border-radius: 6px;
  margin-right: 8px;
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 18px 0;
}

