:root {
  color-scheme: light;
  --bg: #f4f6f1;
  --surface: #fffefa;
  --surface-2: #eef3eb;
  --ink: #17272b;
  --muted: #667278;
  --line: #dce3dc;
  --green: #176b5d;
  --green-2: #21836d;
  --green-soft: #dff0e9;
  --clay: #c96b3c;
  --clay-soft: #f8e3d7;
  --blue: #2d6da3;
  --blue-soft: #dcecf8;
  --gold: #d4a92f;
  --danger: #b43b3b;
  --danger-soft: #f8dddd;
  --shadow: 0 18px 60px rgba(30, 47, 44, 0.12);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

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

button {
  border: 0;
}

button,
select,
input,
textarea {
  border-radius: var(--radius);
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(45, 109, 163, 0.25);
  outline-offset: 2px;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 1.12fr) minmax(360px, 0.88fr);
  overflow: hidden;
  background: #071827;
  color: #fffefa;
}

.auth-visual {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  padding: 34px 48px 46px;
  background: #071827;
  color: #fffefa;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-logo {
  display: block;
  width: min(190px, 100%);
  height: auto;
}

.auth-brand {
  position: relative;
  z-index: 1;
}

.auth-brand .brand-logo {
  width: min(500px, 84vw);
}

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #f2d36b;
  color: #173035;
  font-weight: 900;
}

.auth-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 20px;
  padding: 8px 12px;
  border: 1px solid rgba(38, 178, 188, 0.38);
  border-radius: var(--radius);
  color: #2ed1df;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.auth-visual h1 {
  margin: 0;
  max-width: 760px;
  color: #fffefa;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.35rem;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
}

.auth-visual p {
  max-width: 560px;
  margin: 22px 0 0;
  color: rgba(255, 254, 250, 0.82);
  font-size: 1.12rem;
  line-height: 1.6;
}

.court-card {
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: min(100%, 640px);
  margin: 0;
  border: 1px solid rgba(38, 178, 188, 0.42);
  border-radius: var(--radius);
  background: rgba(8, 38, 50, 0.92);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

.court-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8.65;
  object-fit: cover;
}

.tennis-ball {
  position: absolute;
  right: 14%;
  top: 43%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d9f36a;
  box-shadow: 0 0 0 7px rgba(217, 243, 106, 0.2), 0 0 34px rgba(217, 243, 106, 0.76);
}

.tennis-ball::before {
  position: absolute;
  inset: 3px;
  border-left: 2px solid rgba(7, 24, 39, 0.42);
  border-radius: 50%;
  content: "";
}

.auth-panel {
  position: relative;
  display: flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  padding: 44px;
  background: #071827;
}

.auth-box {
  width: min(100%, 540px);
  padding: 28px;
  border: 1px solid rgba(38, 178, 188, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.97);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
}

.auth-head {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.auth-head > span,
.auth-form-title span,
.auth-new-block > div > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.auth-head > span {
  color: #138174;
  text-transform: uppercase;
}

.auth-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 2.15rem;
  line-height: 1.05;
}

.auth-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-role-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  min-height: 92px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.auth-role-card span {
  display: grid;
  grid-row: span 2;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--green);
  font-weight: 950;
}

.auth-role-card strong {
  align-self: end;
}

.auth-role-card small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.auth-role-card.is-active {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 10px 26px rgba(23, 107, 93, 0.12);
}

.auth-role-card.is-active span {
  background: var(--green);
  color: #fffefa;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 22px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.tab-button,
.auth-role-card,
.nav-button,
.chip-button,
.icon-button,
.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  min-height: 42px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.tab-button {
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab-button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(30, 47, 44, 0.08);
}

.auth-form,
.stack-form {
  display: grid;
  gap: 14px;
}

.auth-screen .field span {
  color: #52656b;
}

.auth-screen .field input,
.auth-screen .field select {
  border-color: #d5e4df;
  background: #fff;
}

.auth-screen .field input:focus-visible,
.auth-screen .field select:focus-visible {
  outline-color: rgba(38, 178, 188, 0.22);
  border-color: #26b2bc;
}

.auth-screen .primary-button {
  min-height: 46px;
  background: #26a7b2;
  color: #fff;
}

.auth-screen .primary-button:hover {
  background: #198b95;
}

.auth-screen .secondary-button,
.auth-screen .ghost-button {
  min-height: 44px;
  border-color: #cfe0dd;
  background: #fff;
}

.auth-screen .secondary-button:hover,
.auth-screen .ghost-button:hover {
  border-color: #26b2bc;
  background: #eef8f7;
  color: #0b6d73;
}

.auth-form-title,
.auth-new-block {
  display: grid;
  gap: 8px;
}

.auth-form-title strong,
.auth-new-block > div > strong {
  font-size: 1rem;
}

.auth-new-block {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9f5;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-inline-note {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d5e4df;
  border-radius: var(--radius);
  background: #f7f9f5;
  color: #52656b;
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

.auth-link {
  display: inline-flex;
  justify-content: center;
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.auth-link-button {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.auth-link:hover,
.auth-link-button:hover {
  text-decoration: underline;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.mini-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

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

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle.is-visible {
  background: var(--surface-2);
  color: var(--green);
}

.password-eye-icon {
  position: relative;
  width: 19px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.password-eye-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.password-toggle.is-visible .password-eye-icon::before {
  position: absolute;
  top: 5px;
  left: -4px;
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: rotate(42deg);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 0 15px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--green-2);
}

.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: #c8d5cd;
  background: var(--surface-2);
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid transparent;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 800;
}

.danger-button:hover {
  border-color: #e6b8b8;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.button-row,
.slot-actions,
.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #fffefa;
  padding: 22px 16px;
}

.sidebar .brand-logo {
  width: 178px;
}

.profile-block {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.profile-block strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-block span {
  color: var(--muted);
  font-size: 0.86rem;
}

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

.teacher-switch-note,
.teacher-switch-help {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.teacher-switch-help {
  margin: 10px 0 0;
}

.student-data-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.75fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #cfe2d8;
  border-radius: var(--radius);
  background: #f7fbf5;
}

.student-data-section span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.student-data-section strong {
  display: block;
  margin-top: 4px;
  font-size: 1.12rem;
}

.student-data-section p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 800;
}

.nav-button svg,
.nav-icon {
  width: 18px;
  min-width: 18px;
  text-align: center;
}

.nav-button.is-active {
  background: var(--green-soft);
  color: var(--green);
}

.sidebar-footer {
  margin-top: auto;
}

.main {
  min-width: 0;
  padding: 28px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.topbar h2,
.section-title h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.4rem);
}

.topbar p {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.pill {
  background: var(--surface-2);
  color: var(--muted);
}

.status-pill.regular,
.pill.green {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.recovery,
.pill.clay {
  background: var(--clay-soft);
  color: var(--clay);
}

.status-pill.extra,
.pill.extra {
  background: #fff4cf;
  color: #8a5b00;
}

.status-pill.blue,
.pill.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-pill.danger,
.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.panel,
.metric-card,
.slot-card,
.student-card,
.message-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel {
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title p {
  margin: 5px 0 0;
  color: var(--muted);
}

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

.calendar-view {
  display: grid;
  gap: 14px;
}

.calendar-period,
.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.calendar-period > div {
  display: grid;
  gap: 2px;
  min-width: 172px;
}

.calendar-period strong {
  font-size: 1rem;
}

.calendar-period span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.calendar-month-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(30, 47, 44, 0.08);
}

.calendar-month-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.calendar-month-weekday,
.calendar-month-day {
  background: var(--surface);
}

.calendar-month-weekday {
  display: grid;
  min-height: 38px;
  place-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.calendar-month-day {
  display: grid;
  min-height: 120px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  align-content: start;
  padding: 8px;
}

.calendar-month-day.is-outside {
  background: #f7f9f5;
  color: #9aa5a8;
}

.calendar-month-day.is-closed {
  background: #fff4f4;
}

.calendar-month-day.has-events:hover {
  background: #f5f9fc;
}

.calendar-month-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.calendar-month-day-head em {
  overflow: hidden;
  color: var(--danger);
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-month-number {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 850;
}

.calendar-month-day.is-today .calendar-month-number {
  background: var(--blue);
  color: #fff;
}

.calendar-month-events,
.calendar-day-detail-list {
  display: grid;
  gap: 4px;
  align-content: start;
}

.calendar-line-event {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 1px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  padding: 3px 5px;
  background: var(--green-soft);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.12;
  text-align: left;
}

.calendar-line-event span,
.calendar-line-event small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-line-event small {
  opacity: 0.84;
  font-size: 0.64rem;
}

.calendar-line-event.is-mine,
.calendar-line-event.is-teacher {
  background: var(--blue);
  color: #fff;
}

.calendar-line-event.is-open {
  background: #dff0e9;
  color: var(--green);
}

.calendar-line-event.is-full,
.calendar-line-event.is-closed {
  background: #eceff2;
  color: var(--muted);
}

.calendar-line-event.is-closed {
  background: var(--danger-soft);
  color: var(--danger);
}

.calendar-line-event.is-recovery,
.calendar-line-event.is-recovery-option,
.calendar-line-event.is-shared {
  background: var(--clay);
  color: #fff;
}

.calendar-line-event.is-extra {
  background: #d29618;
  color: #fff;
}

.calendar-line-event.is-highlighted {
  box-shadow: 0 0 0 3px rgba(212, 169, 47, 0.34);
}

.calendar-more-button {
  width: 100%;
  min-height: 20px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 900;
  text-align: left;
}

.calendar-slot-modal .schedule-slot {
  min-height: auto;
}

.calendar-detail-slot .schedule-slot {
  box-shadow: none;
}

.legend-swatch {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  border: 1px solid rgba(23, 39, 43, 0.18);
}

.legend-swatch.is-open {
  background: #eaf7ef;
}

.legend-swatch.is-mine {
  background: #dcecf8;
}

.legend-swatch.is-full {
  background: #eceff2;
}

.legend-swatch.is-closed {
  background: #f8dddd;
}

.legend-swatch.is-recovery {
  background: #f8e3d7;
}

.week-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 10px;
}

.day-summary {
  display: grid;
  gap: 3px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.day-summary.is-today {
  border-color: var(--blue);
  box-shadow: inset 0 3px 0 var(--blue);
}

.day-summary.is-closed {
  background: #fff4f4;
}

.day-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-summary span,
.day-summary div {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.day-summary b {
  color: var(--ink);
  font-size: 0.95rem;
}

.schedule-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: 0 12px 40px rgba(30, 47, 44, 0.08);
}

.mobile-agenda,
.slot-card-date {
  display: none;
}

.schedule-board {
  display: grid;
  grid-template-columns: 82px repeat(var(--day-count), minmax(178px, 1fr));
  gap: 1px;
  min-width: 1328px;
}

.schedule-corner,
.schedule-day-head,
.schedule-time,
.schedule-cell {
  background: var(--surface);
}

.schedule-corner,
.schedule-time {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
}

.schedule-corner,
.schedule-day-head {
  position: sticky;
  top: 0;
  z-index: 2;
}

.schedule-day-head {
  display: grid;
  gap: 2px;
  min-height: 72px;
  align-content: center;
  padding: 10px;
  border-top: 3px solid transparent;
}

.schedule-day-head.is-today {
  border-top-color: var(--blue);
}

.schedule-day-head.is-closed {
  background: #fff4f4;
}

.schedule-day-head strong {
  font-size: 1rem;
}

.schedule-day-head span,
.schedule-day-head em {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 850;
}

.schedule-day-head em {
  color: var(--danger);
}

.schedule-time {
  min-height: 148px;
}

.schedule-cell {
  min-height: 148px;
  padding: 8px;
}

.schedule-cell:not(.is-empty) {
  display: grid;
  gap: 8px;
  align-content: start;
}

.schedule-cell.is-empty {
  display: grid;
  place-items: center;
  color: #a0a9ad;
  background: #f7f9f5;
  font-weight: 900;
}

.schedule-slot {
  display: grid;
  min-height: 132px;
  gap: 8px;
  align-content: start;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #eaf7ef;
}

.mobile-slot-date {
  display: none;
}

.schedule-slot.is-open {
  border-color: #cde8d7;
}

.schedule-slot.is-mine {
  border-color: #98c5e4;
  background: var(--blue-soft);
}

.schedule-slot.is-full {
  border-color: #dce3dc;
  background: #f1f3f4;
}

.schedule-slot.is-closed {
  border-color: #edc1c1;
  background: var(--danger-soft);
}

.schedule-slot.has-recovery:not(.is-closed) {
  box-shadow: inset 4px 0 0 var(--clay);
}

.schedule-slot.has-extra-booking:not(.is-closed) {
  box-shadow: inset 4px 0 0 #d29618;
}

.schedule-slot.is-shared-recovery {
  border-color: #efc5ad;
  background: var(--clay-soft);
  box-shadow: inset 4px 0 0 var(--clay);
}

.schedule-slot.is-shared-recovery .schedule-slot-head {
  align-items: flex-start;
}

.schedule-slot.is-highlighted {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 169, 47, 0.18);
}

.schedule-slot-head,
.schedule-slot-status,
.schedule-actions,
.schedule-teacher-form div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.schedule-slot-head {
  justify-content: space-between;
}

.schedule-slot-head strong {
  font-size: 1.12rem;
  line-height: 1;
}

.schedule-slot-status {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.schedule-slot-status small {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--clay);
  padding: 2px 7px;
  font-weight: 950;
}

.shared-badge {
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 2px 7px;
  font-weight: 950;
}

.schedule-empty-text,
.schedule-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.schedule-compact-list {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.schedule-booking-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
}

.schedule-booking-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-booking-row b {
  display: grid;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--clay);
  font-size: 0.72rem;
}

.schedule-booking-row .mini-button {
  padding: 0 7px;
}

.teacher-attendance-actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-start;
}

.schedule-actions {
  flex-wrap: wrap;
  margin-top: 2px;
}

.schedule-teacher-form {
  display: grid;
  width: 100%;
  gap: 6px;
}

.schedule-teacher-form select {
  min-width: 0;
  width: 100%;
  min-height: 32px;
  border: 1px solid rgba(23, 39, 43, 0.16);
  background: rgba(255, 255, 255, 0.86);
  padding: 0 7px;
  font-size: 0.78rem;
  font-weight: 800;
}

.schedule-teacher-form div select {
  flex: 1;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.chip-button {
  min-width: 88px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.chip-button.is-active {
  background: var(--ink);
  color: #fff;
}

.chip-button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  align-items: start;
}

.day-column {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.65);
}

.day-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.day-header h3 {
  margin: 0;
  font-size: 1.02rem;
}

.day-header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

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

.slot-card {
  display: grid;
  gap: 11px;
  padding: 12px;
  scroll-margin: 18px;
}

.slot-card.is-highlighted {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 169, 47, 0.18);
}

.slot-card.is-closed {
  background: #f8eeee;
}

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

.slot-time {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 950;
}

.occupancy {
  display: inline-flex;
  gap: 4px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d4ddd4;
}

.dot.is-filled {
  background: var(--green);
}

.slot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.booking-list {
  display: grid;
  gap: 7px;
}

.booking-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.booking-row strong,
.student-card strong,
.message-card strong {
  overflow-wrap: anywhere;
}

.booking-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.mini-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}

.mini-button.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.mini-button.is-green {
  background: var(--green-soft);
  color: var(--green);
}

.mini-button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffefa;
  opacity: 1;
}

.teacher-add-booking-form,
.teacher-book-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px 42px;
  gap: 7px;
}

.teacher-add-booking-form {
  margin-top: 8px;
}

.teacher-add-booking-form.is-compact {
  grid-template-columns: minmax(0, 1fr);
}

.teacher-add-booking-form.is-compact .mini-button {
  min-height: 34px;
}

.teacher-add-booking-form span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.teacher-add-booking-form select,
.teacher-book-form select {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 9px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 126px;
  padding: 16px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.metric-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px;
}

.chart-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: center;
}

.bar-label {
  font-weight: 900;
}

.bar-track {
  display: grid;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.bar-fill {
  height: 100%;
  min-width: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--clay));
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.student-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.preload-schedule-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9f5;
}

.preload-schedule-block > div:first-child {
  display: grid;
  gap: 3px;
}

.preload-schedule-block strong {
  font-size: 0.95rem;
}

.preload-schedule-block span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.schedule-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(146px, 1fr));
  gap: 8px;
}

.schedule-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.schedule-option:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
}

.schedule-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.schedule-option span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.schedule-option strong,
.schedule-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-option small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
}

.teacher-student-dashboard {
  margin-top: 14px;
}

.teacher-student-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffefa;
}

.teacher-student-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  padding: 2px 0 10px;
  margin-bottom: 12px;
}

.teacher-student-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.teacher-student-tab.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 20px rgba(24, 123, 102, 0.18);
}

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

.teacher-student-tab strong {
  font-size: 0.88rem;
}

.teacher-student-tab span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.teacher-student-tab.is-active span {
  color: rgba(255, 255, 255, 0.86);
}

.teacher-student-dashboard-detail {
  display: grid;
}

.teacher-student-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.teacher-student-card-head > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.teacher-student-card-head strong {
  overflow-wrap: anywhere;
}

.teacher-student-card-head span:not(.pill) {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.teacher-plan-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9f5;
}

.teacher-plan-form .field {
  margin: 0;
}

.teacher-plan-form .secondary-button {
  min-height: 42px;
}

.student-movement-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.student-movement-metrics span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.student-movement-metrics b {
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
}

.student-movement-list {
  display: grid;
  gap: 7px;
}

.student-movement-list > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

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

.student-movement-row > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

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

.student-movement-row div span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.student-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.student-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.superadmin-view,
.superadmin-teacher-list,
.superadmin-teacher-card,
.superadmin-student-list {
  display: grid;
  gap: 14px;
}

.superadmin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  padding: 4px 0 10px;
}

.superadmin-tab {
  position: relative;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 14px;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
}

.superadmin-tab strong,
.superadmin-tab span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.superadmin-tab span:last-child {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.superadmin-tab.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 20px rgba(24, 123, 102, 0.18);
}

.superadmin-tab.is-active span:last-child {
  color: rgba(255, 255, 255, 0.86);
}

.superadmin-tab.is-inactive {
  background: #fff7f6;
}

.superadmin-tab.is-active.is-inactive {
  background: var(--danger);
  border-color: var(--danger);
}

.tab-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--danger);
}

.tab-status-dot.is-active {
  background: var(--green);
}

.superadmin-teacher-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.superadmin-teacher-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.superadmin-teacher-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdf9;
  padding: 14px;
}

.superadmin-transfer-panel {
  border: 1px solid #f2c978;
  border-radius: 8px;
  background: #fff8e6;
  padding: 14px;
}

.superadmin-calendar-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.superadmin-calendar-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.superadmin-calendar-toolbar h3 {
  margin: 2px 0 4px;
  font-size: 1.35rem;
}

.superadmin-calendar-toolbar p {
  margin: 0;
  color: var(--muted);
}

.superadmin-calendar-actions {
  justify-content: flex-end;
}

.superadmin-calendar-stats {
  gap: 8px;
}

.superadmin-calendar-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.superadmin-month-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 1px;
  min-width: 924px;
  background: var(--line);
}

.superadmin-month-weekday,
.superadmin-month-day {
  background: var(--surface);
}

.superadmin-month-weekday {
  display: grid;
  min-height: 34px;
  place-items: center;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.superadmin-month-day {
  display: grid;
  min-height: 122px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  align-content: start;
  padding: 7px;
}

.superadmin-month-day.is-outside {
  background: #f7f9f5;
  color: #9aa5a8;
}

.superadmin-month-day.has-events:hover {
  background: #f5f9fc;
}

.superadmin-month-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.superadmin-month-number {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.superadmin-month-day.is-today .superadmin-month-number {
  background: var(--blue);
  color: #fff;
}

.superadmin-month-events,
.superadmin-day-list,
.superadmin-day-students {
  display: grid;
  gap: 5px;
  align-content: start;
}

.superadmin-class-event,
.superadmin-more-button {
  display: grid;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: left;
}

.superadmin-class-event span,
.superadmin-class-event small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.superadmin-class-event small {
  opacity: 0.82;
  font-size: 0.6rem;
}

.superadmin-class-event.regular {
  background: var(--green-soft);
  color: var(--green);
}

.superadmin-class-event.recovery {
  background: var(--clay-soft);
  color: var(--clay);
}

.superadmin-class-event.extra {
  background: #fff4cf;
  color: #8a5b00;
}

.superadmin-more-button {
  background: var(--surface-2);
  color: var(--muted);
}

.superadmin-day-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
}

.superadmin-day-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.superadmin-day-item-head strong {
  display: block;
}

.superadmin-day-item-head span:not(.status-pill),
.superadmin-day-students span {
  color: var(--muted);
  font-size: 0.82rem;
}

.superadmin-day-students div {
  display: grid;
  gap: 2px;
  border-left: 3px solid #cfe5d9;
  padding-left: 8px;
}

.superadmin-access-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.superadmin-access-title strong {
  display: block;
  font-size: 1rem;
}

.superadmin-access-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

.superadmin-teacher-head h3 {
  margin: 4px 0;
  font-size: 1.35rem;
}

.superadmin-teacher-head p,
.superadmin-student-main span {
  color: var(--muted);
}

.superadmin-student-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
}

.superadmin-student-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.superadmin-student-main strong,
.superadmin-student-main span {
  overflow-wrap: anywhere;
}

.empty-state.is-compact {
  padding: 12px;
}

.stat-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.student-edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.config-grid {
  display: grid;
  gap: 12px;
}

.shared-recovery-panel {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid #bed8e8;
  border-radius: var(--radius);
  background: #f2f8fc;
}

.shared-offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.shared-offer-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #cfe3ef;
  border-radius: var(--radius);
  background: #fff;
}

.shared-offer-card h4 {
  margin: 8px 0 4px;
  letter-spacing: 0;
}

.shared-offer-card p,
.shared-offer-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.shared-offer-list {
  display: grid;
  gap: 8px;
}

.shared-offer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.shared-offer-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

.message-calendar-view {
  display: grid;
  gap: 14px;
}

.message-calendar-toolbar,
.message-calendar-stats,
.message-calendar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.message-calendar-toolbar {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.message-calendar-stats {
  justify-content: flex-end;
}

.message-calendar-filters {
  justify-content: flex-start;
}

.message-calendar-filter {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  padding: 0 11px;
  font-weight: 900;
}

.message-calendar-filter b {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.76rem;
}

.message-calendar-filter.is-active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.message-calendar-filter.is-active b {
  background: var(--green);
  color: #fff;
}

.free-slot-chat {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #cde8d7;
  border-radius: var(--radius);
  background: #edf8f1;
}

.free-slot-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.free-slot-chat-head h3 {
  margin: 0;
}

.free-slot-chat-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

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

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

.free-slot-bubble.is-cancellation {
  border-color: #edc1c1;
  background: #fff6f6;
}

.free-slot-bubble.is-urgent {
  border-color: #e9b15d;
  background: #fff8e9;
}

.free-slot-bubble.is-taken {
  border-color: #a8d9c0;
  background: #edf8f1;
}

.free-slot-bubble span {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 950;
}

.free-slot-bubble.is-cancellation span {
  color: var(--danger);
}

.free-slot-bubble.is-urgent span {
  color: #9b6614;
}

.free-slot-bubble.is-taken span {
  color: var(--green);
}

.free-slot-bubble p,
.free-slot-chat-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.free-slot-chat-empty {
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.message-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.message-calendar-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.message-calendar-board {
  display: grid;
  grid-template-columns: 82px repeat(var(--day-count), minmax(164px, 1fr));
  gap: 1px;
}

.message-calendar-corner,
.message-calendar-day,
.message-calendar-time,
.message-calendar-cell {
  background: var(--surface);
}

.message-calendar-corner,
.message-calendar-time {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
}

.message-calendar-day {
  display: grid;
  gap: 2px;
  min-height: 70px;
  align-content: center;
  padding: 10px;
  border-top: 3px solid transparent;
}

.message-calendar-day.is-today {
  border-top-color: var(--blue);
}

.message-calendar-day strong {
  font-size: 1rem;
}

.message-calendar-day span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.message-calendar-time,
.message-calendar-cell {
  min-height: 148px;
}

.message-calendar-cell {
  display: grid;
  gap: 7px;
  align-content: start;
  padding: 8px;
}

.message-calendar-cell.is-empty {
  background: #f7f9f5;
}

.message-event,
.message-side-event,
.message-recovery-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.message-event {
  display: grid;
  gap: 6px;
  padding: 9px;
}

.message-event.is-unread {
  border-color: var(--blue);
}

.message-event-top,
.message-side-event div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.message-event-top span,
.message-side-event span,
.message-recovery-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.message-event-top b,
.message-side-event b {
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 2px 7px;
  font-size: 0.7rem;
}

.message-event strong,
.message-side-event strong {
  font-size: 0.9rem;
  line-height: 1.2;
}

.message-event p,
.message-side-event p,
.message-recovery-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.message-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.event-success {
  background: #edf8f1;
  border-color: #cde8d7;
}

.event-warning {
  background: var(--clay-soft);
  border-color: #efc5ad;
}

.event-danger {
  background: var(--danger-soft);
  border-color: #edc1c1;
}

.event-info {
  background: var(--blue-soft);
  border-color: #b9d7ee;
}

.event-urgent {
  background: #fff8e9;
  border-color: #e9b15d;
}

.event-dark {
  background: #eef1f2;
  border-color: #d6dcdf;
}

.event-taken {
  background: #edf8f1;
  border-color: #a8d9c0;
}

.message-side-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.message-side-head h3 {
  margin: 0;
}

.message-side-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.message-recovery-card,
.message-side-event {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.message-recovery-card {
  background: var(--clay-soft);
  border-color: #efc5ad;
}

.message-recovery-card strong {
  font-size: 1.55rem;
  line-height: 1;
}

.message-side-list {
  display: grid;
  gap: 8px;
}

.chat-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.chat-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: rgba(11, 24, 27, 0.48);
}

.chat-modal {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(680px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(11, 24, 27, 0.34);
}

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

.chat-modal-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.chat-composer {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-composer input {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.chat-modal-head > div > span,
.chat-modal-foot > span,
.chat-meta span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.chat-modal-head h3 {
  margin: 2px 0 0;
  font-size: 1.25rem;
}

.chat-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.chat-thread {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px;
  background: #f7f9f5;
}

.chat-day-divider {
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.86);
  color: var(--muted);
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 900;
}

.chat-bubble {
  display: grid;
  width: min(84%, 520px);
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 22px rgba(30, 47, 44, 0.06);
}

.chat-bubble.is-broadcast {
  align-self: flex-start;
}

.chat-bubble.is-personal {
  align-self: flex-end;
  background: #eef7ff;
  border-color: #b9d7ee;
}

.chat-bubble.is-unread {
  box-shadow: 0 0 0 2px rgba(45, 109, 163, 0.18), 0 8px 22px rgba(30, 47, 44, 0.06);
}

.chat-bubble.event-success {
  background: #edf8f1;
  border-color: #cde8d7;
}

.chat-bubble.event-warning {
  background: var(--clay-soft);
  border-color: #efc5ad;
}

.chat-bubble.event-danger {
  background: var(--danger-soft);
  border-color: #edc1c1;
}

.chat-bubble.event-info {
  background: var(--blue-soft);
  border-color: #b9d7ee;
}

.chat-bubble.event-urgent {
  background: #fff8e9;
  border-color: #e9b15d;
}

.chat-bubble.event-dark {
  background: #eef1f2;
  border-color: #d6dcdf;
}

.chat-bubble.event-taken {
  background: #edf8f1;
  border-color: #a8d9c0;
  color: var(--ink);
}

.chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-meta time {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.chat-bubble strong {
  font-size: 0.96rem;
  line-height: 1.2;
}

.chat-bubble p {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.45;
}

.chat-slot {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.76);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 850;
}

.chat-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.chat-empty {
  margin: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.78);
  color: var(--muted);
  padding: 14px;
  text-align: center;
}

.recovery-offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #efc5ad;
  border-radius: var(--radius);
  background: var(--clay-soft);
}

.recovery-offer span {
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.recovery-offer strong {
  display: block;
  margin-top: 3px;
  font-size: 1.2rem;
}

.recovery-offer p {
  margin: 5px 0 0;
  color: var(--muted);
}

.student-schedule-choice {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #cde8d7;
  border-radius: var(--radius);
  background: #edf8f1;
}

.student-schedule-choice > div {
  display: grid;
  gap: 4px;
}

.student-schedule-choice > div > span {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.student-schedule-choice strong {
  font-size: 1.05rem;
}

.student-schedule-choice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.history-view {
  display: grid;
  gap: 14px;
}

.history-summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.history-summary-row article {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.history-summary-row span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.history-summary-row strong {
  font-size: 1.35rem;
  line-height: 1;
}

.personal-calendar-panel {
  padding: 14px;
}

.personal-calendar-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.personal-calendar-toolbar h3 {
  margin: 0;
}

.personal-calendar-toolbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.personal-calendar-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}

.personal-month-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.personal-month-weekday,
.personal-month-day {
  background: var(--surface);
}

.personal-month-weekday {
  display: grid;
  min-height: 36px;
  place-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.personal-month-day {
  display: grid;
  min-height: 116px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  align-content: start;
  padding: 8px;
}

.personal-month-day.is-outside {
  background: #f7f9f5;
  color: #9aa5a8;
}

.personal-month-day.is-today .personal-month-number {
  background: var(--blue);
  color: #fff;
}

.personal-month-day.has-events {
  cursor: pointer;
}

.personal-month-day.has-events:hover {
  background: #f5f9fc;
}

.personal-month-number {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 850;
}

.personal-month-events {
  display: grid;
  gap: 4px;
  align-content: start;
}

.personal-class-event {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  padding: 3px 5px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.15;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-class-event.is-regular {
  background: var(--blue);
}

.personal-class-event.is-recovery {
  background: var(--clay);
}

.personal-class-event.is-extra {
  background: #d29618;
}

.personal-class-event.is-external {
  background: var(--green);
}

.personal-more-button {
  width: 100%;
  min-height: 20px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 900;
  text-align: left;
}

.class-detail-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}

.class-detail-modal {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(440px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(11, 24, 27, 0.34);
}

.class-detail-head,
.class-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.class-detail-head {
  border-bottom: 1px solid var(--line);
}

.class-detail-head span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.class-detail-head h3 {
  margin: 2px 0 0;
  font-size: 1.25rem;
}

.class-detail-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

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

.class-detail-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.class-detail-time-row > strong {
  font-size: 1.55rem;
  line-height: 1;
}

.class-detail-item p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.class-detail-item dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.class-detail-item dl div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
}

.class-detail-item dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.class-detail-item dd {
  margin: 0;
  font-weight: 850;
}

.class-detail-actions {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.empty-state {
  display: grid;
  min-height: 126px;
  place-items: center;
  padding: 18px;
  text-align: center;
}

.weekly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.weekly-day {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.hour-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hour-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border-radius: 999px;
  background: var(--surface-2);
  padding: 2px 7px 2px 10px;
  font-weight: 900;
}

.hour-tag button {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--danger);
  cursor: pointer;
  font-weight: 900;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

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

.app-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(30, 47, 44, 0.08);
}

.app-notice span {
  font-weight: 850;
  line-height: 1.35;
}

.app-notice.is-ok {
  border-color: #bfe4cd;
  background: #edf8f1;
  color: var(--green);
}

.app-notice.is-error {
  border-color: #f0c6c4;
  background: #fff4f4;
  color: var(--danger);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 1px solid rgba(23, 107, 93, 0.18);
  border-radius: var(--radius);
  background: #173035;
  color: #fff;
  font-weight: 800;
  line-height: 1.35;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .message-calendar-layout {
    grid-template-columns: 1fr;
  }

  .message-calendar-stats {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .auth-screen,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: auto;
    padding: 26px 20px 20px;
  }

  .auth-visual h1 {
    font-size: 3rem;
  }

  .auth-visual p {
    font-size: 1rem;
  }

  .court-card {
    width: 100%;
    max-width: 560px;
  }

  .auth-panel {
    min-height: auto;
    padding: 20px;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar .brand-logo {
    width: 156px;
  }

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

  .main {
    padding: 20px;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .auth-visual,
  .auth-panel,
  .main {
    padding: 16px;
  }

  .auth-visual {
    gap: 24px;
  }

  .auth-visual h1 {
    font-size: 2.35rem;
  }

  .auth-kicker {
    margin-bottom: 14px;
  }

  .auth-box {
    padding: 18px;
  }

  .auth-role-cards {
    grid-template-columns: 1fr;
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 12px;
  }

  .topbar h2 {
    font-size: 1.45rem;
  }

  .topbar p {
    display: none;
  }

  .app-shell.view-calendar .topbar-actions {
    display: none;
  }

  .field-grid,
  .metrics-grid,
  .superadmin-student-row,
  .student-edit-form,
  .student-data-section,
  .teacher-plan-form,
  .teacher-add-booking-form,
  .teacher-book-form {
    grid-template-columns: 1fr;
  }

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

  .student-movement-row {
    grid-template-columns: 1fr;
  }

  .teacher-student-tabs {
    margin-right: 0;
    padding-right: 0;
  }

  .teacher-student-tab {
    flex: 1 1 auto;
    padding: 9px 11px;
  }

  .sidebar {
    gap: 10px;
    padding: 12px;
  }

  .profile-block {
    padding: 10px;
  }

  .superadmin-tab {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 11px;
  }

  .superadmin-teacher-head,
  .superadmin-teacher-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .superadmin-calendar-toolbar {
    flex-direction: column;
  }

  .superadmin-calendar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
  }

  .superadmin-calendar-actions button {
    width: 100%;
  }

  .superadmin-month-board {
    grid-template-columns: repeat(7, 116px);
    min-width: 812px;
  }

  .superadmin-month-day {
    min-height: 104px;
    padding: 5px;
  }

  .superadmin-class-event,
  .superadmin-more-button {
    padding: 3px 5px;
    font-size: 0.62rem;
  }

  .superadmin-day-item-head {
    flex-direction: column;
  }

  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .student-data-section {
    padding: 12px;
  }

  .teacher-switch-form .secondary-button,
  .stack-form .primary-button,
  .stack-form .danger-button {
    width: 100%;
  }

  .button-row {
    align-items: stretch;
  }

  .button-row > button {
    flex: 1 1 140px;
  }

  .app-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .personal-calendar-toolbar,
  .calendar-toolbar {
    flex-direction: column;
  }

  .history-view {
    gap: 10px;
  }

  .history-summary-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .history-summary-row article {
    padding: 8px 6px;
  }

  .history-summary-row span {
    font-size: 0.58rem;
  }

  .history-summary-row strong {
    font-size: 1.15rem;
  }

  .personal-calendar-panel {
    padding: 10px;
  }

  .personal-calendar-toolbar,
  .calendar-toolbar {
    gap: 10px;
    margin-bottom: 10px;
  }

  .personal-calendar-toolbar .button-row,
  .calendar-period,
  .calendar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
  }

  .calendar-period .secondary-button {
    grid-column: 1 / -1;
  }

  .calendar-actions .segmented {
    width: 100%;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .calendar-period > div {
    min-width: 0;
    text-align: center;
  }

  .personal-month-weekday,
  .calendar-month-weekday {
    min-height: 28px;
    font-size: 0.68rem;
  }

  .personal-month-day,
  .calendar-month-day {
    min-height: 86px;
    gap: 4px;
    padding: 5px 3px;
  }

  .personal-month-number,
  .calendar-month-number {
    width: 22px;
    height: 22px;
    font-size: 0.72rem;
  }

  .personal-month-events,
  .calendar-month-events {
    gap: 3px;
  }

  .personal-class-event,
  .calendar-line-event {
    padding: 3px 4px;
    font-size: 0.62rem;
  }

  .personal-more-button,
  .calendar-more-button {
    min-height: 18px;
    padding: 0 4px;
    font-size: 0.6rem;
  }

  .class-detail-layer {
    align-items: end;
    padding: 10px;
  }

  .class-detail-modal {
    width: 100%;
  }

  .class-detail-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .class-detail-actions .primary-button,
  .class-detail-actions .secondary-button {
    width: 100%;
  }

  .class-detail-item .primary-button {
    width: 100%;
  }

  .message-calendar-toolbar,
  .message-calendar-stats,
  .message-calendar-filters {
    align-items: stretch;
    width: 100%;
  }

  .message-calendar-toolbar {
    padding: 12px;
  }

  .message-calendar-filter {
    flex: 1 1 130px;
    justify-content: space-between;
  }

  .free-slot-chat-head {
    flex-direction: column;
  }

  .free-slot-bubble {
    grid-template-columns: 1fr;
  }

  .chat-modal-layer {
    padding: 0;
  }

  .chat-modal {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .chat-modal-head,
  .chat-modal-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-head-actions,
  .chat-modal-foot .button-row {
    justify-content: flex-start;
  }

  .chat-composer {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .chat-thread {
    min-height: 0;
  }

  .chat-bubble {
    width: 100%;
  }

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

  .nav-button {
    justify-content: center;
    padding: 0 8px;
    text-align: center;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .calendar-toolbar,
  .calendar-period,
  .calendar-actions {
    align-items: stretch;
    width: 100%;
  }

  .calendar-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 8px;
    margin: -4px -4px 4px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }

  .calendar-view {
    gap: 8px;
  }

  .calendar-period > div,
  .calendar-actions .segmented {
    flex: 1;
  }

  .calendar-period {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px 64px;
  }

  .calendar-period > div {
    min-width: 0;
  }

  .calendar-period strong {
    font-size: 0.95rem;
  }

  .calendar-period span {
    font-size: 0.78rem;
  }

  .calendar-actions .segmented {
    width: 100%;
  }

  .chip-button {
    min-width: 0;
  }

  .calendar-legend {
    display: none;
  }

  .recovery-offer {
    padding: 12px;
  }

  .recovery-offer p {
    font-size: 0.86rem;
  }

  .schedule-wrap {
    display: none;
  }

  .mobile-agenda {
    display: grid;
    gap: 10px;
  }

  .mobile-day-section {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 10px 26px rgba(30, 47, 44, 0.06);
  }

  .mobile-day-section.is-today {
    border-color: var(--blue);
  }

  .mobile-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: #fffefa;
  }

  .mobile-day-header div {
    display: grid;
    gap: 1px;
  }

  .mobile-day-header strong {
    font-size: 1rem;
  }

  .mobile-day-header span,
  .mobile-day-header em {
    color: var(--muted);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 850;
  }

  .mobile-day-header em {
    text-align: right;
  }

  .mobile-slot-list {
    display: grid;
    gap: 8px;
    padding: 10px;
  }

  .mobile-slot-list .schedule-slot {
    min-height: auto;
    gap: 6px;
    padding: 10px;
  }

  .mobile-day-empty {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 850;
  }

  .slot-card {
    gap: 7px;
    padding: 10px;
    border-radius: 8px;
  }

  .slot-card-date {
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 950;
    text-transform: uppercase;
  }

  .slot-topline {
    gap: 8px;
  }

  .slot-time {
    font-size: 1.05rem;
  }

  .dot {
    width: 7px;
    height: 7px;
  }

  .slot-meta {
    font-size: 0.76rem;
  }

  .booking-row {
    padding: 7px;
  }

  .slot-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .slot-actions .primary-button,
  .slot-actions .secondary-button,
  .slot-actions .danger-button {
    width: 100%;
    min-height: 34px;
  }

  .slot-actions .pill {
    justify-content: center;
  }

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

  .shared-offer-card,
  .shared-offer-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 72px minmax(0, 1fr) 44px;
  }
}
