﻿.schedule-page .crm-container {
  max-width: 1500px;
  margin: 0 auto;
}

@media (min-width: 1366px) {
  .schedule-page .crm-container {
    max-width: min(1980px, calc(100vw - 24px));
  }
}

.card-shell {
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01)),
    rgba(10,10,10,0.35);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.schedule-main {
  padding: 16px;
}

.schedule-main h2 {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

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

.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#monthTitle {
  min-width: 220px;
  text-align: center;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.schedule-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.schedule-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.schedule-legend__dot--single {
  background: rgba(214, 178, 40, 0.9);
}

.schedule-legend__dot--individual {
  background: rgba(40, 160, 210, 0.9);
}

.schedule-legend__dot--group {
  background: rgba(130, 80, 220, 0.9);
}

.schedule-legend__dot--rental {
  background: rgba(230, 80, 170, 0.9);
}

.client-filter-wrap {
  display: grid;
  gap: 6px;
  min-width: 320px;
}

.client-filter-wrap span {
  color: var(--muted);
  font-size: 12px;
}

.client-filter-mode {
  display: flex;
  gap: 6px;
}

.client-chip {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  padding: 0 10px;
  height: 30px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.client-chip.is-active {
  background: linear-gradient(180deg, var(--red-2), var(--red));
  border-color: rgba(214, 70, 61, 0.8);
}

.client-filter-select-wrap {
  min-width: 160px;
}

.client-filter-select-wrap .cs-wrap,
.client-filter-select-wrap select {
  width: 100%;
}

.combined-filter-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 3px 6px;
}

.combined-filter-wrap .client-filter-select-wrap {
  min-width: 120px;
}

.combined-filter-wrap .client-filter-select-wrap .cs-trigger,
.combined-filter-wrap .client-filter-select-wrap select {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 3px 4px;
  font-size: 12px;
  height: 28px;
  min-height: unset;
}

.combined-filter-wrap .filter-divider {
  width: 1px;
  height: 16px;
  background: var(--stroke);
  flex-shrink: 0;
}

.schedule-page .db-toolbar__center {
  flex: 1 1 auto;
  max-width: none;
  min-width: 0;
}

.schedule-page .db-search-wrap {
  flex: 1 1 360px;
  max-width: 520px;
}

.schedule-topbar-filters {
  flex: 1 1 560px;
  min-width: 420px;
  max-width: 760px;
  height: 30px;
  padding: 2px 5px;
  border-radius: 9px;
  background: rgba(255,255,255,0.025);
}

.schedule-topbar-filters .client-chip {
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

.schedule-topbar-filters .client-filter-select-wrap {
  min-width: 0;
  flex: 1 1 0;
}

.schedule-topbar-filters .cs-wrap,
.schedule-topbar-filters select {
  min-width: 0;
}

.schedule-topbar-filters .cs-trigger {
  min-width: 0;
}

/* An empty filter is disabled until matching schedule values exist. Keep its
   surface consistent with the neighboring filters instead of fading the
   whole control into the black toolbar background. */
.schedule-topbar-filters .cs-trigger--disabled,
.schedule-topbar-filters .app-custom-select.is-disabled {
  opacity: 1;
}

.schedule-topbar-filters .cs-label,
.schedule-topbar-filters .cs-placeholder {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-stats {
  margin-bottom: 12px;
  border: 1px solid var(--stroke-soft);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.schedule-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

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

.schedule-status {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.lesson-modal-box {
  max-width: 860px;
}

.lesson-modal-hint {
  margin: 6px 0 14px;
  color: var(--muted);
}

.lesson-teacher-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lesson-teacher-hint {
  font-size: 11px;
  color: var(--muted);
  padding-left: 4px;
  min-height: 14px;
}

.lesson-teacher-hint.is-substitute {
  color: rgba(220, 160, 0, 0.9);
}

.lesson-form-grid select,
.lesson-form-grid input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
}

.lesson-form-grid .cs-wrap {
  width: 100%;
}

.lesson-form-grid .cs-trigger {
  min-height: 44px !important;
  padding: 10px 36px 10px 12px !important;
  border-radius: 12px !important;
  border-color: var(--stroke) !important;
  background: rgba(0, 0, 0, 0.35) !important;
}

.lesson-form-grid .cs-trigger .cs-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 12px;
}

.day-modal-edit-fields .cs-wrap {
  width: 100%;
}

.day-modal-edit-fields .cs-trigger {
  min-height: 34px !important;
  padding: 6px 30px 6px 8px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  font-size: 13px !important;
}

.day-modal-edit-fields .cs-trigger .cs-icon {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  font-size: 10px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays {
  margin-bottom: 8px;
}

.calendar-weekdays span {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.day-cell {
  min-height: 140px;
  border: 1px solid var(--stroke-soft);
  border-radius: 14px;
  padding: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
  background: rgba(0, 0, 0, 0.22);
  display: grid;
  gap: 6px;
  align-content: start;
  cursor: pointer;
  overflow: hidden;
}

.day-cell:not(.day-cell-empty-state):not(.is-outside):hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.13);
}

.day-cell.day-cell-empty-state {
  border-color: rgba(36, 40, 46, 0.95) !important;
  box-shadow: none !important;
}

.day-cell.day-load-green:not(.is-future) {
  box-shadow: inset 0 0 0 1px rgba(67, 171, 85, 0.5);
}

.day-cell.day-load-yellow:not(.is-future) {
  box-shadow: inset 0 0 0 1px rgba(214, 165, 46, 0.55);
}

.day-cell.day-cell-client-focus {
  box-shadow: inset 0 0 0 2px rgba(67, 171, 85, 0.9);
}

.day-cell.day-cell-client-empty {
  box-shadow: inset 0 0 0 1px rgba(64, 68, 76, 0.8);
}

.day-cell.intent-blink {
  animation: intent-day-blink 1.05s ease-in-out 3;
}

@keyframes intent-day-blink {
  0%, 100% { transform: none; }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(60, 190, 90, 0.92),
      0 0 0 3px rgba(67, 171, 85, 0.22);
  }
}

.day-modal-free-slots {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.day-modal-free-slots__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-modal-free-slots__chips button {
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(38, 125, 60, 0.22);
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
}

.day-cell.is-outside {
  opacity: 0.32;
}

.day-cell.is-today {
  background: rgba(194, 53, 43, 0.1) !important;
  border-color: rgba(194, 53, 43, 0.32) !important;
  z-index: 2;
}

.day-number {
  font-weight: 700;
}

.day-cell.is-today .day-number {
  font-weight: 900;
  font-size: 1.15em;
  color: rgba(214, 70, 61, 0.95);
}

.lesson-chip {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-left: 2px solid rgba(194, 53, 43, 0.7);
  padding: 6px 6px 6px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.lesson-chip__time {
  font-weight: 700;
  margin-bottom: 3px;
}

.lesson-chip__meta,
.lesson-chip__note {
  color: rgba(255, 255, 255, 0.72);
}

.lesson-chip--single {
  border-left-color: rgba(230, 190, 50, 0.85);
}

.lesson-chip--individual {
  border-left-color: rgba(60, 180, 230, 0.85);
}

.lesson-chip--rental {
  border-left-color: rgba(230, 80, 170, 0.85);
}

.lesson-chip--group-session {
  border-left-color: rgba(130, 80, 220, 0.85);
}

.lesson-chip--group-session .lesson-chip__time {
  color: rgba(170, 120, 255, 0.95);
}

.rental-modal-box {
  max-width: 680px;
}

.rental-modal-duration {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  grid-column: 1 / -1;
}

.rental-price-display {
  margin-left: auto;
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.rental-rate-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  font-style: italic;
}

.day-modal-box {
  max-width: min(1160px, calc(100vw - 64px));
  position: relative;
}

.day-modal-head {
  margin-bottom: 8px;
}

.day-modal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.day-modal-nav-arrows {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.day-modal-nav h2 {
  margin: 0;
  flex: 1;
  text-align: center;
}
.day-modal-nav-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.75);
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.day-modal-nav-btn:hover {
  background: rgba(255,255,255,0.13);
  color: #fff;
}

.day-modal-list {
  display: grid;
  gap: 8px;
  max-height: 70vh;
  overflow: auto;
}

.day-modal-item {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.28);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 386px);
  gap: 6px 14px;
  align-items: start;
}

.day-modal-item__top {
  display: contents;
}

.day-modal-item__head-left {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.day-modal-item__time {
  font-weight: 700;
  line-height: 1.15;
}

.day-modal-item__title {
  font-weight: 700;
  line-height: 1.18;
}

.day-modal-item__room-icon {
  font-size: 15px;
  line-height: 1;
  margin-top: 2px;
}

.day-modal-item__room-icon:empty {
  display: none;
}

.day-modal-meta {
  display: grid;
  gap: 4px;
  grid-column: 1;
}

.day-modal-meta__row {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  line-height: 1.2;
}

.day-modal-icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  font-size: 10px;
}

.day-modal-completed-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(67, 171, 85, 0.24);
  border-radius: 17px;
  background: rgba(67, 171, 85, 0.1);
  color: rgba(236, 248, 239, 0.88);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  user-select: none;
  min-width: 132px;
  box-sizing: border-box;
  grid-column: 2;
  justify-self: end;
}

.day-modal-completed-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  display: inline-grid;
  place-content: center;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}

.day-modal-completed-toggle input[type="checkbox"]::before {
  content: "";
  width: 8px;
  height: 8px;
  transform: scale(0);
  transition: transform 0.14s ease-in-out;
  clip-path: polygon(14% 44%, 0 59%, 42% 100%, 100% 18%, 84% 4%, 41% 69%);
  background: #09140d;
}

.day-modal-completed-toggle input[type="checkbox"]:checked {
  border-color: rgba(79, 201, 110, 0.92);
  background: linear-gradient(180deg, rgba(95, 220, 126, 0.95), rgba(67, 171, 85, 0.96));
  box-shadow: 0 0 0 2px rgba(67, 171, 85, 0.22);
}

.day-modal-completed-toggle input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.day-modal-completed-toggle input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(67, 171, 85, 0.3);
}

.day-modal-completed-toggle input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.day-modal-item__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 0;
  grid-column: 2;
  align-self: end;
}

.day-modal-item__actions .panel-action-btn {
  min-width: 132px;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.day-modal-delete-btn {
  border-color: rgba(194, 53, 43, 0.32) !important;
  background: rgba(194, 53, 43, 0.14) !important;
}

.day-modal-item--single {
  border-left: 2px solid rgba(230, 190, 50, 0.85);
}

.day-modal-item--individual {
  border-left: 2px solid rgba(60, 180, 230, 0.85);
}

.day-modal-item--rental {
  border-left: 2px solid rgba(230, 80, 170, 0.85);
}

.day-modal-item--group {
  border-left: 2px solid rgba(130, 80, 220, 0.85);
}

.day-modal-item--draft {
  background: rgba(214, 158, 46, 0.12);
  border: 1.5px dashed rgba(214, 158, 46, 0.55);
}

.day-modal-item--draft .day-modal-item__time,
.day-modal-item--draft .day-modal-item__title {
  color: rgba(214, 158, 46, 0.95);
}

.day-modal-item--draft .day-modal-meta__row {
  color: rgba(214, 178, 80, 0.85);
}

.day-modal-item--completed {
  opacity: 0.82;
}

.day-modal-item--completed .day-modal-item__time,
.day-modal-item--completed .day-modal-item__title,
.day-modal-item--completed .day-modal-meta__row span:last-child {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(255,255,255,0.42);
}

.day-modal-item--group .day-modal-item__body {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 2px;
  grid-column: 1 / -1;
}

.day-modal-body-divider {
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
  align-self: stretch;
  margin: 0 14px;
  flex-shrink: 0;
}

.day-modal-attendance {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.day-modal-attendance__student {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 2px 0;
  user-select: none;
}

.day-modal-attendance__student input[type="checkbox"] {
  width: 14px;
  height: 14px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  display: inline-grid;
  place-content: center;
  transition: border-color 0.18s, background 0.18s;
  cursor: pointer;
  flex-shrink: 0;
}

.day-modal-attendance__student input[type="checkbox"]::before {
  content: "";
  width: 8px;
  height: 8px;
  transform: scale(0);
  transition: transform 0.14s ease-in-out;
  clip-path: polygon(14% 44%, 0 59%, 42% 100%, 100% 18%, 84% 4%, 41% 69%);
  background: #09140d;
}

.day-modal-attendance__student input[type="checkbox"]:checked {
  border-color: rgba(79, 201, 110, 0.92);
  background: linear-gradient(180deg, rgba(95, 220, 126, 0.95), rgba(67, 171, 85, 0.96));
}

.day-modal-attendance__student input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.day-modal-attendance__loading,
.day-modal-attendance__empty {
  font-size: 12px;
  opacity: 0.4;
  padding: 2px 0;
}

.lesson-chip--draft {
  background: rgba(214, 158, 46, 0.12);
  border: 1.5px dashed rgba(214, 158, 46, 0.55);
  opacity: 0.85;
  pointer-events: none;
}

.lesson-chip--draft .lesson-chip__time {
  color: rgba(214, 158, 46, 0.95);
}

.lesson-chip--completed {
  opacity: 0.7;
  border-left-color: rgba(54, 167, 84, 0.85);
}

.lesson-chip--completed .lesson-chip__time,
.lesson-chip--completed .lesson-chip__meta,
.lesson-chip--completed > div:nth-child(2) {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(255,255,255,0.45);
}

.day-cell__empty {
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
}

.day-cell__more {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
}

/* ── Drag and drop ────────────────────────────────────── */
.day-cell {
  cursor: grab;
}
.day-cell:active {
  cursor: grabbing;
}
.day-cell.is-dragging {
  opacity: 0.4;
  outline: 2px dashed rgba(194, 53, 43, 0.6);
}
.day-cell.drag-over {
  outline: 2px solid rgba(194, 53, 43, 0.8);
  background: rgba(194, 53, 43, 0.12);
}

/* ── Day-transfer modal ───────────────────────────────── */
.day-transfer-modal-box {
  max-width: 680px;
}

.day-transfer-lesson-list {
  display: grid;
  gap: 10px;
  max-height: 55vh;
  overflow: auto;
  margin-bottom: 4px;
}

.day-transfer-bulk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px 2px;
}
.day-transfer-bulk-label {
  font-size: 12px;
  opacity: 0.55;
  margin-right: 4px;
}

.schedule-page .modal .day-transfer-bulk-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 9px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(13, 13, 13, 0.92) !important;
  color: rgba(235, 235, 235, 0.82) !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transform: none !important;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.schedule-page .modal .day-transfer-bulk-btn:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.018)),
    rgba(16, 16, 16, 0.96) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

.schedule-page .modal .day-transfer-bulk-copy {
  border-color: rgba(74, 190, 118, 0.22) !important;
  color: rgba(211, 235, 217, 0.9) !important;
}

.schedule-page .modal .day-transfer-bulk-copy.is-active {
  background:
    linear-gradient(180deg, rgba(74, 190, 118, 0.075), rgba(255,255,255,0.014)),
    rgba(13, 13, 13, 0.95) !important;
  border-color: rgba(74, 190, 118, 0.42) !important;
  color: rgba(235, 255, 241, 0.96) !important;
  box-shadow: inset 0 0 0 1px rgba(74, 190, 118, 0.06) !important;
}

.day-transfer-confirm-copy {
  background:
    linear-gradient(180deg, rgba(74, 190, 118, 0.14), rgba(74, 190, 118, 0.045)),
    rgba(12, 12, 12, 0.78) !important;
  border-color: rgba(74, 190, 118, 0.46) !important;
  color: rgba(235, 255, 241, 0.96) !important;
  box-shadow: 0 0 0 1px rgba(74, 190, 118, 0.08) inset !important;
}

.schedule-page .modal .day-transfer-bulk-transfer {
  border-color: rgba(214, 70, 61, 0.22) !important;
  color: rgba(238, 216, 213, 0.9) !important;
}

.schedule-page .modal .day-transfer-bulk-transfer.is-active {
  background:
    linear-gradient(180deg, rgba(214, 70, 61, 0.075), rgba(255,255,255,0.014)),
    rgba(13, 13, 13, 0.95) !important;
  border-color: rgba(214, 70, 61, 0.42) !important;
  color: rgba(255, 238, 235, 0.96) !important;
  box-shadow: inset 0 0 0 1px rgba(214, 70, 61, 0.06) !important;
}

.day-transfer-confirm-transfer {
  background: linear-gradient(180deg, rgba(214, 70, 61, 0.22), rgba(214, 70, 61, 0.085)) !important;
  border-color: rgba(214, 70, 61, 0.48) !important;
  color: rgba(255, 238, 235, 0.96) !important;
}

.day-transfer-lesson-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
}

.day-transfer-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.day-transfer-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--red);
  cursor: pointer;
}

.day-transfer-time-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--muted);
}

.day-transfer-time-wrap input[type="time"] {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
}

.day-transfer-lesson-item .cs-wrap {
  flex-shrink: 0;
  min-width: 120px;
}

.day-transfer-lesson-item .cs-trigger {
  min-height: 36px !important;
  padding: 6px 34px 6px 12px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
}

.day-transfer-action-copy .cs-trigger,
.day-transfer-action-select.is-copy {
  border-color: rgba(74, 190, 118, 0.34) !important;
  color: rgba(222, 246, 229, 0.94) !important;
}

.day-transfer-action-transfer .cs-trigger,
.day-transfer-action-select.is-transfer {
  border-color: rgba(214, 70, 61, 0.36) !important;
  color: rgba(255, 218, 214, 0.92) !important;
}

.day-modal-delete-btn {
  font-size: 12px;
  padding: 3px 10px;
  flex-shrink: 0;
  opacity: 0.6;
  color: rgba(214, 70, 61, 0.9);
  border-color: rgba(214, 70, 61, 0.4);
}
.day-modal-delete-btn:hover {
  opacity: 1;
  border-color: rgba(214, 70, 61, 0.8);
}

.confirm-modal {
  z-index: 140;
  background:
    radial-gradient(circle at 50% 40%, rgba(194, 53, 43, 0.13), transparent 32%),
    rgba(0, 0, 0, 0.76);
}

.confirm-modal-box {
  max-width: 460px;
  padding: 24px;
  gap: 16px;
  overflow: visible;
  border-color: rgba(214, 70, 61, 0.26);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015)),
    rgba(16, 13, 13, 0.98);
  box-shadow:
    0 34px 100px rgba(0,0,0,0.65),
    0 0 0 1px rgba(214, 70, 61, 0.08) inset,
    0 0 50px rgba(194, 53, 43, 0.09);
}

.confirm-modal-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #ffd7cf;
  font-family: inherit;
  font-size: 24px;
  font-weight: 900;
  background:
    linear-gradient(180deg, rgba(214,70,61,0.28), rgba(214,70,61,0.12)),
    rgba(255,255,255,0.04);
  border: 1px solid rgba(214,70,61,0.34);
  box-shadow: 0 14px 34px rgba(194,53,43,0.18);
}

.confirm-modal-box h2 {
  margin-bottom: 6px;
  font-size: clamp(28px, 3vw, 40px);
}

.confirm-modal-message {
  margin: 0;
  color: rgba(255,255,255,0.72);
  font-size: 15px;
  line-height: 1.5;
}

.confirm-modal-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
}

.confirm-modal-checkbox-row input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.confirm-modal-actions {
  justify-content: flex-end;
  margin-top: 6px;
}

.confirm-modal-actions button {
  min-width: 116px;
}

/* ── Day modal edit form ──────────────────────────────── */
.day-modal-item__top {
  align-items: flex-start;
  gap: 8px;
}
.day-modal-edit-btn {
  font-size: 12px;
  padding: 3px 10px;
  flex-shrink: 0;
  opacity: 0.75;
}
.day-modal-edit-btn:hover {
  opacity: 1;
}
.day-modal-edit-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  grid-column: 1 / -1;
}
.day-modal-edit-form.hidden {
  display: none;
}
.day-modal-edit-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.day-modal-edit-fields label {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 4px;
}
.day-modal-edit-fields input,
.day-modal-edit-fields select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
  box-sizing: border-box;
}
.day-modal-edit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.day-modal-loop-btn {
  border-color: rgba(218, 172, 64, 0.34) !important;
  background: rgba(218, 172, 64, 0.16) !important;
  color: rgba(255, 232, 174, 0.96) !important;
}

.day-modal-loop-btn:hover {
  border-color: rgba(218, 172, 64, 0.5) !important;
  background: rgba(218, 172, 64, 0.26) !important;
}

.schedule-loop-mode-select {
  height: 28px;
  min-width: 150px;
  max-width: 220px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(218, 172, 64, 0.28);
  background: rgba(22, 24, 20, 0.88);
  color: rgba(255, 232, 174, 0.96);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
}

.schedule-loop-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.schedule-loop-controls.hidden {
  display: none !important;
}

.schedule-loop-count-input {
  width: 56px;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(218, 172, 64, 0.28);
  background: rgba(22, 24, 20, 0.88);
  color: rgba(255, 232, 174, 0.96);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.schedule-loop-count-input.hidden {
  display: none !important;
}

.schedule-loop-mode-select.hidden {
  display: none !important;
}

.day-modal-edit-actions .schedule-loop-controls {
  flex: 1 1 150px;
}

.day-modal-date-confirm__label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  width: 100%;
  margin-bottom: 2px;
}

.schedule-page .modal .day-modal-date-copy-btn {
  background:
    linear-gradient(180deg, rgba(74, 190, 118, 0.14), rgba(74, 190, 118, 0.045)),
    rgba(12, 12, 12, 0.78) !important;
  border: 1px solid rgba(74, 190, 118, 0.46) !important;
  color: rgba(235, 255, 241, 0.96) !important;
  box-shadow: 0 0 0 1px rgba(74, 190, 118, 0.08) inset !important;
}

.schedule-page .modal .day-modal-date-transfer-btn {
  background:
    linear-gradient(180deg, rgba(214, 70, 61, 0.14), rgba(214, 70, 61, 0.045)),
    rgba(12, 12, 12, 0.78) !important;
  border: 1px solid rgba(214, 70, 61, 0.46) !important;
  color: rgba(255, 238, 235, 0.96) !important;
  box-shadow: 0 0 0 1px rgba(214, 70, 61, 0.08) inset !important;
}

@media (max-width: 840px) {
  .schedule-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-right {
    flex-direction: column;
    align-items: stretch;
  }

  .client-filter-wrap {
    min-width: 0;
  }

  #monthTitle {
    min-width: 0;
    width: 100%;
  }

  .schedule-stats {
    grid-template-columns: 1fr;
  }

  .day-cell {
    min-height: 120px;
  }

  .day-modal-box {
    max-width: calc(100vw - 24px);
  }

  .day-modal-list {
    max-height: 66vh;
  }

  .day-modal-item {
    display: block;
    padding: 9px 10px;
  }

  .day-modal-item__top {
    display: flex;
    margin-bottom: 8px;
  }

  .day-modal-meta {
    display: grid;
  }

  .day-modal-completed-toggle,
  .day-modal-item__actions,
  .day-modal-edit-form {
    grid-column: auto;
  }

  .day-modal-item__actions {
    margin-top: 8px;
  }
}

/* ── Mobile calendar: horizontal scroll so cells fit events ── */
@media (max-width: 600px) {
  .schedule-main {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-left: 0;
    padding-right: 0;
  }

  .schedule-toolbar,
  .schedule-stats,
  .schedule-status {
    padding-left: 14px;
    padding-right: 14px;
  }

  .calendar-weekdays,
  .calendar-grid {
    grid-template-columns: repeat(7, 86px);
    min-width: calc(7 * 86px + 6 * 8px);
    padding-left: 14px;
    padding-right: 14px;
    padding-bottom: 6px;
  }

  .day-cell {
    min-height: 110px;
    padding: 6px;
    gap: 4px;
  }

  .lesson-chip {
    padding: 4px 5px;
    font-size: 11px;
    border-radius: 8px;
  }

  .lesson-chip__time {
    font-size: 11px;
    margin-bottom: 2px;
  }
}

/* ── Schedule modal visual upgrade ───────────────────── */
.schedule-page .lesson-modal-box,
.schedule-page .rental-modal-box,
.schedule-page .day-modal-box,
.schedule-page .day-transfer-modal-box {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(1200px 240px at -10% -25%, rgba(214, 70, 61, 0.12), transparent 65%),
    radial-gradient(900px 220px at 110% -40%, rgba(255, 255, 255, 0.06), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)),
    rgba(10, 10, 10, 0.96);
  box-shadow:
    0 36px 100px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255,255,255,0.04) inset;
}

.schedule-page .lesson-modal-box h2,
.schedule-page .rental-modal-box h2,
.schedule-page .day-modal-box h2,
.schedule-page .day-transfer-modal-box h2 {
  font-size: clamp(28px, 3vw, 42px);
}

.schedule-page .modal.show .lesson-modal-box,
.schedule-page .modal.show .rental-modal-box,
.schedule-page .modal.show .day-modal-box,
.schedule-page .modal.show .day-transfer-modal-box {
  animation: scheduleModalIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes scheduleModalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.lesson-form-grid input,
.lesson-form-grid .cs-trigger {
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.lesson-form-grid input:hover,
.lesson-form-grid .cs-trigger:hover {
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.lesson-form-grid input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}

.schedule-time-stepper {
  position: relative;
  min-width: 0;
}

.schedule-time-stepper input {
  width: 100%;
  padding-right: 48px;
}

.schedule-time-stepper__controls {
  position: absolute;
  top: 50%;
  right: 2px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  width: 42px;
  height: 34px;
  box-sizing: border-box;
  padding: 8px 16px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
}

.schedule-time-stepper__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 12px;
  height: 10px;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  appearance: none;
}

.schedule-time-stepper__btn::before {
  content: "";
  width: 5px;
  height: 5px;
  border-top: 1.5px solid rgba(255, 255, 255, 0.62);
  border-left: 1.5px solid rgba(255, 255, 255, 0.62);
}

.schedule-time-stepper__btn:first-child::before {
  transform: translateY(2px) rotate(45deg);
}

.schedule-time-stepper__btn:last-child::before {
  transform: translateY(-2px) rotate(225deg);
}

.schedule-time-stepper__btn:hover {
  background: transparent !important;
}

.schedule-time-stepper__btn:hover::before {
  border-color: rgba(255, 255, 255, 1);
}

#lessonModalNote,
#rentalModalNote,
.rental-modal-duration,
.rental-rate-row {
  grid-column: 1 / -1;
}

.rental-modal-box .paired-field .paired-label {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.rental-rate-row {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 10px 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)),
    rgba(0, 0, 0, 0.28);
}

.rental-discount-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
}

.rental-discount-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.rental-discount-pill:has(input:checked) {
  border-color: rgba(214, 165, 46, 0.62);
  background: rgba(214, 165, 46, 0.18);
  color: rgba(255, 232, 174, 0.96);
}

.rental-discount-pill input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: #d6a52e;
}

.day-modal-list,
.day-transfer-lesson-list {
  padding-right: 4px;
}

.day-modal-item {
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.day-modal-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.day-transfer-lesson-item {
  transition: border-color 0.18s ease, background 0.18s ease;
}

.day-transfer-lesson-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.day-modal-edit-fields input:focus,
.day-modal-edit-fields select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}

.schedule-page .day-modal-list::-webkit-scrollbar,
.schedule-page .day-transfer-lesson-list::-webkit-scrollbar {
  width: 8px;
}

.schedule-page .day-modal-list::-webkit-scrollbar-thumb,
.schedule-page .day-transfer-lesson-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

@media (max-width: 840px) {
  .lesson-form-grid {
    grid-template-columns: 1fr;
  }

  .rental-modal-duration {
    grid-template-columns: 1fr;
  }

  .rental-rate-row {
    flex-wrap: wrap;
    gap: 12px;
  }

  .rental-price-display {
    margin-left: 0;
    width: 100%;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .schedule-page .modal.show .lesson-modal-box,
  .schedule-page .modal.show .rental-modal-box,
  .schedule-page .modal.show .day-modal-box,
  .schedule-page .modal.show .day-transfer-modal-box {
    animation: none;
  }
}

/* ─── Planning mode panel (fixed bottom bar) ─────────────────────────────── */

.planning-mode-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.97);
  border-top: 1px solid rgba(67, 171, 85, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.6);
}

.planning-mode-panel.hidden {
  display: none;
}

.planning-mode-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 12px 18px 14px;
}

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

.planning-mode-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.planning-mode-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(67, 171, 85, 0.22);
  border: 1px solid rgba(67, 171, 85, 0.4);
  color: rgba(120, 210, 130, 0.95);
}

.planning-mode-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-mode-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.planning-draft-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 28px;
}

.planning-draft-empty {
  font-size: 13px;
  color: var(--muted);
}

.planning-draft-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(67, 171, 85, 0.35);
  background: rgba(38, 125, 60, 0.18);
  font-size: 13px;
  color: var(--text);
}

.planning-draft-item__time {
  font-weight: 500;
}

.planning-draft-item__remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}

.planning-draft-item__remove:hover {
  color: rgba(214, 70, 61, 0.9);
}

/* Body padding when planning panel is visible */
body.planning-mode-active {
  padding-bottom: 110px;
}

/* ─── Day modal: planning time-entry section ─────────────────────────────── */

.day-modal-planning-section {
  position: sticky;
  top: 0;
  z-index: 10;
  margin-bottom: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(67, 171, 85, 0.28);
  border-radius: 8px;
  background: rgba(12, 35, 18, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.day-modal-planning-section.hidden {
  display: none;
}

.day-modal-planning-section.hidden {
  display: none;
}

.day-modal-planning-title {
  display: none;
}

.day-modal-planning-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.planning-duration-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* Planning mode: highlight near-future days stronger */
.planning-mode-active .day-cell.day-load-green {
  box-shadow: inset 0 0 0 1.5px rgba(67, 171, 85, 0.65);
}
.planning-mode-active .day-cell.day-load-yellow {
  box-shadow: inset 0 0 0 1.5px rgba(214, 165, 46, 0.7);
}

/* ── Planning form inputs ───────────────────────────── */
.day-modal-planning-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.planning-duration-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.planning-sep {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}

.planning-add-btn {
  margin-left: auto;
  height: 28px;
  padding: 0 12px;
  background: rgba(67, 171, 85, 0.2);
  border: 1px solid rgba(67, 171, 85, 0.4);
  color: #7dd99a;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, border-color 0.18s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.planning-add-btn:hover {
  background: rgba(67, 171, 85, 0.32);
  border-color: rgba(67, 171, 85, 0.6);
}

.planning-add-btn--loop {
  margin-left: 0;
  background: rgba(218, 172, 64, 0.16);
  border-color: rgba(218, 172, 64, 0.34);
  color: rgba(255, 232, 174, 0.96);
}

.planning-add-btn--loop:hover {
  background: rgba(218, 172, 64, 0.26);
  border-color: rgba(218, 172, 64, 0.5);
}

.day-modal-planning-form .schedule-loop-controls {
  flex: 0 1 180px;
}

.waiting-add-planning-btn {
  margin-left: auto;
  height: 24px;
  padding: 0 10px;
  background: rgba(214, 165, 46, 0.15);
  border: 1px solid rgba(214, 165, 46, 0.35);
  color: #d6a52e;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, border-color 0.18s;
  white-space: nowrap;
}
.waiting-add-planning-btn:hover {
  background: rgba(214, 165, 46, 0.28);
  border-color: rgba(214, 165, 46, 0.6);
}

.planning-input {
  height: 28px;
  padding: 0 8px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(76,175,130,0.25);
  color: #fff;
  border-radius: 7px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
  color-scheme: dark;
  width: 80px;
  flex: 0 0 80px;
  min-width: 0;
}
.planning-input--sm {
  flex: 0 0 36px;
  width: 36px;
  text-align: center;
  padding: 0 4px;
}
.planning-input:hover {
  border-color: rgba(76,175,130,0.35);
}
.planning-input:focus {
  border-color: rgba(76,175,130,0.55);
  box-shadow: 0 0 0 3px rgba(76,175,130,0.1);
}
.planning-input::-webkit-inner-spin-button,
.planning-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
}

/* ── Waiting zone (inline inside schedule card) ─────────── */
.waiting-zone {
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.18);
}

.waiting-zone__header {
  margin-bottom: 8px;
}

.waiting-zone__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.waiting-zone__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(240, 190, 60, 0.85);
}

.waiting-zone__badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  background: rgba(214, 165, 46, 0.22);
  border: 1px solid rgba(214, 165, 46, 0.4);
  color: rgba(240, 190, 60, 0.95);
}

.waiting-zone__badge.hidden {
  display: none;
}

.waiting-zone__hint {
  font-size: 12px;
  color: var(--muted);
}

.waiting-zone__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  align-items: center;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.waiting-zone__list.drag-over {
  border-color: rgba(214, 165, 46, 0.6);
  background: rgba(214, 165, 46, 0.07);
}

.waiting-zone__empty {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.28);
}

.waiting-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 32px 9px 12px;
  border: 1px solid rgba(214, 165, 46, 0.35);
  border-radius: 12px;
  background: rgba(214, 165, 46, 0.1);
  cursor: grab;
  width: 190px;
  flex: 0 0 190px;
  position: relative;
  transition: border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.waiting-card:active {
  cursor: grabbing;
}

.waiting-card.is-dragging {
  opacity: 0.4;
}

.waiting-card:hover {
  border-color: rgba(214, 165, 46, 0.6);
  background: rgba(214, 165, 46, 0.18);
}

.waiting-card__name,
.waiting-card__meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.waiting-card__name {
  font-weight: 700;
  font-size: 13px;
}

.waiting-card__meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.waiting-card__date {
  font-size: 11px;
  color: rgba(214, 165, 46, 0.75);
  margin-top: 2px;
}

.waiting-card__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 5px;
  transition: color 0.15s ease, background 0.15s ease;
}

.waiting-card__remove:hover {
  color: rgba(214, 70, 61, 0.9);
  background: rgba(214, 70, 61, 0.12);
}

.lesson-chip--dimmed {
  opacity: 0.32;
  filter: grayscale(0.6);
  pointer-events: none;
}
.day-cell__more--dimmed {
  opacity: 0.32;
}

.day-modal-item__time--editable {
  cursor: pointer;
  border-radius: 6px;
  padding: 1px 4px;
  margin: -1px -4px;
  transition: background 0.15s ease;
}
.day-modal-item__time--editable:hover {
  background: rgba(255,255,255,0.08);
}
.day-modal-item__time--editable::after {
  content: " ✎";
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.day-modal-item__time--editable:hover::after {
  opacity: 0.5;
}

.calendar-weekdays span:nth-child(6),
.calendar-weekdays span:nth-child(7) {
  color: rgba(255, 255, 255, 0.38);
}

/* ── Month stat chips (inline in toolbar) ─────────────── */
.month-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  padding: 0 10px;
  border-left: 1px solid var(--stroke);
  height: 28px;
}

.month-stat-chip strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.month-stat-chip--rental strong {
  color: rgba(235, 100, 190, 0.95);
}

/* ── Waiting zone: collapse when empty ────────────────── */
.waiting-zone:has(.waiting-zone__empty:only-child) {
  padding: 5px 12px;
  background: transparent;
  border-color: transparent;
  margin-bottom: 6px;
}

.waiting-zone:has(.waiting-zone__empty:only-child) .waiting-zone__header {
  margin-bottom: 0;
}

.waiting-zone:has(.waiting-zone__empty:only-child) .waiting-zone__hint,
.waiting-zone:has(.waiting-zone__empty:only-child) .waiting-zone__list {
  display: none;
}

/* ── Dashboard-style split schedule ───────────────────── */
/* A real grid (not position:fixed + vw math) so both blocks remain aligned
   at every interface density. JS overwrites grid-template-columns directly
   while dragging the splitter; the value below is just the initial 70/30. */
.schedule-page .crm-container {
  display: grid;
  grid-template-columns: minmax(480px, 70fr) 12px minmax(360px, 30fr);
  align-items: start;
  column-gap: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 10px 18px;
}

.schedule-page .schedule-header {
  display: none;
}

.schedule-page .schedule-main {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 86px);
  max-height: calc(100vh - 86px);
  overflow: auto;
  border-radius: 16px;
  padding: 14px;
}

/* Everything, including the month grid, keeps its natural (content) height
   by default — schedule.js measures the leftover space inside .schedule-main
   (a fixed calc(100vh-86px) box) and sets #calendarGrid's height explicitly.
   That was more reliable than leaning on flex-grow + grid's 1fr row tracks
   to fill the box on their own, which didn't consistently stretch. With an
   explicit pixel height in place, minmax(_, 1fr) rows below have a genuinely
   definite container height to distribute, so they fill it exactly. */
.schedule-page .schedule-toolbar,
.schedule-page #scheduleDataStatus,
.schedule-page #waitingZone,
.schedule-page .calendar-weekdays,
.schedule-page .calendar-grid {
  flex-shrink: 0;
}

.schedule-page .calendar-grid {
  grid-auto-rows: minmax(124px, 1fr);
}

/* Compact mode's cells are much shorter (52px vs 124px) — same idea, lower floor. */
#calendarGrid.is-compact {
  grid-auto-rows: minmax(52px, 1fr);
}

.schedule-page .schedule-main::-webkit-scrollbar,
.schedule-day-panel .day-modal-list::-webkit-scrollbar {
  width: 8px;
}

.schedule-page .schedule-main::-webkit-scrollbar-thumb,
.schedule-day-panel .day-modal-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.schedule-page .schedule-toolbar {
  align-items: flex-start;
  margin-bottom: 12px;
}

.schedule-page .month-nav {
  flex-wrap: wrap;
}

.schedule-page #monthTitle {
  min-width: 170px;
  font-size: 21px;
}

.schedule-page .waiting-zone {
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(214, 165, 46, 0.045), rgba(0,0,0,0.08)),
    rgba(0, 0, 0, 0.2);
}

.schedule-page .calendar-weekdays,
.schedule-page .calendar-grid {
  gap: 8px;
}

.schedule-page .day-cell {
  min-height: 124px;
  border-radius: 12px;
}

.schedule-page .day-cell.is-panel-day:not(.is-today) {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 0 2px rgba(255, 255, 255, 0.05);
}

.schedule-page .day-cell.is-pinned-day {
  border-color: rgba(74, 190, 118, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(74, 190, 118, 0.28),
    0 0 0 2px rgba(74, 190, 118, 0.07);
}

.schedule-page .day-cell.drag-over,
.schedule-day-panel.drag-over .day-modal-box {
  outline: 2px solid rgba(214, 70, 61, 0.8);
  background:
    linear-gradient(180deg, rgba(214, 70, 61, 0.1), rgba(0, 0, 0, 0.2)),
    rgba(12, 12, 12, 0.95);
}

.schedule-page .day-cell.is-drag-pin-pending {
  border-color: rgba(255, 210, 60, 0.88);
  animation: dragDayPinBounce 0.58s cubic-bezier(0.2, 0.9, 0.24, 1.22) infinite;
  box-shadow:
    inset 0 0 0 1px rgba(255, 210, 60, 0.36),
    0 0 0 3px rgba(255, 210, 60, 0.12),
    0 12px 24px rgba(0, 0, 0, 0.22);
}

.schedule-page .day-cell.is-drag-pinned-target {
  border-color: rgba(74, 190, 118, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(74, 190, 118, 0.38),
    0 0 0 3px rgba(74, 190, 118, 0.12),
    0 0 18px rgba(74, 190, 118, 0.18);
}

@keyframes dragDayPinBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-4px) scale(1.018); }
}

.schedule-day-panel {
  position: sticky;
  top: 66px;
  height: calc(100vh - 84px);
  min-width: 360px;
  z-index: 2;
  display: flex;
  align-self: start;
  pointer-events: auto;
}

/* ── Splitter between the calendar block and the day panel ───────────── */
.schedule-splitter {
  position: sticky;
  top: 66px;
  height: calc(100vh - 84px);
  width: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  touch-action: none;
  align-self: start;
}

.schedule-splitter::before {
  content: "";
  width: 4px;
  height: 46px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.15s ease, height 0.15s ease;
}

.schedule-splitter:hover::before,
.schedule-splitter.is-dragging::before,
.schedule-splitter:focus-visible::before {
  background: rgba(214, 70, 61, 0.75);
  height: 72px;
}

/* ── Compact calendar (calendar block narrower than 60% of the screen) ──
   Day cells drop the lesson-name preview list for a dot-per-lesson summary,
   the same visual language as teacher-cabinet.js's mobile month calendar. */
.day-cell__dots {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}

.day-cell__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.day-cell__dot--single { background: rgba(214, 178, 40, 0.9); }
.day-cell__dot--individual { background: rgba(40, 160, 210, 0.9); }
.day-cell__dot--group { background: rgba(130, 80, 220, 0.9); }
.day-cell__dot--rental { background: rgba(230, 80, 170, 0.9); }
.day-cell__dot--draft { background: rgba(255, 255, 255, 0.45); }

.day-cell__dots small {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

#calendarGrid.is-compact .day-cell {
  min-height: 52px;
  padding: 6px;
  gap: 4px;
}

#calendarGrid.is-compact .lesson-chip,
#calendarGrid.is-compact .day-cell__more,
#calendarGrid.is-compact .day-cell__empty {
  display: none;
}

#calendarGrid.is-compact .day-cell__dots {
  display: flex;
}

.schedule-day-panel .day-modal-box {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: rgba(74, 190, 118, 0.22);
  background:
    linear-gradient(180deg, rgba(74, 190, 118, 0.045), rgba(255,255,255,0.012)),
    rgba(10, 10, 10, 0.92);
}

.schedule-day-panel.is-previewing .day-modal-box {
  border-color: rgba(214, 70, 61, 0.34);
  background:
    linear-gradient(180deg, rgba(214, 70, 61, 0.045), rgba(255,255,255,0.012)),
    rgba(10, 10, 10, 0.94);
}

.schedule-day-panel .day-modal-head {
  padding: 8px 10px 6px;
  margin: 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.schedule-day-panel .day-modal-nav {
  gap: 6px;
}

.schedule-day-panel .day-modal-nav-arrows {
  gap: 3px;
}

.schedule-day-panel .day-modal-nav h2 {
  font-size: 14px !important;
  text-align: left;
  line-height: 1;
}

.day-modal-counts {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.day-modal-nav .day-modal-counts {
  margin-top: 0;
  margin-left: 6px;
  flex-shrink: 0;
}

.day-modal-counts__item {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(93, 160, 220, 0.28);
  background: rgba(93, 160, 220, 0.12);
  color: rgba(185, 218, 255, 0.95);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.day-modal-counts__item--rental {
  border-color: rgba(205, 92, 158, 0.32);
  background: rgba(205, 92, 158, 0.13);
  color: rgba(245, 190, 225, 0.95);
}

.day-modal-filters {
  margin-top: 8px;
}

.schedule-day-panel .day-modal-filters {
  margin-top: 6px;
  flex-wrap: wrap;
}

.schedule-day-panel .day-modal-filters .client-filter-select-wrap {
  min-width: 0;
  flex: 1;
}

.schedule-day-panel .day-modal-nav::after {
  content: "Закреплен";
  flex-shrink: 0;
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(74, 190, 118, 0.16);
  border: 1px solid rgba(74, 190, 118, 0.28);
  color: rgba(130, 225, 160, 0.95);
  font-size: 10px;
  font-weight: 700;
}

.schedule-day-panel.is-previewing .day-modal-nav::after {
  content: "Наведение";
  background: rgba(214, 165, 46, 0.15);
  border-color: rgba(214, 165, 46, 0.3);
  color: rgba(235, 190, 80, 0.95);
}

.schedule-day-panel .day-modal-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  overflow-x: hidden;
  padding: 6px;
  gap: 3px;
  align-content: start;
  grid-auto-rows: max-content;
}

.schedule-day-panel .day-modal-item {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 96px 28px;
  grid-template-rows: 24px 20px;
  gap: 1px 8px;
  align-items: center;
  min-height: 56px;
  padding: 5px 8px;
  border-radius: 8px;
  cursor: grab;
  position: relative;
  contain: layout;
}

.schedule-day-panel .day-modal-item:active {
  cursor: grabbing;
}

.schedule-day-panel .day-modal-item.is-dragging {
  opacity: 0.54;
  outline: 1px dashed rgba(255, 210, 60, 0.5);
  outline-offset: -2px;
}

.schedule-day-panel .day-modal-item--drop-draft {
  grid-template-columns: 70px minmax(0, 1fr) 96px 28px;
  grid-template-rows: auto auto auto;
  min-height: 0;
  cursor: default;
  contain: none;
}

.schedule-day-panel .day-modal-item--drop-draft .day-modal-meta {
  grid-column: 2 / 5;
  grid-row: 2;
}

.schedule-day-panel .day-modal-inline-drop-form {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 8px;
}

.day-modal-item--drop-before {
  box-shadow: none;
}

.day-modal-item--drop-after {
  box-shadow: none;
}

.day-modal-item--drop-before::before,
.day-modal-item--drop-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 2;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 210, 60, 0.96);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.26), 0 0 12px rgba(255, 210, 60, 0.42);
  pointer-events: none;
}

.day-modal-item--drop-before::before {
  top: 0;
}

.day-modal-item--drop-after::after {
  bottom: 0;
}

@keyframes dayModalDropLanded {
  0%   { box-shadow: 0 0 0 0 rgba(255, 210, 60, 0.55); }
  100% { box-shadow: 0 0 0 12px rgba(255, 210, 60, 0); }
}

.day-modal-item--drop-landed {
  animation: dayModalDropLanded 0.7s ease-out;
}

.day-modal-drop-choice {
  position: fixed;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(20, 14, 14, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: dayModalDropChoiceIn 0.16s ease-out;
}

@keyframes dayModalDropChoiceIn {
  from { opacity: 0; transform: scale(0.92) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.day-modal-drop-choice .panel-action-btn {
  white-space: nowrap;
  min-width: 180px;
}

.day-modal-drop-choice__add {
  background: linear-gradient(180deg, rgba(74, 190, 118, 0.22), rgba(74, 190, 118, 0.085)) !important;
  border-color: rgba(74, 190, 118, 0.48) !important;
  color: rgba(235, 255, 241, 0.96) !important;
  box-shadow: 0 0 0 1px rgba(74, 190, 118, 0.08) inset !important;
}

.day-modal-drop-choice__edit--danger {
  background: linear-gradient(180deg, rgba(214, 70, 61, 0.22), rgba(214, 70, 61, 0.085)) !important;
  border-color: rgba(214, 70, 61, 0.48) !important;
  color: rgba(255, 238, 235, 0.96) !important;
}

.schedule-day-panel .day-modal-completed-toggle,
.schedule-day-panel .day-modal-item__actions,
.schedule-day-panel .day-modal-meta {
  grid-column: auto;
}

.schedule-day-panel .day-modal-item__top {
  display: contents;
}

.schedule-day-panel .day-modal-item__head-left {
  display: contents;
  min-width: 0;
}

.schedule-day-panel .day-modal-item__time {
  grid-column: 1;
  grid-row: 1;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  align-self: center;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.schedule-day-panel .day-modal-item__title {
  grid-column: 2;
  grid-row: 1;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-day-panel .day-modal-completed-toggle {
  grid-column: 3;
  grid-row: 1;
  height: 24px;
  width: 96px;
  min-width: 96px;
  padding: 0 9px;
  gap: 6px;
  border-radius: 999px;
  font-size: 11px;
  justify-self: end;
}

.schedule-day-panel .day-modal-completed-toggle span {
  display: inline;
}

.schedule-day-panel .day-modal-completed-toggle input[type="checkbox"] {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.schedule-day-panel .day-modal-meta {
  align-items: center;
  display: flex;
  gap: 0;
  grid-column: 2 / 5;
  grid-row: 2;
  overflow: hidden;
  min-width: 0;
}

.schedule-day-panel .day-modal-meta__row {
  gap: 0;
  font-size: 10px;
  line-height: 1;
  max-width: none;
  min-width: 0;
  opacity: 0.82;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-day-panel .day-modal-meta__row + .day-modal-meta__row::before {
  content: "|";
  margin: 0 6px;
  color: rgba(255,255,255,0.32);
}

.schedule-day-panel .day-modal-meta__row span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-day-panel .day-modal-icon {
  display: none;
}

.schedule-day-panel .day-modal-item__room-icon {
  grid-column: 1;
  grid-row: 2;
  font-size: 16px;
  line-height: 1;
  text-align: center;
}

.schedule-day-panel .day-modal-body-divider,
.schedule-day-panel .day-modal-attendance {
  grid-column: 1 / -1;
}

.schedule-day-panel .day-modal-item--group .day-modal-item__body {
  display: contents;
  margin-top: 0;
}

.schedule-day-panel .day-modal-item--group .day-modal-body-divider,
.schedule-day-panel .day-modal-item--group .day-modal-attendance {
  display: none;
}

.schedule-day-panel .day-modal-item--group.show-actions {
  grid-template-rows: 24px 15px auto 29px;
}

.schedule-day-panel .day-modal-item--group.show-actions .day-modal-item__body {
  display: block;
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 6px;
  min-width: 0;
}

.schedule-day-panel .day-modal-item--group.show-actions .day-modal-body-divider {
  display: none;
}

.schedule-day-panel .day-modal-item--group.show-actions .day-modal-attendance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 6px;
  min-width: 0;
}

.schedule-day-panel .day-modal-item--group.show-actions .day-modal-attendance__student {
  min-width: 0;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.schedule-day-panel .day-modal-item--group.show-actions .day-modal-attendance__student span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-day-panel .day-modal-item--group.show-actions .day-modal-item__actions {
  grid-row: 4;
}

.schedule-day-panel .day-modal-item__actions {
  grid-column: 1 / -1;
  grid-row: 3;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 3px;
  align-self: center;
  position: static;
  width: auto;
  justify-self: end;
  display: none;
}

.schedule-day-panel .day-modal-item__actions .panel-action-btn {
  min-width: 0;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 10px;
  line-height: 1;
  flex: 0 0 auto;
}

.schedule-day-panel .day-modal-more-btn {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  width: 24px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.72);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.schedule-day-panel .day-modal-item__actions .panel-action-btn {
  display: inline-flex;
  position: static;
  box-shadow: none;
}

.schedule-day-panel .day-modal-item.show-actions {
  grid-template-rows: 24px 15px 29px;
}

.schedule-day-panel .day-modal-item.show-actions .day-modal-item__actions {
  display: flex;
}

/* Draft (planning) cards have no "..." toggle — their single "remove" action
   is always visible instead of being hidden behind show-actions. */
.schedule-day-panel .day-modal-item--draft .day-modal-item__actions {
  display: flex;
  grid-row: 3;
}

.schedule-day-panel .day-modal-item.show-actions .day-modal-item__actions .panel-action-btn {
  display: inline-flex;
}

.schedule-day-panel .day-modal-item.show-actions .day-modal-meta {
  grid-column: 2 / 5;
}

.schedule-day-panel .day-modal-item.day-modal-item--group.show-actions {
  grid-template-rows: 24px 15px auto 29px;
}

.schedule-day-panel .day-modal-item.day-modal-item--group.show-actions .day-modal-item__actions {
  grid-row: 4;
}

.schedule-day-panel .day-modal-edit-fields {
  grid-template-columns: 1fr;
}

.schedule-day-panel .modal-actions {
  margin-top: 0;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.schedule-day-panel #closeDayModalBtn {
  display: none;
}

.schedule-day-panel .day-modal-planning-section {
  margin: 6px 8px 0;
  position: static;
}

.schedule-day-panel .day-modal-planning-form {
  flex-wrap: wrap;
}

.schedule-day-panel .planning-add-btn {
  width: 100%;
  margin-left: 0;
}

.schedule-day-panel .day-modal-planning-form .schedule-loop-mode-select {
  width: 100%;
  max-width: none;
}

@media (max-width: 1180px) {
  .schedule-page .crm-container {
    display: block;
    width: 100%;
    padding-right: 10px;
  }

  .schedule-page .schedule-main {
    min-height: auto;
    max-height: none;
  }

  .schedule-day-panel {
    position: static;
    width: auto;
    min-width: 0;
    height: min(620px, 78vh);
    margin: 10px 10px 18px;
  }

  .schedule-splitter {
    display: none;
  }
}

/* ── Schedule workspace refresh (calendar + selected day) ──────────────── */
/* The sidebar and global toolbar intentionally stay under topbar.css. */
.schedule-page .crm-container {
  padding: 8px 10px 12px;
}

.schedule-page .schedule-main,
.schedule-day-panel .day-modal-box {
  border: 1px solid var(--ui-border, var(--stroke));
  background: var(--ui-surface, rgba(10, 10, 10, 0.92));
  color: var(--ui-text, var(--text));
  box-shadow: var(--shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.schedule-page .schedule-main {
  padding: 10px;
  border-radius: 12px;
  overflow: auto;
}

.schedule-page .schedule-toolbar {
  align-items: center;
  min-height: 40px;
  gap: 10px;
  margin: 0 0 8px;
  padding: 0 2px;
}

.schedule-page .month-nav {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.schedule-page #monthTitle {
  order: 2;
  min-width: 158px;
  font-size: 16px;
  line-height: 1;
  text-align: left;
}

.schedule-page #prevMonthBtn { order: 1; }
.schedule-page #nextMonthBtn { order: 3; }
.schedule-page #todayBtn { order: 4; }
.schedule-page .month-stat-chip:first-of-type { order: 5; }
.schedule-page .month-stat-chip:last-of-type { order: 6; }

.schedule-page .month-nav > button,
.schedule-day-panel .day-modal-nav-btn {
  min-width: 30px;
  width: 30px;
  min-height: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--ui-action-border, var(--ui-border));
  background: var(--ui-action-bg, var(--ui-surface-2));
  color: var(--ui-action-text, var(--ui-text));
  box-shadow: none;
}

.schedule-page #todayBtn {
  width: auto;
  padding: 0 10px;
}

.schedule-page .month-stat-chip {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--ui-border-soft, var(--stroke-soft));
  border-radius: 999px;
  background: var(--ui-surface-soft, rgba(255, 255, 255, 0.035));
  color: var(--ui-muted, var(--muted));
}

.schedule-page .month-stat-chip strong {
  color: var(--ui-text, var(--text));
  font-size: 12px;
}

.schedule-page .schedule-legend {
  justify-content: flex-end;
  gap: 9px;
  color: var(--ui-muted, var(--muted));
  font-size: 10px;
}

.schedule-page .schedule-legend__item {
  gap: 4px;
}

.schedule-page .schedule-legend__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.schedule-page .waiting-zone {
  margin-bottom: 7px;
  border-color: var(--ui-border-soft, var(--stroke-soft));
  border-radius: 8px;
  background: var(--ui-surface-soft, rgba(255, 255, 255, 0.025));
}

.schedule-page .waiting-zone:has(.waiting-zone__empty:only-child) {
  min-height: 0;
  margin-bottom: 4px;
  padding: 2px 4px;
}

.schedule-page .waiting-zone__title {
  color: var(--ui-warning, #d6a23e);
  font-size: 10px;
}

.schedule-page .calendar-weekdays,
.schedule-page .calendar-grid {
  gap: 5px;
}

.schedule-page .calendar-weekdays {
  margin-bottom: 5px;
}

.schedule-page .calendar-weekdays span {
  padding: 2px 0;
  color: var(--ui-muted, var(--muted));
  font-size: 11px;
  font-weight: 700;
}

.schedule-page .calendar-weekdays span:nth-child(6),
.schedule-page .calendar-weekdays span:nth-child(7) {
  color: var(--ui-muted, var(--muted));
  opacity: 0.72;
}

.schedule-page .calendar-grid {
  grid-auto-rows: minmax(96px, 1fr);
}

.schedule-page .day-cell {
  position: relative;
  min-height: 96px;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--ui-border-soft, var(--stroke-soft));
  border-radius: 7px;
  background: var(--ui-surface-soft, rgba(255, 255, 255, 0.025));
  color: var(--ui-text, var(--text));
  box-shadow: none;
}

.schedule-page .day-cell:not(.day-cell-empty-state):not(.is-outside):hover {
  border-color: var(--ui-border, var(--stroke));
  background: color-mix(in srgb, var(--ui-accent) 5%, var(--ui-surface-2));
}

.schedule-page .day-cell.day-cell-empty-state {
  border-color: var(--ui-border-soft, var(--stroke-soft)) !important;
  background: color-mix(in srgb, var(--ui-surface-soft) 60%, transparent);
}

.schedule-page .day-cell.is-outside {
  opacity: 0.38;
  background: transparent;
}

.schedule-page .day-cell.is-today,
.schedule-page .day-cell.is-panel-day,
.schedule-page .day-cell.is-pinned-day {
  z-index: 1;
  border-color: color-mix(in srgb, var(--ui-accent) 72%, var(--ui-border)) !important;
  background: color-mix(in srgb, var(--ui-accent-soft) 58%, var(--ui-surface)) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-accent) 24%, transparent) !important;
}

.schedule-page .day-number {
  min-height: 17px;
  color: var(--ui-text, var(--text));
  font-size: 11px;
  line-height: 17px;
}

.schedule-page .day-cell.is-today .day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  min-height: 23px;
  margin: -3px 0 0 -3px;
  border-radius: 7px;
  background: var(--ui-accent, var(--red));
  color: #fff;
  font-size: 11px;
}

.schedule-page .lesson-chip {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 2px;
  min-width: 0;
  min-height: 38px;
  max-height: 38px;
  padding: 5px 6px 5px 8px;
  border-color: var(--ui-border-soft, var(--stroke-soft));
  border-radius: 5px;
  background: color-mix(in srgb, var(--ui-surface-2) 82%, transparent);
  color: var(--ui-text, var(--text));
  font-size: 10px;
  line-height: 1.12;
  overflow: hidden;
}

.schedule-page .lesson-chip > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-page .lesson-chip__time {
  margin-bottom: 0;
  font-size: 10px;
  line-height: 12px;
}

.schedule-page .calendar-grid .lesson-chip > div:nth-child(2) {
  font-size: 10px;
  line-height: 12px;
}

.schedule-page .lesson-chip__meta,
.schedule-page .lesson-chip__note {
  color: var(--ui-muted, var(--muted));
  font-size: 9px;
}

.schedule-page .calendar-grid .lesson-chip__meta {
  display: none;
}

.schedule-page .day-cell__empty {
  color: var(--ui-muted, var(--muted));
  opacity: 0.35;
}

.schedule-page .day-cell__more {
  margin-top: 1px;
  padding-right: 18px;
  color: var(--ui-muted, var(--muted));
  font-size: 10px;
  font-weight: 700;
  line-height: 12px;
}

/* Completion state: same meaning as the former full-cell outline, now a dot. */
.schedule-page .day-cell.day-load-green:not(.is-future),
.schedule-page .day-cell.day-load-yellow:not(.is-future) {
  box-shadow: none;
}

.schedule-page .day-cell.day-load-green:not(.is-future)::after,
.schedule-page .day-cell.day-load-yellow:not(.is-future)::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 2;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 2px solid var(--ui-surface, #111);
  box-sizing: content-box;
}

.schedule-page .day-cell.day-load-green:not(.is-future)::after {
  background: var(--ui-success, #69d58b);
}

.schedule-page .day-cell.day-load-yellow:not(.is-future)::after {
  background: var(--ui-warning, #d6a23e);
}

.schedule-page .day-cell.day-cell-client-focus {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-success) 62%, transparent) !important;
}

.schedule-splitter::before {
  width: 3px;
  height: 58px;
  background: var(--ui-border, var(--stroke));
}

.schedule-splitter:hover::before,
.schedule-splitter.is-dragging::before,
.schedule-splitter:focus-visible::before {
  height: 86px;
  background: var(--ui-accent, var(--red));
}

.schedule-day-panel {
  min-width: 360px;
}

.schedule-day-panel .day-modal-box {
  border-radius: 12px;
  background: var(--ui-surface, rgba(10, 10, 10, 0.94));
}

.schedule-day-panel.is-previewing .day-modal-box {
  border-color: var(--ui-border, var(--stroke));
  background: var(--ui-surface, rgba(10, 10, 10, 0.94));
}

.schedule-day-panel .day-modal-head {
  padding: 10px;
  border-bottom: 1px solid var(--ui-border-soft, var(--stroke-soft));
  background: var(--ui-surface-soft, rgba(255, 255, 255, 0.02));
}

.schedule-day-panel .day-modal-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.schedule-day-panel .day-modal-nav-arrows {
  display: grid;
  grid-template-columns: repeat(2, 30px);
  gap: 4px;
}

.schedule-day-panel .day-modal-nav-arrows .day-modal-nav-btn:nth-child(n + 3) {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  opacity: 0.65;
}

.schedule-day-panel .day-modal-nav h2 {
  min-width: 0;
  color: var(--ui-text, var(--text));
  font-size: 13px !important;
  line-height: 1.2;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-day-panel .day-modal-nav .day-modal-counts {
  margin: 0;
  gap: 4px;
}

.schedule-day-panel .day-modal-counts__item {
  min-height: 20px;
  padding: 2px 6px;
  border-color: color-mix(in srgb, var(--ui-info) 38%, transparent);
  background: var(--ui-info-soft, rgba(92, 165, 220, 0.14));
  color: var(--ui-info, #5ca5dc);
}

.schedule-day-panel .day-modal-counts__item--rental {
  border-color: color-mix(in srgb, var(--ui-accent-2) 38%, transparent);
  background: var(--ui-accent-soft, rgba(194, 53, 43, 0.16));
  color: var(--ui-accent-text, var(--ui-accent-2));
}

.schedule-day-panel .day-modal-nav::after {
  padding: 3px 7px;
  border-color: color-mix(in srgb, var(--ui-success) 34%, transparent);
  background: var(--ui-success-soft, rgba(74, 190, 118, 0.16));
  color: var(--ui-success, #69d58b);
}

.schedule-day-panel.is-previewing .day-modal-nav::after {
  border-color: color-mix(in srgb, var(--ui-warning) 34%, transparent);
  background: var(--ui-warning-soft, rgba(214, 158, 46, 0.16));
  color: var(--ui-warning, #d6a23e);
}

.schedule-day-panel .day-modal-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
  padding: 0;
  border: 0;
  background: transparent;
}

.schedule-day-panel .day-modal-filters .filter-divider {
  display: none;
}

.schedule-day-panel .day-modal-filters .client-filter-select-wrap,
.schedule-day-panel .day-modal-filters .cs-wrap,
.schedule-day-panel .day-modal-filters select {
  width: 100%;
}

.schedule-day-panel .day-modal-filters .cs-trigger,
.schedule-day-panel .day-modal-filters select {
  min-height: 32px;
  border: 1px solid var(--ui-action-border, var(--ui-border));
  border-radius: 7px;
  background: var(--ui-action-bg, var(--ui-surface-2));
  color: var(--ui-action-text, var(--ui-text));
}

.schedule-day-panel .day-modal-list {
  padding: 8px;
  gap: 6px;
  background: var(--ui-surface, rgba(10, 10, 10, 0.94));
}

.schedule-day-panel .day-modal-item {
  min-height: 62px;
  grid-template-columns: 72px minmax(0, 1fr) 92px 28px;
  grid-template-rows: 26px 20px;
  padding: 7px 8px;
  border-color: var(--ui-border-soft, var(--stroke-soft));
  border-radius: 7px;
  background: var(--ui-surface-soft, rgba(255, 255, 255, 0.03));
  color: var(--ui-text, var(--text));
}

.schedule-day-panel .day-modal-item:hover {
  border-color: var(--ui-border, var(--stroke));
  background: color-mix(in srgb, var(--ui-accent) 4%, var(--ui-surface-2));
}

.schedule-day-panel .day-modal-item__time,
.schedule-day-panel .day-modal-item__title {
  color: var(--ui-text, var(--text));
}

.schedule-day-panel .day-modal-meta__row {
  color: var(--ui-muted, var(--muted));
}

.schedule-day-panel .day-modal-meta__row + .day-modal-meta__row::before {
  color: var(--ui-border, var(--stroke));
}

.schedule-day-panel .day-modal-more-btn {
  border-color: var(--ui-action-border, var(--ui-border));
  background: var(--ui-action-bg, var(--ui-surface-2));
  color: var(--ui-action-muted, var(--ui-muted));
}

.schedule-day-panel .modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border-top-color: var(--ui-border-soft, var(--stroke-soft));
  background: var(--ui-surface, rgba(10, 10, 10, 0.94));
}

.schedule-day-panel .modal-actions .panel-action-btn {
  min-height: 34px;
  margin: 0;
  border-radius: 7px;
}

@media (max-width: 1450px) {
  .schedule-page .schedule-legend {
    display: none;
  }

  .schedule-page .lesson-chip {
    font-size: 9px;
  }

  .schedule-page .lesson-chip__meta {
    display: none;
  }
}

@media (max-width: 1180px) {
  .schedule-page .schedule-main {
    overflow: auto;
  }

  .schedule-page .calendar-grid {
    min-height: 640px;
  }

  .schedule-day-panel {
    margin: 10px 0 18px;
  }
}

/* ── Selected-day panel: dense timeline from the schedule reference ───── */
.schedule-day-panel .day-modal-head {
  flex: 0 0 auto;
  padding: 10px 10px 12px;
}

.schedule-day-panel .day-modal-nav {
  position: relative;
  min-height: 58px;
  padding-bottom: 8px;
}

.schedule-day-panel .day-modal-nav h2 {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.schedule-day-panel .day-modal-nav h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 48px;
  height: 2px;
  border-radius: 999px;
  background: var(--ui-accent, var(--red));
}

.schedule-day-panel .day-modal-filters {
  margin-top: 8px;
}

.schedule-day-panel .day-modal-list {
  grid-auto-rows: max-content;
  align-content: start;
  gap: 7px;
  padding: 16px 8px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-top: 1px solid var(--ui-border-soft, var(--stroke-soft));
}

.schedule-day-panel .day-modal-item {
  grid-template-columns: 78px minmax(0, 1fr) 98px 28px;
  grid-template-rows: minmax(26px, auto) minmax(22px, auto);
  align-items: center;
  column-gap: 8px;
  row-gap: 4px;
  min-height: 70px;
  height: auto;
  padding: 8px 8px 8px 10px;
  overflow: hidden;
  contain: layout paint;
}

.schedule-day-panel .day-modal-item__time {
  align-self: center;
  font-size: 10px;
  line-height: 14px;
  text-overflow: ellipsis;
}

.schedule-day-panel .day-modal-item__title {
  align-self: center;
  font-size: 12px;
  line-height: 14px;
}

.schedule-day-panel .day-modal-item__room-icon {
  align-self: center;
  margin: 0;
  font-size: 15px;
}

.schedule-day-panel .day-modal-completed-toggle {
  width: 98px;
  min-width: 98px;
  height: 26px;
  padding: 0 8px;
  font-size: 10px;
}

.schedule-day-panel .day-modal-meta {
  min-height: 18px;
  align-self: center;
}

.schedule-day-panel .day-modal-meta__row {
  min-width: 0;
  font-size: 9px;
  line-height: 12px;
}

.schedule-day-panel .day-modal-more-btn {
  width: 28px;
  height: 22px;
}

.schedule-day-panel .day-modal-item.show-actions {
  grid-template-rows: minmax(26px, auto) minmax(22px, auto) auto;
  min-height: 106px;
  overflow: visible;
  contain: layout;
}

.schedule-day-panel .day-modal-item--drop-draft {
  overflow: visible;
  contain: none;
}

.schedule-day-panel .day-modal-item.show-actions .day-modal-item__actions {
  grid-row: 3;
  margin-top: 5px;
}

.schedule-day-panel .day-modal-item.day-modal-item--group.show-actions {
  grid-template-rows: minmax(26px, auto) minmax(22px, auto) auto auto;
}

.schedule-day-panel .day-modal-item.day-modal-item--group.show-actions .day-modal-item__body {
  grid-row: 3;
}

.schedule-day-panel .day-modal-item.day-modal-item--group.show-actions .day-modal-item__actions {
  grid-row: 4;
}

.schedule-day-panel .history-empty {
  align-self: stretch;
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--ui-muted, var(--muted));
}

.schedule-day-panel .modal-actions {
  flex: 0 0 auto;
}

/* Event-category palette from the approved schedule reference. */
.schedule-page {
  --schedule-subscription: #5fa86a;
  --schedule-first: #c86262;
  --schedule-rental: #6b7280;
  --schedule-group: #7e57c2;
  --schedule-single: #6f9aa3;
}

.schedule-page .schedule-legend__dot--individual,
.schedule-page .day-cell__dot--subscription,
.schedule-page .day-cell__dot--individual {
  background: var(--schedule-subscription);
}

.schedule-page .schedule-legend__dot--first,
.schedule-page .day-cell__dot--first {
  background: var(--schedule-first);
}

.schedule-page .schedule-legend__dot--rental,
.schedule-page .day-cell__dot--rental {
  background: var(--schedule-rental);
}

.schedule-page .schedule-legend__dot--group,
.schedule-page .day-cell__dot--group {
  background: var(--schedule-group);
}

.schedule-page .schedule-legend__dot--single,
.schedule-page .day-cell__dot--single {
  background: var(--schedule-single);
}

.schedule-page .lesson-chip--subscription,
.schedule-page .lesson-chip--individual {
  border-left-color: var(--schedule-subscription) !important;
}

.schedule-page .lesson-chip--first {
  border-left-color: var(--schedule-first) !important;
}

.schedule-page .lesson-chip--rental {
  border-left-color: var(--schedule-rental) !important;
}

.schedule-page .lesson-chip--group-session {
  border-left-color: var(--schedule-group) !important;
}

.schedule-page .lesson-chip--single {
  border-left-color: var(--schedule-single) !important;
}

.schedule-day-panel .day-modal-item--subscription,
.schedule-day-panel .day-modal-item--individual {
  border-left: 4px solid var(--schedule-subscription) !important;
}

.schedule-day-panel .day-modal-item--first {
  border-left: 4px solid var(--schedule-first) !important;
}

.schedule-day-panel .day-modal-item--rental {
  border-left: 4px solid var(--schedule-rental) !important;
}

.schedule-day-panel .day-modal-item--group {
  border-left: 4px solid var(--schedule-group) !important;
}

.schedule-day-panel .day-modal-item--single {
  border-left: 4px solid var(--schedule-single) !important;
}

/* Resizable waiting area. At its compact height, draggable cards become dots. */
.schedule-page .waiting-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-height: 0;
  padding-bottom: 16px;
}

.schedule-page .waiting-zone.is-user-sized {
  overflow: hidden;
}

.schedule-page .waiting-zone.is-user-sized:has(.waiting-zone__empty:only-child) {
  height: auto !important;
}

.schedule-page .waiting-zone__header {
  flex: 0 0 auto;
}

.schedule-page .waiting-zone__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  align-content: flex-start;
}

.schedule-page .waiting-card {
  box-sizing: border-box;
  width: auto;
  min-width: 150px;
  max-width: 240px;
  flex: 1 1 190px;
  transition:
    flex-basis 0.18s ease,
    min-width 0.18s ease,
    max-width 0.18s ease,
    padding 0.18s ease,
    min-height 0.18s ease,
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.waiting-zone__resize-handle {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  z-index: 3;
  height: 12px;
  cursor: row-resize;
  touch-action: none;
}

.waiting-zone__resize-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 52px;
  height: 3px;
  border-radius: 999px;
  background: var(--ui-border, var(--stroke));
  transform: translateX(-50%);
  transition: width 0.15s ease, background 0.15s ease;
}

.waiting-zone__resize-handle:hover::before,
.waiting-zone__resize-handle:focus-visible::before,
.waiting-zone__resize-handle.is-dragging::before {
  width: 82px;
  background: var(--ui-warning, #d6a23e);
}

.schedule-page .waiting-zone:has(.waiting-zone__empty:only-child) .waiting-zone__resize-handle {
  display: none;
}

.schedule-page .waiting-zone.is-condensed:not(.is-compact) {
  padding: 7px 10px 14px;
}

.schedule-page .waiting-zone.is-condensed:not(.is-compact) .waiting-zone__header {
  margin-bottom: 5px;
}

.schedule-page .waiting-zone.is-condensed:not(.is-compact) .waiting-zone__hint {
  display: none;
}

.schedule-page .waiting-zone.is-condensed:not(.is-compact) .waiting-zone__list {
  gap: 6px;
  padding: 6px 8px;
}

.schedule-page .waiting-zone.is-condensed:not(.is-compact) .waiting-card {
  min-width: 118px;
  max-width: 190px;
  min-height: 43px;
  flex-basis: 145px;
  gap: 1px;
  padding: 6px 24px 6px 8px;
  border-radius: 9px;
}

.schedule-page .waiting-zone.is-condensed:not(.is-compact) .waiting-card__name {
  font-size: 11px;
}

.schedule-page .waiting-zone.is-condensed:not(.is-compact) .waiting-card__meta {
  font-size: 10px;
}

.schedule-page .waiting-zone.is-condensed:not(.is-compact) .waiting-card__date {
  display: none;
}

.schedule-page .waiting-zone.is-condensed:not(.is-compact) .waiting-card__remove {
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
}

.schedule-page .waiting-zone.is-compact {
  padding: 6px 10px 14px;
}

.schedule-page .waiting-zone.is-compact .waiting-zone__header {
  margin-bottom: 4px;
}

.schedule-page .waiting-zone.is-compact .waiting-zone__hint,
.schedule-page .waiting-zone.is-compact .waiting-add-planning-btn {
  display: none;
}

.schedule-page .waiting-zone.is-compact .waiting-zone__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: 6px;
  min-height: 18px;
  padding: 4px 8px;
  overflow: hidden;
}

.schedule-page .waiting-zone.is-compact .waiting-card {
  width: 9px;
  min-width: 9px;
  height: 9px;
  min-height: 9px;
  flex: 0 0 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ui-warning, #d6a23e);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ui-warning) 18%, transparent);
  cursor: grab;
}

.schedule-page .waiting-zone.is-compact .waiting-card:hover {
  background: var(--ui-warning, #d6a23e);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ui-warning) 20%, transparent);
  transform: scale(1.12);
}

.schedule-page .waiting-zone.is-compact .waiting-card > * {
  display: none;
}

/* In dot mode the resize bar sits right under the dots and reads as a stray line; show it only on hover. */
.schedule-page .waiting-zone.is-compact .waiting-zone__resize-handle:not(:hover):not(:focus-visible):not(.is-dragging)::before {
  background: transparent;
}

/* Schedule filter row: every control owns a real grid track and may shrink. */
.schedule-page .app-toolbar-filter-row .app-filter-group--wide {
  flex: 1 1 680px;
  width: min(100%, 920px);
  max-width: 920px;
  overflow: visible;
}

.schedule-page .app-toolbar-filter-row .schedule-topbar-filters {
  display: grid;
  grid-template-columns: auto repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

.schedule-page .app-toolbar-filter-row .schedule-topbar-filters .filter-divider {
  display: none;
}

.schedule-page .app-toolbar-filter-row .schedule-topbar-filters .client-chip {
  width: auto;
  min-width: 44px;
  height: 30px;
}

.schedule-page .app-toolbar-filter-row .schedule-topbar-filters .client-filter-select-wrap,
.schedule-page .app-toolbar-filter-row .schedule-topbar-filters .cs-wrap,
.schedule-page .app-toolbar-filter-row .schedule-topbar-filters .app-custom-select,
.schedule-page .app-toolbar-filter-row .schedule-topbar-filters select {
  width: 100%;
  min-width: 0 !important;
  max-width: 100%;
  box-sizing: border-box;
}

.schedule-page .app-toolbar-filter-row .schedule-topbar-filters :is(.cs-trigger, .app-custom-select__trigger, select) {
  width: 100%;
  min-width: 0 !important;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.schedule-page .app-toolbar-filter-row .schedule-topbar-filters :is(
  .cs-label,
  .cs-value,
  .cs-placeholder,
  .app-custom-select__value
) {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .schedule-page .app-toolbar-filter-row .app-filter-group--wide {
    flex-wrap: wrap;
  }

  .schedule-page .app-toolbar-filter-row .app-filter-group--wide > .app-filter-group__label {
    width: 100%;
  }

  .schedule-page .app-toolbar-filter-row .schedule-topbar-filters {
    grid-template-columns: auto repeat(2, minmax(0, 1fr));
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Mobile schedule view (phone, ≤820px): dot calendar + "today" block,
   separated by a real drag splitter (#scheduleMobileSplitHandle) instead of
   an overlay sheet — dragging it trades height between the two blocks, same
   pointer-capture pattern as #scheduleSplitter / .waiting-zone__resize-handle
   elsewhere on this page. Visually modeled on teacher-cabinet.css's
   .tc-mobile-* block (same dot pattern, same cell sizing). The desktop
   grid/day panel above are hidden under the same breakpoint instead of being
   made touch-friendly — see schedule.js's "Mobile schedule view" section for
   the matching JS. Breakpoint matches teacher-cabinet.css:2086's own mobile
   switch on purpose.
   ───────────────────────────────────────────────────────────────────────── */

#scheduleMobileSplitWrap,
.sch-m-legend,
#scheduleMobileLessonSheet {
  display: none;
}

@media (max-width: 820px) {
  .schedule-page .schedule-main,
  .schedule-page .calendar-weekdays,
  .schedule-page #calendarGrid,
  .schedule-page .schedule-day-panel,
  .schedule-page #scheduleSplitter {
    display: none !important;
  }

  .sch-m-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0 14px 8px;
    padding: 0 2px;
  }

  .sch-m-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    white-space: nowrap;
  }

  #scheduleMobileSplitWrap {
    display: grid;
    margin: 0 14px 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: #121212;
    overflow: hidden;
  }

  #scheduleMobileView {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .sch-m-head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 6px;
    padding: 10px 12px 7px;
  }

  .sch-m-icon-btn,
  .sch-m-month-btn {
    height: 36px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
  }

  .sch-m-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
  }

  .sch-m-icon-btn:active {
    background: rgba(255, 255, 255, 0.06);
  }

  .sch-m-month-btn {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-size: 16px;
    font-weight: 800;
  }

  .sch-m-month-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sch-m-head,
  .sch-m-weekdays {
    flex: 0 0 auto;
  }

  .sch-m-weekdays,
  .sch-m-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .sch-m-weekdays {
    padding: 0 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .sch-m-weekdays span {
    min-height: 24px;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.48);
    font-size: 11px;
    font-weight: 750;
  }

  /* The viewport's height is whatever the split grid row gives
     #scheduleMobileView — schedule.js's syncMobileGridMode() decides, from
     that measured height, whether .sch-m-grid renders every week (rows
     stretch via grid-template-rows: repeat(N, 1fr), set in JS — so growing
     the month block visibly grows the grid, not just blank space under a
     fixed-height one) or only the selected date's single week row (an
     actual week-strip, not a scroll-clipped one). flex: 1 1 0 (not auto) so
     this always shrinks to the split's real allocation instead of the
     grid's content size. */
  .sch-m-grid-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
  }

  .sch-m-grid {
    height: 100%;
    border-left: 1px solid rgba(255, 255, 255, 0.055);
    border-top: 1px solid rgba(255, 255, 255, 0.055);
  }

  .sch-m-day {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: grid;
    align-items: center;
    justify-items: center;
    gap: 2px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.055);
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    background: #121212;
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 2px;
    cursor: pointer;
    font-family: inherit;
  }

  .sch-m-day.is-outside { color: rgba(255, 255, 255, 0.32); }
  .sch-m-day.is-today .sch-m-day-num { color: #fff; font-weight: 900; }
  .sch-m-day.is-selected {
    background: linear-gradient(180deg, #d9433a, #b82d27);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  }

  .sch-m-day-num { font-size: 13px; line-height: 1; }

  .sch-m-day-dots {
    width: 100%;
    min-height: 8px;
    display: flex;
    justify-content: center;
    gap: 3px;
    overflow: hidden;
  }

  .sch-m-day small {
    min-height: 11px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    line-height: 1;
  }
  .sch-m-day.is-selected small { color: #fff; font-weight: 850; }

  .sch-m-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex: 0 0 auto;
    display: inline-block;
    background: rgba(255, 255, 255, 0.3);
  }

  .sch-m-dot--subscription { background: var(--schedule-subscription); }
  .sch-m-dot--first { background: var(--schedule-first); }
  .sch-m-dot--group { background: var(--schedule-group); }
  .sch-m-dot--rental { background: var(--schedule-rental); }
  .sch-m-dot--single { background: var(--schedule-single); }

  /* ── Split handle between the month block and the "today" block — same
     visual treatment as .waiting-zone__resize-handle elsewhere on this page.
     Row heights (the grid-template-rows split) are set live by
     schedule.js's initMobileScheduleSheet()/setSplit(), not here. ── */

  #scheduleMobileSplitHandle {
    position: relative;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: row-resize;
    touch-action: none;
    border-top: 1px solid rgba(255, 255, 255, 0.055);
  }

  #scheduleMobileSplitHandle::before {
    content: "";
    width: 46px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    transition: width 0.15s ease, background 0.15s ease;
  }

  #scheduleMobileSplitHandle:hover::before,
  #scheduleMobileSplitHandle:focus-visible::before,
  #scheduleMobileSplitHandle.is-dragging::before {
    width: 76px;
    background: rgba(214, 70, 61, 0.85);
  }

  #scheduleMobileSheet {
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;
    overflow: hidden;
  }

  .sch-m-sheet-head {
    flex: 0 0 auto;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px 6px;
  }

  .sch-m-sheet-head strong { font-size: 15px; color: var(--text); }
  .sch-m-sheet-head span { color: var(--muted); font-size: 12px; }

  .sch-m-sheet-peek {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 0 14px 10px;
    color: var(--text);
    font-size: 13px;
  }

  #scheduleMobileSheet.is-peek .sch-m-sheet-peek { display: flex; }
  #scheduleMobileSheet.is-peek .sch-m-sheet-list { display: none; }

  .sch-m-peek-time { font-weight: 700; flex: 0 0 auto; }
  .sch-m-peek-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sch-m-peek-more { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
  .sch-m-peek-empty { color: var(--muted); }

  /* The peek state is only ~112px tall — the FAB would crowd/overlap the
     peek row at that height, so hide it until the sheet opens back up. */
  #scheduleMobileSheet.is-peek .sch-m-fab-wrap { display: none; }

  .sch-m-sheet-list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 14px 90px;
    display: grid;
    gap: 7px;
  }

  .sch-m-empty {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    padding: 24px 0;
  }

  .sch-m-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid transparent;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
    padding: 9px 10px;
    text-align: left;
    color: var(--text);
    cursor: pointer;
  }

  .sch-m-row--subscription { border-left-color: var(--schedule-subscription); }
  .sch-m-row--first { border-left-color: var(--schedule-first); }
  .sch-m-row--group { border-left-color: var(--schedule-group); }
  .sch-m-row--rental { border-left-color: var(--schedule-rental); }
  .sch-m-row--single { border-left-color: var(--schedule-single); }
  .sch-m-row.is-completed { opacity: 0.6; }

  .sch-m-row-time {
    flex: 0 0 auto;
    min-width: 54px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
  }

  .sch-m-row-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
  .sch-m-row-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
  }
  .sch-m-row-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 11px;
  }

  .sch-m-row-done { flex: 0 0 auto; color: #69c88e; font-size: 14px; }

  .sch-m-fab-wrap {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: grid;
    justify-items: end;
    gap: 8px;
  }

  .sch-m-fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 0;
    background: linear-gradient(145deg, #e45349, #b5281f);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    box-shadow: 0 10px 22px -8px rgba(216, 66, 57, 0.75);
    cursor: pointer;
  }

  .sch-m-fab-menu { display: grid; gap: 6px; }
  .sch-m-fab-menu button {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(20, 20, 20, 0.95);
    color: var(--text);
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
  }

  /* ── Lesson action sheet (tap on a row in the day sheet) ──────────── */

  #scheduleMobileLessonSheet.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
  }

  .sch-m-lsheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
  }

  .sch-m-lsheet-box {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 82vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px 14px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(12, 12, 12, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.6);
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    animation: schMLsheetIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  }

  @keyframes schMLsheetIn {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  .sch-m-lsheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
  }

  .sch-m-lsheet-head strong { display: block; font-size: 16px; color: var(--text); }
  .sch-m-lsheet-sub { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

  .sch-m-lsheet-close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
  }

  .sch-m-lsheet-menu { display: grid; gap: 7px; }
  .sch-m-lsheet-menu button {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }

  .sch-m-lsheet-menu button.is-danger {
    color: #ff7169;
    border-color: rgba(216, 65, 57, 0.4);
    background: rgba(156, 40, 36, 0.12);
  }

  /* buildEditForm()'s own markup (schedule.js), reused as-is inside the
     lesson sheet — just stack it to one column at this width instead of the
     desktop panel's 2-column grid (schedule.css:1174-1179). */
  #scheduleMobileLessonSheetBody .day-modal-edit-fields {
    grid-template-columns: 1fr;
  }
}

/* ── Automations tab (standing weekly schedule per client) ────────────── */
.schedule-view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.schedule-view-toggle__btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.schedule-view-toggle__btn.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.schedule-automations {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

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

.schedule-automations__hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.schedule-automations__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.schedule-automations__table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--stroke);
  white-space: nowrap;
}

.schedule-automations__table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--stroke);
  vertical-align: middle;
}

.schedule-automations__table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.schedule-automations__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.schedule-automations__status--active {
  background: rgba(74, 190, 118, 0.16);
  color: rgba(165, 230, 185, 0.95);
}

.schedule-automations__status--expiring {
  background: rgba(220, 160, 0, 0.18);
  color: rgba(255, 210, 120, 0.95);
}

.schedule-automations__status--stopped {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.schedule-automations__row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ── Automation setup modal (weekday picker) ──────────────────────────── */
.automation-setup-box {
  max-width: 640px;
}

/* Header row: title+hint on the left, a ghost close (×) on the right —
   replaces the shared .modal-content h2::after red underline, which read
   as one more red accent in a modal the admin specifically flagged as
   "too much red". */
.automation-setup-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.automation-setup-head h2 {
  padding-bottom: 0;
}

.automation-setup-head h2::after {
  display: none;
}

.automation-setup-close {
  border: none !important;
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.6) !important;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.automation-setup-close:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  transform: none !important;
}

.automation-setup-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.automation-setup-label {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.automation-setup-client-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.automation-setup-client-row .cs-wrap {
  flex: 1 1 auto;
}

.automation-setup-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--red-2, #d6463d);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.automation-setup-link:hover {
  text-decoration: underline;
}

.automation-setup-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
}

.automation-setup-weekdays {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.automation-setup-weekday {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.automation-setup-weekday:hover {
  background: rgba(255, 255, 255, 0.04);
}

.automation-setup-weekday:has(input:checked) {
  background: linear-gradient(180deg, var(--red-2), var(--red));
  border-color: transparent;
  color: #fff;
}

.automation-setup-weekday input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #fff;
  cursor: pointer;
}

.automation-setup-day {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 2px solid var(--red);
}

.automation-setup-day__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.automation-setup-day__head strong {
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 13px;
}

.automation-setup-day__remove {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--red-2, #d6463d) !important;
  font-size: 12px !important;
  font-weight: 500;
  padding: 2px !important;
  cursor: pointer;
}

.automation-setup-day__remove:hover {
  color: var(--red) !important;
  text-decoration: underline;
  transform: none !important;
}

.automation-setup-day__columns {
  display: grid;
  grid-template-columns: 90px 1fr 1fr 80px auto;
  gap: 8px;
  padding: 0 2px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.automation-setup-day__rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.automation-setup-row {
  display: grid;
  grid-template-columns: 90px 1fr 1fr 80px auto;
  gap: 8px;
  align-items: center;
}

.automation-setup-row input,
.automation-setup-row select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
}

/* Direction/teacher become CustomSelect-driven (see syncAutomationSetupRowSelects
   in schedule.js) so the open list matches the app's dark theme instead of
   falling back to the OS-native dropdown chrome — scoped compact to match
   the row's other fields, since the shared .cs-trigger default (54px,
   style.css) is sized for full-width modal forms, not a 5-column row. */
.automation-setup-row .cs-wrap {
  width: 100%;
  min-width: 0;
}

.automation-setup-row .cs-trigger {
  min-height: 36px !important;
  padding: 7px 28px 7px 10px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
  gap: 6px;
}

.automation-setup-row .cs-trigger .cs-chevron {
  right: 8px;
}

.automation-setup-row .cs-trigger .cs-icon {
  width: 20px;
  height: 20px;
  font-size: 12px;
}

.automation-setup-row__remove {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--muted) !important;
  font-size: 16px !important;
  cursor: pointer;
  line-height: 1;
}

.automation-setup-row__remove:hover {
  color: #fff !important;
  transform: none !important;
}

.automation-setup-add-time {
  width: 100%;
  border: 1px dashed rgba(255, 255, 255, 0.18) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.65) !important;
  font-size: 13px !important;
  font-weight: 500;
  padding: 9px !important;
  border-radius: 10px;
  cursor: pointer;
}

.automation-setup-add-time:hover {
  border-color: rgba(255, 255, 255, 0.32) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #fff !important;
  transform: none !important;
}

.automation-setup-until {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.automation-setup-until__date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--muted);
}

.automation-setup-until__date input[type="date"] {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  padding: 0;
  outline: none;
  color-scheme: dark;
}

.automation-setup-period__options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.automation-setup-chip {
  border: 1px solid var(--stroke) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  box-shadow: none !important;
  color: var(--text) !important;
  font-size: 12px !important;
  font-weight: 500;
  padding: 7px 12px !important;
  border-radius: 999px;
  cursor: pointer;
}

.automation-setup-chip:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  transform: none !important;
}

.automation-setup-info {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid rgba(90, 150, 220, 0.3);
  background: rgba(90, 150, 220, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: rgba(210, 225, 245, 0.85);
}

.automation-setup-info svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: rgba(130, 175, 230, 0.9);
}

@media (max-width: 640px) {
  .automation-setup-day__columns {
    display: none;
  }
  .automation-setup-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "time duration" "direction direction" "teacher teacher" "remove remove";
  }
}
