:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --ink: #17191f;
  --muted: #667085;
  --line: #d9dde5;
  --panel: #ffffff;
  --accent: #1463ff;
  --accent-dark: #0e48c4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 14px 24px;
  position: sticky;
  top: 0;
}

.brand {
  font-weight: 800;
  text-decoration: none;
}

.topbar nav {
  align-items: center;
  display: flex;
  gap: 14px;
}

.topbar nav a {
  color: var(--muted);
  text-decoration: none;
}

.topbar form {
  margin: 0;
}

.shell {
  margin: 0 auto;
  max-width: 1100px;
  padding: 32px 24px 64px;
}

.hero {
  align-items: center;
  display: grid;
  min-height: 62vh;
}

.hero h1,
.page-title h1 {
  font-size: 44px;
  letter-spacing: 0;
  line-height: 1.08;
  margin: 0 0 12px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.button,
button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  min-height: 40px;
  padding: 10px 14px;
  text-decoration: none;
}

.button:hover,
button:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #edf2ff;
  color: var(--accent-dark);
}

.panel,
.row-card,
.metric,
.video-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.narrow {
  max-width: 460px;
}

.metrics {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 24px 0;
}

.metric span {
  display: block;
  font-size: 36px;
  font-weight: 800;
}

.metric p {
  color: var(--muted);
  margin: 0;
}

.actions,
.list {
  display: grid;
  gap: 14px;
}

.inline-actions {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.row-card {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.row-card h2,
.panel h2 {
  font-size: 20px;
  margin: 0 0 6px;
}

.row-card p {
  color: var(--muted);
  margin: 0;
}

.form {
  display: grid;
  gap: 14px;
}

.form.inline {
  align-items: end;
  grid-template-columns: 1fr 1fr auto;
}

label {
  color: var(--muted);
  display: grid;
  font-weight: 700;
  gap: 6px;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  min-height: 42px;
  padding: 9px 10px;
  resize: vertical;
}

table {
  background: var(--panel);
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
}

.users-table {
  min-width: 980px;
}

.users-table td {
  vertical-align: top;
}

.orders-table {
  min-width: 1600px;
}

.orders-table th,
.orders-table td {
  font-size: 13px;
}

.composition-cell {
  max-width: 360px;
  min-width: 280px;
}

.money,
.nowrap {
  white-space: nowrap;
}

.order-filters {
  align-items: end;
}

.compact-user-form {
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.compact-user-form button {
  width: max-content;
}

.pill,
.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  margin: 0 6px 6px 0;
  padding: 5px 9px;
}

.pill {
  background: #edf2ff;
  color: var(--accent-dark);
}

.status-active {
  background: #dcfae6;
  color: #067647;
}

.status-off {
  background: #f2f4f7;
  color: #475467;
}

.lesson-list {
  display: grid;
  gap: 8px;
}

.lesson-list.compact {
  margin-top: 12px;
}

.lesson-list a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
}

.muted {
  color: var(--muted);
}

.check {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.check input {
  min-height: 0;
  width: auto;
}

.student-form {
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr auto;
}

.student-edit-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.course-edit-form {
  grid-template-columns: 1.2fr 1fr auto;
}

.lesson-form {
  grid-template-columns: 1.2fr 0.4fr 1fr;
}

.product-form,
.product-edit-form,
.offer-form,
.offer-edit-form,
.live-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.live-block-form {
  grid-template-columns: 1.2fr 0.35fr 0.8fr 1.2fr;
}

.live-wide {
  grid-column: 1 / -1;
}

.obs-guide {
  display: grid;
  gap: 8px;
}

.obs-guide code {
  background: #101828;
  border-radius: 8px;
  color: #f8fafc;
  display: block;
  overflow-wrap: anywhere;
  padding: 10px 12px;
}

.nested-tool {
  margin: -6px 0 10px;
}

.nested-tool h3 {
  font-size: 16px;
  margin: 18px 0 10px;
}

.offer-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.module-admin {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.module-admin h3 {
  font-size: 16px;
  margin: 0 0 12px;
}

.lesson-admin {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.upload-form {
  grid-template-columns: 1fr auto;
}

.inline-single-action,
.danger-form {
  margin-top: 10px;
}

.danger {
  background: #fee4e2;
  color: #b42318;
}

.danger:hover {
  background: #fecdca;
}

.video-box code {
  background: #101828;
  border-radius: 8px;
  color: #f8fafc;
  display: block;
  overflow-wrap: anywhere;
  padding: 16px;
}

.secondary-title {
  margin-top: 34px;
}

.live-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 330px;
}

.live-main,
.live-blocks {
  display: grid;
  gap: 16px;
}

.live-player {
  aspect-ratio: 16 / 9;
  padding: 0;
}

.live-player iframe,
.live-player video {
  background: #101828;
  border: 0;
  border-radius: 8px;
  display: block;
  height: 100%;
  width: 100%;
}

.live-player p {
  padding: 20px;
}

.live-chat {
  position: sticky;
  top: 86px;
}

.live-chat-messages {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  max-height: 440px;
  min-height: 240px;
  overflow-y: auto;
  padding: 12px;
}

.live-chat-message {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
}

.live-chat-message span {
  color: var(--muted);
  font-size: 12px;
}

.live-chat-message p {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .topbar,
  .row-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics,
  .live-layout,
  .form.inline,
  .student-edit-form,
  .course-edit-form,
  .upload-form,
  .product-form,
  .product-edit-form,
  .live-form,
  .live-block-form {
    grid-template-columns: 1fr;
  }

  .live-chat {
    position: static;
  }

  .hero h1,
  .page-title h1 {
    font-size: 34px;
  }
}
