@font-face {
  font-family: Inter;
  src: url('/assets/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Bebas;
  src: url('/assets/bebas-cyrillic.woff2') format('woff2');
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #faf9f7;
  --ink: #111014;
  --muted: #605b65;
  --line: #e6e1e7;
  --accent: #d9f2ac;
  --pink: #f56ba8;
  --pink-hover: #f88ebd;
  --pink-soft: #fce8f1;
  --green-soft: #eef7de;
  --dark: #0d0d0f;
  --dark-surface: #292930;
  --dark-hover: #34343c;
  --dark-muted: #b8b6be;
  --focus: #a82965;
  --control: #faf9f7;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.page-head h1[tabindex="-1"]:focus-visible { outline: none; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 30px 18px 22px;
  display: flex;
  flex-direction: column;
  background: var(--dark);
  color: #fff;
}
.sidebar :focus-visible { outline-color: var(--accent); }
.brand { display: flex; gap: 11px; align-items: center; margin: 0 5px 40px; font-weight: 750; line-height: 1.25; }
.brand small { display: block; color: var(--dark-muted); font-size: 11px; font-weight: 480; margin-top: 4px; }
.brand-mark { display: block; flex: none; width: 44px; height: 44px; border-radius: 11px; }
.owner-login { display: grid; place-items: center; grid-template-columns: 1fr; min-height: 100dvh; padding: 16px; }
.owner-card { width: min(100%, 430px); padding: clamp(20px, 5vw, 36px); margin: 0; }
.owner-card h1 { margin: 16px 0 20px; font-size: clamp(36px, 8vw, 48px); }
.owner-card form { display: grid; gap: 14px; }
.owner-card input { font-size: 16px; }
.owner-card .notice:not(:empty) { margin-top: 12px; }
.owner-logout { display: block; margin-top: 6px; }
nav { display: grid; gap: 6px; }
nav a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 9px; font-size: 14px; font-weight: 625; }
nav a[aria-current] { color: var(--pink); background: var(--dark-surface); }
nav a:hover { background: var(--dark-surface); }
nav svg, .search svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.local { margin: auto 5px 0; color: var(--dark-muted); font-size: 12px; }
.local span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 5px; }
main { width: min(100%, 1240px); padding: 47px clamp(23px, 4vw, 68px) 55px; margin: 0 auto; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 28px; }
h1 { font: 400 clamp(43px, 6vw, 68px)/.96 Bebas, Inter, sans-serif; overflow-wrap: anywhere; }
.page-head p { color: var(--muted); font-size: 14px; line-height: 1.55; margin-top: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 43px; padding: 8px 15px; border: 1px solid transparent; border-radius: 9px; font-size: 13px; font-weight: 750; text-align: center; }
.primary { background: var(--pink); color: var(--ink); border-color: var(--pink); }
.primary:hover { background: var(--pink-hover); }
.secondary { color: var(--ink); border-color: var(--line); background: var(--control); }
.secondary:hover, .icon-button:hover:enabled { background: var(--pink-soft); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 15px 17px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; }
.filters button { padding: 8px 9px; min-height: 35px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 655; }
.filters button:hover, .filters button[aria-pressed='true'] { color: var(--ink); background: var(--pink-soft); }
.search { position: relative; display: flex; align-items: center; color: var(--muted); }
.search svg { position: absolute; left: 9px; width: 16px; pointer-events: none; }
.search input { width: 200px; padding-left: 32px; min-height: 36px; font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--control); color: var(--muted); }
thead th { font-size: 11px; font-weight: 700; text-align: left; }
th, td { border-top: 1px solid var(--line); padding: 11px 14px; }
th:first-child { padding-left: 17px; }
td:last-child { padding-right: 17px; text-align: right; }
tbody tr:hover { background: #fdf8fb; }
tbody th { text-align: left; }
.course-link { display: flex; gap: 12px; align-items: center; }
.course-link:hover strong { text-decoration: underline; text-underline-offset: 2px; }
.course-link strong { display: block; font-size: 13px; font-weight: 730; overflow-wrap: anywhere; }
.course-link small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.thumb { display: grid; place-items: center; height: 40px; width: 47px; flex: 0 0 47px; overflow: hidden; position: relative; border-radius: 7px; background: #f0f3e7; color: #607050; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.status { display: inline-block; padding: 4px 7px; border-radius: 5px; color: #4f5350; background: #efefed; white-space: nowrap; font-size: 11px; font-weight: 650; }
.status[data-status='published'] { color: #345123; background: #edf4e3; }
.status[data-status='upcoming'] { color: #69431e; background: #f8eedc; }
.price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-arrow { display: inline-grid; width: 28px; height: 28px; background: var(--control); border-radius: 50%; place-items: center; }
.row-arrow:hover { background: var(--accent); }
.catalog-count, .empty { padding: 14px 17px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.form-panel { padding: clamp(16px, 3vw, 25px); margin-bottom: 15px; }
.form-panel h2 { font-size: 18px; margin-bottom: 17px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
label { display: grid; gap: 6px; align-content: start; font-size: 13px; font-weight: 625; min-width: 0; }
label small { color: var(--muted); font-weight: 470; line-height: 1.4; }
input:not([type='checkbox']), select, textarea { width: 100%; padding: 8px 10px; min-height: 39px; border: 1px solid #d7d0d9; border-radius: 8px; background: var(--control); color: var(--ink); font-weight: 500; }
.search input { padding-left: 32px; }
input[readonly] { color: var(--muted); background: #f3eff4; }
textarea { resize: vertical; }
.wide { grid-column: 1 / -1; }
.back { display: inline-block; font-size: 13px; color: var(--muted); font-weight: 640; margin: 0 0 18px; }
.back:hover { text-decoration: underline; }
.section-head, .lesson-head, .form-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.section-head h2 { margin: 0; }
.lessons { padding: 0; margin: 15px 0 0; list-style: none; display: grid; gap: 9px; }
.lesson { background: var(--control); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.lesson-head { margin-bottom: 10px; }
.lesson-index { font-size: 13px; font-weight: 750; }
.lesson-actions { display: flex; gap: 4px; }
.icon-button { border: 1px solid var(--line); border-radius: 7px; width: 34px; min-height: 34px; background: white; color: var(--ink); }
.icon-button.remove { color: #8b3230; }
.checkbox { display: flex; align-items: center; gap: 7px; min-height: 24px; }
.checkbox input { accent-color: #4b6b3f; }
.empty-lessons { margin-top: 16px; color: var(--muted); font-size: 13px; }
.form-footer { margin-top: 16px; }
.notice, .alert { font-size: 13px; font-weight: 650; color: #375725; }
.error { color: #8c302e; }
.alert { padding: 13px; border: 1px solid #dfb5ad; border-radius: 8px; background: #fff0eb; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.plan .notice { min-height: 17px; margin: 10px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 830px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; padding: 11px 15px; }
  .brand { margin: 0; }
  nav { display: flex; }
  .local { display: none; }
  main { padding-top: 26px; }
}

@media (max-width: 535px) {
  main { padding: 24px 12px 32px; }
  .page-head { margin-bottom: 18px; align-items: start; }
  .page-head .button { flex-shrink: 0; }
  .plans, .field-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .toolbar { padding: 12px; }
  .search { width: 100%; }
  .search input { width: 100%; }
  th, td { padding: 10px 5px; }
  th:first-child { padding-left: 8px; }
  td:last-child { padding-right: 8px; }
  .course-link { gap: 6px; }
  .thumb { width: 29px; height: 32px; flex-basis: 29px; }
  .course-link strong, .lesson-count, .price { font-size: 11px; }
  .status { white-space: normal; font-size: 10px; padding: 3px 4px; }
  .row-arrow { width: 22px; height: 22px; }
}

.color-control { display: grid; grid-template-columns: 53px 1fr; gap: 7px; }
.color-control input[type='color'] { padding: 5px; cursor: pointer; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.section-list { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.section-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.section-list span { color: var(--muted); white-space: nowrap; }
.access-table { margin-bottom: 15px; }
.access-table h2 { font-size: 18px; }
.access-table .search input { padding-left: 10px; }
.table-scroll { overflow: auto; }
.access-table td { white-space: nowrap; }
.access-table td:last-child { text-align: left; }
.access-table th:first-child { text-align: left; }
@media (max-width: 535px) {
  .settings-grid { grid-template-columns: 1fr; }
  nav { flex-wrap: wrap; }
  nav a { padding: 8px; }
  nav svg { width: 16px; height: 16px; }
}

.access-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}
.access-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 7px;
  min-height: 106px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.access-card:hover { background: var(--green-soft); border-color: #a4b591; }
.access-card[aria-pressed='true'] { background: var(--accent); border-color: #799364; box-shadow: inset 0 0 0 1px #799364; }
.access-card strong { font: 400 36px/.9 Bebas, Inter, sans-serif; }
.access-card span { font-size: 12px; font-weight: 650; line-height: 1.35; }
.access-table-title { display: flex; align-items: center; gap: 9px; }
.access-table-title .button { min-height: 30px; padding: 4px 8px; font-size: 11px; }
@media (max-width: 640px) {
  .access-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-card { min-height: 91px; padding: 11px; }
}
