:root {
  --brand-blue: #173eac;
  --brand-blue-2: #245fcb;
  --brand-light: #50c8ff;
  --brand-orange: #f58345;
  --brand-green: #4fb84e;
  --brand-violet: #6450c8;
  --bg: #eef5ff;
  --panel: #ffffff;
  --line: rgba(23, 62, 172, 0.12);
  --line-strong: rgba(23, 62, 172, 0.22);
  --text: #17304f;
  --muted: #64738d;
  --shadow: 0 10px 24px rgba(23, 62, 172, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--brand-blue); text-decoration: none; }
button, input, select, textarea { font: inherit; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  height: 100vh;
  padding: 20px 16px 16px;
  background: #fff;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.brand {
  min-height: 56px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(23, 62, 172, 0.08);
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-2) 64%, var(--brand-light));
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.brand-mark.large {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
}
.brand strong { display: block; font-size: 15px; font-weight: 850; line-height: 1.2; }
.brand span, .user-box span { display: block; margin-top: 3px; color: #8ba0bf; font-size: 11px; }
nav { display: grid; gap: 4px; }
nav a {
  border-radius: 8px;
  padding: 10px 12px 10px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
nav a.active, nav a:hover {
  background: #edf4ff;
  color: var(--brand-blue);
  box-shadow: inset 3px 0 0 var(--brand-blue);
}
.nav-section {
  margin: 14px 4px 4px;
  color: #8ba0bf;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.user-box {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #f8fbff;
}
.user-box strong { display: block; font-size: 13px; }
.user-box a { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 800; }
.main { margin-left: 248px; min-height: 100vh; padding: 0 30px 34px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -30px 28px;
  padding: 0 30px;
  border-bottom: 1px solid rgba(23, 62, 172, 0.1);
  background: rgba(238, 245, 255, 0.88);
  backdrop-filter: blur(14px);
}
.crumbs { display: flex; gap: 8px; min-width: 0; color: #8ba0bf; font-size: 13px; font-weight: 750; }
.crumbs strong { color: var(--text); }
.topbar-user {
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px var(--line);
}

h1 { margin: 0 0 8px; font-size: clamp(24px, 3vw, 34px); line-height: 1.15; color: var(--text); }
h2 { margin: 0 0 12px; font-size: 17px; color: var(--text); }
p { margin-top: 0; color: var(--muted); line-height: 1.6; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.button, button {
  border: 1px solid var(--brand-blue);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--brand-blue);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  display: inline-block;
  box-shadow: 0 8px 16px rgba(23, 62, 172, 0.18);
}
.button.secondary, button.secondary { border-color: var(--line); background: #fff; color: var(--brand-blue); box-shadow: none; }
.button.danger-lite, button.danger-lite { border-color: rgba(180, 35, 24, 0.18); color: #b42318; }
.panel, .card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}
.main > section + section { margin-top: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 18px; margin-bottom: 16px; }
.kpi {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}
.kpi span { display: block; margin-bottom: 16px; color: #8ba0bf; font-size: 11px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.kpi strong { display: block; color: var(--brand-blue); font-size: clamp(30px, 3.4vw, 44px); line-height: 1; }
.kpi em { display: block; margin-top: 7px; color: var(--muted); font-style: normal; font-size: 12px; }
.kpi.brand-orange strong { color: var(--brand-orange); }
.kpi.brand-green strong { color: var(--brand-green); }
.kpi.brand-violet strong { color: var(--brand-violet); }
.schedule-kpis { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.schedule-kpis .kpi { min-height: 118px; }

.form-stack { display: grid; gap: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
.field-wide { grid-column: 1 / -1; }
.fieldset { display: flex; flex-wrap: wrap; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #f8fbff; }
.fieldset label { display: flex; align-items: center; gap: 8px; }
input[type="checkbox"] { width: auto; }
.field-hint { color: var(--muted); font-size: 12px; }
.alert {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: 10px;
  padding: 10px;
  margin: 12px 0;
  background: #fff2f2;
  color: #b42318;
}
.success-alert { border-color: rgba(79, 184, 78, 0.22); background: #effaf0; color: #257a2c; }

.schedule-filter-head { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 16px; align-items: end; }
.schedule-filter-head .actions { align-items: end; }
.schedule-filter-head label { min-width: 150px; }
.schedule-selector-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.schedule-selector-row > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
}
.schedule-selector-row strong { display: block; margin-bottom: 8px; color: var(--brand-blue); }
.schedule-check-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.schedule-check-list label {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}
.schedule-grid-wrap {
  overflow: auto;
  max-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.schedule-grid { min-width: 1120px; width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 14px; }
.schedule-grid th, .schedule-grid td { width: 220px; min-width: 220px; border-bottom: 1px solid var(--line); padding: 10px; vertical-align: top; text-align: left; }
.schedule-grid thead th { position: sticky; top: 0; z-index: 4; background: #f7fbff; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.schedule-grid th span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: none; }
.schedule-grid .schedule-sticky {
  position: sticky;
  left: 0;
  z-index: 5;
  width: 170px;
  min-width: 170px;
  background: #f7fbff;
  box-shadow: 8px 0 14px rgba(23, 62, 172, 0.05);
}
.schedule-grid tbody .schedule-sticky { z-index: 3; }
.schedule-grid tbody .schedule-sticky strong, .schedule-grid tbody .schedule-sticky span { display: block; }
.schedule-grid tbody .schedule-sticky strong { color: var(--brand-blue); font-size: 13px; }
.schedule-grid tr.is-blocked td, .schedule-grid tr.is-blocked .schedule-sticky { background: #fff8f3; }
.lesson-card {
  --lesson-color: var(--brand-blue);
  display: grid;
  gap: 6px;
  min-height: 118px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--lesson-color);
  border-radius: 8px;
  padding: 9px;
  background: #f8fbff;
}
.lesson-card.is-dragging { opacity: 0.55; }
.lesson-card.is-cancelled { border-left-color: #b42318; background: #fff7f7; }
.lesson-card.is-cancelled .lesson-top strong { text-decoration: line-through; }
.schedule-drop-cell.is-drop-target { outline: 2px solid var(--brand-light); outline-offset: -4px; background: #f0fbff; }
.lesson-editor-shell { display: grid; grid-template-columns: minmax(0, 1fr); }
.lesson-editor { border-left: 5px solid var(--brand-blue); }
.lesson-editor .actions { justify-content: flex-start; }
.lock-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 30px; margin-bottom: 8px; }
.lock-strip form { margin: 0; }
.lock-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff8f3;
  color: #9a4a1e;
  font-size: 11px;
  font-weight: 900;
}
.lock-pill.own { background: #effaf0; color: #257a2c; }
.tiny-button { padding: 5px 8px; font-size: 11px; box-shadow: none; }
.lesson-card + .lesson-card { margin-top: 8px; }
.lesson-top { display: flex; justify-content: space-between; gap: 8px; }
.lesson-top strong { color: var(--text); font-size: 13px; line-height: 1.2; overflow-wrap: anywhere; }
.lesson-top span, .lesson-meta span, .lesson-meta a {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 7px;
  background: #edf4ff;
  color: var(--brand-blue);
  font-size: 10px;
  font-weight: 800;
}
.lesson-card p, .lesson-card em { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.lesson-card em { font-style: normal; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.lesson-warnings { border-top: 1px solid var(--line); padding-top: 5px; }
.lesson-warnings summary { color: #b42318; font-size: 11px; cursor: pointer; }
.lesson-warnings span { display: block; margin-top: 4px; color: #9b1c1c; font-size: 11px; line-height: 1.35; }
.empty-slot {
  display: grid;
  place-items: center;
  min-height: 70px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.import-preview { display: grid; gap: 10px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.mini-kpis { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.mini-kpis span { border-radius: 999px; padding: 7px 9px; background: #edf4ff; color: var(--brand-blue); font-size: 12px; font-weight: 800; }
.publish-box { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.bulk-grid, .rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}
.bulk-grid form {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #f8fbff;
}
.bulk-grid h3 { margin: 0; font-size: 15px; }
.bulk-preview { display: grid; gap: 8px; margin-bottom: 14px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.report-filter { display: grid; grid-template-columns: minmax(220px, 1fr) 180px 180px auto; gap: 12px; align-items: end; }
.instruction-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.instruction-toc {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 8px;
}
.instruction-toc strong {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-blue);
  font-size: 13px;
  text-transform: uppercase;
}
.instruction-toc a {
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.instruction-toc a:hover { background: #edf4ff; color: var(--brand-blue); }
.instruction-content { display: grid; gap: 16px; min-width: 0; }
.instruction-section { scroll-margin-top: 84px; }
.instruction-section > p { margin-bottom: 12px; }
.instruction-steps {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 22px;
}
.instruction-steps li {
  color: var(--text);
  line-height: 1.55;
}
.instruction-steps.compact { gap: 7px; }
.panel-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-heading span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #edf4ff; color: var(--brand-blue); font-size: 12px; font-weight: 900; }
.panel-heading h2 { margin: 0; }
.reference-form-panel { margin-bottom: 16px; }
.reference-admin-grid { align-items: stretch; }
.reference-form-grid { align-items: end; }
.reference-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}
.study-plan-hours {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}
.check-label {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fbff;
  color: var(--text);
}
.color-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.color-cell i { width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14); }
.empty-table { color: var(--muted); text-align: center; font-weight: 750; }
.is-archived td { color: #8ba0bf; background: #fafcff; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.table-actions form { margin: 0; }
.table-actions .button, .table-actions button { padding: 7px 9px; font-size: 12px; box-shadow: none; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 800; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 12px; vertical-align: top; }
th { background: #f7fbff; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.is-negative { color: #b42318; }
.audit-filter { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.muted-line { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.status-pill { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 900; }
.status-pill.is-success { background: #effaf0; color: #257a2c; }
.status-pill.is-error { background: #fff2f2; color: #b42318; }
.audit-json summary { cursor: pointer; color: var(--brand-blue); font-weight: 800; }
.audit-json pre { max-width: 360px; overflow: auto; border-radius: 8px; padding: 8px; background: #f8fbff; color: var(--muted); font-size: 11px; white-space: pre-wrap; }

.survey-progress-panel {
  display: grid;
  grid-template-columns: minmax(170px, auto) 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}
.survey-progress-panel strong { display: block; color: var(--brand-blue); font-size: 28px; line-height: 1; }
.survey-progress-label { display: block; margin-bottom: 6px; color: #8ba0bf; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.survey-progress-bar { height: 12px; overflow: hidden; border-radius: 999px; background: #edf4ff; }
.survey-progress-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-blue), var(--brand-green)); transition: width 0.18s ease; }
.survey-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.survey-form { display: grid; gap: 16px; min-width: 0; }
.survey-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 18px;
}
.survey-question {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}
.survey-question header { display: flex; align-items: flex-start; gap: 10px; }
.survey-question header span {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #edf4ff;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 900;
}
.survey-question h3 { margin: 4px 0 0; color: var(--text); font-size: 17px; line-height: 1.35; }
.survey-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.survey-option {
  position: relative;
  min-height: 128px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #f8fbff;
  color: var(--text);
  cursor: pointer;
}
.survey-option:hover { border-color: var(--line-strong); background: #fff; }
.survey-option:has(input:checked) {
  border-color: var(--brand-blue);
  background: #edf4ff;
  box-shadow: inset 3px 0 0 var(--brand-blue);
}
.survey-option input { margin-top: 3px; }
.survey-option b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  color: var(--brand-blue);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 12px;
}
.survey-option span { min-width: 0; }
.survey-option strong { display: block; margin-bottom: 5px; color: var(--text); font-size: 13px; line-height: 1.25; }
.survey-option em { display: block; color: var(--muted); font-size: 12px; font-style: normal; line-height: 1.45; }
.survey-comment textarea { min-height: 62px; }
.survey-summary {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 12px;
}
.survey-summary textarea {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.public-page { background: #f4f7fb; color: #172b4d; }
.public-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto auto auto;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid rgba(23, 62, 172, 0.12);
  padding: 16px clamp(18px, 4vw, 54px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}
.public-logo { display: grid; gap: 2px; color: var(--brand-blue); font-weight: 900; }
.public-logo span { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.public-logo strong { font-size: 18px; }
.public-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.public-main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 56px; }
.public-hero { padding: 48px 0 28px; }
.public-hero h1 { font-size: clamp(32px, 5vw, 56px); }
.public-results h2, .public-kind-section h2 { margin-bottom: 14px; }
.public-result-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; }
.public-result-card,
.public-catalog-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}
.public-result-card strong, .public-catalog-card strong { color: var(--text); }
.public-result-card span, .public-catalog-card span { color: var(--muted); font-size: 12px; font-weight: 800; }
.public-catalogs {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}
.public-catalog-section {
  display: grid;
  gap: 12px;
}
.public-catalog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.public-catalog-head h2 { margin: 0; }
.public-catalog-head span {
  border-radius: 999px;
  padding: 5px 10px;
  background: #edf4ff;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 900;
}
.public-catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}
.public-catalog-card {
  min-height: 74px;
  box-shadow: none;
}
.public-catalog-card:hover,
.public-result-card:hover {
  border-color: rgba(23, 62, 172, 0.36);
  box-shadow: 0 12px 32px rgba(23, 62, 172, 0.12);
  transform: translateY(-1px);
}
.public-schedule-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.public-schedule-head span, .public-period { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.public-schedule-head h1 { margin-top: 4px; }
.public-period { margin-bottom: 22px; }
.public-qr-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.public-qr-panel strong { display: block; margin-bottom: 4px; color: var(--brand-blue); }
.public-qr-panel span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.qr-svg { width: 132px; height: 132px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; }
.public-kind-section { margin-top: 22px; }
.public-lessons { display: grid; gap: 10px; }
.public-lesson-card {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}
.public-lesson-time { display: grid; align-content: start; gap: 5px; color: var(--brand-blue); font-weight: 900; }
.public-lesson-time span { color: var(--muted); font-size: 12px; }
.public-lesson-time b, .public-change-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff8f3;
  color: #9a4a1e;
  font-size: 11px;
  text-transform: uppercase;
}
.public-lesson-body { display: grid; gap: 8px; }
.public-lesson-body h3 { margin: 0; font-size: 18px; }
.public-lesson-body p, .public-lesson-body em { margin: 0; color: var(--muted); font-style: normal; }
.public-tags, .public-notices { display: flex; flex-wrap: wrap; gap: 6px; }
.public-tags span {
  border-radius: 999px;
  padding: 5px 8px;
  background: #edf4ff;
  color: var(--brand-blue);
  font-size: 11px;
  font-weight: 900;
}
.public-notices span {
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff8f3;
  color: #9a4a1e;
  font-size: 12px;
  font-weight: 800;
}
.public-empty { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 14px; background: #fff; }
.public-lesson-card.is-cancelled { background: #fff7f7; border-color: rgba(180, 35, 24, 0.22); }
.public-lesson-card.is-cancelled h3 { text-decoration: line-through; }
.public-change-filter { align-items: end; }
.public-changes-list { display: grid; gap: 10px; }
.public-change-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}
.public-change-card strong { display: block; margin: 7px 0; color: var(--text); }
.public-change-card p { margin: 0; }
.public-change-card aside { display: grid; align-content: start; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.public-change-card aside em { font-style: normal; }

.import-kind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.import-kind-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}
.import-kind-card h3 { margin: 0 0 8px; }
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inline-form input,
.inline-form select { min-width: 140px; }
.success-text { color: #16723a; }

@media print {
  .public-topbar, .public-actions, .public-admin-link { display: none !important; }
  .public-main { width: 100%; padding: 0; }
  .public-lesson-card { box-shadow: none; break-inside: avoid; }
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(23, 62, 172, 0.11);
  padding: 28px;
  text-align: center;
}
.login-card label { text-align: left; margin: 12px 0; }
.login-card button { width: 100%; }
.hint { margin-top: 14px; color: var(--muted); font-size: 13px; }

@media (max-width: 1180px) {
  .kpi-grid, .schedule-kpis { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .two-col, .schedule-filter-head, .schedule-selector-row, .reference-filter, .audit-filter, .bulk-grid, .rules-grid, .report-filter, .instruction-layout { grid-template-columns: 1fr; }
  .survey-layout { grid-template-columns: 1fr; }
  .survey-summary { position: static; }
  .instruction-toc { position: static; }
  .public-topbar, .public-lesson-card, .public-change-card { grid-template-columns: 1fr; }
  .public-result-grid, .public-catalog-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}

@media (max-width: 760px) {
  .sidebar { position: relative; width: auto; height: auto; }
  .main { margin-left: 0; padding: 0 18px 28px; }
  .topbar { margin: 0 -18px 22px; padding: 12px 18px; height: auto; }
  .page-header { display: block; }
  .kpi-grid, .schedule-kpis, .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .schedule-filter-head .actions { display: grid; grid-template-columns: 1fr; }
  .schedule-grid-wrap { max-height: none; }
  .survey-progress-panel, .survey-options { grid-template-columns: 1fr; }
  .survey-option { min-height: auto; }
  .survey-summary textarea { min-height: 320px; }
  .public-result-grid, .public-catalog-grid { grid-template-columns: 1fr; }
  .public-schedule-head { display: block; }
  .public-qr-panel { display: grid; }
  .public-search { grid-template-columns: 1fr; }
}
