:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #14171f;
  --muted: #667085;
  --line: #dde2ea;
  --soft: #eef2f7;
  --accent: #0f766e;
  --accent-2: #b42318;
  --accent-3: #7c3aed;
  --warn: #b54708;
  --ok: #067647;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.09);
  --rock-bg: url("./assets/background-rock.jpg") center top / min(680px, 100vw) auto repeat;
  --blue-hero: linear-gradient(135deg, rgba(37, 99, 235, 0.96), rgba(14, 165, 233, 0.92) 52%, rgba(20, 184, 166, 0.9));
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overscroll-behavior: none;
  background:
    linear-gradient(180deg, rgba(245, 248, 252, 0.34), rgba(245, 246, 248, 0.72)),
    var(--rock-bg),
    var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior: none;
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, rgba(245, 248, 252, 0.3), rgba(245, 246, 248, 0.64)),
    var(--rock-bg),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  background: rgba(245, 246, 248, 0.18);
}

.start-screen {
  min-height: 100vh;
  padding: calc(26px + env(safe-area-inset-top)) 16px calc(26px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.01), rgba(245, 246, 248, 0.42) 38%),
    var(--rock-bg);
}

.start-panel {
  width: min(100%, 520px);
}

.start-logo {
  width: 180px;
  height: 104px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
  padding: 4px;
}

.start-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.start-panel h1 {
  margin: 18px 0 0;
  font-size: 31px;
  line-height: 1.08;
}

.start-version {
  width: fit-content;
  margin-top: 8px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.start-panel p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.42;
}

.start-actions {
  display: flex;
  margin: 0 0 14px;
}

.entry-grid {
  display: grid;
  gap: 10px;
}

/* Логин-форма */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  margin-top: 8px;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  text-align: left;
}
.login-field > span {
  font-size: 12px;
  font-weight: 760;
  color: var(--muted);
}
.login-select {
  height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
}
.login-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.login-actions .btn {
  flex: 1;
}

/* Мульти-ученики для репетиции */
.rehearsal-students-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.rehearsal-student-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1e40af;
}
.rehearsal-student-tag button {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 12px;
  cursor: pointer;
  padding: 0 0 0 2px;
  line-height: 1;
}

.entry-card {
  width: 100%;
  min-height: 96px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  text-align: left;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.entry-card strong {
  align-self: end;
  font-size: 17px;
  line-height: 1.2;
}

.entry-card small {
  align-self: start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.entry-icon {
  grid-row: 1 / 3;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e6f4f1;
  color: var(--accent);
}

.entry-icon.teacher {
  background: #f1ecff;
  color: var(--accent-3);
}

.entry-icon.admin {
  background: #fff1e6;
  color: var(--warn);
}

.entry-icon.director {
  background: #eef2ff;
  color: #3538cd;
}

.topbar {
  position: static;
  background: transparent;
  border-bottom: 1px solid rgba(221, 226, 234, 0.45);
}

.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  min-width: 0;
}

.brand-logo-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo-line img {
  width: 52px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  background: #000;
  padding: 2px;
  flex: 0 0 auto;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 760;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  min-width: 42px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-weight: 760;
  justify-content: center;
  border: 0;
  cursor: pointer;
}
.profile-pill-photo {
  padding: 0;
  overflow: hidden;
  width: 42px;
  height: 42px;
  border-radius: 10px;
}
.profile-pill-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-edit-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 0 8px;
}
.avatar-preview-big {
  width: 100px;
  height: 100px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-preview-big img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-initials {
  font-size: 28px;
  font-weight: 700;
  color: var(--muted);
}
.avatar-edit-label {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.avatar-remove-btn {
  background: none;
  border: none;
  color: var(--accent-2);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.login-avatar {
  width: 100px;
  height: 100px;
  border-radius: 16px;
  overflow: hidden;
  margin: 0 auto 12px;
  border: 2px solid var(--line);
}
.login-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.role-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 0 2px;
  scrollbar-width: none;
}

.role-strip::-webkit-scrollbar {
  display: none;
}

.role-button,
.chip,
.tab-button,
.icon-button,
.primary-button,
.ghost-button,
.mini-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.role-button {
  padding: 8px 12px;
  font-size: 14px;
}

.role-button.active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.main {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}

.section {
  margin: 0 0 20px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

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

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.hero-panel {
  background: #111827;
  color: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.student-hero,
.admin-hero {
  background:
    var(--blue-hero),
    #2563eb;
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.2);
}

.hero-panel h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.16;
}

.hero-panel p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  line-height: 1.45;
}

/* Кнопка «Новое занятие» на главной админа */
.admin-new-lesson-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: none;
  cursor: pointer;
}
.admin-new-lesson-icon {
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  color: rgba(255,255,255,0.9);
}
.admin-new-lesson-label {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

/* Строка дата + время в модале */
.day-add-row2 {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 10px;
  align-items: start;
}

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

.metric,
.card,
.lesson-card,
.room-card,
.finance-row,
.profile-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.metric {
  padding: 12px;
  min-height: 82px;
}

.metric .label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.metric .value {
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
  font-weight: 780;
}

.metric .sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.card {
  padding: 14px;
}

.profile-card {
  padding: 14px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e6f4f1;
  color: #0f766e;
  font-weight: 800;
  font-size: 18px;
}

.avatar.teacher {
  background: #f1ecff;
  color: #6d28d9;
}

.avatar.admin {
  background: #fff1e6;
  color: #b54708;
}

.photo-slot {
  width: 64px;
  height: 72px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  background: #e6f4f1;
  color: #0f766e;
  border: 1px dashed rgba(15, 118, 110, 0.48);
  font-weight: 850;
  font-size: 18px;
}

.photo-slot span {
  display: block;
  font-size: 10px;
  font-weight: 760;
  color: var(--muted);
}

.photo-slot.teacher {
  background: #f1ecff;
  color: var(--accent-3);
  border-color: rgba(124, 58, 237, 0.38);
}

.photo-slot.admin {
  background: #fff1e6;
  color: var(--warn);
  border-color: rgba(181, 71, 8, 0.38);
}

.photo-slot.director {
  background: #eef2ff;
  color: #3538cd;
  border-color: rgba(53, 56, 205, 0.34);
}

.profile-card h3,
.card h3,
.lesson-card h3,
.room-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.profile-card p,
.card p,
.lesson-card p,
.room-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.toolbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 6px;
  scrollbar-width: none;
}

.toolbar::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 8px 12px;
  font-size: 13px;
}

.chip.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.chip.danger-chip {
  border-color: #fecdca;
  background: #fef3f2;
  color: var(--accent-2);
}

.lesson-list,
.room-grid,
.finance-list,
.people-list {
  display: grid;
  gap: 10px;
}

.calendar-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.calendar-grid {
  min-width: calc(78px + var(--room-count) * 142px);
  display: grid;
  grid-template-columns: 78px repeat(var(--room-count), 142px);
}

.calendar-corner,
.calendar-room,
.calendar-time,
.calendar-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.calendar-corner,
.calendar-room {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 44px;
  background: #111827;
  color: #fff;
}

.calendar-corner {
  left: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.calendar-room {
  display: grid;
  place-items: center;
  padding: 8px;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
}

button.calendar-room {
  border-top: 0;
  border-left: 0;
}

.day-room {
  cursor: default;
}

.day-room span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 680;
}

.calendar-room span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 620;
  line-height: 1.18;
}

.calendar-time {
  position: sticky;
  left: 0;
  z-index: 3;
  min-height: 86px;
  display: grid;
  place-items: start center;
  padding-top: 10px;
  background: #f8fafc;
  color: #344054;
  font-size: 13px;
  font-weight: 820;
}

.calendar-cell {
  min-height: 86px;
  padding: 6px;
  background: #fff;
}

.calendar-cell.conflict {
  background: #fff1f0;
}

.empty-cell {
  display: grid;
  place-items: center;
  background: #fbfcfe;
}

.empty-cell button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.calendar-event {
  width: 100%;
  min-height: 70px;
  padding: 7px;
  border-radius: 8px;
  display: grid;
  align-content: start;
  gap: 3px;
  text-align: left;
  background: #ecfdf3;
  color: var(--ok);
  border: 1px solid #abefc6;
}

.calendar-event.done {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #d1d5db;
}

.calendar-event.warn {
  background: #fff7ed;
  color: var(--warn);
  border-color: #fed7aa;
}

.calendar-event.danger {
  background: #fef3f2;
  color: var(--accent-2);
  border-color: #fecdca;
}

.calendar-event.selected-event {
  outline: 3px solid rgba(124, 58, 237, 0.26);
  border-color: var(--accent-3);
  background: #f1ecff;
  color: var(--accent-3);
}

.calendar-event strong {
  color: inherit;
  font-size: 13px;
  line-height: 1.12;
}

.calendar-event span,
.calendar-event em {
  color: inherit;
  opacity: 0.84;
  font-size: 11px;
  line-height: 1.15;
  font-style: normal;
}

.move-help {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.room-schedule-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.room-schedule-grid {
  min-width: calc(78px + var(--day-count) * 150px);
  display: grid;
  grid-template-columns: 78px repeat(var(--day-count), 150px);
}

.teacher-calendar-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  touch-action: pan-y;
}

.calendar-periods {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
}

.period-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.period-row::-webkit-scrollbar {
  display: none;
}

.year-row {
  padding-top: 1px;
}

.period-select-row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px;
}

.period-select-row label {
  display: grid;
  gap: 5px;
}

.period-select-row label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.period-select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 780;
  outline: none;
}

.period-select.active-blue {
  border-color: #84caff;
  background: #eff8ff;
  color: #175cd3;
}

.period-chip {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.period-chip.active-blue {
  border-color: #84caff;
  background: #eff8ff;
  color: #175cd3;
}

.teacher-calendar-grid {
  min-width: calc(54px + var(--day-count) * 110px);
  display: grid;
  grid-template-columns: 54px repeat(var(--day-count), 110px);
}

.teacher-calendar-time,
.teacher-calendar-cell,
.teacher-calendar-corner,
.teacher-day-head {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.teacher-calendar-corner {
  position: sticky;
  left: 0;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  min-height: 48px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 820;
}

.teacher-day-head {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 3;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px;
  padding: 7px;
  background: #fff;
  color: #111827;
  text-align: left;
}

.teacher-day-head strong {
  display: block;
  font-size: 12px;
  line-height: 1.1;
  text-transform: uppercase;
}

.teacher-day-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.teacher-calendar-time {
  position: sticky;
  left: 0;
  z-index: 3;
  min-height: 56px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 6px 4px;
  background: #f8fafc;
  color: #344054;
  font-size: 11px;
  font-weight: 820;
}

.teacher-calendar-cell {
  position: relative;
  min-height: 56px;
  padding: 4px;
  background: #fff;
  cursor: pointer;
}

.empty-teacher-cell {
  background: #fbfcfe;
}

.free-teacher-cell {
  background: #ecfdf3;
}

.blocked-teacher-cell {
  background: #fef3f2;
}

.slot-actions,
.slot-cell-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: flex-start;
}

.row-actions {
  flex-direction: row;
  justify-content: center;
}

.slot-cell-actions {
  position: absolute;
  right: 4px;
  top: 4px;
}

.slot-plus,
.slot-minus {
  width: 16px;
  height: 16px;
  min-height: 16px;
  border-radius: 0;
  display: inline-grid;
  place-items: center;
  background: transparent;
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

.slot-actions:not(.row-actions) .slot-minus,
.slot-cell-actions .slot-minus {
  margin-top: 3px;
}

.slot-cell-actions .slot-minus {
  transform: translate(3px, 4px);
}

.slot-plus {
  color: var(--ok);
}

.slot-minus {
  color: var(--accent-2);
}

.free-label,
.blocked-label {
  position: absolute;
  left: 5px;
  bottom: 5px;
  font-size: 10px;
  font-weight: 800;
}

.free-label {
  color: var(--ok);
}

.blocked-label {
  color: var(--accent-2);
}

.teacher-calendar-event {
  width: 100%;
  min-height: 39px;
  padding: 5px;
  border-radius: 7px;
  display: grid;
  align-content: start;
  gap: 2px;
  text-align: left;
  background: #ecfdf3;
  color: var(--ok);
  border: 1px solid #abefc6;
}

.teacher-calendar-event.done {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #d1d5db;
}

.teacher-calendar-event.warn {
  background: #fff7ed;
  color: var(--warn);
  border-color: #fed7aa;
}

.teacher-calendar-event.danger {
  background: #fef3f2;
  color: var(--accent-2);
  border-color: #fecdca;
}

.teacher-calendar-event strong {
  color: inherit;
  font-size: 9px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.teacher-calendar-event span {
  color: inherit;
  opacity: 0.82;
  font-size: 9px;
  line-height: 1.1;
}

.admin-calendar-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-width: none;
}

.admin-calendar-tabs::-webkit-scrollbar {
  display: none;
}

.smart-tabs {
  position: relative;
  padding-bottom: 8px;
  overflow: visible;
}

.smart-picker-wrap {
  position: relative;
  flex: 0 0 auto;
}

.smart-picker-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
  white-space: nowrap;
}

.student-tab-input {
  width: 110px;
  text-align: left;
  outline: none;
  font-size: 13px;
  touch-action: manipulation;
}

.student-tab-input::placeholder {
  color: #98a2b3;
  opacity: 1;
}

.smart-picker-button span {
  color: var(--muted);
  font-size: 11px;
}

.smart-picker-button.active,
.smart-picker-button.open {
  border-color: #84caff;
  background: #eff8ff;
  color: #175cd3;
}

.smart-picker-button.active span,
.smart-picker-button.open span {
  color: #175cd3;
}

.admin-inline-picker {
  display: grid;
  gap: 7px;
  max-height: 70vh;
  overflow-y: auto;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid #b9e6fe;
  border-radius: 8px;
  background: #f5fbff;
}

.dropdown-picker {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 25;
  width: max(260px, 100%);
  min-width: 260px;
  max-width: min(340px, calc(100vw - 32px));
  margin: 0;
  box-shadow: var(--shadow);
}

.room-check-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.student-dropdown-picker {
  left: auto;
  right: 0;
  width: 280px;
  max-height: 70vh;
  padding: 7px;
}

.admin-inline-picker button {
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.admin-inline-picker button.single-line-option {
  min-height: 36px;
  display: flex;
  align-items: center;
}

.admin-inline-picker button.selected {
  border-color: #84caff;
  background: #eff8ff;
  color: #175cd3;
}

.admin-inline-picker strong,
.admin-inline-picker span {
  display: block;
}

.admin-inline-picker strong {
  font-size: 13px;
  line-height: 1.15;
}

.admin-inline-picker span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.student-inline-picker input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

.student-inline-picker input:focus {
  border-color: #84caff;
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.12);
}

.inline-results {
  max-height: none;
  overflow: visible;
}

.search-hint {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 2px;
}

.admin-picker-row {
  position: relative;
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-picker-row label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.admin-picker-row select,
.admin-picker-row input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

.admin-picker-row select:focus,
.admin-picker-row input:focus {
  border-color: #84caff;
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.12);
}

.student-search-results {
  display: grid;
  gap: 6px;
  max-height: 230px;
  overflow-y: auto;
}

.student-search-results button {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
}

.student-search-results strong,
.student-search-results span {
  display: block;
}

.student-search-results strong {
  font-size: 13px;
  line-height: 1.15;
}

.student-search-results span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(17, 24, 39, 0.18);
}

.slot-popover {
  width: min(100%, 340px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
}

.slot-popover h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.slot-popover p {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.slot-popover-actions {
  display: grid;
  gap: 8px;
}

.slot-action-button {
  min-height: 42px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
}

.slot-action-button.add {
  background: var(--ok);
}

.slot-action-button.remove {
  background: var(--accent-2);
}

.slot-action-button.cancel {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.empty-cell button:disabled {
  opacity: 0.32;
  cursor: default;
}

.lesson-card {
  padding: 0;
  overflow: hidden;
}

.lesson-head {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  align-items: start;
}

.time-block {
  min-height: 54px;
  border-radius: 8px;
  background: var(--soft);
  display: grid;
  place-items: center;
  text-align: center;
  color: #1f2937;
  font-weight: 760;
  font-size: 15px;
}

.time-block span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  margin-top: 2px;
}

.status {
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 720;
  background: var(--soft);
  color: var(--muted);
  text-align: center;
}

.status.done {
  background: #f3f4f6;
  color: #6b7280;
}

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

.status.warn {
  background: #fff7ed;
  color: var(--warn);
}

.status.danger {
  background: #fef3f2;
  color: var(--accent-2);
}

.lesson-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.lesson-actions button {
  min-height: 44px;
  background: #fff;
  color: var(--ink);
  border-right: 1px solid var(--line);
  font-weight: 700;
}

.lesson-actions button:last-child {
  border-right: 0;
}

.lesson-cancel-btn {
  color: #dc2626 !important;
  font-weight: 700;
}

.lesson-actions button:active,
.icon-button:active,
.primary-button:active,
.ghost-button:active,
.mini-button:active {
  transform: translateY(1px);
}

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

.room-card {
  padding: 12px;
}

.room-load {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--soft);
  margin-top: 10px;
}

.room-load div {
  height: 100%;
  background: var(--accent);
}

.finance-row {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.finance-row strong {
  font-size: 15px;
}

.finance-row span {
  color: var(--muted);
  font-size: 12px;
}

.amount {
  font-weight: 780;
  color: var(--ink);
}

.amount.negative {
  color: var(--accent-2);
}

.form-grid {
  display: grid;
  gap: 10px;
}

.student-form {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.field label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px;
  outline: none;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.primary-button,
.ghost-button,
.mini-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 760;
}

.primary-button {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  min-height: 46px;
}

.ghost-button {
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
}

.mini-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  background: var(--soft);
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
}

.icon::before,
.icon::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon.schedule::after {
  inset: 6px 3px auto;
  border-width: 2px 0 0;
  border-radius: 0;
}

.icon.wallet::before {
  inset: 4px 2px;
  border-radius: 5px;
}

.icon.wallet::after {
  inset: 8px 3px 5px auto;
  width: 5px;
  border-radius: 999px;
}

.icon.rooms::before {
  inset: 3px;
}

.icon.rooms::after {
  inset: 3px 8px;
  border-width: 0 2px;
  border-radius: 0;
}

.icon.profile::before {
  inset: 2px 5px 9px;
  border-radius: 999px;
}

.icon.profile::after {
  inset: 10px 3px 2px;
  border-radius: 999px 999px 4px 4px;
}

.icon.reports::before {
  inset: 3px 4px;
  border-radius: 3px;
}

.icon.reports::after {
  inset: auto 7px 5px;
  height: 7px;
  border-width: 0 2px 2px 2px;
  border-radius: 0;
}

.icon.chat::before {
  inset: 3px 2px 5px;
  border-radius: 5px;
}

.icon.chat::after {
  inset: auto 5px 2px auto;
  width: 6px;
  height: 6px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 3px 0;
  transform: rotate(35deg);
}

.chat-group-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-width: none;
}

.chat-group-tabs::-webkit-scrollbar {
  display: none;
}

.chat-layout {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.chat-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 2px;
}

.chat-list-item {
  width: 100%;
  min-height: 46px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.chat-list-item.active {
  border-color: var(--accent);
  background: #ecfdf3;
}

.chat-list-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.chat-list-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.teacher-browser {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.teacher-list {
  display: grid;
  gap: 8px;
  max-height: 540px;
  overflow-y: auto;
  padding-right: 2px;
}

.teacher-list-item {
  width: 100%;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.teacher-list-item.active {
  border-color: var(--accent);
  background: #ecfdf3;
}

.teacher-list-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.18;
}

.teacher-list-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.teacher-profile {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.teacher-main-card {
  grid-template-columns: 64px minmax(0, 1fr);
}

.compact-title {
  margin: 4px 0 0;
}

.trial-slot-list {
  display: grid;
  gap: 8px;
}

.trial-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.trial-slot strong,
.teacher-day strong {
  display: block;
  font-size: 13px;
  line-height: 1.18;
}

.trial-slot span,
.teacher-day span,
.teacher-day p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

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

.teacher-day {
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.teacher-day strong span {
  margin-top: 4px;
}

.teacher-day p {
  margin: 7px 0 0;
}

.chat-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.chat-head {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.chat-head h3 {
  margin: 0;
  font-size: 16px;
}

.chat-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.message-list {
  display: grid;
  gap: 8px;
  min-height: 260px;
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
  background: #fbfcfe;
}

.message {
  max-width: 82%;
  padding: 9px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.message.mine {
  justify-self: end;
  background: #ecfdf3;
  border-color: #abefc6;
}

.message strong {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.message p {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.35;
}

.message span {
  color: var(--muted);
  font-size: 11px;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.chat-composer input {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  outline: none;
}

.chat-composer .primary-button {
  min-height: 44px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}

.bottom-nav-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
}

.tab-button {
  flex: 1;
  min-width: 0;
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 2px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  font-size: 10px;
  font-weight: 720;
  overflow: hidden;
}
.tab-button span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-button.active {
  background: #ecfdf3;
  color: var(--accent);
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 9999;
  max-width: 520px;
  margin: 0 auto;
  background: var(--blue-hero), #2563eb;
  color: #fff;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.32);
  font-size: 14px;
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(17, 24, 39, 0.28);
}

.settings-page {
  min-height: 100vh;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.02), rgba(245, 246, 248, 0.36) 36%),
    var(--rock-bg),
    var(--bg);
}

.settings-card,
.settings-modal {
  width: min(100%, 460px);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.settings-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.settings-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.settings-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.settings-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.settings-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.settings-list button {
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-row-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.settings-row-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.settings-row-arrow {
  color: var(--muted);
  font-size: 18px;
  flex-shrink: 0;
}

.settings-list strong,
.settings-list span {
  display: block;
}

.settings-list strong {
  font-size: 14px;
  line-height: 1.15;
}

.settings-list span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

/* ── Настройки: кнопка «Назад» ─────────────────────────── */
.settings-back {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.settings-card-tall,
.settings-modal-tall {
  max-width: 560px;
}

/* ── Уведомления ─────────────────────────────────────────── */
.notif-two-col {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}

@media (min-width: 680px) {
  .notif-two-col {
    grid-template-columns: 1fr 1fr;
  }

  .notif-col-right {
    border-left: 1px solid var(--line);
  }
}

.notif-col-left {
  min-width: 0;
}

.notif-col-right {
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  background: var(--soft);
}

.notif-settings {
  padding: 12px;
  display: grid;
  gap: 12px;
}

/* ── Лог уведомлений ─────────────── */
.notif-log-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.notif-log-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 20px 0;
  margin: 0;
}

.notif-log-entry {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.notif-log-time {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.notif-log-msg {
  font-weight: 700;
  font-size: 13px;
}

.notif-log-body {
  font-size: 12px;
  color: var(--muted);
}

.notif-log-channels {
  display: grid;
  gap: 3px;
  margin-top: 4px;
}

.notif-log-ch {
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 5px;
}

.ch-ok {
  background: #ecfdf3;
  color: var(--ok);
}

.ch-fail {
  background: #fef3f2;
  color: var(--accent-2);
}

/* ── Статус каналов ─────────────── */
.notif-status-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.notif-status-rows {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.notif-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.notif-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-ok   { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-off  { background: #d1d5db; }

.notif-status-name {
  font-weight: 600;
  min-width: 62px;
}

.notif-status-detail {
  color: var(--muted);
  font-size: 12px;
}

.notif-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #fff;
}

.notif-group-disabled {
  opacity: 0.6;
}

.notif-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}

.notif-toggle {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: var(--soft);
  color: var(--muted);
  border: 1px solid var(--line);
  cursor: pointer;
}

.notif-toggle.on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.notif-segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  min-width: 116px;
  min-height: 34px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  gap: 3px;
}

.notif-segmented button {
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.notif-segmented button.active.off {
  background: #fff;
  color: var(--accent-2);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.notif-segmented button.active.on {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.notif-perm-label {
  font-size: 12px;
  color: var(--muted);
}

.notif-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.notif-ok {
  margin: 0;
  font-size: 12px;
  color: var(--ok);
}

.notif-details {
  font-size: 12px;
  color: var(--muted);
}

.notif-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 0;
}

.notif-steps {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.6;
}

.notif-steps code {
  background: var(--soft);
  border-radius: 4px;
  padding: 1px 4px;
  font-family: monospace;
  font-size: 11px;
}

.notif-fields {
  display: grid;
  gap: 6px;
}

.notif-input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--soft);
  color: var(--ink);
}

.notif-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.notif-static {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.notif-action-btn {
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: center;
}

.notif-badge-soon {
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde68a;
}

.empty {
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

@media (min-width: 760px) {
  .app-shell {
    padding-bottom: 24px;
  }

  .main {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 18px;
    align-items: start;
  }

  .section.full {
    grid-column: 1 / -1;
  }

  .metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bottom-nav {
    position: sticky;
    bottom: auto;
    top: 86px;
    margin: 0 auto;
    max-width: 980px;
    border: 0;
    background: transparent;
    padding: 10px 16px 0;
  }

  .bottom-nav-inner {
    max-width: none;
    display: flex;
    flex-wrap: nowrap;
  }

  .tab-button {
    background: #fff;
    border-color: var(--line);
    min-height: 44px;
    grid-auto-flow: column;
    place-content: center;
    font-size: 11px;
    flex: 1 1 0;
    min-width: 0;
  }

  .room-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .student-form .primary-button {
    grid-column: 1 / -1;
  }

  .chat-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .chat-composer {
    grid-template-columns: minmax(0, 1fr) 140px;
  }
}

.topup-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.topup-btn {
  padding: 10px 0;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
  cursor: pointer;
}

.topup-btn:active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* === Админ-календарь: переключатель вида, день, мультикабинеты === */
.admin-view-toggle {
  display: inline-flex;
  gap: 0;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.admin-view-toggle button {
  min-height: 36px;
  padding: 7px 18px;
  border: none;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}
.admin-view-toggle button.active {
  background: #eff8ff;
  color: #175cd3;
}

.day-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.day-nav-arrow {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}
.day-nav-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.day-nav-label strong {
  font-size: 13px;
  text-transform: uppercase;
}
.day-nav-label span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.day-nav-today {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}
.day-nav-today.active-blue {
  border-color: #84caff;
  background: #eff8ff;
  color: #175cd3;
}

/* Чек-лист кабинетов в выпадающем списке */
.room-checklist button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}
.room-checklist strong {
  display: inline-block;
  font-size: 13px;
}
.room-check-all {
  border-bottom: 1px solid var(--line) !important;
  border-radius: 8px 8px 0 0 !important;
}
.room-check-box {
  display: inline-flex !important;
  width: 18px;
  font-size: 16px;
  line-height: 1;
  margin: 0 !important;
  color: #175cd3;
}
.room-dot {
  display: inline-block !important;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin: 0 !important;
  flex: 0 0 auto;
}

/* Легенда цветов кабинетов (недельный вид) */
.room-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 10px 2px 0;
}
.room-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

/* Колонки кабинетов в дневном виде */
.admin-day-col-head {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 7px 6px;
  background: #fff;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.admin-day-col-head strong {
  font-size: 12px;
  font-weight: 820;
  line-height: 1.15;
}
.calendar-empty-hint {
  margin: 10px 0 0;
}

/* === Календарь ученика: своё занятие, свободно у педагога, занят, легенда === */
.teacher-calendar-event.selected-event {
  outline: 2px solid #175cd3;
  outline-offset: -2px;
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.18);
}
.teacher-calendar-event.own-event {
  border-left: 3px solid #175cd3;
}
.teacher-calendar-event em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 10px;
  font-weight: 760;
  color: #175cd3;
}
.student-free-cell {
  cursor: pointer;
}
.busy-teacher-cell {
  background: #f3f4f6;
  display: grid;
  place-items: center;
}
.busy-mini {
  font-size: 10px;
  font-weight: 700;
  color: #98a2b3;
}

.student-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 2px 10px;
}
.legend-swatch {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 4px;
  flex: 0 0 auto;
}
.legend-swatch.own {
  background: #d1fadf;
  border: 1px solid #027a48;
}
.legend-swatch.free {
  background: #ecfdf3;
  border: 1px dashed #12b76a;
}
.legend-swatch.busy {
  background: #f3f4f6;
  border: 1px solid #d0d5dd;
}

/* === Месяц (админ), кнопка-метрика, заявки на перенос === */
.admin-month-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.admin-month-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.admin-month-head .admin-month-dow {
  padding: 7px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  background: #f9fafb;
  border-bottom: 1px solid var(--line);
}
.admin-month-cell {
  position: relative;
  min-height: 64px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 5px 5px 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
}
.admin-month-cell.out-month { background: #fafafa; }
.admin-month-cell.out-month .admin-month-date { color: #cbd2dc; }
.admin-month-cell.is-today { background: #eff8ff; }
.admin-month-date { font-size: 13px; font-weight: 760; color: var(--ink); }
.admin-month-count {
  font-size: 11px;
  font-weight: 800;
  color: #175cd3;
  background: #eff8ff;
  border-radius: 999px;
  padding: 1px 7px;
}
.admin-month-dots { display: flex; gap: 3px; margin-top: auto; flex-wrap: wrap; }

.metric-button {
  cursor: pointer;
  font: inherit;
  text-align: center;
  width: 100%;
}
.metric-button .sub { color: #175cd3; font-weight: 700; }

/* Заявки на перенос */
.request-list { display: grid; gap: 10px; }
.request-card {
  border: 1px solid var(--line);
  border-left: 4px solid #f79009;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}
.request-card.accepted { border-left-color: #12b76a; }
.request-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.request-head strong { font-size: 15px; }
.request-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.request-age {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eff8ff;
  color: #175cd3;
  font-size: 11px;
  font-weight: 820;
  white-space: nowrap;
}
.request-status { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.request-status.wait { background: #fffaeb; color: #b54708; }
.request-status.ok { background: #ecfdf3; color: #027a48; }
.request-body { margin: 7px 0 2px; font-size: 14px; color: var(--ink); }
.request-meta { margin: 0; font-size: 12px; color: var(--muted); }
.request-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mini-button.accept { background: #12b76a; color: #fff; border-color: #12b76a; }
.mini-button.apply { background: #175cd3; color: #fff; border-color: #175cd3; }
.mini-button.apply.ghost { background: #fff; color: #175cd3; }
.mini-button.reject { background: #fff; color: #b42318; border-color: #fda29b; }
.picker-empty { padding: 8px 9px; font-size: 12px; color: var(--muted); }
.room-check-sub { color: var(--muted); font-size: 12px; }

/* «Галки только в левой части»: не заливаем всю строку чек-листа целиком */
.room-checklist .room-check-option.selected,
.room-checklist .room-check-all.selected {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.room-checklist .room-check-box { color: #175cd3; font-size: 17px; }

/* Недельная сетка: страница расширяется до ширины всей недели.
   overflow:visible → страница (а не элемент) прокручивает x и y,
   поэтому sticky top/left держатся у края вьюпорта — без рывков при зуме. */
.calendar-week-box {
  overflow: visible;
  width: max-content;
  max-width: none;
  touch-action: auto;
}

/* === v62: панель вида + кнопка «текущий», компактные чипы, день-колонка === */
.admin-view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}
.admin-view-bar .admin-view-toggle {
  margin: 0;
}

/* Компактные события в ячейке: горизонтальный список «Кабинет · Ученик», цвет по кабинету */
.cal-cell-events {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 3px;
  align-content: flex-start;
}
.cal-chip {
  display: inline-flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  justify-content: flex-start;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}
.cal-chip.warn { background: #fffaeb; }
.cal-chip.done { background: #f3f4f6; color: #6b7280; }
.cal-chip.danger { background: #fef3f2; }

.admin-entity-calendar {
  min-width: calc(54px + var(--day-count) * clamp(118px, 20vw, 156px));
  grid-template-columns: 54px repeat(var(--day-count), clamp(118px, 20vw, 156px));
}

.admin-entity-calendar .teacher-calendar-cell {
  min-height: 64px;
}

/* День-вид: одна колонка на всю ширину, ячейки повыше и тянутся вниз под события */
.teacher-calendar-grid.admin-day-single {
  min-width: 100%;
  grid-template-columns: 54px minmax(0, 1fr);
}
.admin-day-single .day-cell {
  min-height: 64px;
  align-items: flex-start;
}

.admin-day-single .cal-cell-events {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.admin-day-single .cal-chip {
  width: 100%;
  justify-content: flex-start;
}

/* Выбор недели: даём строке выйти за ширину экрана, чтобы при отдалении были видны все недели */
.period-row.week-row {
  overflow-x: visible;
  width: max-content;
  max-width: none;
}

/* === v63: год короче + месяц справа, выбор недели в 2 ряда (только цифры) === */
.period-select-row.year-month-row {
  grid-template-columns: 1fr 2fr; /* год ~вдвое короче месяца */
}
/* Выбор недели: переносим в несколько рядов, чтобы поместились все недели месяца */
.period-row.week-row {
  flex-wrap: wrap;
  overflow-x: visible;
  width: auto;
  max-width: 100%;
}
.period-chip.is-current-week:not(.active-blue) {
  border-color: #84caff;
  color: #175cd3;
}

/* === v63: кнопка установки в шапке + лента уведомлений === */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.install-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #111827;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
  cursor: pointer;
}
.notif-feed {
  display: grid;
  gap: 8px;
}
.notif-feed-item {
  border: 1px solid var(--line);
  border-left: 3px solid #3b82f6;
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}
.notif-feed-item strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
}
.notif-feed-item span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.notif-feed-header {
  cursor: pointer;
  user-select: none;
}
.notif-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff !important;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
  margin-left: 6px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.8);
}
.notif-toggle-arrow {
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.2s;
  display: inline-block;
}
.notif-toggle-arrow.collapsed {
  transform: rotate(-90deg);
}

/* === День: вертикальное растяжение ячеек двумя пальцами (--day-scale) === */
.admin-day-single {
  --day-scale: 1;
  touch-action: pan-y; /* разрешаем вертикальный скролл, забираем pinch себе */
}
/* Растягиваем ТОЛЬКО высоту ячеек по вертикали. Шрифт и ширина не меняются. */
.admin-day-single .teacher-calendar-time,
.admin-day-single .day-cell {
  min-height: calc(64px * var(--day-scale));
}
.admin-day-single .day-cell {
  align-content: flex-start;
}
/* Чипы тоже растягиваются: при наполненных ячейках (8+ событий) ячейка продолжает расти */
.admin-day-single .cal-chip {
  min-height: calc(20px * var(--day-scale));
}
.admin-day-single .cal-cell-events {
  gap: calc(4px * min(2, var(--day-scale)));
  padding: calc(3px * min(2, var(--day-scale)));
}
.day-pinch-hint {
  margin: 0 2px 8px;
  font-size: 11px;
  color: var(--muted);
}

/* === День: список чипов по 8 кабинетов в каждом часе === */
.day-room-chips-list {
  display: flex;
  flex-direction: column;
  /* Рост гарантированно пропорционален масштабу (даже когда строки заполнены текстом):
     добавляем отступ, зависящий от (scale - 1), — без «мёртвой зоны». */
  gap: calc(2px + 7px * (max(1, var(--day-scale, 1)) - 1));
  padding: calc(3px + 4px * (max(1, var(--day-scale, 1)) - 1)) calc(4px * var(--day-scale, 1));
  width: 100%;
}

.day-room-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: calc(32px * var(--day-scale, 1));
  padding: calc(3px + 13px * (max(1, var(--day-scale, 1)) - 1)) 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  border-left: 3px solid #ccc;
  background: var(--panel);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.day-room-chip-empty {
  border-color: #e5e7eb;
  border-left-color: #e5e7eb !important;
  background: transparent;
}
.day-room-chip-empty:active {
  background: #f0fdf4;
}

.day-chip-room {
  font-size: 10px;
  font-weight: 800;
  min-width: 24px;
  color: var(--muted);
  flex-shrink: 0;
}
.day-chip-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.day-chip-student {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.day-chip-disc {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 1.2;
}
.day-chip-teacher {
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.day-chip-flag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  border-radius: 3px;
  padding: 0 3px;
  line-height: 14px;
}
.day-room-add-plus {
  font-size: 16px;
  font-weight: 300;
  color: #16a34a;
  margin-left: auto;
  line-height: 1;
}

/* Модал добавления занятия — по центру экрана */
.day-add-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.4);
}
.day-add-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 61;
  transform: translate(-50%, -50%);
  width: min(380px, calc(100% - 32px));
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
}
.day-add-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.day-add-title {
  font-size: 16px;
  font-weight: 780;
  margin: 0;
  color: var(--ink);
}
.modal-delete-btn {
  flex-shrink: 0;
  height: 32px;
  border-radius: 8px;
  background: #fef3f2;
  border: 1px solid #fda29b;
  color: #b42318;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}
.delete-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.delete-confirm-dialog {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  width: min(320px, 100%);
  text-align: center;
}
.delete-confirm-dialog h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 780;
}
.delete-confirm-dialog p {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 14px;
}
.delete-confirm-actions {
  display: flex;
  gap: 12px;
}
.delete-confirm-actions button {
  flex: 1;
  min-height: 44px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.delete-confirm-cancel {
  background: #f3f4f6;
  color: var(--ink);
}
.delete-confirm-ok {
  background: #d92d20;
  color: #fff;
}
.day-add-meta {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
}
.day-add-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.day-add-field > span {
  font-size: 12px;
  font-weight: 760;
  color: var(--muted);
}
.day-add-select {
  height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
  touch-action: manipulation;
}
.day-add-date {
  -webkit-appearance: none;
  appearance: none;
  height: 42px !important;
  max-width: 100%;
}
.day-flags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.day-flag-btn {
  padding: 5px 10px;
  border-radius: 20px;
  border: 1.5px solid;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.day-flag-short {
  font-size: 12px;
  font-weight: 800;
}
.day-flag-on {
  font-weight: 700;
}
.day-repeat-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.day-repeat-btn {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.day-repeat-on {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}
.day-student-search-wrap {
  position: relative;
}
.day-student-input {
  padding-right: 30px;
}
.day-student-chosen {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #16a34a;
  font-size: 16px;
  pointer-events: none;
}
.day-student-results {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 4px;
  overflow: hidden;
  max-height: 180px;
  overflow-y: auto;
}
.day-student-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: none;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.day-student-result-item:last-child {
  border-bottom: none;
}
.day-student-result-item:active {
  background: #eff8ff;
}
.day-student-badge {
  font-size: 10px;
  color: #175cd3;
  background: #eff8ff;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: auto;
}
.day-student-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}
.day-student-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
}
.day-student-selected-name {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: #166534;
}
.day-student-clear {
  font-size: 12px;
  color: #2563eb;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}
.day-add-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.day-add-actions .btn {
  flex: 1;
  min-height: 44px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 760;
  cursor: pointer;
  border: none;
}
.day-add-actions .btn-ghost {
  background: #f3f4f6;
  color: var(--ink);
}
.day-add-actions .btn-primary {
  background: #2563eb;
  color: #fff;
}
.day-add-actions .btn-disabled {
  opacity: 0.45;
  cursor: default;
}

/* Компактный чип события для недельного вида (аналог day-room-chip, но уже) */
.week-event-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 3px 5px 3px 7px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  margin-bottom: 2px;
  gap: 1px;
}
.week-event-chip.done { background: #f3f4f6; color: #6b7280; }
.week-event-chip.warn { background: #fffaeb; }
.week-event-chip.danger { background: #fef3f2; }
.week-chip-room { font-size: 9px; font-weight: 760; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.week-chip-name { font-size: 11px; font-weight: 720; color: var(--ink); white-space: normal; word-break: break-word; max-width: 100%; }
.week-chip-disc { font-size: 10px; font-weight: 560; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Drag ghost element */
.drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: #1d4ed8;
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  white-space: nowrap;
  opacity: 0.92;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.drag-ghost span { font-size: 10px; font-weight: 500; opacity: 0.85; }

/* Drop target highlight */
.drag-over {
  background: #eff6ff !important;
  outline: 2px dashed #3b82f6 !important;
  outline-offset: -2px;
}

/* Блокировка выделения текста во время перетаскивания */
body.dragging, body.dragging * {
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* Уведомления: кликабельный элемент (для Admin → заявки) */
.notif-clickable {
  cursor: pointer;
  border-radius: 8px;
}
.notif-clickable:active {
  background: #f0f4f8;
}

/* Уведомления: строка с кнопкой "прочитано" */
.notif-feed-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.notif-item-body {
  flex: 1;
  min-width: 0;
}
.notif-item-body strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
}
.notif-item-body span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.notif-read-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #22c55e;
  background: transparent;
  color: #22c55e;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 2px;
}
.notif-read-btn:active {
  background: #dcfce7;
}
.notif-feed-item-read {
  opacity: 0.55;
  border-left-color: var(--line);
}
.notif-history-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 0 4px;
}
.notif-history-btn {
  width: 100%;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  color: #2563eb;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 500;
}
.notif-history-btn:active {
  opacity: 0.7;
}

/* Пометка переноса на чипах в admin-календаре */
.chip-pending {
  display: block;
  font-size: 10px;
  font-style: italic;
  color: #d97706;
  line-height: 1.2;
  margin-top: 1px;
}

/* Кнопка «Пополнение баланса» на главной админа */
.admin-balance-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  margin-top: 10px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 16px 36px rgba(5, 150, 105, 0.2);
}

/* Вкладка «Педагоги» для администратора */
.admin-teachers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-teacher-card {
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-teacher-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-teacher-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
}
.admin-teacher-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-teacher-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-hero), #2563eb;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border-radius: 50%;
}
.admin-teacher-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-teacher-info strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-teacher-disc {
  font-size: 12px;
  color: var(--muted);
}
.admin-teacher-meta {
  font-size: 12px;
  color: var(--muted);
}
.admin-teacher-students {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-student-chip {
  background: var(--surface-2, #f3f4f6);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}
.admin-student-chip:hover {
  background: #e5e7eb;
}

/* Модал пополнения баланса */
.balance-method-row {
  display: flex;
  gap: 10px;
}
.balance-method-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.balance-method-opt input[type="radio"] {
  display: none;
}
.balance-method-opt.active {
  border-color: #059669;
  background: #ecfdf5;
  color: #065f46;
}

/* Вкладка «Ученики» для администратора */
.admin-students-search {
  width: 100%;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.admin-students-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.admin-student-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.12s;
}
.admin-student-card:last-child {
  border-bottom: none;
}
.admin-student-card:active {
  background: #f0f4f8;
}
.admin-student-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.admin-student-left {
  min-width: 0;
  flex: 1;
}
.admin-student-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.admin-student-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.admin-student-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.admin-student-balance {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.admin-student-balance.low {
  color: #b42318;
}
.admin-student-chevron {
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.2s;
  display: inline-block;
  line-height: 1;
}
.admin-student-chevron.open {
  transform: rotate(90deg);
}
.admin-student-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.admin-student-info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  align-items: baseline;
}
.info-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Period tabs (директор Финансы) ─────────────────────────── */
.period-tabs {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}
.period-tab {
  padding: 7px 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.period-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

/* ── P&L table ───────────────────────────────────────────────── */
.pl-table {
  padding: 0 16px 8px;
}
.pl-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.pl-row:last-child { border-bottom: none; }
.pl-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.pl-label {
  font-size: 14px;
  color: var(--text);
}
.pl-sub {
  font-size: 11px;
  color: var(--muted);
}
.pl-cost .pl-label { color: var(--muted); }
.pl-val {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.pl-minus { color: var(--muted); }
.pl-pos   { color: #16a34a; font-weight: 600; }
.pl-neg   { color: #ef4444; font-weight: 600; }
.pl-pct {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.pl-hint {
  font-size: 12px;
  color: var(--muted);
}
.pl-subtotal {
  background: rgba(var(--accent-rgb, 99,102,241), 0.05);
}
.pl-subtotal .pl-label { font-weight: 600; }
.pl-total {
  border-top: 2px solid var(--border);
  border-bottom: none;
}
.pl-total .pl-label { font-weight: 700; font-size: 15px; }
.pl-total .pl-val   { font-size: 15px; }

.metric-val-neg { color: #ef4444; }

/* ── Write-offs table (Списания за день) ─────────────────────── */
.money-sort-bar {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
}
.money-sort-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.money-sort-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.write-offs-table {
  padding: 0 16px 16px;
}
.wot-head,
.wot-row {
  display: grid;
  grid-template-columns: 1fr 1fr 80px 72px;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
}
.wot-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.wot-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.wot-total {
  font-weight: 600;
  border-bottom: none;
  border-top: 2px solid var(--border);
  color: var(--text);
}

/* ── Payroll section (Расчёт педагогов) ─────────────────────── */
.payroll-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  cursor: pointer;
  user-select: none;
}
.payroll-list {
  padding: 0 16px 16px;
}
.payroll-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.payroll-row:last-child { border-bottom: none; }
.payroll-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.payroll-info strong { font-size: 14px; }
.payroll-info span { font-size: 12px; color: var(--muted); }
.payroll-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.payroll-owed {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.payroll-owed.positive { color: var(--danger, #ef4444); }
.payroll-done { color: var(--success, #22c55e); font-size: 18px; }

/* ── Pending trial cards (admin home) ────────────────────────── */
.trial-pending-list {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.trial-pending-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card-bg, var(--surface));
  border: 1px solid var(--border);
  border-left: 3px solid #f59e0b;
  border-radius: 10px;
}
.trial-pending-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.trial-pending-info strong { font-size: 14px; }
.trial-pending-info span { font-size: 12px; color: var(--muted); }
.trial-pending-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Pending trial banner (student home) ─────────────────────── */
.trial-waiting-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  margin: 0 16px 4px;
}
.trial-waiting-icon { font-size: 22px; flex-shrink: 0; }
.trial-waiting-banner strong { display: block; font-size: 14px; }
.trial-waiting-banner span { font-size: 12px; color: var(--muted); }

/* ── Mini action buttons ─────────────────────────────────────── */
.mini-button {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.mini-button.mini-ok {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}
.mini-button.mini-del {
  background: transparent;
  color: #ef4444;
  border-color: #ef4444;
}

/* ── Other expenses (Прочие расходы) ────────────────────────── */
.other-expense-block { margin-top: 12px; }
.oe-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.oe-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-alt, #f9fafb); border-radius: 10px; padding: 8px 12px;
}
.oe-info { display: flex; flex-direction: column; gap: 2px; }
.oe-desc { font-size: 14px; color: var(--text); }
.oe-date { font-size: 11px; color: var(--muted); }
.oe-right { display: flex; align-items: center; gap: 10px; }
.oe-amount { font-size: 14px; font-weight: 600; color: #ef4444; }
.oe-del {
  background: none; border: none; color: var(--muted); font-size: 18px;
  cursor: pointer; padding: 0 4px; line-height: 1;
}
.oe-form {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.oe-input {
  flex: 1; min-width: 120px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 14px;
}
.oe-input-num { max-width: 110px; flex: 0 0 110px; }
.oe-add-btn {
  padding: 8px 14px; border-radius: 10px; border: none;
  background: var(--accent, #6366f1); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}

/* ── Teacher profitability table ─────────────────────────────── */
.prof-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prof-table thead th {
  padding: 6px 4px; font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.prof-table tbody tr { border-bottom: 1px solid var(--border); }
.prof-table tbody tr:last-child { border-bottom: none; }
.prof-table td { padding: 9px 4px; vertical-align: middle; }
.pt-name { text-align: left; font-weight: 600; color: var(--text); min-width: 72px; }
.pt-num  { text-align: right; color: var(--text); white-space: nowrap; }
.pl-hint { font-size: 12px; color: var(--muted); padding: 8px 0 2px; }
.pl-minus-light { color: #f87171; }

/* ── Expenses tab ────────────────────────────────────────────── */
.exp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.exp-th {
  padding: 6px 4px; font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; border-bottom: 1px solid var(--border); text-align: left;
}
.exp-th-num, .exp-th-del { text-align: right; }
.exp-row { border-bottom: 1px solid var(--border); }
.exp-row:last-child { border-bottom: none; }
.exp-row td { padding: 10px 4px; vertical-align: middle; }
.exp-desc { font-weight: 500; color: var(--text); }
.exp-num  { text-align: right; font-weight: 600; white-space: nowrap; }
.exp-rec  { color: var(--muted); font-size: 12px; white-space: nowrap; padding: 10px 8px; }
.exp-del-cell { text-align: right; }
.oe-input-rec { flex: 0 0 130px; min-width: 130px; }

/* ── Cash split bar ──────────────────────────────────────────── */
.cash-split { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.cash-split-row { display: flex; align-items: center; gap: 8px; }
.cash-split-label { width: 68px; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.cash-split-bar-wrap {
  flex: 1; height: 8px; border-radius: 4px;
  background: var(--border); overflow: hidden;
}
.cash-split-bar { height: 100%; border-radius: 4px; transition: width 0.3s; }
.cash-bar-cash     { background: #22c55e; }
.cash-bar-transfer { background: #6366f1; }
.cash-split-val { font-size: 13px; font-weight: 600; color: var(--text); text-align: right; min-width: 80px; }
.cash-tag      { color: #16a34a; font-weight: 600; }
.transfer-tag  { color: #6366f1; font-weight: 600; }
.metric-val-neg { color: #ef4444; }

/* ── White card wrapper for financial tables ─────────────────── */
.fin-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(15,23,42,0.05);
  padding: 4px 12px;
  overflow: hidden;
}
.fin-card .pl-table { padding: 0; }
.fin-card .disc-table { padding: 0; }
.fin-card .exp-table  { padding: 0; }

/* ── Expense add button ──────────────────────────────────────── */
.exp-add-btn {
  padding: 6px 14px; border-radius: 20px;
  border: none; background: var(--accent, #6366f1);
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}

/* ── Modal close X ───────────────────────────────────────────── */
.modal-close-x {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: #f3f4f6; color: var(--ink);
  font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ── Export bar ──────────────────────────────────────────────── */
.export-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.export-btn {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.export-btn:active { opacity: 0.7; }

/* ── Discipline advances table ───────────────────────────────── */
.disc-table { display: flex; flex-direction: column; }
.disc-head {
  display: grid; grid-template-columns: 1fr 60px 90px 80px;
  gap: 4px; padding: 6px 4px;
  font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.disc-row {
  display: grid; grid-template-columns: 1fr 60px 90px 80px;
  gap: 4px; padding: 10px 4px;
  border-bottom: 1px solid var(--border); align-items: center;
}
.disc-row:last-child { border-bottom: none; }
.disc-name-wrap { display: flex; flex-direction: column; gap: 4px; }
.disc-name { font-size: 13px; font-weight: 600; color: var(--text); }
.disc-bar-wrap { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.disc-bar { height: 100%; border-radius: 2px; background: var(--accent, #6366f1); }
.disc-num { font-size: 12px; text-align: right; color: var(--text); }
.disc-bal { font-weight: 600; }
.disc-bonus { color: #22c55e; }

/* ── Lesson detail modal — move form & cancel confirm ────────── */
.lesson-move-form {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: 14px;
}
.lesson-move-form label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.lesson-move-form input {
  padding: 10px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  color: var(--ink);
  background: var(--panel);
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.lesson-move-form input:focus {
  border-color: var(--accent, #2563eb);
}
.lesson-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.btn-cancel-red {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  background: #fef3f2;
  border: 1.5px solid #fda29b;
  color: #b42318;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn-back {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  background: #f3f4f6;
  border: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.cancel-confirm-body {
  margin-top: 14px;
  text-align: center;
}
.cancel-confirm-body p {
  font-size: 14px;
  color: var(--muted);
  margin: 6px 0 20px;
}
.btn-confirm-red {
  width: 100%;
  height: 46px;
  border-radius: 10px;
  background: #d92d20;
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
}

/* ── Payroll settle confirm ──────────────────────────────────── */
.settle-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.settle-confirm-dialog {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  width: min(320px, 100%);
  text-align: center;
}
.settle-confirm-dialog h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 780;
}
.settle-confirm-dialog p {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 14px;
}
.settle-confirm-actions {
  display: flex;
  gap: 12px;
}
.settle-confirm-actions button {
  flex: 1;
  min-height: 44px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.settle-btn-ok {
  background: #16a34a;
  color: #fff;
}
.settle-btn-cancel {
  background: #f3f4f6;
  color: var(--ink);
}

/* ── Payroll fin-card styles ─────────────────────────────────── */
.payroll-list {
  display: flex;
  flex-direction: column;
}
.payroll-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.payroll-row:last-child {
  border-bottom: none;
}
.payroll-info {
  min-width: 0;
  flex: 1;
}
.payroll-info strong {
  font-size: 14px;
  font-weight: 700;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.payroll-info span {
  font-size: 12px;
  color: var(--muted);
}
.payroll-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.payroll-owed {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.payroll-owed.positive { color: var(--ink); }
.payroll-done { color: #16a34a; font-weight: 700; }
.settle-action-btn {
  padding: 6px 14px;
  border-radius: 8px;
  background: #16a34a;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

/* ── Print styles ────────────────────────────────────────────── */
@media print {
  .bottom-nav, .app-header-actions, .export-bar,
  .period-tabs, .oe-form, .oe-del, .switch-role-btn { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .section { box-shadow: none !important; border: 1px solid #ddd !important; }
  .pl-val, .disc-num, .cash-split-val { color: #000 !important; }
  .pl-pos { color: #16a34a !important; }
  .pl-neg { color: #dc2626 !important; }
}

/* === v118: ряд пикеров админ-календаря не должен вылезать за правый край === */
/* 3 равные колонки (могут сжиматься ниже контента) — нет лишней области справа. */
.admin-calendar-tabs.smart-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  overflow: visible; /* выпадашки видны, они позиционируются absolute и capped по ширине */
}
.smart-tabs .smart-picker-wrap {
  min-width: 0;
}
.smart-tabs .smart-picker-button,
.smart-tabs .student-tab-input {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  font-size: 12px;
  gap: 4px;
}
.smart-tabs .picker-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.smart-tabs .picker-caret {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}
