/* =========================================================
   Giao diện web khóa học — Thầy Lê Minh Trí
   Màu chủ đạo: xanh mòng két + cyan, nền giấy kẻ ô
   ========================================================= */
:root {
  --bg: #f3f6f7;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --ink: #10232d;
  --ink-2: #3a515c;
  --muted: #6b7f88;
  --line: #dce4e7;
  --grid: rgba(16, 35, 45, 0.045);
  --primary: #0a6fae;
  --primary-hover: #085c91;
  --primary-ink: #ffffff;
  --accent: #38b6ff;
  --soft: #e3f3fd;
  --soft-ink: #08588b;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #9a5b06;
  --warn-soft: #fdf3e1;
  --ok: #1a7f4b;
  --ok-soft: #e5f5ec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 35, 45, .06), 0 8px 24px rgba(16, 35, 45, .06);
  --topbar-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1a20;
    --surface: #132229;
    --surface-2: #172a32;
    --ink: #e6eff2;
    --ink-2: #b7c8cf;
    --muted: #87a0a9;
    --line: #23383f;
    --grid: rgba(230, 239, 242, 0.035);
    --primary: #38b6ff;
    --primary-hover: #5ec4ff;
    --primary-ink: #04121c;
    --accent: #7fcfff;
    --soft: #12344a;
    --soft-ink: #9fdcff;
    --danger: #ff8a7d;
    --danger-soft: #3a1c1a;
    --warn: #f3b866;
    --warn-soft: #3a2b12;
    --ok: #6fd69c;
    --ok-soft: #12321f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 .5rem;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

p {
  margin: 0 0 .75rem;
}

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

.center {
  text-align: center;
}

.right {
  text-align: right;
}

.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9em;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Thương hiệu ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--ink);
  font-weight: 600;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 1.35rem;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
  flex: none;
}

.brand-mark.sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 1.05rem;
}

.brand-logo {
  display: block;
  flex: none;
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.brand-logo.sm {
  width: 34px;
  height: 34px;
}

/* ---------- Nút ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: 9px;
  border: 1px solid transparent;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}

.btn:hover {
  text-decoration: none;
}

.btn-sm {
  min-height: 34px;
  padding: 0 .75rem;
  font-size: .88rem;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
  min-height: 46px;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.btn-text-danger {
  color: var(--danger);
}

.btn-text-danger:hover {
  background: var(--danger-soft);
}

/* ---------- Form ---------- */
.form {
  display: grid;
  gap: 1rem;
}

.form label {
  display: grid;
  gap: .35rem;
  font-weight: 500;
  font-size: .92rem;
  color: var(--ink-2);
}

input:not([type=checkbox]):not([type=file]),
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

textarea {
  min-height: 0;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

.hint {
  color: var(--muted);
  font-weight: 400;
  font-size: .82rem;
}

.check {
  display: flex !important;
  align-items: center;
  gap: .5rem;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.form-actions {
  display: flex;
  gap: .5rem;
}

.grid-form {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.grid-form .form-actions {
  align-self: end;
}


/* Nút nằm cùng hàng với ô nhập: căn thẳng với ô nhập */
.grid-form .form-actions:not(.span-2) {
  align-self: start;
  padding-top: calc(.92rem * 1.55 + .35rem);
}

.grid-form .form-actions:not(.span-2) .btn {
  min-height: 44px;
}

.span-2 {
  grid-column: 1 / -1;
}

/* .row-2 { display: grid; grid-template-columns: 1fr 140px; gap: 1rem; } */
.row-2 {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 1rem;
  align-items: start;
}

.pw-field {
  position: relative;
  display: block;
}

.pw-field input {
  padding-right: 4.2rem;
}

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  padding: .4rem .6rem;
  cursor: pointer;
  border-radius: 6px;
}

/* ---------- Thông báo ---------- */
.alert {
  padding: .75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: .92rem;
  border: 1px solid transparent;
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}

.alert-success {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 25%, transparent);
}

.alert-info {
  background: var(--soft);
  color: var(--soft-ink);
}

/* =========================================================
   TRANG ĐĂNG NHẬP
   ========================================================= */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px 26px;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.75rem;
}

.auth-brand strong {
  display: block;
  font-size: 1.05rem;
}

.auth-brand small {
  display: block;
  color: var(--muted);
  font-size: .85rem;
}

.auth-card h1 {
  font-size: 1.45rem;
  margin-bottom: .25rem;
}

.auth-card>.muted {
  margin-bottom: 1.25rem;
}

.auth-note {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  font-size: .85rem;
  color: var(--muted);
}

/* =========================================================
   THANH TRÊN CÙNG
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: .75rem;
  height: var(--topbar-h);
  padding: 0 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.topbar-right form {
  margin: 0;
}

.who {
  font-weight: 500;
  color: var(--ink-2);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  border: 0;
  background: none;
  color: var(--ink);
  padding: 8px;
  margin-left: -8px;
  border-radius: 8px;
  cursor: pointer;
}

/* =========================================================
   TRANG HỌC
   ========================================================= */
.preview-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  align-items: center;
  padding: .5rem 16px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: .85rem;
  border-bottom: 1px solid var(--line);
}

.preview-bar a {
  color: var(--warn);
  font-weight: 600;
  padding: .1rem .5rem;
  border-radius: 6px;
}

.preview-bar a.on {
  background: var(--warn);
  color: var(--surface);
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-h));
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.sidebar-head {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: .15rem;
}

.sidebar-head small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .72rem;
  font-weight: 600;
}

.sidebar-head strong {
  font-size: 1.05rem;
  line-height: 1.3;
}

.sidebar-head .muted {
  font-size: .85rem;
}

.chapters details {
  border-bottom: 1px solid var(--line);
}

.chapters summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 40px 14px 18px;
  position: relative;
  display: grid;
  gap: .1rem;
}

.chapters summary::-webkit-details-marker {
  display: none;
}

.chapters summary::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .15s;
}

.chapters details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.chapters summary:hover {
  background: var(--surface-2);
}

.ch-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary);
}

.ch-title {
  font-weight: 600;
  line-height: 1.35;
}

.ch-count {
  font-size: .8rem;
  color: var(--muted);
}

.chapters ol {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
}

.chapters ol a {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: .6rem;
  align-items: start;
  padding: 9px 18px 9px 18px;
  color: var(--ink-2);
  border-left: 3px solid transparent;
}

.chapters ol a:hover {
  background: var(--surface-2);
  text-decoration: none;
  color: var(--ink);
}

.chapters ol a.active {
  background: var(--soft);
  color: var(--soft-ink);
  border-left-color: var(--primary);
  font-weight: 600;
}

.l-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}

.active .l-num {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}

.l-title {
  line-height: 1.4;
  padding-top: 1px;
}

.l-tags {
  display: flex;
  gap: 4px;
  padding-top: 2px;
}

.tag {
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.tag-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}

.empty-li {
  padding: 6px 18px 10px 62px;
  color: var(--muted);
  font-size: .88rem;
}

.content {
  padding: 28px clamp(16px, 4vw, 48px) 64px;
  max-width: 1080px;
  width: 100%;
}

.crumb {
  color: var(--primary);
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: .25rem;
}

.lesson-title {
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  margin-bottom: 1.1rem;
}

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #0b141a;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player.small {
  max-width: 480px;
}

.player-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #9fb3bb;
  padding: 1rem;
  text-align: center;
}

.wm {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  color: rgba(255, 255, 255, .22);
  font-size: clamp(11px, 1.4vw, 15px);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  white-space: nowrap;
  transition: left 1.2s ease, top 1.2s ease;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.panel>h2 {
  margin-bottom: .9rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .9rem;
}

.panel-head h2 {
  margin: 0;
}

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.files li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.files form {
  margin: 0;
}

.file-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 44px;
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .03em;
}

.file-meta {
  display: grid;
  min-width: 0;
  flex: 1;
}

.file-meta b,
.file-meta a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.file-meta small {
  color: var(--muted);
}

.files.compact li {
  padding: 8px 10px;
}

.files.compact .file-ico {
  width: 34px;
  height: 38px;
}

.note {
  white-space: normal;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.pager-link {
  display: grid;
  gap: .15rem;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.pager-link:hover {
  border-color: var(--primary);
  text-decoration: none;
}

.pager-link small {
  color: var(--primary);
  font-weight: 600;
}

.pager-link span {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pager-link.next {
  text-align: right;
  grid-column: 2;
}

.empty {
  padding: 15vh 0;
  text-align: center;
}

.scrim {
  display: none;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .brand-name {
    display: none;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    left: 0;
    top: var(--topbar-h);
    bottom: 0;
    height: auto;
    width: min(86vw, 340px);
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow);
  }

  .nav-open .sidebar {
    transform: none;
  }

  .scrim {
    display: block;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    z-index: 35;
    background: rgba(5, 14, 18, .45);
  }

  .scrim[hidden] {
    display: none;
  }

  .content {
    padding-top: 20px;
  }

  .player {
    border-radius: 10px;
    margin: 0 -4px;
    width: calc(100% + 8px);
  }

  .pager {
    grid-template-columns: 1fr;
  }

  .pager-link.next {
    grid-column: 1;
  }

  .who {
    display: none;
  }
}

@media (max-width: 520px) {
  .files li {
    flex-wrap: wrap;
  }

  .files .file-meta {
    flex-basis: calc(100% - 60px);
  }

  .files li .btn {
    flex: 1;
  }
}

/* =========================================================
   TRANG QUẢN TRỊ
   ========================================================= */
.admin-nav {
  display: flex;
  gap: .25rem;
  margin-left: 1rem;
  overflow-x: auto;
}

.admin-nav a {
  padding: .45rem .75rem;
  border-radius: 8px;
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
}

.admin-nav a:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.admin-nav a.on {
  background: var(--soft);
  color: var(--soft-ink);
}

.admin-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.page-head h1 {
  margin-bottom: .2rem;
}

.page-head p {
  margin: 0;
}

.back {
  display: inline-block;
  font-size: .88rem;
  margin-bottom: .35rem;
  font-weight: 500;
}

.credential {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--soft);
  border: 1px dashed var(--primary);
}

.credential small {
  display: block;
  color: var(--soft-ink);
  font-size: .78rem;
}

.credential b {
  font-size: 1.15rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.credential .btn {
  margin-left: auto;
}

.filter {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: .6rem;
  margin-bottom: 1rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: var(--surface-2);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
}

.badge-on {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-off {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 1rem;
}

.pagination a {
  min-width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-2);
}

.pagination a.on {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
  align-items: start;
}

.two-col.wide-left {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}

.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.course-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  gap: .5rem;
  align-content: start;
  border-top: 4px solid var(--primary);
}

.course-card h3 a {
  color: var(--ink);
}

.course-card p {
  margin: 0;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.stats span {
  font-size: .8rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--ink-2);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .5rem;
}

.card-actions form {
  margin: 0 0 0 auto;
}

.collapsible summary {
  list-style: none;
  cursor: pointer;
}

.collapsible summary::-webkit-details-marker {
  display: none;
}

.collapsible summary h2 {
  margin: 0;
  display: inline;
}

.collapsible summary::after {
  content: " ▾";
  color: var(--muted);
}

.collapsible[open] summary {
  margin-bottom: 1rem;
}

.chapter-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}

.chapter-head form {
  margin: 0;
}

.inline-form {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex: 1;
  min-width: 260px;
}

.chapter-title-input {
  font-weight: 600;
}

.sort-input {
  width: 76px !important;
  flex: none;
}

.lesson-admin-list {
  list-style: none;
  margin: 0 0 .75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.lesson-admin-list:empty {
  display: none;
}

.lesson-admin-list li {
  display: grid;
  grid-template-columns: 26px 1fr auto auto;
  gap: .75rem;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.lesson-admin-list li:last-child {
  border-bottom: 0;
}

.lesson-admin-list .l-title {
  color: var(--ink);
  font-weight: 500;
}

.add-row input {
  flex: 1;
}

.upload {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}

@media (max-width: 900px) {
  .admin-page .topbar {
    height: auto;
    min-height: var(--topbar-h);
    flex-wrap: wrap;
    padding: 10px 16px;
  }

  .admin-nav {
    order: 3;
    width: 100%;
    margin: 0;
  }

  .two-col,
  .two-col.wide-left {
    grid-template-columns: 1fr;
  }

  .filter {
    grid-template-columns: 1fr;
  }

  .row-2 {
    grid-template-columns: 1fr;
  }

  .lesson-admin-list li {
    grid-template-columns: 26px 1fr auto;
  }

  .lesson-admin-list .l-tags {
    display: none;
  }
}