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

.icon-picker-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}

.icon-picker-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.07) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 10px !important;
  padding: 8px 14px !important;
  font-size: 20px;
  cursor: pointer;
  box-shadow: none !important;
  transition: background 0.15s !important;
}

.icon-picker-toggle:hover {
  background: rgba(255,255,255,0.12) !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

.icon-picker-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  padding: 10px;
  max-width: 320px;
  max-height: 280px;
  overflow-y: auto;
  background: rgba(18,18,18,0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.icon-picker-group-title {
  flex-basis: 100%;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.4);
  margin-top: 8px;
}

.icon-picker-group-title:first-child {
  margin-top: 0;
}

.icon-picker-dropdown.hidden {
  display: none;
}

.icon-preset-btn {
  background: rgba(255,255,255,0.07) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  box-shadow: none !important;
  transition: background 0.15s !important;
}

.icon-preset-btn:hover {
  background: rgba(255,255,255,0.14) !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

.icon-preset-btn.selected {
  background: rgba(194,53,43,0.3) !important;
  border-color: rgba(194,53,43,0.6) !important;
}

.icon-custom-input {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
  font-size: 16px;
  outline: none;
  width: 150px;
}

.teachers-page .crm-layout {
  display: grid;
  grid-template-columns: minmax(390px, 520px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 12px;
}

.teachers-page .crm-main {
  min-width: 0;
}

.teachers-page .crm-container {
  max-width: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.teachers-page .crm-header {
  margin: 0;
  border-radius: 12px;
  padding: 14px 16px;
}

.teachers-page .crm-header h1 {
  margin: 0;
  font-size: 26px;
}

.teachers-page .client-panel {
  position: sticky;
  top: 72px;
  right: auto;
  width: auto;
  height: calc(100vh - 86px);
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  overflow: auto;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.024), rgba(255,255,255,0.01)),
    rgba(10,10,10,0.62);
  box-shadow: var(--shadow);
}

.teachers-page .client-panel__empty,
.teachers-page .client-panel__content {
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.teachers-page .client-panel__empty {
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.teachers-page .client-panel__content.hidden,
.teachers-page .client-panel__empty.hidden {
  display: none !important;
}

.teachers-page .panel-close-btn {
  display: none;
}

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

  .teachers-table {
    min-width: 0;
  }
}

.teachers-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.summary-card {
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)), rgba(10,10,10,0.35);
  backdrop-filter: blur(12px);
}

.summary-card__label {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.07em;
}

.summary-card__value {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  font-family: 'Oswald', sans-serif;
}

.teachers-filters {
  padding: 14px;
  margin-bottom: 0;
  border-radius: 12px;
}

.teachers-filters__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.teachers-filters input,
.teachers-filters select {
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.35);
  color: #fff;
  padding: 10px 12px;
}

.teachers-filters .cs-wrap {
  width: 100%;
}

.teachers-filters .cs-trigger {
  width: 100% !important;
  min-height: 44px !important;
  border-radius: 12px !important;
  border-color: var(--stroke) !important;
  background: rgba(0,0,0,0.35) !important;
  color: #fff !important;
  padding: 10px 38px 10px 14px !important;
  font-size: 14px !important;
}

.teachers-filters .cs-trigger:hover {
  border-color: rgba(255,255,255,0.18) !important;
  background: rgba(255,255,255,0.045) !important;
}

.teachers-page .cs-dropdown-portal {
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 12px !important;
  background: rgba(17,17,17,0.98) !important;
  box-shadow: 0 18px 48px rgba(0,0,0,0.46) !important;
  overflow: hidden !important;
}

.teachers-page .cs-option {
  color: rgba(255,255,255,0.84) !important;
  background: transparent !important;
}

.teachers-page .cs-option:hover,
.teachers-page .cs-option.is-highlighted {
  background: rgba(255,255,255,0.07) !important;
  color: #fff !important;
}

.teachers-page .cs-option--active {
  background: rgba(194,53,43,0.22) !important;
  color: #fff !important;
}

.card-shell {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)), rgba(8,8,8,0.4);
  box-shadow: var(--shadow);
}

.teachers-table-wrap {
  overflow: hidden;
}

.teachers-catalog-panel {
  border-radius: 12px;
}

.teachers-catalog-head {
  min-height: 54px;
  padding: 0 14px;
  border-bottom: 1px solid var(--stroke-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255,255,255,0.88);
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.teachers-catalog-head strong {
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.68);
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  letter-spacing: 0;
}

.teachers-catalog {
  display: grid;
  gap: 7px;
  padding: 8px;
  max-height: min(620px, calc(100vh - 310px));
  overflow: auto;
}

.teacher-catalog-item {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,0.78);
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.teacher-catalog-item:hover,
.teacher-catalog-item:focus-visible {
  border-color: rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.045);
  color: #fff;
}

.teacher-catalog-item.is-selected {
  border-color: rgba(202,166,78,0.38);
  background: linear-gradient(90deg, rgba(202,166,78,0.16), rgba(202,166,78,0.04));
  color: #fff;
}

.teacher-catalog-item__icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 19px;
}

.teacher-catalog-item__main,
.teacher-catalog-item__side,
.teacher-catalog-item__metrics,
.teacher-catalog-item__rates {
  min-width: 0;
  display: grid;
}

.teacher-catalog-item__main {
  gap: 4px;
}

.teacher-catalog-item__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255,255,255,0.96);
  font-size: 14px;
  font-weight: 850;
}

.teacher-catalog-item__meta,
.teacher-catalog-item__sub,
.teacher-catalog-item__upcoming {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255,255,255,0.46);
  font-size: 12px;
  line-height: 1.25;
}

.teacher-catalog-item__sub {
  white-space: nowrap;
}

.teacher-catalog-item__side {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding-left: 48px;
}

.teacher-catalog-item__metrics,
.teacher-catalog-item__rates {
  gap: 3px;
  color: rgba(255,255,255,0.68);
  font-size: 11px;
  font-weight: 700;
}

.teacher-catalog-item__rates {
  text-align: right;
}

.teacher-catalog-item__upcoming {
  grid-column: 1 / -1;
}

.teacher-catalog-empty {
  min-height: 280px;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.34);
  font-size: 13px;
  text-align: center;
}

.teachers-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.teachers-table th,
.teachers-table td {
  padding: 12px;
  border-bottom: 1px solid var(--stroke-soft);
  font-size: 13px;
}

.teachers-table th {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
  font-family: 'Oswald', sans-serif;
  color: rgba(255,255,255,0.88);
}

.teachers-table tr:hover td {
  background: rgba(255,255,255,0.03);
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

.teacher-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--stroke);
}

.teacher-chip--active { background: rgba(54,167,84,0.2); }
.teacher-chip--inactive { background: rgba(194,53,43,0.2); }
.teacher-chip--temp-inactive { background: rgba(214,158,46,0.2); }

.teacher-chip--account-active { background: rgba(54,167,84,0.2); }
.teacher-chip--account-pending { background: rgba(214,158,46,0.2); }
.teacher-chip--account-none { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.55); }

.teacher-status-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.teacher-account-wrap {
  margin-top: 4px;
  text-align: right;
}

.teacher-status-until {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
}

.teacher-status-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.teacher-status-editor select,
.teacher-status-editor input {
  background:
    radial-gradient(120% 180% at 20% 0%, rgba(255,255,255,0.06), transparent 60%),
    rgba(10, 12, 16, 0.92);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.teacher-status-editor select {
  min-width: 170px;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.7) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.7) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 1px),
    calc(100% - 11px) calc(50% - 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.teacher-status-editor select:focus,
.teacher-status-editor input:focus {
  outline: none;
  border-color: rgba(214, 70, 61, 0.55);
  box-shadow: 0 0 0 3px rgba(214, 70, 61, 0.18);
}

.teacher-status-editor button {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  min-width: 38px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.teacher-status-editor button[data-role="save-status"] {
  background: linear-gradient(135deg, rgba(40, 145, 73, 0.35), rgba(27, 98, 50, 0.3));
  border-color: rgba(106, 198, 135, 0.4);
}

.teacher-status-editor button:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.24);
  transform: translateY(-1px);
}

.teacher-status-editor label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
}

.teacher-status-editor label.is-hidden {
  display: none;
}

.teacher-open-btn {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  cursor: pointer;
}

.teacher-tabs {
  display: none;
}

.teacher-tab-btn {
  border: 1px solid var(--stroke);
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.68);
  font-size: 12px;
  min-height: 38px;
  padding: 0 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1 0 min(150px, 18%);
  min-width: 112px;
  max-width: 170px;
  white-space: nowrap;
  font-weight: 750;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.teacher-tab-btn:hover {
  color: rgba(255,255,255,0.92);
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.07);
}

.teacher-tab-btn.is-active {
  background: linear-gradient(180deg, var(--red-2), var(--red));
  border-color: rgba(214,70,61,0.8);
  color: #fff;
}

.teacher-tab-btn__icon {
  display: inline-block;
  font-size: 15px;
  line-height: 1;
  opacity: 0.95;
}

.teacher-tab-btn__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teacher-simple-editor {
  display: grid;
  gap: 10px;
}

.teacher-profile-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.008)),
    rgba(255,255,255,0.012);
}

.teacher-profile-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.teacher-profile-card__eyebrow {
  display: block;
  margin-bottom: 4px;
  color: rgba(255,255,255,0.38);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.teacher-profile-card__head h3 {
  margin: 0;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 23px;
  line-height: 1.05;
  letter-spacing: 0;
  text-transform: uppercase;
}

.teacher-profile-card__head p {
  margin: 5px 0 0;
  color: rgba(255,255,255,0.42);
  font-size: 12px;
  font-weight: 750;
}

.teacher-profile-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.teacher-profile-card__edit,
.teacher-profile-card__cabinet,
.teacher-profile-card__invite {
  min-width: 128px;
  min-height: 36px;
}

.teacher-invite-dialog {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,0.68);
}

.teacher-invite-dialog__panel {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: #161616;
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
}

.teacher-invite-dialog__panel h3 {
  margin: 0;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.teacher-invite-dialog__panel p {
  margin: 0;
  color: rgba(255,255,255,0.68);
  line-height: 1.4;
}

.teacher-invite-dialog__link {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  background: #0d0d0d;
  color: #fff;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.teacher-invite-dialog__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.teacher-invite-dialog__actions button {
  min-width: 130px;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: #c4483f;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.teacher-invite-dialog__actions .teacher-invite-dialog__secondary {
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.82);
}

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

.teacher-info-tile {
  min-width: 0;
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,0.075);
  border-radius: 9px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.22);
}

.teacher-info-tile--wide {
  grid-column: 1 / -1;
}

.teacher-info-tile span {
  color: rgba(255,255,255,0.38);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.teacher-info-tile strong {
  min-width: 0;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.teacher-info-tile--notes {
  align-content: start;
}

.teacher-info-tile--notes strong {
  white-space: pre-wrap;
}

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

.teacher-info-tags b {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255,255,255,0.045);
  color: rgba(255,255,255,0.86);
  font-size: 12px;
  line-height: 1;
}

.teacher-editor-section {
  border: 1px solid var(--stroke-soft);
  border-radius: 10px;
  padding: 10px 12px 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.004)),
    rgba(255,255,255,0.008);
}

.teacher-editor-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.teacher-editor-section__head h3 {
  margin: 0;
  color: rgba(255,255,255,0.72);
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.teacher-editor-section__head span {
  color: rgba(255,255,255,0.28);
  font-size: 11px;
  font-weight: 700;
}

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

.teacher-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.teacher-field--wide {
  grid-column: 1 / -1;
}

.teacher-field span {
  color: rgba(255,255,255,0.42);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.teacher-field input,
.teacher-field select {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.42);
  color: #fff;
  padding: 7px 9px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.teacher-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.62) 50%), linear-gradient(135deg, rgba(255,255,255,0.62) 50%, transparent 50%);
  background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.teacher-field textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.42);
  color: #fff;
  padding: 8px 9px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.35;
  outline: none;
}

.teacher-field .cs-wrap {
  width: 100%;
}

.teacher-field .cs-trigger {
  min-height: 34px !important;
  border-radius: 8px !important;
  border-color: rgba(255,255,255,0.12) !important;
  background: rgba(0,0,0,0.42) !important;
  padding: 6px 30px 6px 9px !important;
  font-size: 13px !important;
}

.teacher-field .cs-multi-badges {
  gap: 4px !important;
}

.teacher-field .cs-badge {
  min-height: 20px !important;
  padding: 0 6px !important;
  border-radius: 7px !important;
  font-size: 11px !important;
}

.teacher-field input:focus,
.teacher-field select:focus,
.teacher-field textarea:focus {
  border-color: rgba(214,70,61,0.85);
  box-shadow: 0 0 0 3px rgba(194,53,43,0.18);
}

.teacher-extra-rates {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.teacher-rate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 140px) auto;
  gap: 8px;
  align-items: center;
}

.teacher-rate-row input {
  min-width: 0;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.42);
  color: #fff;
  padding: 7px 9px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.teacher-rate-row input::placeholder {
  color: rgba(255,255,255,0.36);
}

.teacher-rate-row input:focus {
  border-color: rgba(214,70,61,0.85);
  box-shadow: 0 0 0 3px rgba(194,53,43,0.18);
}

.teacher-rate-row__remove,
.teacher-add-rate-btn {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12) !important;
  background: rgba(255,255,255,0.06) !important;
  color: rgba(255,255,255,0.74) !important;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
}

.teacher-add-rate-btn {
  margin-top: 8px;
  padding: 0 12px;
}

.teacher-rate-effective-from {
  margin-top: 12px;
  max-width: 220px;
}

.teacher-rate-row__remove {
  width: 34px;
  padding: 0;
}

.teacher-rate-row__remove:hover,
.teacher-add-rate-btn:hover {
  border-color: rgba(255,255,255,0.2) !important;
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
}

.teacher-lang-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.teacher-lang-chip {
  min-width: 50px;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.045);
  color: rgba(255,255,255,0.68);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  user-select: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.teacher-lang-chip input {
  display: none;
}

.teacher-lang-chip:hover {
  border-color: rgba(255,255,255,0.22);
  color: #fff;
}

.teacher-lang-chip.is-selected {
  border-color: rgba(74, 190, 118, 0.52);
  background: rgba(74, 190, 118, 0.16);
  color: rgba(215,255,226,0.96);
}

.teacher-simple-editor__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: rgba(255,255,255,0.62);
  font-size: 11px;
}

.teacher-simple-editor__summary span {
  border: 1px solid var(--stroke-soft);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255,255,255,0.035);
}

.teacher-simple-editor__actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.teacher-simple-editor__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  /* The panel sits flush against the viewport's bottom-right corner, exactly
     where the fixed AI-assist launcher (52px, 24px inset, z-index near max)
     lives — without this clearance the launcher sits on top of the Save
     button and swallows its clicks. */
  padding-right: 80px;
  margin-bottom: 80px;
}

.teacher-simple-editor__actions .panel-action-btn {
  min-width: 140px;
  min-height: 38px;
}

.panel-action-btn--ghost {
  background: rgba(255,255,255,0.07) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.76) !important;
  box-shadow: none !important;
}

.panel-action-btn--danger {
  background: rgba(194,53,43,0.16) !important;
  border-color: rgba(194,53,43,0.4) !important;
  color: rgba(255,100,90,0.95) !important;
  box-shadow: none !important;
}

.panel-action-btn--danger:hover {
  background: rgba(194,53,43,0.26) !important;
  border-color: rgba(194,53,43,0.55) !important;
  color: rgba(255,120,110,1) !important;
}

.panel-action-select {
  min-width: 132px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.76);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.panel-action-select:disabled {
  opacity: 0.5;
  cursor: default;
}

/* teacherScheduleAccessSelect is enhanced by CustomSelect (see custom-select.js) —
   the native <select>.panel-action-select above stays as the underlying form
   control (hidden by the component) while .cs-wrap/.cs-trigger below is the
   actual themed control the user sees, sized to match the ghost buttons beside it. */
.teacher-profile-card__actions .cs-wrap {
  width: auto;
  min-width: 132px;
}

.teacher-profile-card__actions .cs-trigger {
  width: auto;
  min-width: 132px;
  min-height: 38px;
  padding: 0 34px 0 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.07) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.76) !important;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 760px) {
  .teacher-profile-card__head,
  .teacher-simple-editor__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-simple-editor__footer {
    padding-right: 0;
  }

  .teacher-profile-card__actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-profile-card__edit,
  .teacher-profile-card__cabinet,
  .teacher-profile-card__invite {
    width: 100%;
  }

  .teacher-invite-dialog__actions {
    flex-direction: column;
  }

  .teacher-invite-dialog__actions button {
    width: 100%;
  }

  .teacher-profile-card__grid,
  .teacher-simple-editor__grid {
    grid-template-columns: 1fr;
  }

  .teacher-tabs {
    gap: 6px;
  }

  .teacher-tab-btn {
    flex-basis: auto;
    min-width: 104px;
    padding: 0 10px;
  }

  .teacher-tab-btn__icon { font-size: 14px; }
}

.teacher-kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.teacher-kv div {
  border: 1px solid var(--stroke-soft);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
}

.teacher-kv span { color: var(--muted); display: block; margin-bottom: 4px; }

.rate-current-card {
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.rate-current-card:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
}

.teacher-kv input,
.teacher-kv select,
#teacherPanelBody textarea {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.48);
  color: #fff;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

#teacherPanelBody textarea {
  min-height: 92px;
  resize: vertical;
}

.teacher-kv input:hover,
.teacher-kv select:hover,
#teacherPanelBody textarea:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.58);
}

.teacher-kv input:focus,
.teacher-kv select:focus,
#teacherPanelBody textarea:focus {
  border-color: rgba(214,70,61,0.85);
  box-shadow: 0 0 0 3px rgba(194,53,43,0.18);
  background: rgba(0,0,0,0.64);
}

.teacher-kv select {
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.7) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.7) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.teacher-kv input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.75);
  cursor: pointer;
}

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

.teacher-list-item {
  border: 1px solid var(--stroke-soft);
  border-radius: 10px;
  padding: 10px;
}

@media (max-width: 1120px) {
  .teachers-page .crm-layout {
    grid-template-columns: 1fr;
  }

  .teachers-page .client-panel {
    position: static;
    height: auto;
    min-height: 420px;
  }

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

.teacher-rate-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.teacher-rate-modal__box {
  width: min(440px, 100%);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)), rgba(10,10,10,0.92);
  box-shadow: var(--shadow);
}

.teacher-rate-modal__box h3 {
  margin: 0 0 12px;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.teacher-rate-modal__box input {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.45);
  color: #fff;
  padding: 10px 12px;
}

.teacher-rate-modal__date-label {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.teacher-rate-modal__date-label input {
  margin-top: 4px;
}

.teacher-rate-modal__actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.teachers-availability-planner {
  margin-top: 14px;
  padding: 16px;
  border-radius: 12px;
}

.teacher-availability-card {
  border: 1px solid var(--stroke-soft);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.006)),
    rgba(255,255,255,0.01);
}

.teacher-availability-card__hint {
  margin-top: 10px;
  border: 1px solid rgba(218, 172, 64, 0.16);
  border-radius: 9px;
  padding: 8px 10px;
  background: rgba(218, 172, 64, 0.055);
  color: rgba(255,255,255,0.48);
  font-size: 12px;
  line-height: 1.3;
}

.teacher-profile-card + .teacher-availability-card {
  margin-top: 12px;
}

.teachers-availability-planner__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.teachers-availability-planner__head h3 {
  margin: 0 0 4px;
  font-family: 'Oswald', sans-serif;
}

.teachers-availability-planner__head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.teachers-availability-planner__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.teacher-availability-card .teachers-availability-planner__controls {
  gap: 6px;
}

.teacher-availability-card .panel-action-btn {
  min-height: 34px;
  border-radius: 9px;
  padding-inline: 10px;
}

.teachers-availability-planner__controls select {
  min-width: 280px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.35);
  color: #fff;
  padding: 10px 12px;
}

.teachers-availability-planner__controls .cs-wrap {
  min-width: 280px;
}

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

.teachers-availability-planner__controls .cs-dropdown {
  border-radius: 12px !important;
  border: 1px solid var(--stroke) !important;
  background: rgba(16,16,16,0.98) !important;
}

.teachers-availability-planner__controls .cs-option {
  color: #fff !important;
}

.availability-action-btn {
  min-height: 36px;
  padding-inline: 11px;
  border-color: rgba(218, 172, 64, 0.28) !important;
  background: rgba(218, 172, 64, 0.12) !important;
  color: rgba(255, 232, 174, 0.96) !important;
  white-space: nowrap;
}

.availability-action-btn:hover {
  border-color: rgba(218, 172, 64, 0.48) !important;
  background: rgba(218, 172, 64, 0.22) !important;
}

.availability-month-title {
  min-width: 180px;
  text-align: center;
  font-weight: 700;
  text-transform: capitalize;
}

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

.availability-calendar-cell {
  border: 1px solid var(--stroke-soft);
  border-radius: 14px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #fff;
}

.availability-calendar-cell--head {
  min-height: 26px;
  font-size: 12px;
  color: var(--muted);
  border: none;
  border-radius: 0;
  background: transparent;
  font-weight: 700;
}

.availability-calendar-cell--pad {
  opacity: 0.2;
  border: none;
  background: transparent;
}

.availability-calendar-cell--day {
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  min-height: 104px;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 8px 10px;
  display: grid;
  align-content: start;
  gap: 5px;
  background: rgba(0, 0, 0, 0.22);
}

.teachers-page .availability-calendar-grid {
  gap: 5px;
}

.teachers-page .availability-calendar-cell--day {
  min-height: 70px;
  border-radius: 9px;
  padding: 7px;
}

.teachers-page .availability-day-number {
  font-size: 17px;
}

.teachers-page .avail-cell-slot {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.availability-calendar-cell--day:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-1px);
}

.availability-day-number {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

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

.availability-calendar-cell--day.is-empty { background: rgba(0, 0, 0, 0.22); }
.availability-calendar-cell--day.is-weekly { border-color: rgba(255,255,255,0.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); }
.availability-calendar-cell--day.is-available { border-color: rgba(54,167,84,0.55); box-shadow: inset 0 0 0 1px rgba(54,167,84,0.2); }
.availability-calendar-cell--day.is-unavailable { border-color: rgba(194,53,43,0.65); box-shadow: inset 0 0 0 1px rgba(194,53,43,0.22); }
.availability-calendar-cell--day.is-mixed { border-color: rgba(255,255,255,0.35); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); }
.availability-calendar-cell--day.is-selected { outline: 1px solid rgba(194, 53, 43, 0.85); box-shadow: inset 0 0 0 1px rgba(194,53,43,0.45); }
.availability-calendar-cell--day.is-drag-target { box-shadow: inset 0 0 0 2px rgba(214,70,61,0.72); }
.availability-calendar-cell--day.is-slot-drop-target {
  border-color: rgba(218, 172, 64, 0.8);
  background: rgba(218, 172, 64, 0.11);
  box-shadow: inset 0 0 0 2px rgba(218, 172, 64, 0.45);
}
.availability-calendar-cell--day.is-slot-copy-target {
  border-color: rgba(74, 190, 118, 0.75);
  background: rgba(74, 190, 118, 0.1);
  box-shadow: inset 0 0 0 2px rgba(74, 190, 118, 0.42);
}

.availability-editor {
  margin-top: 14px;
  border-top: 1px solid var(--stroke-soft);
  padding-top: 14px;
}

.availability-editor h4 {
  margin: 0 0 10px;
}

.availability-editor__form {
  display: grid;
  grid-template-columns: 180px 120px 120px 1fr auto;
  gap: 8px;
}

.availability-editor__form select,
.availability-editor__form input {
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.35);
  color: #fff;
  padding: 10px 12px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.availability-editor__form select:hover,
.availability-editor__form input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.availability-editor__form select:focus,
.availability-editor__form 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);
}

.avail-cell-slot {
  display: block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 6px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  cursor: grab;
  user-select: none;
  transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
}

.avail-cell-slot:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
}

.avail-cell-slot.is-dragging {
  opacity: 0.42;
  cursor: grabbing;
}

.availability-slot-dragging .availability-calendar-cell--day {
  cursor: copy;
}
.avail-cell-slot--avail {
  background: rgba(54, 167, 84, 0.25) !important;
  color: rgba(130, 240, 160, 1) !important;
}
.avail-cell-slot--unavail {
  background: rgba(194, 53, 43, 0.3) !important;
  color: rgba(255, 120, 110, 1) !important;
}

.avail-interval-popover {
  position: absolute;
  z-index: 50000;
  width: 320px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)), rgba(10,10,14,0.97);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  padding: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.avail-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
}

.avail-popover-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}
.avail-popover-close:hover { color: #fff; }

.avail-choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.avail-choice-btn {
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.avail-choice-btn:hover { transform: translateY(-1px); }
.avail-choice-btn--avail { border-color: rgba(54,167,84,0.4); }
.avail-choice-btn--avail:hover { background: rgba(54,167,84,0.18); border-color: rgba(54,167,84,0.7); }
.avail-choice-btn--unavail { border-color: rgba(194,53,43,0.4); }
.avail-choice-btn--unavail:hover { background: rgba(194,53,43,0.18); border-color: rgba(194,53,43,0.7); }

.avail-loop-day-btn {
  width: 100%;
  min-height: 34px;
  margin: -2px 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(218, 172, 64, 0.28);
  background: rgba(218, 172, 64, 0.1);
  color: rgba(255, 232, 174, 0.96);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.avail-loop-day-btn:hover {
  border-color: rgba(218, 172, 64, 0.5);
  background: rgba(218, 172, 64, 0.18);
}

.avail-loop-options {
  display: grid;
  gap: 6px;
  margin: -4px 0 12px;
}

.avail-loop-options--hidden {
  display: none;
}

.avail-loop-options button {
  width: 100%;
  min-height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.035);
  color: rgba(255,255,255,0.76);
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  padding: 7px 9px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.avail-loop-options button:hover {
  border-color: rgba(218, 172, 64, 0.32);
  background: rgba(218, 172, 64, 0.1);
  color: #fff;
}

.avail-popover-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.avail-popover-form--hidden {
  display: none;
}

.avail-popover-form select,
.avail-popover-form input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.4);
  color: #fff;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.avail-popover-form select:focus,
.avail-popover-form input:focus {
  outline: none;
  border-color: rgba(214,70,61,0.7);
  background: rgba(0,0,0,0.55);
}
.avail-popover-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.7) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.7) 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 1px), calc(100% - 9px) calc(50% - 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
}

.avail-pop-times {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avail-pop-times span { color: rgba(255,255,255,0.5); font-size: 14px; flex-shrink: 0; }
.avail-pop-times input { flex: 1; }

.avail-pop-input--error { border-color: rgba(214,70,61,0.85) !important; }

.avail-pop-save-btn {
  width: 100%;
  justify-content: center;
}

.avail-popover-slots {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--stroke-soft);
  padding-top: 10px;
}

.avail-popover-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}

.avail-popover-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.avail-popover-slot--avail { border-color: rgba(54,167,84,0.3); }
.avail-popover-slot--unavail { border-color: rgba(194,53,43,0.3); }
.avail-popover-slot:hover {
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

.avail-popover-slot button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 13px;
  padding: 0 4px;
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.avail-popover-slot button:hover { color: rgba(214,70,61,0.9); }

.avail-popover-slot__actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.avail-popover-slot [data-edit-pop-slot-btn]:hover {
  color: rgba(255, 232, 174, 0.98);
}

.availability-day-slots {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.availability-day-slot {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.28);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.availability-day-slot:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.availability-day-slot button {
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  color: #fff;
  padding: 4px 10px;
  cursor: pointer;
}

.availability-day-slot--empty {
  color: var(--muted);
}

@media (max-width: 840px) {
  .teachers-availability-planner__controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .teachers-availability-planner__controls select {
    min-width: 0;
    width: 100%;
  }

  .availability-editor__form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .availability-calendar-grid {
    grid-template-columns: repeat(7, 86px);
    min-width: calc(7 * 86px + 6 * 6px);
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .availability-calendar-cell--day {
    min-height: 92px;
    padding: 7px;
    gap: 4px;
  }

  .availability-editor__form {
    grid-template-columns: 1fr;
  }
}

/* Teachers workspace: catalog on the left, selected teacher workspace on the right. */
.teachers-page .crm-layout {
  display: grid;
  grid-template-columns: minmax(390px, 43%) minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 12px;
}

.teachers-page .crm-main,
.teachers-page .crm-container {
  display: contents;
}

.teachers-page .crm-header {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  padding: 2px 4px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.teachers-page .crm-breadcrumb {
  display: none;
}

.teachers-page .crm-header h1 {
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1;
  text-transform: uppercase;
}

.teachers-page .crm-subtitle {
  margin-top: 5px;
  font-size: 12px;
}

.teachers-page .teachers-summary {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
  margin: 0;
}

.teacher-kpi-card {
  min-width: 0;
  min-height: 86px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--ui-border, var(--stroke));
  border-radius: 10px;
  background: var(--ui-surface, rgba(10, 10, 10, 0.62));
  color: var(--ui-text, inherit);
  box-shadow: var(--shadow);
}

.teacher-kpi-card__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ui-border-strong, var(--stroke));
  border-radius: 50%;
  color: var(--red-2);
  background: var(--ui-surface-soft, rgba(255, 255, 255, 0.035));
}

.teacher-kpi-card__icon svg {
  width: 22px;
  height: 22px;
}

.teacher-kpi-card__copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.teacher-kpi-card__label {
  color: var(--ui-muted, var(--muted));
  font-family: 'Oswald', sans-serif;
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.teacher-kpi-card__value {
  overflow: hidden;
  color: var(--ui-text, inherit);
  font-family: 'Oswald', sans-serif;
  font-size: clamp(20px, 1.7vw, 27px);
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teachers-page .teachers-filters {
  grid-column: 1;
  grid-row: 3;
  min-width: 0;
  padding: 7px;
  border-radius: 10px;
}

.teachers-page .teachers-filters__row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.teachers-page .teachers-filters .cs-trigger {
  min-height: 34px !important;
  padding: 7px 30px 7px 10px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
}

.teachers-page .teachers-catalog-panel {
  grid-column: 1;
  grid-row: 4;
  min-width: 0;
  min-height: 0;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
}

.teachers-page .teachers-catalog-head {
  min-height: 44px;
  padding-inline: 12px;
  font-size: 14px;
}

.teachers-page .teachers-catalog {
  max-height: calc(100vh - 300px);
  gap: 5px;
  padding: 7px;
}

.teachers-page .teacher-catalog-item {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 9px 10px;
}

.teachers-page .teacher-catalog-item__icon {
  width: 40px;
  height: 40px;
}

.teachers-page .teacher-catalog-item__main {
  gap: 3px;
}

.teachers-page .teacher-catalog-item__name {
  font-size: 13px;
}

.teachers-page .teacher-catalog-item__meta,
.teachers-page .teacher-catalog-item__sub {
  font-size: 10px;
}

.teachers-page .teacher-catalog-item__side {
  grid-column: 3;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 9px;
  padding: 0;
}

.teachers-page .teacher-catalog-item__metrics {
  gap: 2px;
  text-align: right;
  white-space: nowrap;
}

.teachers-page .client-panel {
  grid-column: 2;
  grid-row: 2 / 5;
  position: sticky;
  top: 72px;
  align-self: start;
  width: auto;
  height: calc(100vh - 86px);
  min-width: 0;
  overflow: auto;
  border-color: var(--ui-border, var(--stroke));
  border-radius: 10px;
  background: var(--ui-surface, rgba(10, 10, 10, 0.62));
}

.teachers-page .client-panel__content {
  min-height: 100%;
  padding: 0;
}

.teachers-page .client-panel__empty {
  padding: 22px;
}

.teachers-page .client-panel__header {
  display: block;
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid var(--ui-border-soft, var(--stroke-soft));
}

.teacher-detail-hero {
  min-width: 0;
}

.teacher-detail-hero,
.teacher-detail-identity,
.teacher-detail-actions,
.teacher-detail-key,
.teacher-detail-presence {
  display: flex;
  align-items: center;
}

.teacher-detail-hero {
  justify-content: space-between;
  gap: 14px;
}

.teacher-detail-identity {
  min-width: 0;
  gap: 11px;
}

.teacher-detail-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ui-border-strong, var(--stroke));
  border-radius: 10px;
  background: var(--ui-surface-soft, rgba(255, 255, 255, 0.05));
  color: var(--ui-text, inherit);
  font-size: 25px;
}

.teacher-detail-title {
  min-width: 0;
}

.teacher-detail-title h2 {
  margin: 0;
  overflow: hidden;
  color: var(--ui-text, inherit);
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-detail-title p {
  margin: 4px 0 0;
  color: var(--ui-muted, var(--muted));
  font-size: 11px;
}

.teacher-detail-key {
  gap: 5px;
  margin-top: 5px;
  color: var(--ui-muted, var(--muted));
  font-size: 10px;
}

.teacher-detail-presence {
  display: inline-flex;
  gap: 5px;
}

.teacher-detail-presence::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: '';
  opacity: 0.55;
}

.teacher-detail-presence.is-online::before {
  opacity: 1;
}

.teacher-detail-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 6px;
}

.teacher-detail-actions .panel-action-btn,
.teacher-detail-actions .cs-trigger {
  min-width: 0 !important;
  min-height: 34px !important;
  padding: 7px 11px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  white-space: nowrap;
}

.teacher-detail-actions .cs-wrap {
  min-width: 128px;
}

.teacher-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.teacher-detail-stats article,
.teacher-finance-grid article {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--ui-border-soft, var(--stroke-soft));
  border-radius: 8px;
  background: var(--ui-surface-soft, rgba(255, 255, 255, 0.025));
}

.teacher-detail-stats span,
.teacher-finance-grid span {
  color: var(--ui-muted, var(--muted));
  font-family: 'Oswald', sans-serif;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.teacher-detail-stats strong,
.teacher-finance-grid strong {
  overflow: hidden;
  color: var(--ui-text, inherit);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-detail-stats small {
  overflow: hidden;
  color: var(--ui-muted, var(--muted));
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.teachers-page .client-panel .teacher-tabs {
  display: flex;
  gap: 16px;
  padding: 0 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--ui-border-soft, var(--stroke-soft));
}

body.teachers-page .client-panel .teacher-tab-btn {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 38px;
  max-width: none;
  padding: 0 2px !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--ui-muted, var(--muted)) !important;
  box-shadow: none !important;
}

body.teachers-page .client-panel .teacher-tab-btn:hover {
  color: var(--ui-text, inherit) !important;
}

body.teachers-page .client-panel .teacher-tab-btn.is-active {
  border-bottom-color: var(--red-2) !important;
  background: transparent !important;
  color: var(--ui-text, inherit) !important;
}

.teachers-page #teacherPanelBody {
  margin: 0;
  padding: 10px;
  border: 0;
}

.teacher-detail-view {
  min-width: 0;
}

.teacher-profile-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--ui-border-soft, var(--stroke-soft));
  border-radius: 9px;
}

.teacher-profile-field {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(100px, 38%) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ui-border-soft, var(--stroke-soft));
}

.teacher-profile-field:nth-child(odd) {
  border-right: 1px solid var(--ui-border-soft, var(--stroke-soft));
}

.teacher-profile-field:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.teacher-profile-field span {
  color: var(--ui-muted, var(--muted));
  font-size: 10px;
}

.teacher-profile-field strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ui-text, inherit);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.teacher-detail-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.teacher-detail-section-head h3 {
  margin: 0;
  color: var(--ui-text, inherit);
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  text-transform: uppercase;
}

.teacher-detail-section-head p {
  margin: 3px 0 0;
  color: var(--ui-muted, var(--muted));
  font-size: 11px;
}

.teacher-finance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.teacher-detail-list,
.teacher-history-list {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.teacher-detail-list__row,
.teacher-history-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--ui-border-soft, var(--stroke-soft));
  border-radius: 8px;
  background: var(--ui-surface-soft, rgba(255, 255, 255, 0.02));
  color: var(--ui-text, inherit);
  font-size: 11px;
}

.teacher-detail-list__row > div,
.teacher-history-row > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.teacher-detail-list__row span,
.teacher-history-row span,
.teacher-history-row time {
  color: var(--ui-muted, var(--muted));
  font-size: 10px;
}

.teacher-detail-empty {
  min-height: 140px;
  display: grid;
  place-items: center;
  color: var(--ui-muted, var(--muted));
  font-size: 12px;
}

.teachers-page .teacher-availability-card {
  margin-top: 10px;
  padding: 10px;
  border-radius: 9px;
}

.teachers-page .teachers-availability-planner__head h3 {
  font-size: 15px;
}

.teachers-page .teachers-availability-planner__head p,
.teachers-page .teacher-availability-card__hint {
  font-size: 10px;
}

.teachers-page .teacher-availability-card__hint {
  margin-top: 7px;
  padding: 6px 8px;
}

.teachers-page .availability-calendar-grid {
  gap: 3px;
  margin-top: 8px;
}

.teachers-page .availability-calendar-cell--day {
  min-height: 58px;
  padding: 5px;
}

.teachers-page .availability-day-number {
  font-size: 13px;
}

@media (max-width: 1180px) {
  .teachers-page .crm-layout {
    grid-template-columns: minmax(330px, 40%) minmax(0, 1fr);
  }

  .teacher-detail-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .teacher-detail-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .teacher-detail-stats,
  .teacher-finance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teachers-page .teacher-catalog-item__side {
    grid-column: 1 / -1;
    padding-left: 50px;
  }
}

@media (max-width: 900px) {
  .teachers-page .crm-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .teachers-page .crm-header,
  .teachers-page .teachers-summary,
  .teachers-page .teachers-filters,
  .teachers-page .teachers-catalog-panel,
  .teachers-page .client-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .teachers-page .client-panel {
    position: static;
    height: auto;
    min-height: 540px;
  }

  .teachers-page .teachers-catalog {
    max-height: 460px;
  }
}

@media (max-width: 620px) {
  .teachers-page .teachers-summary,
  .teachers-page .teachers-filters__row,
  .teacher-profile-matrix {
    grid-template-columns: minmax(0, 1fr);
  }

  .teacher-profile-field,
  .teacher-profile-field:nth-child(odd),
  .teacher-profile-field:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--ui-border-soft, var(--stroke-soft));
  }

  .teacher-profile-field:last-child {
    border-bottom: 0;
  }

  .teacher-detail-stats,
  .teacher-finance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-detail-list__row,
  .teacher-history-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .teacher-detail-list__row > span,
  .teacher-history-row > span {
    grid-column: 1 / -1;
  }
}
