:root {
  --bg: #f7f7fb;
  --panel: #fff;
  --panel2: #fafafd;
  --text: #24232b;
  --muted: #777581;
  --line: #e9e7ed;
  --brand: #f06b55;
  --brand2: #ef4f91;
  --soft: #fff1ec;
  --ok: #2ca66f;
  --warn: #e79a25;
  --bad: #dc5260;
  --shadow: 0 16px 45px rgba(34, 28, 45, 0.08);
  --ring: rgba(55, 112, 184, 0.42);
  --focus: #3770b8;
  --brand-ink: #c9256b;
  --neutral-chip: #eceaf1;
  --radius: 22px;
}
[data-theme='dark'] {
  --bg: #151419;
  --panel: #211f26;
  --panel2: #29262f;
  --text: #f7f4f8;
  --muted: #aaa5b0;
  --line: #39353f;
  --soft: #35252b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  --ring: rgba(112, 168, 238, 0.55);
  --focus: #70a8ee;
  --brand-ink: #ff9ec2;
  --neutral-chip: #332f3b;
}
* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  min-height: 30px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--muted) 75%, transparent);
  background-clip: padding-box;
}
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.toolbar input:focus-visible,
.toolbar select:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 16%, transparent);
}
html.modal-open,
html.modal-open body {
  overflow: hidden;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px/1.45 Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 26px;
}
.logo {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  font-size: 20px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 10px 24px rgba(239, 79, 145, 0.25);
}
.brand b {
  display: block;
  font-size: 17px;
}
.brand small {
  color: var(--muted);
}
.nav {
  display: grid;
  gap: 6px;
}
.nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 14px;
  border-radius: 13px;
  text-align: left;
  display: flex;
  gap: 11px;
  align-items: center;
}
.nav button.active,
.nav button:hover {
  background: var(--soft);
  color: var(--brand-ink);
}
.nav .ico {
  font-size: 18px;
  width: 22px;
  text-align: center;
}
.side-bottom {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  display: grid;
  gap: 8px;
}
.side-bottom button {
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  border-radius: 12px;
  padding: 10px;
}
.main {
  padding: 28px 32px 60px;
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  gap: 16px;
}
.topbar h1 {
  font-size: 28px;
  margin: 0 0 4px;
}
.sub {
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.btn {
  border: 0;
  border-radius: 13px;
  padding: 11px 15px;
  font-weight: 700;
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 8px 20px rgba(239, 79, 145, 0.2);
}
.btn.danger {
  color: var(--bad);
}
.grid {
  display: grid;
  gap: 18px;
}
.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.stat {
  position: relative;
  overflow: hidden;
}
.stat .value {
  font-size: 27px;
  font-weight: 850;
  margin: 7px 0 2px;
}
.stat .label {
  color: var(--muted);
}
.stat .badge {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--soft);
  font-size: 18px;
}
.cols {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.section-head h2 {
  font-size: 18px;
  margin: 0;
}
.section-head span {
  color: var(--muted);
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 38px 15px;
}
.empty .emoji {
  font-size: 36px;
  margin-bottom: 8px;
}
.list {
  display: grid;
  gap: 10px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel2);
}
.row.click {
  cursor: pointer;
}
.row.click:hover {
  border-color: #efb2c8;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #ff9a6c, #ed5e91);
}
.grow {
  min-width: 0;
  flex: 1;
}
.grow b,
.grow small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grow small {
  color: var(--muted);
  margin-top: 2px;
}
.right {
  text-align: right;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--panel);
  border: 1px solid var(--line);
}
.pill.ok {
  color: var(--ok);
  background: rgba(44, 166, 111, 0.1);
}
.pill.warn {
  color: var(--warn);
  background: rgba(231, 154, 37, 0.11);
}
.pill.bad {
  color: var(--bad);
  background: rgba(220, 82, 96, 0.1);
}
.progress {
  height: 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
}
.attention {
  border-left: 4px solid var(--warn);
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar input,
.toolbar select {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 13px;
  outline: none;
}
.toolbar input {
  min-width: 240px;
  flex: 1;
}
.student-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.student-card {
  cursor: pointer;
}
.student-card:hover {
  transform: translateY(-2px);
  border-color: #efb2c8;
}
.student-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 17px;
}
.student-card h3 {
  margin: 0;
  font-size: 17px;
}
.student-card .meta {
  color: var(--muted);
}
.student-card-details {
  display: grid;
  gap: 8px;
  margin: -3px 0 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel2);
}
.student-card-details div {
  display: grid;
  gap: 2px;
}
.student-card-details span,
.profile-contact-grid span {
  color: var(--muted);
  font-size: 11px;
}
.student-card-details b,
.profile-contact-grid b {
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.student-card-notes b {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.student-lesson-link {
  width: fit-content;
  color: var(--brand-ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.student-lesson-link:hover {
  text-decoration: underline;
}
.student-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
  margin-bottom: 15px;
}
.student-metrics div {
  padding: 9px 5px;
  background: var(--panel2);
  border-radius: 12px;
}
.student-metrics b,
.student-metrics small {
  display: block;
}
.student-metrics small {
  color: var(--muted);
  font-size: 11px;
}
.page {
  display: none;
}
.page.active {
  display: block;
}
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.day {
  min-height: 115px;
  padding: 10px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--panel2);
}
.day .date {
  font-weight: 800;
  margin-bottom: 8px;
}
.day.today {
  border-color: var(--brand2);
}
.event {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--text);
  font-size: 12px;
  padding: 6px 7px;
  border-radius: 9px;
  margin-top: 5px;
  background: var(--soft);
  cursor: pointer;
}
.report-preview {
  white-space: pre-wrap;
  border: 1px dashed var(--line);
  background: var(--panel2);
  padding: 17px;
  border-radius: 14px;
  min-height: 180px;
}
.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.field {
  display: grid;
  gap: 6px;
}
.field.full {
  grid-column: 1/-1;
}
.field label {
  font-weight: 700;
  font-size: 13px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
}
.field select,
.toolbar select,
select {
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 48%, var(--muted) 49% 63%, transparent 64%),
    linear-gradient(135deg, transparent 48%, var(--muted) 49% 63%, transparent 64%);
  background-position:
    calc(100% - 20px) 50%,
    calc(100% - 14px) 50%;
  background-size: 7px 7px;
  background-repeat: no-repeat;
}
.field textarea {
  resize: vertical;
  min-height: 82px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 14%, transparent);
}
.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-wrap {
  position: fixed;
  inset: 0;
  background: rgba(22, 18, 27, 0.58);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100;
  overscroll-behavior: contain;
}
.modal-wrap.open {
  display: flex;
}
.modal {
  width: min(720px, 100%);
  max-height: 92vh;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--panel);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}
.modal-head {
  position: sticky;
  top: 0;
  background: var(--panel);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.modal-head h2 {
  margin: 0;
  font-size: 20px;
}
.close {
  border: 0;
  background: var(--panel2);
  color: var(--text);
  width: 35px;
  height: 35px;
  border-radius: 10px;
  font-size: 19px;
}
.modal-body {
  padding: 21px;
}
.modal-foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 -8px 20px -12px rgba(20, 15, 30, 0.28);
}
.tabs {
  display: flex;
  gap: 7px;
  overflow: auto;
  margin-bottom: 16px;
}
.tabs button {
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
  padding: 8px 11px;
  border-radius: 10px;
}
.tabs button.active {
  background: var(--soft);
  color: var(--brand-ink);
}
.profile-summary {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.profile-summary .avatar {
  width: 56px;
  height: 56px;
  font-size: 20px;
}
.profile-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.profile-contact-grid div {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
}
@media (max-width: 560px) {
  .profile-contact-grid {
    grid-template-columns: 1fr;
  }
}
.mini-table {
  width: 100%;
  border-collapse: collapse;
}
.mini-table th,
.mini-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.mini-table th {
  font-size: 12px;
  color: var(--muted);
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: var(--text);
  color: var(--panel);
  padding: 12px 16px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.38s cubic-bezier(0.2, 1.35, 0.4, 1);
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.mobile-top {
  display: none;
}
.quick {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  font-size: 25px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 15px 35px rgba(239, 79, 145, 0.35);
  z-index: 15;
}
.notice {
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--soft);
  color: var(--brand2);
  margin-bottom: 15px;
}
.kpi-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
}
.danger-text {
  color: var(--bad);
}
.report-builder {
  display: grid;
  grid-template-columns: minmax(330px, 0.72fr) minmax(430px, 1.28fr);
  gap: 18px;
  align-items: start;
}
.builder-stack {
  display: grid;
  gap: 14px;
}
.builder-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.builder-item {
  display: grid;
  grid-template-columns: 1fr 90px 34px;
  gap: 7px;
  align-items: center;
}
.builder-item.topic {
  grid-template-columns: 1fr 34px;
}
.builder-item input,
.builder-item select {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  border-radius: 10px;
  padding: 9px;
}
.icon-btn {
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--bad);
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.report-paper {
  font-family: Manrope, system-ui, sans-serif;
  background: #fff;
  color: #243037;
  border-radius: 22px;
  box-shadow: 0 12px 35px rgba(17, 24, 39, 0.1);
  overflow: hidden;
}
.paper-head {
  padding: 23px;
  background: linear-gradient(135deg, #ffc6d1, #ffd7a2 45%, #b6f3e6);
}
.paper-head h2 {
  font-size: 22px;
  color: #243037;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}
.paper-pills {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 11px;
}
.paper-pill {
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.paper-body {
  padding: 20px;
  display: grid;
  gap: 13px;
}
.paper-section {
  border: 1px dashed #e5e7eb;
  border-radius: 16px;
  padding: 14px;
}
.paper-section h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.paper-section ul {
  margin: 0;
  padding-left: 20px;
}
.paper-section li {
  margin: 5px 0;
  padding: 5px 8px;
  background: #fff7f3;
  border-radius: 8px;
}
.ring-box {
  display: grid;
  place-items: center;
}
.ring-css {
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  position: relative;
}
.ring-css svg {
  position: absolute;
  inset: 0;
  width: 128px;
  height: 128px;
  transform: rotate(-90deg);
  overflow: visible;
}
.ring-css circle {
  fill: none;
  stroke-width: 14;
}
.ring-track {
  stroke: #e5e7eb;
}
.ring-value {
  stroke: #22c55e;
  stroke-linecap: butt;
  stroke-dasharray: 326.726;
  stroke-dashoffset: 326.726;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.ring-css b {
  position: relative;
  font-size: 23px;
  color: #243037;
}
.report-empty {
  color: #6b7280;
}
.report-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
@media (max-width: 1050px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .student-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .report-builder {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .app {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    height: 70px;
    padding: 8px;
    background: var(--panel);
    border: 0;
    border-top: 1px solid var(--line);
  }
  .brand,
  .side-bottom {
    display: none;
  }
  .nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
  }
  .nav button {
    padding: 7px 3px;
    display: grid;
    place-items: center;
    font-size: 10px;
    gap: 0;
  }
  .nav .ico {
    font-size: 20px;
  }
  .main {
    padding: 18px 15px 95px;
  }
  .topbar {
    align-items: flex-start;
  }
  .topbar h1 {
    font-size: 24px;
  }
  .topbar .actions .btn:not(.primary) {
    display: none;
  }
  .cols,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .student-grid {
    grid-template-columns: 1fr;
  }
  .calendar-days {
    display: flex;
    overflow-x: auto;
  }
  .day {
    min-width: 145px;
  }
  .quick {
    bottom: 85px;
    right: 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
}
@media (max-width: 470px) {
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .card {
    padding: 15px;
  }
  .stat .value {
    font-size: 22px;
  }
  .stat .badge {
    display: none;
  }
  .actions .btn {
    padding: 10px;
  }
  .student-metrics {
    font-size: 12px;
  }
}
/* Responsive layout: desktop, laptop, tablet and phone */
html {
  min-width: 320px;
}
body {
  overflow-x: hidden;
}
.main {
  min-width: 0;
  max-width: 1800px;
  width: 100%;
  margin: 0 auto;
}
.grid,
.card {
  min-width: 0;
}
.brand {
  padding-left: 10px;
}
.stat .badge {
  display: none;
}
.stat .value {
  margin-top: 0;
}
.quick {
  display: none;
}
.resting-person {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 14px;
  filter: drop-shadow(0 8px 14px rgba(34, 28, 45, 0.12));
}
@media (max-width: 1280px) {
  .cols,
  .report-builder {
    grid-template-columns: 1fr;
  }
  .student-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .report-paper {
    max-width: 820px;
  }
  .calendar-days {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1050px) {
  .app {
    grid-template-columns: 215px minmax(0, 1fr);
  }
  .main {
    padding: 24px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .calendar-days {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .row {
    min-width: 0;
  }
  .grow {
    min-width: 0;
  }
}
@media (max-width: 820px) {
  .app {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    height: 72px;
    padding: 8px;
    background: var(--panel);
    border: 0;
    border-top: 1px solid var(--line);
  }
  .brand,
  .side-bottom {
    display: none;
  }
  .nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
  }
  .nav button {
    padding: 7px 3px;
    display: grid;
    place-items: center;
    font-size: 10px;
    gap: 0;
    min-width: 0;
  }
  .nav .ico {
    font-size: 19px;
  }
  .main {
    padding: 20px 18px 96px;
    max-width: none;
  }
  .topbar {
    align-items: flex-start;
  }
  .topbar h1 {
    font-size: 24px;
  }
  .topbar .actions .btn:not(.primary) {
    display: none;
  }
  .cols,
  .settings-grid,
  .report-builder {
    grid-template-columns: 1fr;
  }
  .student-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .calendar-days {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
  }
  .day {
    min-width: 160px;
    scroll-snap-align: start;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .modal {
    max-height: 88vh;
  }
}

/* Промежуточные ширины: полная неделя начинается с понедельника,
   а панель действий занимает отдельную аккуратную строку. */
@media (min-width: 821px) and (max-width: 1050px) {
  #page-schedule .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  #page-schedule .topbar .actions {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(150px, auto) minmax(170px, auto);
    width: 100%;
    gap: 10px;
  }
  #page-schedule .topbar .actions .btn {
    min-height: 48px;
    padding-inline: 14px;
  }
  #page-schedule .calendar-days {
    grid-template-columns: repeat(7, minmax(92px, 1fr)) !important;
    min-width: 692px;
  }
  #page-schedule .calendar-weekday {
    display: block !important;
  }
  #page-schedule .mobile-weekday {
    display: none !important;
  }
  #page-schedule .day {
    min-width: 0;
    padding: 8px;
  }
  #page-schedule .day .date {
    font-size: 11px;
  }
  #page-schedule .event {
    padding: 7px;
    overflow: hidden;
    overflow-wrap: anywhere;
    font-size: 11px;
  }
}

/* На любой ширине календарь остаётся семидневной сеткой и при нехватке места
   прокручивается горизонтально, а не переносит дни на новую строку. */
#page-schedule .calendar-card {
  overflow-x: auto;
}
#page-schedule .calendar-days {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(105px, 1fr)) !important;
  min-width: 735px;
}
#page-schedule .day.past-day {
  background: color-mix(in srgb, var(--panel2) 78%, var(--bg));
  opacity: 0.7;
}
#page-schedule .day.past-day .event {
  filter: grayscale(0.2);
}
#page-schedule .day:not(.past-day):not(.outside-month) {
  background: var(--panel);
}
.students-empty {
  grid-column: 1 / -1;
  padding: 22px 4px;
  text-align: center;
  color: var(--muted);
}
.package-size-summary {
  display: grid;
  gap: 4px;
  margin: 0;
}
.package-size-summary span {
  color: var(--muted);
  font-size: 13px;
}
.package-month-card {
  margin-bottom: 18px;
}
.package-month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.package-month-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel2);
}
.package-month-item div {
  min-width: 0;
}
.package-month-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}
.package-month-item strong {
  font-size: 18px;
}
.report-block-picker {
  margin-bottom: 12px;
}
.report-block-picker h3 {
  margin: 0 0 10px;
}
.report-block-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-block-checks label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.report-block-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.report-include-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  height: 38px;
  padding: 0 11px 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel2);
  cursor: pointer;
  transition: 0.18s ease;
}
.report-include-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.report-toggle-icon {
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 2px solid var(--muted);
  border-radius: 6px;
  transition: 0.18s ease;
}
.report-include-toggle input:checked + .report-toggle-icon {
  border-color: transparent;
  background: linear-gradient(135deg, #ff706c, #ef3f91);
  box-shadow: 0 5px 12px rgba(239, 63, 145, 0.24);
}
.report-include-toggle input:checked + .report-toggle-icon::after {
  content: '';
  display: block;
  width: 8px;
  height: 4px;
  margin: 4px 0 0 3px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
.report-toggle-state {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.report-include-toggle:hover {
  border-color: rgba(239, 63, 145, 0.35);
  background: var(--panel);
}
.report-include-toggle:has(input:focus-visible) {
  outline: 3px solid rgba(239, 63, 145, 0.2);
  outline-offset: 2px;
}
@media (max-width: 600px) {
  .main {
    padding: 16px 12px 94px;
  }
  .topbar {
    display: grid;
  }
  .topbar .actions {
    width: 100%;
  }
  .topbar .actions .btn.primary {
    width: 100%;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .student-grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 16px;
    border-radius: 18px;
  }
  .stat .value {
    font-size: 22px;
  }
  .section-head {
    align-items: flex-start;
  }
  .section-head .btn {
    padding: 8px 10px;
  }
  .report-tools .btn {
    flex: 1;
  }
  .paper-head,
  .paper-body {
    padding: 15px;
  }
  .builder-item {
    grid-template-columns: minmax(0, 1fr) 72px 34px;
  }
  .modal-wrap {
    padding: 8px;
  }
  .modal {
    border-radius: 18px;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-foot {
    padding: 13px 16px;
  }
}

@media (max-width: 820px) {
  #page-schedule .calendar-card {
    overflow-x: auto;
    padding: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  #page-schedule .calendar-days {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(92px, 1fr)) !important;
    min-width: 700px !important;
    gap: 7px;
  }
  #page-schedule .calendar-weekday,
  #page-schedule .day,
  #page-schedule .day.has-events,
  #page-schedule .day.today {
    display: block;
  }
  #page-schedule .day {
    min-height: 105px;
    margin: 0;
    padding: 8px;
    border-radius: 13px;
    box-shadow: none;
  }
  #page-schedule .mobile-weekday,
  #page-schedule .day.today .date:after {
    display: none;
  }
  #page-schedule .day .date {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
  }
}

/* На телефоне месяц читается как вертикальный список дней, без широкой сетки. */
@media (max-width: 820px) {
  #page-schedule #calendar[data-calendar-view='month'] {
    display: block !important;
    min-width: 0 !important;
  }
  #page-schedule #calendar[data-calendar-view='month'] .calendar-weekday,
  #page-schedule #calendar[data-calendar-view='month'] .day.outside-month {
    display: none !important;
  }
  #page-schedule #calendar[data-calendar-view='month'] .day {
    display: block;
    min-height: 64px;
    margin-bottom: 9px;
    padding: 12px;
    border-radius: 14px;
  }
  #page-schedule #calendar[data-calendar-view='month'] .day .date {
    font-size: 13px;
  }
  #page-schedule #calendar[data-calendar-view='month'] .mobile-weekday {
    display: inline !important;
  }
}
@media (max-width: 380px) {
  .main {
    padding-left: 9px;
    padding-right: 9px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .nav button {
    font-size: 9px;
  }
  .nav .ico {
    font-size: 17px;
  }
  .topbar h1 {
    font-size: 22px;
  }
  .student-metrics {
    font-size: 12px;
  }
  .report-tools {
    display: grid;
    grid-template-columns: 1fr;
  }
  .paper-pill {
    font-size: 11px;
  }
}
.schedule-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.schedule-slot {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 120px 36px;
  gap: 8px;
  align-items: center;
}
.schedule-slot select,
.schedule-slot input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  border-radius: 11px;
  padding: 10px;
}
.slot-conflict {
  grid-column: 1/-1;
  color: var(--bad);
  font-size: 12px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(220, 82, 96, 0.08);
}
.slot-suggestion {
  border: 0;
  background: transparent;
  color: var(--brand2);
  font-weight: 700;
  text-decoration: underline;
}
.subsection {
  margin-top: 28px;
}
.group-card {
  border-top: 4px solid var(--brand2);
}
.groups-empty {
  grid-column: 1/-1;
  text-align: center;
  color: var(--muted);
  padding: 32px 10px;
}
.member-chips,
.goal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.member-chip,
.goal-chip {
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--neutral-chip);
  color: var(--text);
  border: 1px solid var(--line);
}
.goal-chip {
  cursor: pointer;
}
.goal-chip input {
  width: auto;
  margin: 0 5px 0 0;
}
.custom-goal-chip {
  display: inline-flex;
  align-items: center;
  padding-right: 4px;
}
.custom-goal-chip .goal-chip {
  padding-right: 4px;
}
.goal-remove {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--bad);
  font-size: 13px;
  line-height: 1;
}
.goal-remove:hover {
  background: rgba(220, 82, 96, 0.12);
}
.lesson-topic-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}
.lesson-topic-heading label {
  margin: 0;
}
.lesson-topic-add {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(240, 107, 85, 0.24);
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}
.lesson-topic-add:hover {
  transform: scale(1.06);
}
.lesson-topic-add:active {
  transform: scale(0.96);
}
.lesson-topic-add:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.lesson-topic-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  transition: color 0.15s ease;
}
.lesson-topic-hint.is-ready {
  color: var(--brand-ink);
  font-weight: 600;
}
.lesson-topic-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}
.lesson-topic-list:empty {
  display: none;
}
.lesson-topic-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding: 8px 9px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--neutral-chip);
  color: var(--text);
}
.lesson-topic-chip span {
  overflow-wrap: anywhere;
}
.lesson-topic-remove {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--bad);
  cursor: pointer;
}
.lesson-topic-remove svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lesson-topic-remove:hover {
  background: rgba(220, 82, 96, 0.12);
}
.payments-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 18px;
}
.table-wrap {
  overflow: auto;
}
.payment-positive {
  color: var(--ok);
}
.payment-negative {
  color: var(--bad);
}
.debt-stat {
  border-color: rgba(220, 82, 96, 0.5);
  background: rgba(220, 82, 96, 0.08);
}
.debt-stat .value,
.debt-stat .label {
  color: var(--bad);
}
.nav-badge {
  display: none;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 19px;
  text-align: center;
  margin-left: auto;
}
.nav-badge.show {
  display: inline-block;
}
.app-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
}
.header-theme {
  width: 42px;
  height: 42px;
  padding: 0;
}
.subscribe {
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-radius: 13px;
  padding: 11px 15px;
  font-weight: 800;
}
.sidebar-toggle {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  border-radius: 12px;
  padding: 10px;
}
.app.sidebar-compact {
  grid-template-columns: 82px minmax(0, 1fr);
}
.sidebar-compact .sidebar {
  padding-left: 12px;
  padding-right: 12px;
}
.sidebar-compact .nav button {
  justify-content: center;
  padding: 12px 8px;
}
.sidebar-compact .nav-label,
.sidebar-compact .nav-badge,
.sidebar-compact .side-label {
  display: none;
}
.sidebar-compact .nav .ico {
  width: auto;
}
.today-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.lesson-note {
  color: var(--brand2) !important;
}
.unfilled-card {
  border-left: 4px solid var(--warn);
}
.inline-help {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  cursor: help;
}
.onboarding {
  width: min(520px, 100%);
}
.reminder-banner {
  display: none;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--brand2);
  margin-bottom: 16px;
}
.reminder-banner.show {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
@media (max-width: 1050px) {
  .payments-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 820px) {
  .nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .schedule-slot {
    grid-template-columns: minmax(0, 1fr) 105px 36px;
  }
}
@media (max-width: 420px) {
  .schedule-slot {
    grid-template-columns: 1fr 1fr 34px;
  }
  .nav button {
    font-size: 8px;
  }
}
@media (max-width: 1050px) {
  .today-sections {
    grid-template-columns: 1fr;
  }
}
.avatar {
  display: none !important;
}
.app-header {
  justify-content: flex-start;
  padding: 18px 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  box-shadow: 0 12px 30px rgba(239, 79, 145, 0.22);
}
.app-header b {
  font-size: 20px;
}
.app-header small {
  display: block;
  margin-top: 3px;
  opacity: 0.88;
}
.sidebar-toggle {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 19px;
}
.side-actions {
  display: grid;
  gap: 8px;
}
.side-actions a,
.side-actions button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tg-icon {
  width: 19px;
  height: 19px;
  display: block;
  flex: 0 0 19px;
  fill: currentColor;
}
.side-warning {
  font-size: 10px;
  line-height: 1.35;
  color: var(--muted);
}
.rating-label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.rating-label select {
  min-width: 76px;
}
.calendar-days {
  min-width: 770px;
}
.calendar-weekday {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 3px;
}
.calendar-card {
  overflow-x: auto;
}
.dashboard-empty-person {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 8px;
}
@media (max-width: 820px) {
  .app-header {
    margin-bottom: 14px;
    padding: 15px 17px;
  }
  .sidebar-toggle {
    display: none;
  }
  .app.sidebar-compact {
    display: block;
  }
  .nav-label {
    display: block;
  }
  .subscribe {
    padding: 10px 12px;
    font-size: 12px;
  }
  .calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    overflow: visible;
    scroll-snap-type: none;
  }
  .day {
    min-width: 0;
  }
  .app-header b {
    font-size: 18px;
  }
}
.student-card {
  position: relative;
}
.student-card-main {
  cursor: pointer;
  padding-right: 0;
}
.student-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  opacity: 0;
  transition:
    opacity 0.15s,
    color 0.15s,
    background 0.15s;
  z-index: 2;
}
.student-card:hover .student-delete,
.student-card:focus-within .student-delete,
.student-delete:focus-visible {
  opacity: 1;
}
.student-delete:hover,
.student-delete:focus-visible {
  color: var(--bad);
  background: rgba(220, 82, 96, 0.1);
}
@media (hover: none) {
  .student-delete {
    opacity: 0.6;
  }
}
@media (max-width: 820px) {
  .student-delete {
    opacity: 0.7;
  }
}
.subscribe {
  background: #2878e8 !important;
  box-shadow: 0 9px 22px rgba(40, 120, 232, 0.25);
}
#hello {
  font-size: 28px;
  font-weight: 850;
  line-height: 1.2;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: currentColor;
}
.greeting-visual {
  display: inline;
  margin-left: 6px;
  vertical-align: baseline;
  font: inherit;
  font-family: Arial, sans-serif;
  color: var(--muted);
  filter: none;
  animation: none !important;
}
.greeting-visual.day {
  color: #e9a321;
}
.greeting-visual.morning {
  color: #9a6542;
}
.greeting-visual.night {
  color: #6d71a8;
  letter-spacing: 0;
}
.greeting-visual.evening {
  color: #e17b55;
}
.custom-event {
  background: rgba(40, 120, 232, 0.12);
  border-left: 3px solid #2878e8;
}
.conflict-error {
  display: none;
  color: var(--bad);
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(220, 82, 96, 0.1);
  margin-top: 10px;
}
.conflict-error.show {
  display: block;
}
.reminder-popup {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(22, 18, 27, 0.52);
  backdrop-filter: blur(7px);
  z-index: 260;
}
.reminder-popup.show {
  display: grid;
}
.reminder-popup-card {
  width: min(440px, 100%);
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 30px;
  border-radius: 25px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 30px 90px rgba(20, 15, 30, 0.35);
}
.reminder-popup-card:before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
}
.reminder-popup-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 15px;
  display: grid;
  place-items: center;
  border-radius: 23px;
  background: var(--soft);
  font-size: 34px;
}
.reminder-popup h2 {
  margin: 0 0 7px;
  font-size: 23px;
}
.reminder-popup p {
  margin: 0 0 20px;
  color: var(--muted);
}
.reminder-popup-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
}
.today-done {
  margin-top: 18px;
}
.lesson-paid-field {
  padding: 0;
}

.calendar-view-switch {
  display: inline-flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel2);
}
.calendar-view-switch .pill {
  border: 0;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}
.calendar-view-switch .pill.active {
  color: #c72c70;
  background: linear-gradient(135deg, rgba(255, 112, 108, 0.17), rgba(239, 63, 145, 0.18));
  box-shadow: 0 5px 14px rgba(239, 63, 145, 0.14);
}
.calendar-view-switch .pill:hover:not(.active) {
  color: var(--text);
}
#page-schedule #calendar[data-calendar-view='day'] {
  grid-template-columns: minmax(0, 1fr) !important;
  min-width: 0 !important;
}
#page-schedule #calendar[data-calendar-view='month'] .day.outside-month {
  opacity: 0.5;
  background: var(--panel2);
}
.profile-lesson-link {
  display: inline-flex;
  margin-top: 8px;
  text-decoration: none;
}

/* Календарь всегда остаётся сеткой из полных недель, включая телефоны. */
@media (max-width: 820px) {
  #page-schedule .calendar-card {
    overflow-x: auto;
    padding: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  #page-schedule .calendar-days {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(92px, 1fr)) !important;
    min-width: 700px !important;
    gap: 7px;
    overflow: visible !important;
  }
  #page-schedule .calendar-weekday {
    display: block;
  }
  #page-schedule .day,
  #page-schedule .day.has-events,
  #page-schedule .day.today {
    display: block;
    min-width: 0;
    min-height: 105px;
    margin: 0;
    padding: 8px;
    border-radius: 13px;
    box-shadow: none;
  }
  #page-schedule .mobile-weekday {
    display: none;
  }
  #page-schedule .day .date {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
  }
  #page-schedule .day.today .date:after {
    display: none;
  }
  #page-schedule .event {
    padding: 7px;
    font-size: 11px;
  }
  #page-schedule .topbar .actions {
    align-items: stretch;
  }
  .calendar-view-switch {
    width: 100%;
  }
  .calendar-view-switch .pill {
    flex: 1;
  }
}
#paymentHistory .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  align-items: center;
}
#paymentHistory .payment-positive {
  white-space: nowrap;
}
@media (max-width: 420px) {
  #paymentHistory .row {
    grid-template-columns: minmax(0, 1fr) 34px;
  }
  #paymentHistory .payment-positive {
    grid-column: 1/2;
    grid-row: 2;
    margin-top: 5px;
  }
  #paymentHistory .icon-btn {
    grid-column: 2;
    grid-row: 1/3;
  }
  .reminder-popup-actions .btn {
    width: 100%;
  }
}
.sidebar-toggle {
  margin-bottom: 20px;
}
.notice {
  background: rgba(231, 154, 37, 0.12);
  color: #94620d;
  border: 1px solid rgba(231, 154, 37, 0.24);
}
.notice.success {
  background: rgba(44, 166, 111, 0.11);
  color: var(--ok);
  border-color: rgba(44, 166, 111, 0.22);
}
.dashboard-unfilled-alert {
  display: none;
  margin-bottom: 16px;
  padding: 13px 15px;
  border-radius: 14px;
  background: rgba(220, 82, 96, 0.11);
  color: var(--bad);
  border: 1px solid rgba(220, 82, 96, 0.28);
  font-weight: 800;
}
.dashboard-unfilled-alert.show {
  display: flex;
  align-items: center;
  gap: 9px;
}
.dashboard-unfilled-alert:before {
  content: '⚠';
  font-size: 20px;
  line-height: 1;
}
.dashboard-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.dashboard-calendar-action {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}
.dashboard-event-row {
  width: 100%;
  margin-top: 0;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dashboard-event-row:hover {
  border-color: #2878e8;
}
.dashboard-event-row .grow {
  display: grid;
  gap: 4px;
}
.dashboard-three > .card {
  height: auto;
  min-height: 0;
}
.dashboard-three .list {
  max-height: none;
  overflow: visible;
}
.dashboard-three .section-head {
  min-height: 52px;
}
.dashboard-three .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
.dashboard-three .row > .btn {
  width: 100%;
  padding: 8px 10px;
  margin-top: 2px;
  white-space: normal;
}
.today-done {
  margin-top: 0;
}
.unfilled-card {
  border-left: 1px solid var(--line);
  border-top: 4px solid var(--warn);
}
#goalChips .goal-chip,
#groupMembers .member-chip {
  position: relative;
  cursor: pointer;
  transition: 0.18s;
  user-select: none;
}
#goalChips .goal-chip input,
#groupMembers .member-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
#goalChips .goal-chip.selected,
#groupMembers .member-chip.selected {
  background: rgba(44, 166, 111, 0.14);
  color: var(--ok);
  border-color: rgba(44, 166, 111, 0.28);
}
#groupMembers .member-chip.selected,
.goal-option.selected {
  order: -1;
}
.goal-option {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.goal-option .goal-chip {
  padding-right: 29px;
}
.goal-remove {
  display: grid;
  place-items: center;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  font-size: 18px;
}
.goal-option:not(.selected):hover .goal-remove,
.goal-option:not(.selected):focus-within .goal-remove {
  opacity: 1;
  pointer-events: auto;
}
.goal-option.selected .goal-remove {
  display: none;
}
@media (max-width: 1100px) {
  .dashboard-three {
    grid-template-columns: 1fr;
  }
  .dashboard-three .section-head {
    min-height: 0;
  }
}
@media (max-width: 600px) {
  .sidebar-toggle {
    margin-bottom: 0;
  }
}
.app-dialog-wrap {
  z-index: 500;
}
.app-dialog {
  width: min(460px, 100%);
  overflow: hidden;
}
.app-dialog-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 17px;
  background: rgba(231, 154, 37, 0.13);
  color: var(--warn);
  font-size: 25px;
}
.app-dialog.danger-dialog .app-dialog-icon {
  background: rgba(220, 82, 96, 0.11);
  color: var(--bad);
}
.app-dialog-message {
  margin: 0;
  color: var(--muted);
  white-space: pre-line;
}
.app-dialog .modal-foot {
  flex-wrap: wrap;
}
.app-dialog .modal-foot .btn {
  min-width: 110px;
}
.app-dialog .modal-foot .btn.danger {
  background: var(--bad);
  border-color: transparent;
  color: #fff;
}
.goal-remove-mobile-hint {
  display: none;
}
.mobile-profile-actions {
  display: none;
}
.modal-foot {
  flex-wrap: wrap;
}
.sidebar-compact .nav button {
  position: relative;
}
.sidebar-compact .nav-badge.show {
  display: inline-block;
  position: absolute;
  right: 5px;
  top: 5px;
  margin: 0;
}
.schedule-self-error {
  color: var(--bad);
  font-weight: 700;
}
@media (max-width: 820px) {
  .goal-option:not(.selected) .goal-remove {
    opacity: 1;
    pointer-events: auto;
  }
  .goal-option .goal-chip {
    padding-right: 32px;
  }
  .goal-remove-mobile-hint {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 7px;
  }
  .mobile-profile-actions {
    display: block;
  }
  .topbar .actions .btn.keep-mobile {
    display: inline-flex;
  }
  .topbar .actions:has(.keep-mobile) {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .topbar .actions:has(.keep-mobile) .btn {
    width: 100%;
    justify-content: center;
  }
  .modal-foot .btn {
    flex: 1 1 auto;
  }
}
@media (max-width: 420px) {
  .modal-foot {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }
  .modal-foot .btn {
    width: 100%;
    margin: 0 !important;
  }
  .topbar .actions:has(.keep-mobile) {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 820px) {
  .toast {
    left: 12px;
    right: 12px;
    bottom: 88px;
    text-align: center;
  }
}
.mobile-weekday {
  display: none;
}
@media (max-width: 1280px) {
  #page-schedule .calendar-weekday {
    display: none;
  }
  #page-schedule .mobile-weekday {
    display: inline;
  }
}
@media (max-width: 820px) {
  .dashboard-three .empty {
    padding: 16px 10px;
  }
  .dashboard-empty-person,
  .dashboard-three .empty .emoji,
  #upcoming .dashboard-empty-person {
    font-size: 30px;
    margin-bottom: 4px;
  }
}
@media (max-width: 820px) {
  #page-schedule .calendar-card {
    overflow: visible;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  #page-schedule .calendar-days {
    display: block !important;
    min-width: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
  }
  #page-schedule .calendar-weekday {
    display: none;
  }
  #page-schedule .day {
    display: none;
    min-width: 0;
    min-height: 0;
    margin: 0 0 11px;
    padding: 14px;
    border-radius: 17px;
    background: var(--panel);
    box-shadow: var(--shadow);
  }
  #page-schedule .day.has-events,
  #page-schedule .day.today {
    display: block;
  }
  #page-schedule .day .date {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: capitalize;
  }
  #page-schedule .day.today .date:after {
    content: 'Сегодня';
    margin-left: auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--brand2);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }
  #page-schedule .mobile-weekday {
    display: inline;
  }
  #page-schedule .event {
    margin-top: 7px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-left-width: 3px;
    font-size: 13px;
    line-height: 1.4;
  }
  #page-payments .payments-layout {
    gap: 12px;
  }
  #page-payments .table-wrap {
    overflow: visible;
  }
  #page-payments .mini-table,
  #page-payments .mini-table tbody {
    display: block;
    width: 100%;
  }
  #page-payments .mini-table thead {
    display: none;
  }
  #paymentBalances {
    display: grid;
    gap: 10px;
  }
  #paymentBalances .payment-group-title {
    display: block;
    margin: 8px 0 0;
  }
  #paymentBalances .payment-group-title:first-child {
    margin-top: 0;
  }
  #paymentBalances .payment-group-title th {
    display: block;
    padding: 2px 1px 5px;
    border: 0;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  #paymentBalances .payment-card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--panel2);
  }
  #paymentBalances .payment-card-row td {
    display: grid;
    gap: 2px;
    padding: 0;
    border: 0;
    min-width: 0;
  }
  #paymentBalances .payment-card-row td:before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  #paymentBalances .payment-card-row td:first-child {
    grid-column: 1/-1;
  }
  #paymentBalances .payment-card-row td:first-child b {
    font-size: 15px;
  }
  #paymentBalances .payment-card-action {
    grid-column: 1/-1;
  }
  #paymentBalances .payment-card-action:before {
    display: none;
  }
  #paymentBalances .payment-card-action .btn {
    width: 100%;
    margin-top: 1px;
  }
  #paymentBalances .payment-empty-row,
  #paymentBalances .payment-empty-row td {
    display: block;
    border: 0;
    text-align: center;
    color: var(--muted);
  }
  #paymentHistory .row {
    padding: 12px;
  }
}
@media (max-width: 380px) {
  #paymentBalances .payment-card-row {
    grid-template-columns: 1fr;
  }
  #paymentBalances .payment-card-row td:first-child,
  #paymentBalances .payment-card-action {
    grid-column: auto;
  }
}
.app {
  transition: grid-template-columns 0.28s ease;
}
.sidebar {
  transition:
    padding 0.28s ease,
    box-shadow 0.28s ease;
}
.nav-label,
.side-label {
  transition: opacity 0.18s ease;
}
.sidebar-toggle {
  position: absolute;
  right: -16px;
  top: 28px;
  z-index: 4;
  width: 32px !important;
  height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 13px 13px 0 !important;
  border-left: 0 !important;
  background: var(--panel) !important;
  box-shadow: 5px 2px 14px rgba(20, 15, 30, 0.1);
  font-size: 24px !important;
  line-height: 1;
}
.sidebar-compact .sidebar-toggle {
  right: -16px;
}
.nav .ico {
  font-size: 22px !important;
}
.nav .people-icon {
  font-size: 24px !important;
}
.nav .ico svg {
  width: 23px;
  height: 23px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.event {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
}
.event .sub {
  color: var(--muted);
}
.day .event--planned {
  border-left-color: var(--brand2);
  background: rgba(239, 79, 145, 0.1);
  background: color-mix(in srgb, var(--brand2) 10%, var(--panel));
}
.day .event--unconfirmed {
  border-left-color: var(--warn);
  background: rgba(231, 154, 37, 0.12);
  background: color-mix(in srgb, var(--warn) 12%, var(--panel));
}
.day .event--done {
  border-left-color: var(--ok);
  background: rgba(44, 166, 111, 0.1);
  background: color-mix(in srgb, var(--ok) 10%, var(--panel));
}
.day .event--missed,
.day .event--paid_missed {
  border-left-color: var(--warn);
  background: rgba(231, 154, 37, 0.1);
  background: color-mix(in srgb, var(--warn) 10%, var(--panel));
}
.day .event--moved {
  border-left-color: var(--warn);
  border-left-style: dashed;
  background: rgba(231, 154, 37, 0.08);
  background: color-mix(in srgb, var(--warn) 8%, var(--panel));
}
.day .event--cancelled {
  opacity: 0.6;
  text-decoration: line-through;
}
.custom-event {
  background: rgba(40, 120, 232, 0.12);
  border-left: 3px solid #2878e8;
}
.lesson-done-pill {
  cursor: pointer;
  align-self: start;
  justify-self: start;
  border-color: rgba(44, 166, 111, 0.3);
}
@keyframes fieldIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
#testFields,
#movedToField,
#homeworkGradeField,
#packageSizeField,
#groupAttendance,
#customPeriodFields {
  animation: fieldIn 0.24s ease;
}
#homeworkGradeField {
  display: grid !important;
  transition: opacity 0.18s ease;
}
#homeworkGradeField.is-disabled {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.page.active {
  animation: pageIn 0.24s ease;
}
.modal-wrap.open .modal {
  animation: modalIn 0.22s ease;
}
.card,
.paper-section {
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}
@keyframes pageIn {
  from {
    opacity: 0.25;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.toggle-row {
  display: flex !important;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel2);
  font-weight: 400 !important;
}
.toggle-row > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-row > span:last-child {
  display: grid;
  gap: 2px;
}
.toggle-row small {
  color: var(--muted);
  font-size: 11px;
}
.toggle-ui {
  position: relative;
  width: 44px;
  height: 25px;
  flex: 0 0 44px;
  border-radius: 999px;
  background: #cfd2da;
  transition: 0.2s;
}
.toggle-ui:after {
  content: '';
  position: absolute;
  width: 19px;
  height: 19px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: 0.2s;
}
.toggle-row > input:checked + .toggle-ui {
  background: var(--ok);
}
.toggle-row > input:checked + .toggle-ui:after {
  transform: translateX(19px);
}
.toggle-row > input:focus-visible + .toggle-ui {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.help-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: help;
  vertical-align: middle;
}
.help-tip:after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  z-index: 30;
  width: min(280px, 75vw);
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--text);
  color: var(--panel);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 5px);
  transition: 0.16s;
  pointer-events: none;
}
.help-tip:hover:after,
.help-tip:focus:after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.modal .help-tip:after {
  left: 0;
  transform: translate(0, 5px);
}
.modal .help-tip:hover:after,
.modal .help-tip:focus:after {
  transform: none;
}
.textarea-copy {
  position: relative;
}
.textarea-copy textarea {
  padding-right: 48px;
}
.copy-textarea-btn {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(24, 22, 30, 0.08);
}
.copy-textarea-btn:hover {
  color: var(--focus);
  border-color: color-mix(in srgb, var(--focus) 45%, var(--line));
}
#paymentHistory .icon-btn {
  transition:
    color 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}
#paymentHistory .icon-btn:hover,
#paymentHistory .icon-btn:focus-visible {
  color: #fff;
  border-color: var(--bad);
  background: var(--bad);
  transform: scale(1.06);
}
.report-history-action {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
}
.report-history-action .help-tip:after {
  left: 0;
  transform: translate(0, 5px);
}
.report-history-action .help-tip:hover:after,
.report-history-action .help-tip:focus:after {
  transform: none;
}
.tutorial-modal {
  width: min(620px, 100%);
}
.tutorial-progress {
  height: 7px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.tutorial-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  transition: width 0.28s ease;
}
.tutorial-step-count {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.tutorial-visual {
  width: 64px;
  height: 64px;
  margin: 18px 0 12px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--soft);
  font-size: 30px;
  transition: transform 0.2s;
}
.tutorial-modal h3 {
  font-size: 22px;
  margin: 0 0 8px;
}
.tutorial-modal p {
  font-size: 15px;
  color: var(--muted);
  white-space: pre-line;
}
.tutorial-modal.step-change .tutorial-visual {
  animation: tutorialPop 0.25s ease;
}
@keyframes tutorialPop {
  50% {
    transform: scale(0.9);
  }
  100% {
    transform: none;
  }
}
.builder-stack .card {
  min-width: 0;
}
.builder-item input {
  width: 100%;
}
.report-tools {
  justify-content: flex-end;
}
.report-tools .btn {
  min-width: 160px;
}
@media (max-width: 820px) {
  .sidebar-toggle {
    display: none !important;
  }
  .help-tip:after {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 90px;
    width: auto;
    transform: translateY(5px);
  }
  .help-tip:hover:after,
  .help-tip:focus:after,
  .report-history-action .help-tip:hover:after,
  .report-history-action .help-tip:focus:after {
    transform: none;
  }
}
@media (max-width: 620px) {
  .builder-item,
  .builder-item.topic {
    grid-template-columns: minmax(0, 1fr) 38px;
  }
  .builder-item .rating-label {
    grid-column: 1/2;
    grid-row: 2;
  }
  .builder-item .r-remove {
    grid-column: 2;
    grid-row: 1/3;
  }
  .report-tools .btn {
    width: 100%;
    min-width: 0;
  }
  .lesson-homework-card {
    padding: 10px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 15% 15%, rgba(239, 79, 145, 0.14), transparent 34%),
    radial-gradient(circle at 85% 80%, rgba(240, 107, 85, 0.16), transparent 36%), var(--bg);
}
[hidden] {
  display: none !important;
}
.auth-gate[hidden] {
  display: none;
}
.auth-card {
  width: min(460px, 100%);
  padding: 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 28px 90px rgba(34, 28, 45, 0.18);
  animation: modalIn 0.28s ease both;
}
.auth-card h1 {
  margin: 0 0 8px;
  font-size: 27px;
}
.auth-card p {
  margin: 0 0 20px;
  color: var(--muted);
}
.auth-card .field {
  margin-bottom: 12px;
}
.auth-card .btn {
  width: 100%;
}
.auth-message {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(44, 166, 111, 0.1);
  color: var(--ok);
}
.auth-message.show {
  display: block;
}
.auth-message.error {
  background: rgba(220, 82, 96, 0.1);
  color: var(--bad);
}
.auth-message strong {
  font-weight: 800;
}
.auth-message code {
  background: var(--panel2);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text);
}
.auth-message.error code {
  background: rgba(220, 82, 96, 0.06);
  color: var(--bad);
}
.auth-contact {
  display: block;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-weight: 500;
  font-size: 12.5px;
  text-decoration: none;
  transition: color 0.16s;
}
.auth-contact:hover {
  color: var(--text);
}
.auth-contact b {
  color: var(--brand2);
  font-weight: 700;
}
.auth-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.auth-link {
  border: 0;
  background: transparent;
  color: var(--brand2);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 9px;
  width: auto !important;
}
.auth-link:hover {
  background: var(--soft);
}
.auth-link:disabled {
  color: var(--muted);
  cursor: default;
  background: transparent;
}
.auth-sep {
  color: var(--muted);
  font-size: 13px;
  user-select: none;
}
.auth-hint {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--panel2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.cloud-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: none;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  box-shadow: var(--shadow);
  font-size: 12px;
}
.cloud-status.show {
  display: flex;
}
.cloud-status.error {
  color: var(--bad);
}
.cloud-status.conflict,
.cloud-status.offline {
  max-width: min(720px, calc(100vw - 36px));
  border-radius: 16px;
  color: var(--bad);
}
.cloud-status.offline {
  color: var(--warn);
}
.cloud-status.conflict i {
  background: var(--bad);
}
.cloud-status.offline i {
  background: var(--warn);
}
#cloudConflictActions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
#cloudConflictActions[hidden] {
  display: none;
}
#cloudConflictActions button {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.cloud-status-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#cloudConflictHelp {
  color: var(--muted);
  line-height: 1.35;
}
.cloud-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}
.cloud-status.saving i {
  background: var(--warn);
  animation: pulseSoft 0.8s infinite alternate;
}
.cloud-status.error i {
  background: var(--bad);
}
@media (max-width: 620px) {
  .auth-card {
    padding: 23px;
    border-radius: 22px;
  }
  .auth-card h1 {
    font-size: 23px;
  }
  .cloud-status {
    right: 10px;
    bottom: 82px;
  }
  .cloud-status.conflict {
    left: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  #cloudConflictActions {
    width: 100%;
    flex-direction: column;
  }
}
.analytics-card .stat {
  overflow: visible;
}
.stat > .help-tip {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
  z-index: 1;
}
.analytics-card {
  margin-bottom: 18px;
}
.analytics-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.analytics-tabs .pill {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
  padding: 8px 13px;
  font-weight: 700;
  font-size: 13px;
}
.analytics-tabs .pill.active {
  background: var(--soft);
  color: var(--brand-ink);
  border-color: transparent;
}
.analytics-tabs .pill:hover {
  color: var(--brand-ink);
}
.analytics-custom {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--panel2);
}
.analytics-custom .form-grid {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.analytics-monthly {
  margin-top: 16px;
}
.analytics-monthly h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.analytics-monthly .month-bars {
  display: grid;
  gap: 8px;
}
.month-bar {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}
.month-bar-label {
  color: var(--muted);
  text-transform: capitalize;
}
.month-bar-track {
  position: relative;
  height: 22px;
  background: var(--panel2);
  border-radius: 8px;
  overflow: hidden;
}
.month-bar-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  border-radius: 8px;
  transition: width 0.3s ease;
}
.month-bar-value {
  font-weight: 800;
  white-space: nowrap;
}
.analytics-empty {
  text-align: center;
  color: var(--muted);
  padding: 24px 10px;
}
#paymentHistoryStudent {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 11px;
  padding: 8px 12px;
  font-weight: 600;
  max-width: 200px;
}
@media (max-width: 600px) {
  .month-bar {
    grid-template-columns: 80px 1fr auto;
    font-size: 12px;
  }
  .analytics-custom .form-grid {
    grid-template-columns: 1fr;
  }
  .analytics-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  #paymentHistoryStudent {
    max-width: 100%;
    width: 100%;
    margin-top: 8px;
  }
}

/* На телефоне неделя и месяц — вертикальные списки читаемых карточек. */
@media (max-width: 820px) {
  #page-reports .report-tools.is-fixed {
    bottom: calc(84px + env(safe-area-inset-bottom)) !important;
    z-index: 19;
  }
  #page-schedule .calendar-card {
    overflow: visible;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  #page-schedule #calendar[data-calendar-view='week'],
  #page-schedule #calendar[data-calendar-view='month'] {
    display: block !important;
    min-width: 0 !important;
    width: 100%;
  }
  #page-schedule #calendar[data-calendar-view='week'] .calendar-weekday,
  #page-schedule #calendar[data-calendar-view='month'] .calendar-weekday,
  #page-schedule #calendar[data-calendar-view='month'] .day.outside-month {
    display: none !important;
  }
  #page-schedule #calendar[data-calendar-view='week'] .day,
  #page-schedule #calendar[data-calendar-view='month'] .day {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 70px;
    margin: 0 0 10px;
    padding: 13px;
    border-radius: 15px;
  }
  #page-schedule #calendar[data-calendar-view='week'] .mobile-weekday,
  #page-schedule #calendar[data-calendar-view='month'] .mobile-weekday {
    display: inline !important;
  }
  #page-schedule #calendar[data-calendar-view='week'] .day .date,
  #page-schedule #calendar[data-calendar-view='month'] .day .date {
    display: flex;
    margin-bottom: 9px;
    font-size: 13px;
    text-transform: capitalize;
  }
  #page-schedule .event {
    overflow: visible;
    overflow-wrap: anywhere;
    padding: 10px;
    font-size: 13px;
  }
}
