:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #172033;
  --muted: #69758a;
  --line: #dde5f0;
  --line-strong: #c8d3e2;
  --primary: #3157d5;
  --primary-dark: #2445aa;
  --primary-soft: #eef3ff;
  --sidebar: #111827;
  --sidebar-panel: #182033;
  --sidebar-line: #293449;
  --sidebar-text: #e6edf7;
  --sidebar-muted: #9aa7bc;
  --danger: #b42318;
  --ok: #087443;
  --warning: #9a6700;
  --closed: #eef2f6;
  --open: #edf8f1;
  --lesson: #fff5d8;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.app-body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

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

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  padding: 0 15px;
  background: var(--primary);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

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

.button.secondary,
.actions button {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

.button.secondary:hover,
.actions button:hover {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

button:focus-visible,
.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(49, 87, 213, 0.22);
  outline-offset: 2px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex: 0 0 262px;
  flex-direction: column;
  width: 262px;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 18px 12px 14px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  margin-bottom: 24px;
}

.brand {
  color: #f2f7ff;
  font-weight: 850;
  font-size: 24px;
  line-height: 1;
}

.collapse-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  background: var(--sidebar-panel);
  color: #dce8f8;
  font-size: 22px;
  line-height: 1;
}

.side-nav {
  display: grid;
  gap: 5px;
  overflow-y: auto;
  padding-bottom: 18px;
}

.side-nav__label {
  margin: 18px 8px 8px;
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--sidebar-text);
  font-weight: 800;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-nav a span {
  display: inline-flex;
  justify-content: center;
  width: 18px;
  color: #c8d5e8;
}

.side-nav a:hover {
  background: var(--sidebar-panel);
}

.side-nav a.active {
  background: #263552;
  color: white;
  box-shadow: inset 3px 0 0 #6ee7b7;
}

.sidebar__account {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  border-top: 1px solid var(--sidebar-line);
  padding-top: 14px;
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e9f5ff;
  color: #152033;
  font-weight: 900;
}

.account-text {
  display: grid;
  min-width: 0;
}

.account-text strong,
.account-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-text strong {
  color: #f2f7ff;
  font-size: 13px;
}

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

.sidebar__account button {
  min-height: 36px;
  border: 1px solid var(--sidebar-line);
  background: var(--sidebar-panel);
  color: white;
  padding: 0 12px;
}

.content-shell {
  flex: 1;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: auto;
  background: var(--bg);
}

.content-top {
  display: flex;
  align-items: center;
  min-height: 96px;
  border-bottom: 1px solid var(--line);
  background: white;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.content-top h1 {
  margin: 0 0 6px;
  font-size: 27px;
  font-weight: 850;
  line-height: 1.1;
}

.content-top p {
  margin: 0;
  color: #5a6b85;
  font-size: 13px;
  font-weight: 700;
}

.page {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: calc(100dvh - 96px);
  max-width: none;
  margin: 0;
  padding: 18px 24px 36px;
}

.page--no-top {
  min-height: 100dvh;
  padding-top: 16px;
}

.auth-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0 0 8px;
  letter-spacing: 0;
  color: var(--text);
}

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

.panel,
.auth-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.narrow {
  max-width: 620px;
}

.methodologist-editor {
  display: grid;
  grid-template-columns: minmax(420px, 0.85fr) minmax(620px, 1.45fr);
  align-items: start;
  gap: 14px;
}

.methodologist-details,
.embedded-schedule {
  min-width: 0;
}

.methodologist-details h1,
.embedded-schedule h2 {
  margin-top: 0;
}

.embedded-schedule {
  padding: 0;
  overflow: hidden;
}

.embedded-schedule__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.embedded-schedule__head h2,
.embedded-schedule__head p {
  margin: 0;
}

.embedded-schedule__head p {
  margin-top: 4px;
  color: var(--muted);
}

.embedded-schedule__head input[type="date"] {
  width: 145px;
}

.embedded-schedule__grid {
  max-height: calc(100vh - 260px);
}

.methodologist-editor__actions {
  position: sticky;
  bottom: 0;
  z-index: 6;
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px 16px;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

.wide {
  max-width: 980px;
}

.auth-card {
  max-width: 420px;
  margin: 70px auto;
  box-shadow: var(--shadow-md);
}

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

.stats article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.stats span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
}

.stats strong {
  font-size: 30px;
  line-height: 1.1;
}

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

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px 16px 16px;
  background: #fbfcfe;
}

legend {
  padding: 0 6px;
  font-weight: 800;
  color: var(--text);
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 11px;
  background: white;
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.12);
  outline: 0;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f6f8fb;
  color: #7b8798;
  cursor: not-allowed;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.check,
.slot-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.age-range {
  grid-template-columns: repeat(2, minmax(140px, 220px));
}

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

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

.row-actions {
  justify-content: flex-end;
  min-width: 300px;
}

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

.alert {
  margin-bottom: 16px;
  border: 1px solid #f4bbb6;
  border-radius: 8px;
  background: #fff4f2;
  color: var(--danger);
  padding: 12px 14px;
  font-weight: 700;
}

.table-wrap,
.schedule-scroll,
.schedule-editor {
  overflow: auto;
}

.empty-state {
  max-width: 520px;
  padding: 28px 0;
  color: var(--muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 900px);
  gap: 16px;
}

.settings-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.settings-tabs button {
  min-height: 36px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  box-shadow: none;
}

.settings-tabs button:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.settings-tabs button.active {
  background: var(--primary);
  color: white;
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.settings-create {
  align-items: flex-end;
  margin: 18px 0;
}

.settings-create input[name="name"] {
  max-width: 320px;
}

.setting-card {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px 16px;
}

.toggle-row span {
  display: grid;
  gap: 4px;
}

.toggle-row small {
  color: var(--muted);
  font-weight: 600;
}

.toggle-row input {
  width: 20px;
  min-width: 20px;
  min-height: 20px;
}

.lesson-filters {
  margin-bottom: 14px;
}

.lesson-filters.panel {
  padding: 18px 20px;
}

.wizard-panel {
  width: 100%;
  max-width: none;
  margin: 0;
}

.lesson-create-panel {
  flex: 1;
  min-height: 0;
}

.wizard-progress {
  display: grid;
  grid-template-columns: max-content minmax(40px, 1fr) max-content;
  align-items: center;
  max-width: 560px;
  margin: 0 auto 28px;
}

.wizard-progress__item {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-weight: 850;
}

.wizard-progress__item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-sm);
}

.wizard-progress__item.active {
  color: var(--primary);
}

.wizard-progress__item.active span {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.wizard-progress__line {
  height: 2px;
  margin: 0 12px;
  background: linear-gradient(90deg, var(--line), #cbd5e1);
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
}

.wizard-sections {
  display: grid;
  gap: 14px;
}

.wizard-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 16px;
}

.wizard-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.wizard-section__head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.wizard-section__head p {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  text-align: right;
}

.wizard-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  align-items: start;
}

.wizard-fields.compact {
  grid-template-columns: minmax(280px, 0.9fr) minmax(220px, 1fr);
}

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

.segmented-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segmented-options.single-option {
  grid-template-columns: minmax(0, 1fr);
}

.segmented-options label {
  display: block;
}

.segmented-options input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  clip-path: inset(50%);
}

.segmented-options span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-weight: 800;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.segmented-options span:hover {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

.segmented-options input:checked + span {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: inset 0 0 0 1px rgba(49, 87, 213, 0.16);
}

.segmented-options input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.field-hint {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.wizard-actions {
  justify-content: flex-end;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.match-summary {
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 800;
}

.methodologist-matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  min-height: 120px;
}

.methodologist-matches.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.methodologist-match {
  display: grid;
  align-content: start;
  justify-items: start;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.methodologist-match:hover,
.methodologist-match.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--text);
}

.methodologist-match strong {
  font-size: 17px;
}

.methodologist-match span,
.methodologist-match small {
  color: var(--muted);
  font-weight: 600;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(5, minmax(135px, 1fr));
  align-items: end;
  gap: 12px;
}

.filter-actions {
  grid-column: 1 / -1;
}

.filter-actions button,
.filter-actions .button {
  min-height: 38px;
}

.lesson-list-panel {
  padding: 0 22px 18px;
  overflow: hidden;
}

.lesson-list-panel .table-wrap {
  max-height: calc(100dvh - 350px);
}

.lessons-table {
  min-width: 1180px;
  table-layout: fixed;
}

.lessons-table th,
.lessons-table td {
  padding: 10px 12px;
}

.lessons-table td {
  overflow: hidden;
}

.lessons-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.lessons-table th:nth-child(1) {
  width: 120px;
}

.lessons-table th:nth-child(2) {
  width: 190px;
}

.lessons-table th:nth-child(3) {
  width: 250px;
}

.lessons-table th:nth-child(4),
.lessons-table th:nth-child(5) {
  width: 170px;
}

.lessons-table th:nth-child(6) {
  width: 190px;
}

.lessons-table th:nth-child(7) {
  width: 130px;
}

.lessons-table th:nth-child(8) {
  width: 92px;
}

.lesson-date-cell,
.lesson-client-cell,
.lesson-change-cell {
  line-height: 1.25;
}

.lesson-date-cell strong,
.lesson-client-cell strong,
.lesson-change-cell strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-date-cell span,
.lesson-client-cell span,
.lesson-change-cell span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-package-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lessons-table td:nth-child(4),
.lessons-table td:nth-child(5) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions {
  text-align: right;
}

.table-actions__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}

.icon-action:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.icon-action:focus-visible {
  outline: 3px solid rgba(49, 87, 213, 0.22);
  outline-offset: 2px;
}

.lessons-table .status {
  white-space: nowrap;
}

.status-scheduled {
  background: var(--primary-soft);
  color: #244fc7;
}

.status-completed {
  background: #e7f8ef;
  color: var(--ok);
}

.status-cancelled {
  background: #fff0ef;
  color: var(--danger);
}

.status-no_show {
  background: var(--lesson);
  color: var(--warning);
}

.audit-panel {
  margin-bottom: 14px;
}

.audit-timeline {
  display: grid;
}

.audit-entry {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding: 0 0 18px;
}

.audit-entry:not(:last-child)::before {
  position: absolute;
  top: 15px;
  bottom: 0;
  left: 6px;
  width: 2px;
  background: var(--line);
  content: "";
}

.audit-entry__marker {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border: 3px solid #a9bce8;
  border-radius: 50%;
  background: white;
}

.audit-entry__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.audit-entry__head time {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.audit-changes {
  display: grid;
  gap: 5px;
  margin-top: 9px;
}

.audit-change {
  display: grid;
  grid-template-columns: minmax(130px, 0.6fr) minmax(120px, 1fr) minmax(120px, 1fr);
  gap: 10px;
  border-top: 1px solid #edf0f5;
  padding-top: 5px;
  font-size: 13px;
}

.audit-change span {
  color: var(--muted);
  font-weight: 700;
}

.audit-change del {
  color: var(--danger);
  text-decoration: none;
}

.audit-change ins {
  color: var(--ok);
  font-weight: 700;
  text-decoration: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

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

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  background: #fbfcfe;
}

tbody tr:hover {
  background: #fbfdff;
}

.grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.item-card__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.status {
  align-self: flex-start;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status.ok {
  background: #e7f8ef;
  color: var(--ok);
}

.schedule-editor table,
.day-grid {
  min-width: 980px;
}

.schedule-form {
  padding: 0;
  overflow: hidden;
}

.schedule-form > .form-actions {
  border-top: 1px solid var(--line);
  padding: 16px 18px;
}

.week-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-soft);
  color: var(--text);
}

.week-picker input {
  width: 150px;
}

.schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.schedule-toolbar__summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0 12px;
  box-shadow: var(--shadow-sm);
}

.schedule-toolbar__summary > span {
  color: var(--primary);
  font-size: 15px;
}

.schedule-toolbar__summary strong {
  font-size: 18px;
  line-height: 1;
}

.schedule-toolbar__summary small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.schedule-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-toolbar__form {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 8px;
  box-shadow: var(--shadow-sm);
}

.schedule-toolbar__form .button,
.schedule-toolbar__form button {
  gap: 7px;
  min-height: 36px;
}

.button-icon {
  width: 38px;
  min-height: 36px;
  padding: 0;
}

.schedule-date-field {
  position: relative;
  display: block;
  min-width: 210px;
}

.schedule-date-field > span {
  position: absolute;
  top: 50%;
  left: 11px;
  z-index: 1;
  color: var(--muted);
  font-size: 16px;
  transform: translateY(-50%);
  pointer-events: none;
}

.schedule-date-field input {
  min-height: 36px;
  padding-left: 34px;
}

.schedule-editor {
  max-height: calc(100vh - 255px);
  overflow: auto;
}

.availability-grid {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
}

.availability-grid th,
.availability-grid td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0;
  text-align: center;
}

.availability-grid thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 76px;
  background: #fbfcfe;
}

.schedule-time-head,
.schedule-time {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 82px;
  background: #fbfcfe;
}

.availability-grid thead .schedule-time-head {
  z-index: 5;
}

.schedule-day-head {
  min-width: 124px;
}

.schedule-day-head.today {
  background: var(--primary-soft);
}

.schedule-day-head.past,
.schedule-cell.past {
  background: #f5f6f8;
  color: #98a2b3;
}

.schedule-day-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  margin-bottom: 7px;
}

.schedule-day-title span {
  font-weight: 800;
}

.schedule-day-title strong {
  font-size: 18px;
}

.day-toggle {
  width: 28px;
  min-height: 28px;
  border: 1px solid #b8d8c4;
  border-radius: 6px;
  padding: 0;
  background: var(--open);
  color: var(--ok);
}

.day-toggle:hover {
  background: #dff3e8;
}

.schedule-time {
  height: 38px;
  padding-right: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.half-hour .schedule-time {
  color: #a2acba;
}

.schedule-cell {
  height: 38px;
  background: white;
}

.full-hour .schedule-cell,
.full-hour .schedule-time {
  border-top: 1px solid var(--line-strong);
}

.slot-check {
  display: block;
  width: 100%;
  height: 100%;
  justify-content: center;
  cursor: pointer;
}

.slot-check span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: transparent;
  font-size: 11px;
  font-weight: 900;
}

.slot-check input {
  position: absolute;
  opacity: 0;
}

.slot-check input:checked + span {
  background: #def4e8;
  color: var(--ok);
}

.slot-check input:checked + span:empty::after {
  content: "✓";
  font-size: 19px;
}

.schedule-cell.booked .slot-check span {
  background: #fff0c7;
  color: var(--warning);
  cursor: not-allowed;
}

.schedule-cell.past .slot-check {
  cursor: not-allowed;
}

.schedule-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.schedule-empty {
  padding: 28px;
}

.time-col {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 84px;
  background: #fbfcfe;
}

.schedule-scroll {
  max-height: calc(100dvh - 128px);
  overflow: auto;
}

.day-grid thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fbfcfe;
  box-shadow: inset 0 -1px 0 var(--line);
  white-space: nowrap;
}

.day-grid thead .time-col {
  z-index: 6;
}

.day-grid td {
  width: 176px;
  height: 44px;
  padding: 5px;
  vertical-align: top;
}

.day-grid .methodologist-col.col-even {
  background: #f8fbff;
}

.day-grid .methodologist-col.col-odd {
  background: #eef3f8;
}

.day-grid td.open.col-even {
  background: #effaf3;
}

.day-grid td.open.col-odd {
  background: #e7f4ed;
}

.day-grid td.open.drop-slot {
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.day-grid td.open.drop-slot.drag-over {
  background: #d9f7e5;
  box-shadow: inset 0 0 0 2px var(--ok);
}

.day-grid td.closed.col-even {
  background: #f7f9fc;
}

.day-grid td.closed.col-odd {
  background: #edf2f7;
}

.day-grid .lesson-slot {
  background: #fff9eb;
}

.day-grid .lesson-slot.col-even,
.day-grid .lesson-slot.col-odd {
  background: #fff9eb;
}

.lesson-card {
  display: flex;
  align-items: flex-start;
  min-height: 36px;
  border: 1px solid #e7bf55;
  border-radius: 8px;
  background: var(--lesson);
  padding: 7px 8px;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(154, 103, 0, 0.08);
}

.lesson-card[draggable="true"] {
  cursor: grab;
}

.lesson-card[draggable="true"]:active,
.lesson-card.dragging {
  cursor: grabbing;
}

.lesson-card.dragging {
  opacity: 0.58;
}

.lesson-card strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.empty-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px dashed #75a986;
  border-radius: 8px;
  color: var(--ok);
  font-weight: 900;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.55);
}

.schedule-board.is-moving {
  cursor: progress;
}

.schedule-board.is-moving .lesson-card,
.schedule-board.is-moving .empty-slot {
  pointer-events: none;
}

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

.feedback {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

@media (max-width: 820px) {
  .app-body {
    overflow: auto;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .content-shell {
    height: auto;
    overflow: visible;
  }

  .sidebar__account {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .sidebar__account form {
    grid-column: 1 / -1;
  }

  .sidebar__account button {
    width: 100%;
  }

  .page-head,
  .content-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .page {
    padding: 18px;
  }

  .stats,
  .two-col,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .schedule-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .schedule-toolbar__summary,
  .schedule-toolbar__controls {
    flex: 1 1 100%;
  }

  .schedule-toolbar__form {
    flex: 1 1 auto;
    flex-wrap: wrap;
  }

  .schedule-date-field {
    flex: 1 1 180px;
    min-width: 180px;
  }
}

@media (max-width: 1250px) {
  .methodologist-editor {
    grid-template-columns: 1fr;
  }

  .embedded-schedule__grid {
    max-height: 620px;
  }

  .filter-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 700px) {
  .filter-grid,
  .audit-change,
  .wizard-fields,
  .wizard-fields.compact {
    grid-template-columns: 1fr;
  }

  .wizard-fields .span-2 {
    grid-column: auto;
  }

  .wizard-section__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .wizard-section__head p {
    text-align: left;
  }

  .wizard-progress__item {
    font-size: 13px;
  }

  .audit-entry__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}
