:root {
  --bg: #07111f;
  --panel: rgba(11, 22, 38, 0.88);
  --panel-2: rgba(17, 30, 51, 0.95);
  --card: rgba(15, 24, 40, 0.95);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(79, 209, 255, 0.28);
  --text: #f5f7fb;
  --muted: #9aa8bf;
  --cyan: #44d9ff;
  --cyan-2: #22b8ff;
  --violet: #7c5cff;
  --success: #33d17a;
  --warning: #ffb84d;
  --danger: #ff6b81;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(68, 217, 255, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(124, 92, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #06101b 0%, #07111f 50%, #050c16 100%);
  color: var(--text);
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

code {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 8px;
  color: #ccefff;
}

.admin-layout {
  position: relative;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: relative;
  z-index: 20;
  border-right: 1px solid var(--border);
  background: rgba(4, 10, 18, 0.75);
  backdrop-filter: blur(18px);
  padding: 28px 18px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar__brand h2 {
  margin: 0;
  font-size: 1rem;
}

.sidebar__brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.sidebar__logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #04111d;
  font-weight: 800;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar__link {
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: 0.25s ease;
}

.sidebar__link:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar__link.active {
  color: var(--text);
  background: rgba(68, 217, 255, 0.1);
  border-color: var(--border-strong);
}

.main-content {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 32px;
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumb a {
  color: var(--cyan);
}

.topbar-actions {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  position: relative;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: 0.25s ease;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  color: #04101d;
  box-shadow: 0 12px 35px rgba(34, 184, 255, 0.22);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.is-loading {
  opacity: 0.72;
  cursor: wait;
}

.btn-block {
  width: 100%;
}

.import-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.mode-btn {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: 0.25s ease;
}

.mode-btn:hover,
.mode-btn.active {
  border-color: var(--border-strong);
  background: rgba(68, 217, 255, 0.08);
}

.mode-btn strong,
.mode-btn span {
  display: block;
}

.mode-btn strong {
  font-size: 1rem;
  margin-bottom: 6px;
}

.mode-btn span {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}

.import-mode-panel.hidden {
  display: none;
}

.overlay,
.sidebar::before,
.sidebar::after {
  pointer-events: none;
}

.hero-card {
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(68, 217, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(17, 30, 51, 0.95) 0%, rgba(10, 18, 31, 0.98) 100%);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 700;
}

.hero-card__header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.hero-card__header h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.04;
}

.hero-description {
  margin: 14px 0 0;
  max-width: 850px;
  color: var(--muted);
  line-height: 1.75;
}

.hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.badge--dark {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 380px;
  gap: 22px;
}

.main-column,
.side-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel__header {
  margin-bottom: 20px;
}

.panel__header--between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-label {
  margin: 0 0 10px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 700;
}

.panel__header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
}

.field input,
.field select {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
  padding: 0 14px;
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.radio-card input {
  margin-top: 3px;
}

.radio-card strong {
  display: block;
  margin-bottom: 6px;
}

.radio-card small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.88rem;
}

.upload-box {
  border: 1px dashed var(--border-strong);
  border-radius: 24px;
  background: rgba(68, 217, 255, 0.05);
  padding: 34px 20px;
  text-align: center;
  transition: 0.25s ease;
}

.upload-box.dragover {
  border-color: var(--cyan);
  background: rgba(68, 217, 255, 0.1);
}

.upload-box--course {
  min-height: 260px;
  display: grid;
  place-items: center;
}

.upload-box__content h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.upload-box__content p {
  margin: 0 auto 18px;
  max-width: 700px;
  color: var(--muted);
  line-height: 1.7;
}

.upload-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cyan);
}

.file-info {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.preview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.preview-summary--course {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.course-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 18px;
}

.course-preview-head span,
.course-preview-head small {
  display: block;
  color: var(--muted);
}

.course-preview-head strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 6px 0;
}

.validation-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.validation-badge--empty {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.validation-badge--ok {
  color: #81f2b0;
  background: rgba(51, 209, 122, 0.14);
  border: 1px solid rgba(51, 209, 122, 0.22);
}

.validation-badge--warn {
  color: #ffd08a;
  background: rgba(255, 184, 77, 0.14);
  border: 1px solid rgba(255, 184, 77, 0.22);
}

.validation-badge--error {
  color: #ff9cae;
  background: rgba(255, 107, 129, 0.14);
  border: 1px solid rgba(255, 107, 129, 0.22);
}

.course-structure-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.course-module-preview {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.course-module-preview__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.course-module-preview__head h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.course-module-preview__head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.course-module-preview__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.course-mini-chip {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  white-space: nowrap;
}

.course-lesson-preview {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.course-lesson-preview:last-child {
  border-bottom: 0;
}

.course-lesson-preview__order {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(68, 217, 255, 0.1);
  color: var(--cyan);
  font-weight: 900;
}

.course-lesson-preview strong,
.course-lesson-preview span {
  display: block;
}

.course-lesson-preview span {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.86rem;
}

.validation-counters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
}

.validation-counters span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.03);
}

.validation-issues {
  display: grid;
  gap: 14px;
}

.issue-group {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  overflow: hidden;
}

.issue-group__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.issue-group__head strong {
  font-size: 0.98rem;
}

.issue-list {
  margin: 0;
  padding: 12px 18px 16px 34px;
  color: var(--muted);
  line-height: 1.6;
}

.issue-list li + li {
  margin-top: 8px;
}

.issue-group--error .issue-group__head {
  color: #ff9cae;
}

.issue-group--warning .issue-group__head {
  color: #ffd08a;
}

.empty-state--compact {
  margin-top: 0;
  padding: 22px 18px;
}

.summary-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.summary-card strong {
  font-size: 1.25rem;
}

.preview-table-wrap {
  overflow-x: auto;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.preview-table th,
.preview-table td {
  text-align: left;
  padding: 15px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.preview-table th {
  color: var(--muted);
  font-size: 0.84rem;
}

.row-status {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.row-status--ok {
  background: rgba(51, 209, 122, 0.14);
  color: #74f0aa;
}

.row-status--error {
  background: rgba(255, 107, 129, 0.14);
  color: #ff96a8;
}

.empty-state {
  margin-top: 14px;
  padding: 36px 20px;
  border: 1px dashed var(--border);
  border-radius: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.empty-state h3 {
  margin: 0 0 10px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.format-table,
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.format-row,
.rule-item {
  padding: 15px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.format-row strong,
.rule-item strong {
  display: block;
  margin-bottom: 6px;
}

.format-row span,
.rule-item p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.import-box p {
  color: var(--muted);
  line-height: 1.7;
  margin-top: 0;
  margin-bottom: 18px;
}

.import-message {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 600;
}

.import-message.success {
  background: rgba(51, 209, 122, 0.12);
  color: #81f2b0;
  border: 1px solid rgba(51, 209, 122, 0.2);
}

.import-message.error {
  background: rgba(255, 107, 129, 0.12);
  color: #ff9cae;
  border: 1px solid rgba(255, 107, 129, 0.2);
}

.hidden {
  display: none !important;
}

@media (max-width: 1280px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .preview-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .topbar,
  .hero-card__header,
  .panel__header--between {
    flex-direction: column;
    align-items: stretch;
  }

  .form-grid,
  .radio-group,
  .import-mode-switch {
    grid-template-columns: 1fr;
  }

  .course-preview-head,
  .course-module-preview__head {
    flex-direction: column;
    align-items: stretch;
  }

  .course-module-preview__meta {
    justify-content: flex-start;
  }

  .course-lesson-preview {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .course-lesson-preview__stats {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  .main-content {
    padding: 18px;
  }

  .preview-summary {
    grid-template-columns: 1fr;
  }
}
