:root {
  --ink: #17212b;
  --muted: #667486;
  --line: rgba(23, 33, 43, 0.12);
  --blue: #159eef;
  --green: #48cbb9;
  --orange: #ff8a3d;
  --paper: #fff;
  --soft: #f5fbff;
  --shadow: 0 16px 44px rgba(22, 42, 70, 0.1);
}

* {
  box-sizing: border-box;
}

body.crm-page {
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6fbff;
}

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

button {
  cursor: pointer;
}

.crm-topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px max(24px, calc((100vw - 1220px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.crm-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.crm-brand img {
  width: 54px;
  height: 42px;
  object-fit: contain;
}

.crm-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.crm-user button,
.crm-filters button,
.lead-action {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-weight: 900;
  padding: 0 16px;
}

.crm-shell {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 18px;
  width: min(1380px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0;
  align-items: start;
}

[data-crm-view] {
  grid-column: 2;
  min-width: 0;
}

.crm-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.crm-hero--filters-only {
  justify-content: flex-end;
}

.crm-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crm-hero h1 {
  margin: 8px 0 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
}

.crm-hero p {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
}

.crm-filters {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 170px auto;
  gap: 10px;
}

.crm-filters input,
.crm-filters select,
.lead-manager,
.lead-status,
.lead-note {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: 0;
  padding: 0 12px;
}

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

.crm-summary article {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(22, 42, 70, 0.06);
}

.crm-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.crm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.crm-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  padding: 0 14px;
}

.crm-tabs button.is-active {
  border-color: rgba(21, 158, 239, 0.35);
  background: #eaf6ff;
  color: var(--ink);
}


.crm-tabs span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 24px;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
}
.crm-tabs .crm-role-new-count { background: #e53935; }
.crm-tabs .crm-role-new-count[hidden] { display: none; }
.crm-tabs button.has-new .crm-role-total { display: none; }

.crm-help {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid rgba(21, 158, 239, 0.2);
  border-radius: 8px;
  background: #eef8ff;
  color: var(--ink);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 800;
}

.crm-help span {
  color: var(--muted);
}

.crm-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.crm-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.crm-table th,
.crm-table td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.crm-table th {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-name {
  display: block;
  font-weight: 900;
}

.client-id {
  display: inline-flex;
  margin-top: 6px;
  border-radius: 6px;
  background: #eaf6ff;
  color: #087fc5;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 900;
}

.client-id-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.user-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 6px;
  border-radius: 999px;
  background: #e8f8ef;
  color: #168450;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

.user-status-badge[data-user-status="blocked"] {
  background: #ffe8e6;
  color: #d3281f;
}

.user-status-badge[data-user-status="temporary"] {
  background: #fff2e4;
  color: #bd5b0d;
}

.user-status-badge[data-user-status="deleted"] {
  background: #edf0f3;
  color: #687386;
}

.user-status-badge--inline {
  margin-top: 0;
  vertical-align: middle;
}

.client-meta,
.lead-meta {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.client-block-meta {
  color: #c63a31;
}

.lead-controls {
  display: grid;
  grid-template-columns: 150px 160px auto;
  gap: 8px;
  align-items: start;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #eef3f7;
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill[data-status="new"] {
  background: #fff2e8;
  color: #c45b12;
}

.status-pill[data-status="contacted"] {
  background: #eaf6ff;
  color: #087fc5;
}

.status-pill[data-status="paid"],
.status-pill[data-status="studying"] {
  background: #e9fbf7;
  color: #168977;
}

.lead-note {
  min-height: 42px;
  resize: vertical;
  padding-top: 10px;
}

.lead-action {
  background: var(--blue);
}

.lead-action--danger {
  background: #e5483d;
}

.lead-action--muted {
  background: #536274;
}

.client-summary-row.is-expanded td {
  background: #f8fbfd;
  border-bottom-color: transparent;
}

.client-summary-row td {
  padding-top: 9px;
  padding-bottom: 9px;
  vertical-align: middle;
}

.crm-table td.crm-shift--day {
  background: #fff0f6;
  color: #972456;
  font-weight: 800;
}

.crm-table td.crm-shift--night {
  background: #eaf3ff;
  color: #1658a0;
  font-weight: 800;
}

.teachers-crm-table {
  table-layout: fixed;
  min-width: 1120px;
}

.teachers-crm-table col[data-teacher-col="teacher"] { width: 220px; }
.teachers-crm-table col[data-teacher-col="client_id"] { width: 125px; }
.teachers-crm-table col[data-teacher-col="email"] { width: 250px; }
.teachers-crm-table col[data-teacher-col="crm_status"] { width: 145px; }
.teachers-crm-table col[data-teacher-col="profile_status"] { width: 170px; }
.teachers-crm-table col[data-teacher-col="manager"] { width: 135px; }
.teachers-crm-table col[data-teacher-col="created"] { width: 145px; }

.teachers-crm-table th {
  position: relative;
  padding: 8px 12px;
  vertical-align: top;
}

.teachers-crm-table th > button[data-teacher-sort] {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.teachers-crm-table th > button[data-teacher-sort].is-active {
  color: var(--blue);
}

.teachers-crm-table th input,
.teachers-crm-table th select {
  width: 100%;
  min-height: 28px;
  margin-top: 6px;
  border: 1px solid #d7e3ee;
  border-radius: 7px;
  background: #fff;
  padding: 0 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.teachers-crm-table th input.is-active,
.teachers-crm-table th select.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(21, 158, 239, .14);
}

.teacher-date-filters {
  display: grid;
  gap: 4px;
}

.teacher-clear-filters {
  width: 100%;
  min-height: 26px;
  margin-top: 5px;
  border: 0;
  border-radius: 7px;
  background: #eaf6ff;
  color: #087fc5;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.teacher-col-resize {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 2;
  width: 8px;
  height: 100%;
  cursor: col-resize;
}

.teacher-col-resize:hover {
  background: rgba(21, 158, 239, .2);
}

.client-compact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
}

.client-name-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.client-summary-row .client-name-button {
  max-width: min(340px, 100%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-email {
  display: inline-block;
  max-width: 100%;
  min-width: 0;
  color: #657487;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-publication-status.is-published,
.profile-publication-status.is-approved {
  background: #e8f8ef;
  color: #168450;
}

.profile-publication-status.is-pending_review,
.profile-publication-status.is-submitted {
  background: #fff7df;
  color: #8b6414;
}

.profile-publication-status.is-needs_update,
.profile-publication-status.is-needs_changes {
  background: #fff0e8;
  color: #c65314;
}

.profile-publication-status.is-rejected {
  background: #ffeeec;
  color: #d3281f;
}

.profile-publication-status.is-not_published,
.profile-publication-status.is-paused,
.profile-publication-status.is-draft {
  background: #edf2f7;
  color: #526274;
}

.client-name-button:hover {
  color: var(--blue);
}

@media (max-width: 760px) {
  .teachers-crm-table {
    table-layout: auto;
    min-width: 980px;
  }

  .teacher-col-resize {
    display: none;
  }
}

.client-profile-row > td {
  padding: 0 16px 18px;
  background: #f8fbfd;
}

.client-profile-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 16px 40px rgba(22, 42, 70, 0.08);
}

.client-profile-hero {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.client-profile-hero--teacher { grid-template-columns: 92px 92px minmax(220px, 340px) minmax(320px, 1fr); gap: 14px; align-items: start; }
.client-profile-photo, .client-profile-video { display: grid; justify-items: center; align-content: start; gap: 6px; width: 92px; }
.client-profile-copy { display: grid; min-width: 0; gap: 9px; }
.client-profile-copy-fields { display: grid; grid-template-columns: minmax(150px, 2fr) minmax(200px, 3fr); gap: 10px; min-width: 0; }
.client-profile-copy-fields > div { min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfd; }
.client-profile-copy-fields span { color: #657487; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.client-profile-copy-fields p { margin: 4px 0 0; max-height: 6.5em; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.4; }
.client-profile-copy-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.client-profile-copy-actions small { margin-right: auto; color: #a56211; font-weight: 800; }
.client-profile-copy-actions .teacher-video-icon-action { width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 8px; cursor: pointer; }
.client-profile-copy-actions .teacher-video-icon-action:disabled { opacity: .5; cursor: not-allowed; }

.client-profile-avatar {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(135deg, #eaf8ff, #fff1e8);
  color: #159eef;
  font-size: 30px;
  font-weight: 900;
}

.client-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.client-photo-preview {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.client-photo-preview:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.client-photo-dialog {
  box-sizing: border-box;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.client-photo-dialog::backdrop { background: rgba(15, 28, 48, .78); }
.client-photo-dialog-controls { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-bottom: 8px; }
.client-photo-dialog-controls button { width: 36px; height: 36px; border: 0; border-radius: 8px; font-size: 24px; cursor: pointer; }
.client-photo-dialog img { display: block; height: auto; width: auto; max-width: calc(100vw - 46px); max-height: calc(100dvh - 90px); object-fit: contain; }

.client-media-thumb { display: grid; place-items: center; width: 92px; height: 92px; overflow: hidden; border-radius: 12px; background: #132136; color: #fff; font-size: 25px; text-align: center; }
.client-media-thumb img { width: 100%; height: 100%; object-fit: contain; }
.client-media-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; width: 92px; min-height: 32px; }
.client-media-message { grid-column: 1 / -1; color: #657487; font-size: 12px; }
.client-media-message:empty { display: none; }
.client-media-actions .teacher-video-icon-action { display: grid; place-items: center; width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 8px; color: #fff; cursor: pointer; }
.client-media-actions .teacher-video-icon-action:focus-visible { outline: 3px solid #159eef; outline-offset: 2px; }
.client-media-actions .teacher-video-icon-action:disabled { opacity: .55; cursor: wait; }

.client-profile-main {
  min-width: 0;
}

.client-profile-role,
.client-profile-admin-head span {
  color: #159eef;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-profile-main h2 {
  margin: 3px 0 4px;
  font-size: 30px;
  line-height: 1.05;
}

.client-profile-main p {
  margin: 0;
  color: #657487;
  font-weight: 800;
  line-height: 1.35;
}

.client-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.client-profile-tags > span:not(.user-status-badge),
.client-profile-public-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #eef7fb;
  color: #3f5b6b;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.client-profile-score {
  display: grid;
  gap: 4px;
  justify-items: end;
  align-content: center;
  min-height: 82px;
  border-radius: 14px;
  background: #101c29;
  color: #fff;
  padding: 14px;
}

.client-profile-score span {
  color: rgba(255,255,255,.66);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-profile-score strong {
  font-size: 20px;
}

.client-profile-warning {
  display: grid;
  gap: 3px;
  border-radius: 12px;
  background: #fff0ee;
  color: #d3281f;
  padding: 12px 14px;
}

.client-profile-warning span,
.client-profile-warning small {
  color: #9e332d;
  font-weight: 800;
}

.client-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
}

.client-profile-card,
.client-profile-admin {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfe;
  padding: 14px;
}

.client-profile-card h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.client-profile-card p {
  margin: 0 0 6px;
  color: var(--ink);
  font-weight: 900;
}

.client-profile-card small {
  color: #657487;
  font-weight: 800;
}

.client-profile-card dl {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 8px;
  margin: 0;
}

.client-profile-card dt {
  color: #657487;
}

.client-profile-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.client-profile-facts {
  display: grid;
  gap: 8px;
}

.client-profile-facts article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.student-activity { margin-top: 12px; }
.student-activity-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.student-activity-filters button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.student-activity-filters button.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.student-activity-summary { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; color: #657487; font-size: 13px; }
.student-activity-summary b { color: var(--ink); }
.teacher-activity-milestones { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 14px; }
.teacher-activity-milestone { display: inline-flex; align-items: center; justify-content: center; gap: 3px; width: 42px; height: 38px; border: 1px solid currentColor; border-radius: 10px; }
.teacher-activity-milestone svg { width: 21px; height: 21px; flex: none; }
.teacher-activity-milestone.is-good { color: #168653; background: #e8f8ef; }
.teacher-activity-milestone.is-bad { color: #ca3d44; background: #fff0f0; }
.teacher-activity-milestone.is-pending { color: #b86f08; background: #fff3dc; }
.teacher-activity-milestone.is-neutral { color: #7a8997; background: #f3f6f8; }
.teacher-activity-milestone.has-reviewer { width: 60px; }
.teacher-activity-milestone .crm-reviewer-badge { width: 20px; height: 20px; font-size: 11px; }
.teacher-activity-completion { display: grid; gap: 5px; width: 160px; min-width: 140px; margin-left: auto; }
.teacher-activity-completion .profile-completion__label { display: flex; justify-content: space-between; gap: 8px; color: var(--ink); font-size: 12px; font-weight: 700; }
.teacher-activity-completion .profile-completion__track { display: block; height: 7px; overflow: hidden; border-radius: 999px; background: #dfe9ef; }
.teacher-activity-completion .profile-completion__track > span { display: block; height: 100%; border-radius: inherit; background: #2180dd; }
.teacher-activity-events { border-top: 1px solid var(--line); padding-top: 10px; }
.teacher-activity-events > summary { display: flex; align-items: center; gap: 8px; width: fit-content; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.teacher-activity-events > summary::before { content: '▸'; color: #2180dd; transition: transform .2s ease; }
.teacher-activity-events[open] > summary::before { transform: rotate(90deg); }
.teacher-activity-events > summary span { color: #657487; font-weight: 400; }
.teacher-activity-events .student-activity-timeline { margin-top: 12px; }
.student-activity-funnel { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.student-activity-funnel span { border: 1px solid var(--line); border-radius: 999px; color: #657487; font-size: 12px; padding: 5px 8px; }
.student-activity-funnel span.is-complete { background: #e8f8ef; border-color: #a7dfbd; color: #197342; }
.student-activity-timeline { display: grid; gap: 8px; }
.student-activity-timeline article { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; border-top: 1px solid var(--line); padding-top: 8px; }
.student-activity-timeline time, .student-activity-timeline span { color: #657487; font-size: 13px; }
.crm-reviewer-badge {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  border-radius: 50%;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}
.crm-reviewer-badge.is-a { background: #fce4f0; color: #af2168; }
.crm-reviewer-badge.is-r { background: #dcecff; color: #1260ae; }
.student-activity-timeline .crm-reviewer-badge,
.moderation-log .crm-reviewer-badge { color: #af2168; }
.student-activity-timeline .crm-reviewer-badge.is-r,
.moderation-log .crm-reviewer-badge.is-r { color: #1260ae; }

.client-profile-facts span {
  color: #657487;
}

.client-profile-admin {
  display: grid;
  gap: 12px;
}

.client-profile-admin-head {
  display: grid;
  gap: 3px;
}

.client-profile-admin-head strong {
  font-size: 20px;
}

.client-profile-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.client-profile-approver { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; color: #657487; font-size: 12px; font-weight: 800; white-space: nowrap; }
.client-profile-approver strong { color: var(--ink); }

.client-profile-save-status { color: #486078; }
.client-profile-save-status:empty { display: none; }
.client-profile-history { display: block; }
.client-profile-history > summary { cursor: pointer; font-weight: 800; }
.client-profile-history[open] > summary { margin-bottom: 10px; }
.client-profile-history [data-client-payment-status]:empty { display: none; }
.client-payment-entry {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.client-payment-status::first-letter { text-transform: uppercase; }

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

.client-profile-toolbar--note {
  grid-column: 1 / -1;
}

.client-profile-password-form {
  width: min(100%, 560px);
  display: grid;
  gap: 10px;
  max-width: 560px;
  padding: 16px;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: #fff;
}

.client-profile-password-form[hidden] { display: none; }
.client-profile-password-form label { display: grid; gap: 5px; }
.client-profile-password-form input { width: 100%; min-width: 0; }
.client-profile-password-form p { margin: 0; }
.client-profile-password-form > div { display: flex; gap: 8px; flex-wrap: wrap; }

.client-profile-icon-action {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: 10px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.client-profile-icon-action.lead-action--done { background: #18854f; opacity: 1; }
a.client-profile-icon-action { color: #fff; text-decoration: none; }
a.client-profile-icon-action svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.client-profile-icon-action:hover,
.client-profile-icon-action:focus-visible {
  filter: brightness(.95);
  box-shadow: 0 0 0 3px rgba(21, 158, 239, .18);
}

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

@media (max-width: 900px) {
  .client-profile-hero,
  .client-profile-grid,
  .lead-controls.client-profile-controls {
    grid-template-columns: 1fr;
  }
  .client-profile-hero--teacher { grid-template-columns: 92px 92px minmax(0, 1fr); }
  .client-profile-hero--teacher .client-profile-copy { grid-column: 1 / -1; }

  .client-profile-score {
    justify-items: start;
  }

  .client-profile-toolbar,
  .client-profile-toolbar--note {
    grid-column: auto;
  }

  .client-profile-password-form { grid-column: auto; }
}

@media (max-width: 620px) {
  .client-profile-hero--teacher { grid-template-columns: 92px 92px minmax(0, 1fr); }
  .client-profile-copy-fields { grid-template-columns: 1fr; }
  .client-payment-entry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.moderation-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(12, 21, 35, 0.42);
  padding: 22px;
}

.moderation-modal__card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(11, 24, 40, 0.24);
  padding: 22px;
}

.moderation-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef3f7;
  color: #17212b;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.test-mark-card {
  width: min(440px, 100%);
  padding: 20px;
}

.test-mark-card h2 {
  margin: 0;
  padding-right: 34px;
  font-size: 22px;
  line-height: 1.2;
}

.test-mark-card > p {
  margin: 8px 0 12px;
  color: #53647a;
  font-size: 14px;
}

.test-mark-details {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f2f7fb;
}

.test-mark-details dt {
  color: #53647a;
  font-size: 12px;
}

.test-mark-details dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.test-mark-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.test-mark-form label {
  font-size: 13px;
}

.test-mark-form input {
  display: block;
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
  padding: 6px 10px;
  border: 1px solid var(--admin-line, #ccd9e6);
  border-radius: 8px;
  font: inherit;
}

.test-mark-form button {
  min-height: 38px;
}

.test-mark-form [data-test-mark-message] {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
}

.test-mark-form .is-error {
  color: #b42318;
}

.moderation-modal__head {
  padding-right: 44px;
}

.moderation-modal__head span {
  color: #159eef;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.moderation-modal__head h2 {
  margin: 4px 0 6px;
  font-size: 28px;
}

.moderation-modal__head p {
  margin: 0 0 16px;
  color: #657487;
  font-weight: 800;
}

.moderation-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfd;
}

.moderation-form label {
  display: grid;
  gap: 6px;
  color: #657487;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.moderation-form input,
.moderation-form select,
.moderation-form textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(23, 33, 43, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #17212b;
  padding: 0 11px;
  font: inherit;
  font-weight: 700;
  text-transform: none;
}

.moderation-form textarea {
  min-height: 86px;
  padding-top: 10px;
  resize: vertical;
}

.moderation-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.moderation-check {
  display: inline-flex !important;
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  text-transform: none !important;
}

.moderation-check input {
  width: auto;
  min-height: 0;
}

.moderation-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.moderation-message {
  margin: 0;
  color: #168977;
  font-weight: 800;
}

.moderation-message.is-error,
.moderation-empty.is-error {
  color: #d3281f;
}

.moderation-log {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.moderation-log h3 {
  margin: 0;
  font-size: 18px;
}

.moderation-log article {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.moderation-log article header,
.moderation-log article div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.moderation-log article strong {
  color: #17212b;
  text-transform: capitalize;
}

.moderation-log article time,
.moderation-log article span,
.moderation-log article em,
.moderation-log article small,
.moderation-empty {
  color: #657487;
  font-size: 12px;
  font-weight: 800;
}

.moderation-log article p {
  margin: 0;
  color: #17212b;
  font-weight: 800;
}

.empty-state {
  color: var(--muted);
  font-weight: 800;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  color: var(--ink);
  margin-bottom: 5px;
}

.crm-main-nav,
.crm-toolbar,
.article-form__actions,
.article-editor-toolbar,
.article-bulk__inner,
.article-pager,
.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.crm-main-nav {
  grid-column: 1;
  position: sticky;
  top: 88px;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 10px 28px rgba(22, 42, 70, 0.06);
}

.crm-main-nav button,
.crm-main-nav a,
.crm-toolbar button,
.article-bulk button,
.article-pager button,
.article-editor__head button,
.article-form__actions button,
.article-editor-toolbar button,
.article-actions button,
.article-actions a,
.taxonomy-form button,
.taxonomy-mini-table button,
.crm-primary {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  padding: 0 14px;
}

.crm-main-nav button {
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  text-align: left;
}

.crm-main-nav a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  text-align: left;
}

.crm-main-nav button.is-active,
.crm-main-nav a.is-active,
.crm-primary,
.article-form__actions .crm-primary {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.crm-hero--compact {
  align-items: center;
}

.crm-hero--compact h1 {
  font-size: clamp(32px, 4vw, 48px);
}

.crm-section-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.article-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(130px, 0.7fr)) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.article-filters input,
.article-filters select,
.article-filters button,
.article-field input,
.article-field select,
.article-field textarea,
.taxonomy-form input,
.taxonomy-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: 0;
  padding: 0 12px;
  font-weight: 800;
}

.article-filters button {
  border: 0;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.article-bulk {
  margin-bottom: 14px;
  padding: 12px 14px;
}

.article-bulk__inner {
  justify-content: space-between;
}

.article-bulk__inner label,
.article-switches label,
.taxonomy-check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.article-bulk__inner span {
  margin-left: auto;
  color: #168977;
  font-weight: 900;
}

.article-bulk__inner span.is-error {
  color: #c45b12;
}

.article-editor {
  margin-bottom: 14px;
  padding: 24px;
  overflow: visible;
}

.article-editor__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.article-editor__head h2 {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1.1;
}

.article-form,
.article-field,
.taxonomy-form label {
  display: grid;
  gap: 8px;
}

.article-field,
.taxonomy-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.article-field textarea,
.taxonomy-form textarea {
  min-height: 96px;
  padding-top: 12px;
  resize: vertical;
}

.article-field select[multiple] {
  min-height: 128px;
  padding: 10px 12px;
}

.article-form__grid,
.article-media-grid,
.article-seo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

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

.article-media-grid {
  grid-template-columns: 1.2fr 1fr 1.2fr 1fr;
}

.article-upload {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 180px;
  border: 1px dashed rgba(21, 158, 239, 0.32);
  border-radius: 8px;
  background: #f7fcff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  padding: 14px;
}

.article-upload img {
  width: 100%;
  max-height: 170px;
  border-radius: 8px;
  object-fit: cover;
}

.article-seo {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.article-seo legend {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 8px;
}

.article-editor-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.article-editor-toolbar {
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  padding: 10px;
}

.article-editor-toolbar button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.article-content {
  min-height: 360px;
  outline: 0;
  padding: 20px;
  font-size: 16px;
  line-height: 1.72;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  line-height: 1.18;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
}

.article-content th,
.article-content td {
  border: 1px solid var(--line);
  padding: 10px;
}

.article-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.article-table th[data-article-sort] {
  cursor: pointer;
}

.article-title,
.article-table small,
.article-slug {
  display: block;
}

.article-table small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.article-slug {
  margin-bottom: 5px;
  color: var(--ink);
  font-weight: 900;
}

.article-table a {
  color: #087fc5;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.article-thumb {
  width: 72px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
}

.tag-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tag-strip span {
  border-radius: 999px;
  background: #fff2e8;
  color: #b55310;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
}

.no-alt {
  display: inline-flex;
  margin: 6px 4px 0 0;
  border-radius: 999px;
  background: #ffe8e2;
  color: #b94220;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 900;
}

.article-actions {
  align-items: stretch;
}

.article-actions button,
.article-actions a {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
}

.article-pager {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding: 14px 16px;
}

.article-pager span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.taxonomy-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
}

.taxonomy-form {
  display: grid;
  align-content: start;
  gap: 14px;
}

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

.taxonomy-mini-table {
  min-width: 640px;
}

.taxonomy-mini-table small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

body.crm-page {
  font-weight: 500;
}

.crm-user,
.crm-filters input,
.crm-filters select,
.lead-manager,
.lead-status,
.lead-note,
.article-filters input,
.article-filters select,
.article-filters button,
.article-field input,
.article-field select,
.article-field textarea,
.taxonomy-form input,
.taxonomy-form textarea {
  font-weight: 600;
}

.crm-user button,
.crm-filters button,
.lead-action,
.crm-toolbar button,
.article-bulk button,
.article-pager button,
.article-editor__head button,
.article-form__actions button,
.article-editor-toolbar button,
.article-actions button,
.article-actions a,
.taxonomy-form button,
.taxonomy-mini-table button,
.crm-primary {
  font-weight: 700;
}

.crm-topbar {
  min-height: 64px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.crm-brand,
.client-name,
.client-id,
.status-pill,
.article-title,
.article-slug,
.taxonomy-mini-table strong {
  font-weight: 700;
}

.crm-hero h1 {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 800;
}

.crm-hero p {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.crm-summary,
.crm-tabs,
.crm-help,
.article-bulk {
  margin-bottom: 10px;
}

.crm-summary {
  gap: 10px;
}

.crm-summary article {
  min-height: 70px;
  padding: 12px;
}

.crm-summary strong {
  font-size: 24px;
}

.crm-tabs button {
  min-height: 36px;
  font-weight: 700;
}

.crm-help {
  padding: 10px 12px;
  font-weight: 600;
}

.crm-table th,
.crm-table td {
  padding: 10px 12px;
}

.crm-table th {
  font-weight: 700;
}

.client-meta,
.lead-meta,
.article-table small,
.taxonomy-mini-table small {
  font-weight: 500;
}

.lead-controls {
  grid-template-columns: 130px 140px auto;
}

.article-filters {
  gap: 8px;
  margin-bottom: 10px;
}

.article-filters input,
.article-filters select,
.article-filters button,
.article-field input,
.article-field select,
.article-field textarea,
.taxonomy-form input,
.taxonomy-form textarea {
  min-height: 38px;
}

.article-editor {
  padding: 16px;
}

.article-editor__head {
  margin-bottom: 12px;
}

.article-editor__head h2 {
  font-size: 22px;
  font-weight: 800;
}

.article-form__grid,
.article-media-grid,
.article-seo {
  gap: 10px;
  margin-bottom: 12px;
}

.article-field,
.taxonomy-form label,
.article-bulk__inner label,
.article-switches label,
.taxonomy-check {
  font-weight: 600;
}

.article-upload {
  min-height: 146px;
  padding: 10px;
  font-weight: 600;
}

.article-upload img {
  max-height: 130px;
}

.article-seo {
  padding: 12px;
}

.article-editor-toolbar {
  padding: 8px;
}

.article-content {
  min-height: 280px;
  padding: 14px;
  font-size: 15px;
  line-height: 1.6;
}

.tag-strip span,
.no-alt {
  font-weight: 700;
}

.article-pager {
  padding: 10px 12px;
}

.taxonomy-layout {
  gap: 14px;
  padding: 14px;
}

.taxonomy-form {
  gap: 10px;
}

@media (max-width: 820px) {
  .crm-topbar,
  .crm-hero,
  .crm-user {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-filters {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .crm-shell {
    display: block;
    width: min(100% - 20px, 100%);
    padding: 14px 0;
  }

  .crm-main-nav {
    position: static;
    flex-direction: row;
    margin-bottom: 12px;
    overflow-x: auto;
  }

  .crm-main-nav button {
    width: auto;
    white-space: nowrap;
  }

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

  .crm-help {
    align-items: flex-start;
    flex-direction: column;
  }

  .article-filters,
  .article-form__grid,
  .article-media-grid,
  .article-seo,
  .taxonomy-layout {
    grid-template-columns: 1fr;
  }

  .article-editor {
    padding: 16px;
  }
}

/* Article grid: compact admin table workspace */
.article-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.article-admin-head h1 {
  margin: 0;
  color: #10213a;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
}

.article-admin-head span {
  color: #006fe8;
  font-size: 12px;
  font-weight: 700;
}

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

.article-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(23, 33, 43, 0.1);
}

.article-list-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-list-toolbar button,
.article-list-controls button {
  min-height: 34px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.article-list-tools button {
  border: 0;
  background: #2b3548;
  color: #fff;
  padding: 0 14px;
  box-shadow: 0 2px 5px rgba(16, 33, 58, 0.16);
}

.article-list-toolbar .crm-primary {
  min-height: 36px;
  border-color: #1276ea;
  background: #1276ea;
  color: #fff;
  padding: 0 16px;
}

.article-list-controls.article-filters {
  display: grid;
  grid-template-columns: minmax(150px, max-content) minmax(220px, 300px);
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.article-list-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2c3b50;
  font-size: 12px;
  font-weight: 700;
}

.article-list-controls select,
.article-list-controls input[type="search"] {
  width: auto;
  min-height: 34px;
  border: 1px solid #d7e1ec;
  border-radius: 4px;
  background: #fff;
  color: #17212b;
  font-size: 12px;
  font-weight: 600;
  padding: 0 10px;
}

.article-list-controls input[type="search"] {
  width: min(300px, 100%);
  justify-self: end;
  padding-left: 34px;
  background:
    linear-gradient(transparent, transparent),
    url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%238293a8' d='M10 4a6 6 0 0 1 4.7 9.7l4.8 4.8-1.4 1.4-4.8-4.8A6 6 0 1 1 10 4Zm0 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z'/%3E%3C/svg%3E") 10px center / 16px 16px no-repeat #fff;
}

.article-list-controls [data-article-message] {
  grid-column: 1 / -1;
  min-height: 0;
  color: #168977;
  font-size: 12px;
  font-weight: 700;
}

.article-list-controls [data-article-message]:empty {
  display: none;
}

.article-list-controls [data-article-message].is-error {
  color: #c45b12;
}

.article-grid-panel {
  border-radius: 4px;
  box-shadow: 0 10px 26px rgba(24, 40, 64, 0.06);
}

.article-grid-panel .crm-table-wrap {
  overflow-x: auto;
}

.article-table {
  min-width: 1240px;
  table-layout: fixed;
  border-collapse: collapse;
}

.article-col-check {
  width: 34px;
}

.article-col-id {
  width: 50px;
}

.article-col-actions {
  width: 86px;
}

.article-col-title {
  width: 255px;
}

.article-col-slug {
  width: 210px;
}

.article-col-taxonomy {
  width: 145px;
}

.article-col-seo {
  width: 245px;
}

.article-col-status {
  width: 88px;
}

.article-col-updated {
  width: 105px;
}

.article-col-delete {
  width: 54px;
}

.article-table th,
.article-table td {
  padding: 9px 8px;
  vertical-align: middle;
}

.article-table th {
  background: #f6f8fb;
  color: #566579;
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
}

.article-table td {
  color: #10213a;
  font-size: 12px;
  font-weight: 600;
}

.article-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.article-title {
  color: #10213a;
  font-size: 12px;
  line-height: 1.38;
  font-weight: 800;
}

.article-table small {
  margin-top: 5px;
  color: #627187;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 600;
}

.article-slug {
  margin: 0 0 4px;
  color: #10213a;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
  word-break: break-word;
}

.article-table a:not(.article-icon-button) {
  color: #006fe8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.tag-strip {
  gap: 4px;
  margin-top: 6px;
}

.tag-strip span {
  border-radius: 5px;
  background: #edf1f6;
  color: #40516a;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
}

.article-actions--icons {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
}

.article-icon-button {
  width: 32px;
  min-width: 32px;
  height: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d5e2ee;
  border-radius: 4px;
  background: #fff;
  color: #0875e1;
  padding: 0;
  text-decoration: none;
}

.article-icon-button svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.article-icon-button:hover {
  border-color: #9fc7f2;
  background: #f3f8ff;
}

.article-icon-button--danger {
  border-color: #ffd5d8;
  color: #ff2537;
}

.article-icon-button--danger:hover {
  border-color: #ff9ca5;
  background: #fff4f5;
}

.article-table .status-pill {
  min-height: 23px;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 800;
}

.status-pill[data-status="paused"] {
  background: #fff1e4;
  color: #e86616;
}

.article-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid rgba(23, 33, 43, 0.1);
  padding: 12px 14px;
}

.article-pager__summary {
  color: #24354e;
  font-size: 12px;
  font-weight: 800;
}

.article-pager__pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.article-pager button {
  min-width: 32px;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #40516a;
  font-size: 12px;
  font-weight: 700;
  padding: 0 9px;
}

.article-pager button.is-active {
  border-color: #1276ea;
  background: #1276ea;
  color: #fff;
}

.article-pager button:disabled {
  cursor: default;
  color: #9aa8ba;
}

.article-pager__ellipsis {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: #40516a;
  padding: 0 6px;
}

@media (max-width: 820px) {
  .article-list-toolbar,
  .article-admin-head,
  .article-pager {
    align-items: stretch;
    flex-direction: column;
  }

  .article-list-controls.article-filters {
    grid-template-columns: 1fr;
  }

  .article-list-controls input[type="search"] {
    width: 100%;
    justify-self: stretch;
  }
}

/* Admin reference layout */
:root {
  --admin-sidebar: 208px;
  --admin-navy: #16243c;
  --admin-navy-deep: #101c30;
  --admin-blue: #0878f8;
  --admin-page: #f5f7fb;
  --admin-line: #dfe6ef;
  --admin-text: #172640;
  --admin-muted: #66758b;
}

body.crm-page {
  min-width: 1200px;
  background: var(--admin-page);
  color: var(--admin-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.crm-mobile-bar,
.crm-mobile-menu-backdrop {
  display: none;
}

.crm-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--admin-sidebar);
  min-height: 100vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--admin-navy) 0%, var(--admin-navy-deep) 100%);
  color: #fff;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.crm-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 66px;
  padding: 0 18px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.crm-sidebar__brand img {
  width: 38px;
  height: 38px;
  border-radius: 3px;
  object-fit: contain;
  background: #fff;
}

.crm-sidebar__brand { padding-right: 49px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.crm-sidebar__role { white-space: nowrap; font-size: 14px; }
.crm-sidebar__initial--ann { color: #f9a8d4; }
.crm-sidebar__initial--ramadan { color: #7dd3fc; }
.crm-sidebar__logout { position: absolute; top: 16px; right: 13px; margin: 0; }
.crm-sidebar__logout button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer; }
.crm-sidebar__logout button:hover { background: rgba(255, 255, 255, 0.16); }
.crm-sidebar__logout button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.crm-sidebar__logout svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.crm-sidebar__account {
  display: grid;
  gap: 11px;
  padding: 13px 19px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #d9e4f5;
  font-size: 13px;
  line-height: 1.3;
}

.crm-sidebar__account form {
  margin: 0;
}

.crm-sidebar__account button {
  width: fit-content;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 0 14px;
}

body.crm-login-page {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background: #f5f7fb;
  color: var(--admin-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.crm-login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.crm-login-card {
  width: min(100%, 390px);
  padding: 28px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(22, 36, 60, 0.12);
}

.crm-login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--admin-text);
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
}

.crm-login-brand img {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  object-fit: contain;
}

.crm-login-card h1 {
  margin: 24px 0 18px;
  color: var(--admin-text);
  font-size: 28px;
  line-height: 1.1;
}

.crm-login-card form {
  display: grid;
  gap: 14px;
}

.crm-login-card label {
  display: grid;
  gap: 7px;
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 700;
}

.crm-login-card input {
  min-height: 42px;
  border: 1px solid var(--admin-line);
  border-radius: 5px;
  padding: 0 12px;
  color: var(--admin-text);
  font: inherit;
  background: #fff;
}

.crm-login-card input:focus {
  border-color: var(--admin-blue);
  outline: 3px solid rgba(8, 120, 248, 0.12);
}

.crm-login-card button {
  min-height: 44px;
  border: 0;
  border-radius: 5px;
  background: var(--admin-blue);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.crm-login-error {
  margin: 0 0 16px;
  border: 1px solid #ffd1d1;
  border-radius: 5px;
  padding: 10px 12px;
  background: #fff4f4;
  color: #a41313;
  font-size: 13px;
  font-weight: 700;
}

.crm-shell {
  display: block;
  width: calc(100% - var(--admin-sidebar));
  min-height: 100vh;
  margin: 0 0 0 var(--admin-sidebar);
  padding: 0;
}

[data-crm-view] {
  grid-column: auto;
  min-width: 0;
}

.crm-main-nav {
  position: static;
  display: block;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 8px 0 14px;
}

.crm-main-nav button,
.crm-main-nav a,
.crm-nav-group > span {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e7edf7;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  padding: 6px 18px 6px 20px;
}

.crm-nav-group > span {
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.crm-nav-group > span:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: 2px solid rgba(255, 255, 255, 0.34);
  outline-offset: -2px;
}

.crm-nav-group > span::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 12px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.72;
}

.crm-nav-group.is-open > span::before {
  transform: rotate(45deg);
}

.crm-nav-group:not(.is-open) :is(button, a) {
  display: none;
}

.crm-nav-group :is(button, a) {
  min-height: 32px;
  color: #d3ddec;
  padding-left: 39px;
}

.crm-main-nav button:hover,
.crm-main-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.crm-main-nav button.is-active,
.crm-main-nav a.is-active {
  border: 0;
  background: linear-gradient(90deg, #0878f8 0%, #1d8bff 100%);
  color: #fff;
}

.article-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  margin: 0;
  border-bottom: 1px solid var(--admin-line);
  background: #f8fafc;
  padding: 0 18px 0 23px;
}

.article-admin-head h1 {
  margin: 0;
  color: #172640;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}

.article-admin-head span {
  color: #0b72e7;
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
}

.article-admin-head .profile-review-time {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  line-height: 1.2;
}

.profile-review-time [data-profile-response-time] {
  color: #166534;
  font-size: 20px;
  font-weight: 800 !important;
  white-space: nowrap;
}

@media (max-width: 820px) {
  [data-crm-view="teacher-profile-updates"] > .article-admin-head {
    height: auto;
    min-height: 68px;
    gap: 6px;
    padding-block: 8px;
  }

  .article-admin-head .profile-review-time {
    flex-wrap: wrap;
  }
}

.article-list-shell {
  display: block;
  min-height: calc(100vh - 68px);
  background: #fff;
}

.article-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
  gap: 14px;
  border-bottom: 1px solid var(--admin-line);
  background: #fff;
  padding: 0 14px 0 24px;
}

.article-list-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.article-list-toolbar button,
.article-list-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
}

.article-list-toolbar svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.article-list-tools button {
  border: 1px solid #24324a;
  background: linear-gradient(180deg, #35425a 0%, #253249 100%);
  color: #fff;
  padding: 0 14px;
  box-shadow: 0 1px 2px rgba(16, 29, 47, 0.22);
}

.article-list-toolbar .crm-primary {
  min-height: 38px;
  border: 1px solid #0878f8;
  border-radius: 4px;
  background: #0878f8;
  color: #fff;
  padding: 0 17px;
  box-shadow: 0 1px 2px rgba(8, 120, 248, 0.18);
}

.article-list-controls.article-filters {
  position: relative;
  display: grid;
  grid-template-columns: max-content 230px;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 18px;
  margin: 0;
  border-bottom: 1px solid var(--admin-line);
  background: #fff;
  padding: 0 23px;
}

.article-list-controls label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #172640;
  font-size: 13px;
  font-weight: 600;
}

.article-list-controls select,
.article-list-controls input[type="search"] {
  width: auto;
  min-height: 36px;
  border: 1px solid #cad5e4;
  border-radius: 4px;
  background-color: #fff;
  color: #172640;
  font-size: 13px;
  font-weight: 500;
  outline: 0;
  padding: 0 11px;
  box-shadow: none;
}

.article-list-controls select {
  min-width: 112px;
}

.article-list-controls input[type="search"] {
  width: 225px;
  justify-self: end;
  padding-left: 35px;
  background:
    url("data:image/svg+xml,%3Csvg width='17' height='17' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%238a98ad' d='M10 4a6 6 0 0 1 4.7 9.7l4.8 4.8-1.4 1.4-4.8-4.8A6 6 0 1 1 10 4Zm0 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z'/%3E%3C/svg%3E") 11px center / 17px 17px no-repeat #fff;
}

.article-list-controls [data-article-message] {
  display: none;
}

.article-list-controls [data-article-message]:not(:empty) {
  position: absolute;
  left: 23px;
  bottom: 4px;
  display: block;
  color: #0b8a70;
  font-size: 12px;
  font-weight: 600;
}

.article-list-controls [data-article-message].is-error {
  color: #d14343;
}

.article-list-controls [data-site-lead-message]:not(:empty) {
  position: absolute;
  left: 23px;
  bottom: 4px;
  display: block;
  color: #0b8a70;
  font-size: 12px;
  font-weight: 600;
}

.article-list-controls [data-site-lead-message].is-error {
  color: #d14343;
}

.article-grid-panel {
  margin: 0 14px 0 18px;
  border: 1px solid var(--admin-line);
  border-radius: 2px;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
}

.article-grid-panel .crm-table-wrap {
  overflow-x: auto;
}

.article-table {
  width: 100%;
  min-width: 900px;
  table-layout: fixed;
  border-collapse: collapse;
}

.article-col-check {
  width: 2.7%;
}

.article-col-id {
  width: 3%;
}

.article-col-actions {
  width: 6.5%;
}

.article-col-title {
  width: 38%;
}

.article-col-slug {
  width: 33.5%;
}

.article-col-taxonomy {
  width: 11.5%;
}

.article-col-seo {
  width: 20%;
}

.article-col-status {
  width: 9.5%;
}

.article-col-updated {
  width: 9.5%;
}

.article-col-delete {
  width: 3.8%;
}

.article-table th,
.article-table td {
  border-bottom: 1px solid var(--admin-line);
  color: #172640;
  text-align: left;
  vertical-align: middle;
  padding: 10px 7px;
}

.article-table th {
  height: 43px;
  background: #f8fafc;
  color: #526176;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  text-transform: none;
  white-space: nowrap;
}

.article-table th[data-article-sort]::after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 12px;
  margin-left: 5px;
  vertical-align: -2px;
  opacity: 0.42;
  background: url("data:image/svg+xml,%3Csvg width='9' height='12' viewBox='0 0 9 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2395a4b8' d='M4.5 0 8 4H1l3.5-4Zm0 12L1 8h7l-3.5 4Z'/%3E%3C/svg%3E") center / 9px 12px no-repeat;
}

.article-table td {
  height: 74px;
  background: #fff;
  font-size: 13px;
  line-height: 1.48;
  font-weight: 500;
}

.article-table tbody tr:hover td {
  background: #fbfdff;
}

.article-table th:first-child,
.article-table td:first-child,
.article-table th:nth-child(2),
.article-table td:nth-child(2),
.article-table th:nth-child(3),
.article-table td:nth-child(3),
.article-table th:nth-child(8),
.article-table td:nth-child(8),
.article-table th:nth-child(10),
.article-table td:nth-child(10) {
  text-align: center;
}

.article-table input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #0878f8;
}

.article-title {
  display: block;
  color: #172640;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 700;
}

.article-title--edit {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.article-title--edit:hover,
.article-title--edit:focus-visible {
  color: #0878f8;
  text-decoration: underline;
}

.article-table small {
  display: block;
  margin: 0;
  color: #172640;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
}

.article-url-path,
.article-table a:not(.article-icon-button) {
  display: block;
  color: #172640;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.article-slug {
  margin: 0;
  color: #172640;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
}

.article-table td:nth-child(6) strong {
  display: block;
  margin-bottom: 4px;
  color: #172640;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
}

.tag-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0;
}

.tag-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  border-radius: 5px;
  background: #e9eef5;
  color: #41506a;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
}

.article-actions--icons {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.article-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 32px;
  min-height: 32px;
  border: 1px solid #cdd9e8;
  border-radius: 4px;
  background: #fff;
  color: #0878f8;
  padding: 0;
  text-decoration: none;
  box-shadow: none;
}

.article-icon-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.article-icon-button:hover {
  border-color: #9ac4f6;
  background: #f4f9ff;
}

.article-icon-button--danger {
  color: #ff2638;
  border-color: #ffc5ca;
}

.article-icon-button--danger:hover {
  border-color: #ff9aa4;
  background: #fff6f7;
}

.article-table .status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}

.status-pill[data-status="active"] {
  background: #c8f3e9;
  color: #078a70;
}

.status-pill[data-status="draft"] {
  background: #ffe9d5;
  color: #f06416;
}

.article-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 18px;
  border-top: 0;
  background: #fff;
  padding: 0 22px;
}

.article-pager__summary {
  color: #172640;
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
}

.article-pager__pages {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.article-pager button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 33px;
  min-height: 33px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #273650;
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  padding: 0 8px;
}

.article-pager button.is-active {
  border-color: #0878f8;
  background: #0878f8;
  color: #fff;
}

.article-pager button:disabled {
  color: #98a6ba;
}

.article-pager__ellipsis {
  display: inline-flex;
  align-items: center;
  min-height: 33px;
  color: #273650;
  padding: 0 3px;
}

.site-leads-table {
  width: 100%;
  min-width: 1220px;
  border-collapse: collapse;
}

.site-leads-table th,
.site-leads-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--admin-line);
  color: #172640;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  vertical-align: middle;
}

.site-leads-table th {
  height: 43px;
  background: #f8fafc;
  color: #526176;
  font-size: 12px;
  font-weight: 700;
}

.site-leads-table td {
  min-height: 64px;
}

.site-lead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.site-lead-actions button {
  min-height: 30px;
  border: 1px solid #cdd9e8;
  border-radius: 4px;
  background: #fff;
  color: #0878f8;
  font-size: 12px;
  font-weight: 600;
  padding: 0 9px;
}

.site-lead-actions button[data-site-lead-delete] {
  border-color: #ffc5ca;
  color: #ff2638;
}

.site-lead-details {
  display: none;
  max-width: 340px;
  margin-top: 6px;
  color: #66758b;
  font-size: 12px;
  white-space: pre-wrap;
}

.site-lead-details.is-visible {
  display: block;
}

.legal-admin-shell {
  background: #fff;
}

.legal-admin-view {
  min-height: 100vh;
  background: #fff;
}

.legal-admin-filters {
  flex: 1;
  grid-template-columns: minmax(220px, 1.2fr) 210px 160px 110px minmax(120px, .8fr);
  margin: 0;
}

.legal-admin-editor {
  margin: 14px 18px;
  padding: 24px;
}

.legal-switches {
  margin: 18px 0;
}

.legal-editor-block {
  display: grid;
  gap: 10px;
}

.legal-wysiwyg {
  min-height: 320px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
  color: #172640;
  outline: 0;
  padding: 18px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
}

.legal-wysiwyg:focus {
  border-color: #0878f8;
  box-shadow: 0 0 0 3px rgba(8, 120, 248, 0.12);
}

.legal-wysiwyg h2 {
  margin: 24px 0 8px;
  color: #172640;
  font-size: 22px;
  line-height: 1.2;
}

.legal-wysiwyg p {
  margin: 0 0 14px;
}

.legal-documents-table {
  min-width: 1120px;
}

.legal-documents-table td {
  vertical-align: middle;
}

.legal-documents-table a {
  color: #0878f8;
  font-weight: 700;
}

.legal-sort-input {
  width: 78px;
  min-height: 34px;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  padding: 0 8px;
  font-weight: 700;
}

.legal-row-actions {
  gap: 6px;
}

.legal-row-actions button[data-legal-delete] {
  border-color: #ffc5ca;
  color: #ff2638;
}

.legal-categories-panel {
  margin: 18px;
  padding: 18px;
}

.legal-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.legal-category-grid article {
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.legal-category-grid span,
.legal-category-grid small {
  display: block;
  color: #66758b;
  font-size: 12px;
  font-weight: 700;
}

.legal-category-grid strong {
  display: block;
  margin-top: 10px;
  color: #172640;
  font-size: 34px;
  line-height: 1;
}

.legal-category-grid button {
  min-height: 36px;
  margin-top: 14px;
  border: 1px solid #0878f8;
  border-radius: 6px;
  background: #fff;
  color: #0878f8;
  font-weight: 700;
  padding: 0 12px;
}

.crm-main-nav > button .crm-nav-alert-badge,
.crm-nav-group button .crm-nav-alert-badge,
.crm-nav-group button b[data-support-badge] {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff4d2e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 3px rgba(255, 77, 46, 0.16);
}

.crm-nav-group button.has-alert {
  color: #fff;
}

.crm-main-nav > button .crm-nav-alert-badge[hidden],
.crm-nav-group button .crm-nav-alert-badge[hidden],
.crm-nav-group button b[hidden] {
  display: none;
}

.support-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.support-table tr.is-active {
  background: #eef8ff;
}

.support-table tr.has-unread td:first-child {
  font-weight: 900;
}

.support-table td strong,
.support-table td small {
  display: block;
}

.support-table td small {
  margin-top: 3px;
  color: #657487;
  font-size: 12px;
  line-height: 1.35;
}

.support-table button,
.support-detail button,
.support-reply-form button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: #159eef;
  color: #fff;
  font-weight: 800;
}

.support-unread {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff4d2e;
  color: #fff;
  font-size: 11px;
}

.support-priority {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf8fb;
  color: #436171;
  font-size: 12px;
  font-weight: 900;
}

.support-priority.is-high,
.support-priority.is-urgent {
  background: #fff3e8;
  color: #b85c14;
}

.support-detail {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.support-detail > h2,
.support-detail-head h2 {
  margin: 0;
  font-size: 24px;
}

.support-detail > p,
.support-detail-head p {
  margin: 6px 0 0;
  color: #657487;
  line-height: 1.45;
}

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

.support-detail-head span {
  color: #159eef;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.support-detail-meta {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 9px;
  margin: 0;
}

.support-detail-meta dt {
  color: #657487;
  font-weight: 800;
}

.support-detail-meta dd {
  margin: 0;
  font-weight: 800;
}

.support-detail-meta select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(23,33,43,.14);
  border-radius: 10px;
  background: #fff;
  color: #17212b;
  padding: 0 10px;
}

.support-detail-meta dd button {
  margin-top: 6px;
  background: #edf8fb;
  color: #436171;
}

.support-message-list {
  display: grid;
  gap: 9px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.support-message-list article {
  padding: 11px 12px;
  border: 1px solid rgba(23,33,43,.1);
  border-radius: 12px;
  background: #f7fbfc;
}

.support-message-list article.is-agent {
  background: #17212b;
  color: #fff;
}

.support-message-list article.is-internal {
  border-style: dashed;
  background: #fff3e8;
  color: #8f4a12;
}

.support-message-list strong,
.support-message-list time {
  display: block;
  font-size: 12px;
}

.support-message-list p {
  margin: 5px 0;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.support-message-list time {
  color: #657487;
}

.support-message-list article.is-agent time {
  color: rgba(255,255,255,.7);
}

.message-status {
  display: inline-block;
  margin-left: 6px;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
  opacity: .9;
}

.message-status.is-read {
  color: #16a34a;
  opacity: 1;
}

.support-message-attachment {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: inherit;
  font-weight: 800;
}

.support-message-attachment img {
  display: block;
  width: min(240px, 100%);
  max-height: 170px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.65);
}

.support-message-attachment span {
  font-size: 12px;
  opacity: .82;
}

.support-reply-form {
  display: grid;
  gap: 9px;
}

.support-reply-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(23,33,43,.14);
  border-radius: 12px;
  background: #fff;
  color: #17212b;
  padding: 10px 12px;
  font: inherit;
}

.support-ticket-template-picker {
  width: min(320px, 100%);
  min-height: 38px;
  border: 1px solid rgba(23,33,43,.14);
  border-radius: 8px;
  background: #fff;
  color: #17212b;
  font: inherit;
}

.support-reply-form .support-send-reply {
  background: #16a34a;
}

.support-reply-form [data-support-reply-error] {
  align-self: center;
  color: #d14343;
  font-size: 12px;
  font-weight: 700;
}

.support-reply-form div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.support-note-form[hidden] {
  display: none;
}

.support-admin-shell {
  gap: 16px;
  min-width: 0;
}

.support-ticket-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.support-ticket-tabs button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
  color: #172640;
  font-weight: 700;
  cursor: pointer;
}

.support-ticket-tabs button[aria-pressed="true"] {
  border-color: #159eef;
  background: #eaf6ff;
  color: #0875be;
}

.support-ticket-tabs button[data-support-tab=""] {
  border-color: #159eef;
  background: #eaf6ff;
  color: #0875be;
}

.support-ticket-tabs button[data-support-tab="waiting_for_customer"] {
  border-color: #f2aa39;
  background: #fff7e9;
  color: #a96308;
}

.support-ticket-tabs button[data-support-tab="closed"] {
  border-color: #39af75;
  background: #eaf8f0;
  color: #16804d;
}

.support-ticket-tabs button[data-support-tab=""][aria-pressed="true"] { background: #d8efff; }
.support-ticket-tabs button[data-support-tab="waiting_for_customer"][aria-pressed="true"] { background: #ffe6bd; }
.support-ticket-tabs button[data-support-tab="closed"][aria-pressed="true"] { background: #d9f2e4; }

.support-chat-shell {
  min-width: 0;
}

.support-chat-admin {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(230px, 300px) minmax(360px, 1fr) minmax(220px, 280px);
  height: calc(100vh - 68px);
  height: calc(100dvh - 68px);
  min-height: 420px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.support-chat-list-panel,
.support-chat-context {
  background: #f7fafc;
}

.support-chat-list-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--admin-line);
}

.support-chat-list-panel .support-chat-list-head { flex: 0 0 auto; }
.support-chat-list-panel .support-chat-list { flex: 1 1 0; min-height: 0; max-height: none; }
.support-chat-context { min-height: 0; overflow: auto; }

.support-chat-list-head {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--admin-line);
}

.support-chat-list-head strong {
  font-size: 18px;
  color: #172640;
}

.support-chat-role-tabs {
  display: flex;
  gap: 6px;
}

.support-chat-role-tabs button {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 7px 4px;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: #fff;
  color: #52647a;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.support-chat-role-tabs button.is-active {
  border-color: #159cf4;
  background: #eaf6ff;
  color: #0877c4;
}

.support-chat-tab-badge:not([hidden]) {
  position: absolute;
  top: -5px;
  right: -2px;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: #ff4d2e;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.support-chat-role-tabs button[hidden] {
  display: none;
}

.support-chat-list-head input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
}

.support-chat-list {
  max-height: 560px;
  overflow: auto;
}

.support-chat-row {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--admin-line);
  background: transparent;
  padding: 12px 14px;
  color: #172640;
  text-align: left;
}

.support-chat-row:hover,
.support-chat-row.is-active {
  background: #eaf5ff;
}

.support-chat-row img,
.support-chat-customer img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.support-chat-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.support-chat-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-chat-row small,
.support-chat-row time {
  color: #6d7b91;
  font-size: 11px;
}

.support-chat-row small {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-chat-role {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eaf3ff;
  color: #1e7bff;
  font-style: normal;
  font-weight: 900;
}

.support-chat-row b {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  padding: 0 5px;
  background: #e84040;
  color: #fff;
  font-size: 11px;
}

.support-chat-thread {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.support-chat-thread header {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 0 20px;
  border-bottom: 1px solid var(--admin-line);
}

.support-chat-thread header div {
  display: grid;
  gap: 3px;
}

.support-chat-thread header span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6d7b91;
  font-size: 12px;
}

.support-chat-messages {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px;
  background: #fff;
}

.support-chat-messages article {
  width: fit-content;
  min-width: 0;
  max-width: min(68%, 620px);
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #edf3f8;
  color: #172640;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: normal;
}

.support-chat-messages article span {
  white-space: pre-wrap;
}

.support-chat-image img {
  display: block;
  width: min(280px, 100%);
  max-height: 240px;
  border-radius: 8px;
  object-fit: contain;
}

.support-chat-messages article.is-agent {
  justify-self: end;
  background: #172640;
  color: #fff;
}

.support-chat-messages time {
  color: #708097;
  font-size: 11px;
  line-height: 1.25;
}

.support-chat-messages article.is-agent time {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.7);
}

.support-chat-messages article.is-agent time .crm-reviewer-badge {
  width: 20px;
  height: 20px;
  font-size: 11px;
  flex: none;
}

.support-chat-thread form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--admin-line);
  align-items: end;
}

.support-chat-image-picker {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  cursor: pointer;
}

.support-chat-image-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.support-chat-file-name,
.support-chat-upload-error {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

.support-chat-upload-error { color: #dc2626; }

.support-chat-thread textarea {
  min-width: 0;
  min-height: 40px;
  max-height: 150px;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  padding: 9px 12px;
  font: inherit;
  line-height: 1.35;
  resize: none;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.support-chat-thread button {
  min-width: 68px;
  border: 0;
  border-radius: 6px;
  background: #159eef;
  color: #fff;
  font-weight: 800;
}

.support-chat-context {
  border-left: 1px solid var(--admin-line);
  padding: 20px;
}

.support-chat-customer {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.support-chat-customer img {
  width: 52px;
  height: 52px;
}

.support-chat-customer > span {
  color: #6d7b91;
  font-size: 13px;
}

.support-chat-customer dl {
  width: 100%;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 9px;
  margin: 12px 0 0;
  font-size: 12px;
}

.support-chat-customer dt {
  color: #6d7b91;
}

.support-chat-customer dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #172640;
  font-weight: 700;
}

.support-admin-shell .support-filters.article-list-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(240px, 1.25fr);
  align-items: end;
  justify-content: stretch;
  height: auto;
  min-height: 0;
  gap: 12px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.support-admin-shell .support-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #172640;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}

.support-admin-shell .support-filters select,
.support-admin-shell .support-filters input[type="search"] {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border-radius: 6px;
  font-size: 13px;
}

.support-admin-shell .support-filters input[type="search"] {
  justify-self: stretch;
}

.support-admin-shell .support-filters [data-support-message] {
  grid-column: 1 / -1;
  min-height: 16px;
  color: #0b8a70;
  font-size: 12px;
  font-weight: 700;
}

.support-admin-shell .support-filters [data-support-message]:empty {
  display: none;
}

.support-admin-shell .support-filters [data-support-message].is-error {
  color: #d14343;
}

.support-admin-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 16px;
  min-width: 0;
}

.support-admin-layout:not(.has-active-ticket) {
  grid-template-columns: minmax(0, 1fr);
}

.support-admin-layout.has-active-ticket {
  grid-template-columns: minmax(0, 1fr);
}

.support-admin-layout > * {
  min-width: 0;
}

.support-detail[hidden] {
  display: none !important;
}

.support-table-panel {
  min-width: 0;
  overflow: hidden;
}

.support-table-panel .crm-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.support-table {
  width: 100%;
  min-width: 1040px;
  table-layout: fixed;
  border-collapse: collapse;
}

.support-table th,
.support-table td {
  padding: 12px 10px;
  vertical-align: middle;
}

.support-table th:nth-child(1),
.support-table td:nth-child(1) {
  width: 72px;
}

.support-table th:nth-child(2),
.support-table td:nth-child(2) {
  width: 190px;
}

.support-table th:nth-child(3),
.support-table td:nth-child(3) {
  width: 86px;
}

.support-table th:nth-child(4),
.support-table td:nth-child(4) {
  width: 150px;
}

.support-table th:nth-child(6),
.support-table td:nth-child(6),
.support-table th:nth-child(7),
.support-table td:nth-child(7) {
  width: 110px;
}

.support-table th:nth-child(8),
.support-table td:nth-child(8) {
  width: 132px;
}

.support-table th:nth-child(9),
.support-table td:nth-child(9) {
  width: 150px;
}

.support-table th:nth-child(10),
.support-table td:nth-child(10) {
  width: 82px;
}

.support-table td,
.support-table td strong,
.support-table td small {
  overflow-wrap: anywhere;
}

.support-detail {
  position: fixed;
  inset: 18px 18px 18px calc(var(--admin-sidebar) + 18px);
  z-index: 80;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px 18px;
  overflow: hidden;
  border-radius: 12px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(10, 28, 52, .28);
}

.support-detail-head {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.support-detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.support-detail-close {
  flex: 0 0 36px !important;
  width: 36px;
  height: 36px;
  padding: 0 !important;
  border-radius: 8px !important;
  background: #ef4444 !important;
  color: #fff !important;
  font-size: 26px;
  line-height: 1;
}

.support-detail .support-close-ticket {
  background: #ef4444;
}

.support-detail-head h2,
.support-detail-head p {
  overflow-wrap: anywhere;
}

.support-detail-meta {
  grid-column: 2;
  grid-row: 2 / 4;
  grid-template-columns: 92px minmax(0, 1fr);
  min-height: 0;
  align-content: start;
  overflow-y: auto;
}

.support-detail-meta dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.support-detail .support-message-list {
  grid-column: 1;
  grid-row: 1 / 3;
  min-height: 0;
  max-height: none;
  align-content: start;
  grid-auto-rows: max-content;
}

.support-detail .support-reply-form {
  grid-column: 1;
  grid-row: 3;
  min-width: 0;
  gap: 6px;
}

.support-detail .support-reply-form textarea {
  box-sizing: border-box;
  max-height: min(160px, 26dvh);
}

.support-reply-form .support-reply-toolbar,
.support-reply-form .support-reply-actions {
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.support-reply-toolbar > .support-ticket-template-picker {
  flex: 0 1 320px;
  width: auto;
  min-width: 0;
  min-height: 40px;
}

.support-reply-actions {
  flex: 0 0 auto;
}

.support-reply-actions > button:not(.chat-emoji-trigger) {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
}

.support-reply-feedback {
  align-items: center;
}

.support-reply-feedback:not(:has([data-support-reply-file-name]:not(:empty), [data-support-reply-error]:not(:empty))),
.support-reply-feedback [data-support-reply-file-name]:empty,
.support-reply-feedback [data-support-reply-error]:empty {
  display: none;
}

.status-pill.support-status[data-status="open"],
.status-pill.support-status[data-status="waiting_for_support"],
.support-status.is-open,
.support-status.is-waiting_for_support {
  background: #fff1f1;
  color: #c62828;
}

.status-pill.support-status[data-status="waiting_for_customer"],
.support-status.is-waiting_for_customer {
  background: #fff7d6;
  color: #9a6500;
}

.status-pill.support-status[data-status="resolved"],
.status-pill.support-status[data-status="closed"],
.support-status.is-resolved,
.support-status.is-closed {
  background: #e7f8ef;
  color: #168575;
}

@media (max-width: 1280px) {
  body.crm-page {
    min-width: 0;
  }

  .crm-sidebar {
    width: 190px;
  }

  .crm-shell {
    width: calc(100% - 190px);
    margin-left: 190px;
  }

  .article-table {
    min-width: 1320px;
  }

  .support-admin-layout {
    grid-template-columns: 1fr;
  }

  .support-detail {
    position: fixed;
    inset: 14px 14px 14px 204px;
  }
}

@media (max-width: 1180px) {
  .support-admin-shell .support-filters.article-list-controls {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .support-admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .support-chat-shell {
    min-height: 0;
  }

  .support-chat-admin {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
  }

  .support-chat-list-panel .support-chat-list {
    flex: 0 1 auto;
    max-height: 240px;
  }

  .support-chat-thread {
    height: clamp(360px, calc(100dvh - 210px), 640px);
  }

  .support-chat-context {
    display: none;
  }

  .support-chat-messages article {
    max-width: 88%;
  }

  .support-detail {
    inset: 10px;
    padding: 14px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 9px;
  }

  .support-detail-head,
  .support-detail-meta,
  .support-detail .support-message-list,
  .support-detail .support-reply-form {
    grid-column: 1;
  }

  .support-detail-head { grid-row: 1; }
  .support-detail-meta { grid-row: 2; }
  .support-detail .support-message-list { grid-row: 3; }
  .support-detail .support-reply-form { grid-row: 4; }

  .support-detail-meta {
    max-height: min(160px, 22dvh);
  }

  .support-detail-head,
  .support-detail-actions {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .support-detail-actions {
    justify-content: stretch;
  }

  .support-detail-actions button {
    flex: 1;
  }
}

@media (max-width: 900px) and (max-height: 560px) {
  .support-detail-meta {
    max-height: 12dvh;
  }
}

.teacher-videos-shell .teacher-video-filters.article-list-controls {
  grid-template-columns: 160px 150px minmax(240px, 1fr) minmax(180px, auto);
  align-items: end;
}

.teacher-video-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.teacher-video-layout.has-active-video {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
}

.teacher-video-table td strong,
.teacher-video-table td small {
  display: block;
}

.teacher-video-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.teacher-video-thumb {
  display: block;
  width: 118px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #eef8ff;
  object-fit: cover;
}

.teacher-video-table a {
  color: #0f75b8;
  font-weight: 800;
  word-break: break-word;
}

.teacher-video-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  width: max-content;
}

.teacher-video-actions button,
.teacher-video-actions a,
.teacher-video-detail-actions button,
.teacher-video-detail-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: #159eef;
  color: #fff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.teacher-video-actions button[data-teacher-video-action="approved"],
.teacher-video-actions button[data-teacher-photo-action="approved"],
.teacher-video-actions button[data-teacher-profile-update-action="approved"],
.teacher-video-detail-actions button[data-teacher-video-action="approved"],
.teacher-video-detail-actions button[data-teacher-photo-action="approved"],
.teacher-video-detail-actions button[data-teacher-profile-update-action="approved"] {
  background: #16a34a;
}

.teacher-video-actions button[data-teacher-video-action="rejected"],
.teacher-video-detail-actions button[data-teacher-video-action="rejected"] {
  background: #ef4444;
}

.teacher-video-actions button[data-teacher-video-action="needs_update"],
.teacher-video-detail-actions button[data-teacher-video-action="needs_update"] {
  background: #f59e0b;
}

.teacher-video-actions button[data-teacher-video-action="hidden"],
.teacher-video-detail-actions button[data-teacher-video-action="hidden"] {
  background: #64748b;
}

.teacher-video-table .teacher-video-actions .teacher-video-icon-action {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 10px;
  color: #fff;
  word-break: normal;
}

.teacher-video-icon-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.teacher-video-icon-action svg circle {
  fill: none;
}

.teacher-video-icon--view {
  background: #159eef;
}

.teacher-video-icon--profile {
  background: #334155;
}

.teacher-video-icon--approve {
  background: #16a34a;
}

.teacher-video-icon--reject {
  background: #ef4444;
}

.teacher-video-icon--update {
  background: #f59e0b;
}

.teacher-video-icon--hide {
  background: #64748b;
}

.teacher-video-status.is-pending {
  background: #fff3d9;
  color: #b85c14;
}

.teacher-video-status.is-approved {
  background: #dcf8ed;
  color: #168575;
}

.teacher-video-status.is-rejected {
  background: #ffe4e6;
  color: #be123c;
}

.teacher-video-status.is-needs_update {
  background: #fff7ed;
  color: #c2410c;
}

.teacher-video-status.is-hidden {
  background: #f1f5f9;
  color: #64748b;
}

.teacher-photos-shell .teacher-photo-filters.article-list-controls {
  grid-template-columns: 160px 150px minmax(240px, 1fr) minmax(180px, auto);
  align-items: end;
}

.teacher-photo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.teacher-photo-layout.has-active-photo {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
}

.teacher-photo-table td strong,
.teacher-photo-table td small {
  display: block;
}

.teacher-photo-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.teacher-photo-thumb {
  display: block;
  width: 76px;
  height: 76px;
  border-radius: 12px;
  background: #eef8ff;
  object-fit: cover;
}

.teacher-photo-zoom {
  display: inline-block;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: zoom-in;
}

.teacher-photo-zoom:focus-visible { outline: 3px solid #159eef; outline-offset: 3px; }

.teacher-photo-gallery {
  width: min(96vw, 1100px);
  max-width: none;
  max-height: 96dvh;
  padding: 12px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px #0f172a66;
}

.teacher-photo-gallery::backdrop { background: #0f172ad9; }
.teacher-photo-gallery-head { display: flex; justify-content: space-between; align-items: center; color: #334155; font-weight: 700; }
.teacher-photo-gallery button { border: 0; border-radius: 8px; background: #eef8ff; color: #17243d; font-size: 28px; cursor: pointer; }
.teacher-photo-gallery-head button { width: 40px; height: 40px; }
.teacher-photo-gallery-main { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.teacher-photo-gallery-main button { height: 56px; }
.teacher-photo-gallery-main img { display: block; max-width: 100%; max-height: calc(96dvh - 125px); margin: auto; object-fit: contain; }
.teacher-photo-gallery [data-gallery-caption] { margin: 8px 0 0; text-align: center; color: #334155; }
@media (max-width: 600px) { .teacher-photo-gallery-main { grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 4px; } }

.teacher-photo-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.teacher-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 124px;
}

.teacher-photo-detail {
  align-self: start;
  padding: 18px;
}

.teacher-photo-detail[hidden] {
  display: none;
}

.teacher-photo-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}

.teacher-photo-compare figure {
  margin: 0;
}

.teacher-photo-compare .teacher-photo-zoom { display: block; width: 100%; }

.teacher-photo-compare .teacher-photo-thumb,
.teacher-photo-compare .teacher-photo-empty {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.teacher-photo-compare figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.teacher-photo-status.is-pending {
  background: #fff3d9;
  color: #b85c14;
}

.teacher-photo-status.is-approved {
  background: #dcf8ed;
  color: #168575;
}

.teacher-photo-status.is-rejected {
  background: #ffe4e6;
  color: #be123c;
}

.teacher-photo-status.is-hidden {
  background: #f1f5f9;
  color: #64748b;
}

.teacher-profile-updates-shell .teacher-profile-update-filters.article-list-controls {
  grid-template-columns: 170px minmax(240px, 1fr) auto;
  align-items: end;
  height: 64px;
}

.teacher-profile-update-table-panel {
  max-width: 1540px;
}

.teacher-profile-update-table {
  min-width: 1280px;
  table-layout: fixed;
}

.teacher-profile-update-table th:nth-child(1) { width: 10%; }
.teacher-profile-update-table th:nth-child(2) { width: 20%; }
.teacher-profile-update-table th:nth-child(3) { width: 16%; }
.teacher-profile-update-table th:nth-child(4) { width: 11%; }
.teacher-profile-update-table th:nth-child(5) { width: 19%; }
.teacher-profile-update-table th:nth-child(6) { width: 8%; text-align: center; white-space: nowrap; }
.teacher-profile-update-table th:nth-child(7) { width: 16%; }

.teacher-profile-update-table td {
  padding: 7px 10px;
  vertical-align: middle;
}

.teacher-profile-update-table td small {
  overflow-wrap: anywhere;
}

.teacher-profile-update-table .teacher-photo-actions {
  flex-wrap: nowrap;
  max-width: none;
  align-items: center;
  white-space: nowrap;
}

.teacher-profile-update-table td:nth-child(6) {
  text-align: center;
}

.teacher-profile-update-table .teacher-photo-actions .teacher-video-icon-action {
  display: inline-flex;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
}

.teacher-profile-update-table .teacher-profile-preview-link {
  display: inline-flex;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
}

.teacher-profile-update-table .teacher-profile-preview-link:hover,
.teacher-profile-update-table .teacher-profile-preview-link:focus-visible {
  color: #fff;
  background: #1e293b;
}

.crm-table td .moderation-review-duration {
  display: block;
  margin-top: 4px;
  color: #168450;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.teacher-profile-update-clear {
  min-height: 38px;
  padding: 0 12px;
  white-space: nowrap;
}

.teacher-profile-update-table th {
  vertical-align: top;
}

.teacher-profile-update-table th > button {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.teacher-profile-update-table th > button:hover,
.teacher-profile-update-table th > button:focus-visible {
  color: #1597e3;
}

.teacher-profile-update-table th > input,
.teacher-profile-update-date-filters input {
  box-sizing: border-box;
  width: 100%;
  min-width: 100px;
  height: 32px;
  margin-top: 7px;
  padding: 4px 7px;
  border: 1px solid #d4e0eb;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
}

.teacher-profile-update-table th > small {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
}

.teacher-profile-update-date-filters {
  display: flex;
  gap: 4px;
}

.teacher-profile-update-date-filters input {
  min-width: 115px;
}

@media (max-width: 700px) {
  .teacher-profile-updates-shell .teacher-profile-update-filters.article-list-controls {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .teacher-profile-update-clear {
    justify-self: start;
  }
}

.teacher-profile-update-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.teacher-profile-update-layout.has-active-update {
  grid-template-columns: minmax(0, 1fr) minmax(390px, 480px);
}

.teacher-profile-updates-shell .teacher-profile-update-layout.has-active-update {
  grid-template-columns: minmax(0, 1fr);
}

.teacher-profile-updates-shell [data-teacher-profile-update-detail].is-pending-review { width: min(800px, calc(100vw - 24px)); }

.teacher-profile-updates-shell [data-teacher-profile-update-detail] {
  position: fixed;
  inset: 12px 12px auto auto;
  z-index: 65;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(520px, calc(100vw - 24px));
  min-width: 0;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px;
}

[data-teacher-profile-update-detail] > :not(.profile-update-changes) { flex: 0 0 auto; }
[data-teacher-profile-update-detail] .teacher-video-detail-head { margin: 0; gap: 8px; }
[data-teacher-profile-update-detail] .teacher-video-detail-head > div { min-width: 0; overflow-wrap: anywhere; }
[data-teacher-profile-update-detail] .teacher-video-detail-head h2 { margin: 2px 0; font-size: 19px; }
[data-teacher-profile-update-detail] .teacher-video-detail-head span { font-size: 11px; }

.profile-update-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin: 0; font-size: 11px; }
.profile-update-summary > div { display: flex; align-items: center; gap: 4px; min-width: 0; }
.profile-update-summary dt { color: var(--muted); }
.profile-update-summary dd { margin: 0; overflow-wrap: anywhere; }
.profile-update-summary .status-pill { padding: 3px 7px; font-size: 11px; }

[data-teacher-profile-update-detail] .profile-update-changes { min-height: 0; overflow: auto; gap: 0; margin: 0; }
.profile-recheck-context {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 8px;
  margin-bottom: 7px;
  border-radius: 8px;
  background: #fff1de;
}
.profile-recheck-context > div:only-child { grid-column: 1 / -1; }
.profile-recheck-context a { display: block; }
.profile-recheck-context img {
  display: block;
  width: 86px;
  height: 86px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}
.profile-recheck-context p,
.profile-recheck-copy { white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-recheck-context p { margin: 3px 0 0; }
.profile-recheck-blocked { margin: 5px 0; color: #9a4d00; }

[data-teacher-profile-update-detail] .profile-update-change { padding: 7px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
[data-teacher-profile-update-detail] .profile-update-change h4 { margin-bottom: 4px; font-size: 13px; }
[data-teacher-profile-update-detail] .profile-update-change--compare { display: grid; grid-template-columns: minmax(0, 112px) minmax(0, 1fr); align-items: start; gap: 6px; }
[data-teacher-profile-update-detail] .profile-update-change--compare h4 { margin: 4px 0 0; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  [data-teacher-profile-update-detail] .profile-update-change--compare { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  [data-teacher-profile-update-detail] .profile-update-change--compare h4 { margin: 0; }
}
[data-teacher-profile-update-detail] .profile-update-diff { gap: 5px; }
[data-teacher-profile-update-detail] .profile-update-diff > div { padding: 5px 7px; border-radius: 6px; background: #f5f8fb; overflow-wrap: anywhere; }
[data-teacher-profile-update-detail] .profile-update-diff > div + div { background: #edf6ff; }
[data-teacher-profile-update-detail] .profile-update-diff > div > span:first-child { margin: 0 0 2px; }
[data-teacher-profile-update-detail] .profile-update-mini-list { grid-template-columns: fit-content(42%) minmax(0, 1fr); gap: 2px 6px; }
[data-teacher-profile-update-detail] .profile-update-value-list { margin: 0; padding-left: 15px; }
[data-teacher-profile-update-detail] .profile-update-value-list li + li { margin-top: 4px; }
.profile-update-language-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.profile-update-language-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; }
.profile-update-language-list .profile-update-language-level { margin: 0; font: inherit; text-transform: none; }
[data-teacher-profile-update-detail] .profile-update-diff .profile-update-chip-list { gap: 3px; padding: 0; background: transparent; }
[data-teacher-profile-update-detail] .profile-update-chip-list span { min-height: 18px; padding: 0 5px; margin: 0; }

[data-teacher-profile-update-detail] .profile-update-diff--wide {
  position: relative;
  grid-template-columns: max-content max-content minmax(0, 1fr);
}
.profile-update-diff--wide > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  clip-path: inset(50%);
}
.profile-update-diff--wide > label {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.profile-update-version-requested:checked ~ label:first-of-type,
.profile-update-version-current:checked ~ label:last-of-type {
  border-color: #9bcdf5;
  background: #edf6ff;
  color: var(--ink);
  font-weight: 700;
}
.profile-update-version-requested:focus-visible ~ label:first-of-type,
.profile-update-version-current:focus-visible ~ label:last-of-type {
  outline: 2px solid #1479c9;
  outline-offset: 1px;
}
[data-teacher-profile-update-detail] .profile-update-diff--wide > div {
  display: none;
  grid-column: 1 / -1;
  padding: 8px 10px;
  white-space: pre-wrap;
}
[data-teacher-profile-update-detail] .profile-update-version-requested:checked ~ .profile-update-value-requested,
[data-teacher-profile-update-detail] .profile-update-version-current:checked ~ .profile-update-value-current {
  display: block;
}
[data-teacher-profile-update-detail] .profile-update-description-list p { margin: 2px 0 0; }
[data-teacher-profile-update-detail] .profile-update-description-list li + li {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

[data-teacher-profile-update-detail] .teacher-video-comment { gap: 4px; }
[data-teacher-profile-update-detail] .teacher-video-comment textarea { box-sizing: border-box; min-height: 44px; max-height: 20dvh; padding: 5px 8px; }
[data-teacher-profile-update-detail] .profile-update-toolbar { flex-wrap: nowrap; margin-top: 6px; }
[data-teacher-profile-update-detail] .profile-update-toolbar .moderation-template-picker { flex: 1 1 auto; min-width: 0; width: auto; }
[data-teacher-profile-update-detail] [data-teacher-profile-update-decision-message] { margin: 4px 0; font-size: 12px; }

@media (max-height: 460px) {
  [data-teacher-profile-update-detail] .profile-update-changes { flex: 0 0 auto; overflow: visible; }
}

.teacher-profile-update-table td strong,
.teacher-profile-update-table td small {
  display: block;
}

.teacher-profile-update-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.teacher-profile-update-detail {
  align-self: start;
  padding: 18px;
}

.teacher-profile-update-detail[hidden] {
  display: none;
}

.teacher-profile-update-status.is-pending_review {
  background: #fff3d9;
  color: #b85c14;
}

.teacher-profile-update-status.is-approved {
  background: #dcf8ed;
  color: #168575;
}

.teacher-profile-update-status.is-rejected {
  background: #ffe4e6;
  color: #be123c;
}

.teacher-profile-update-status.is-needs_update {
  background: #fff7ed;
  color: #c2410c;
}

.teacher-profile-update-status.is-hidden {
  background: #f1f5f9;
  color: #64748b;
}

.profile-update-changes {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.profile-update-current {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.profile-update-current h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
}

.profile-update-current dl,
.profile-update-mini-list {
  display: grid;
  grid-template-columns: minmax(120px, .4fr) minmax(0, 1fr);
  gap: 7px 12px;
  margin: 0;
}

.profile-update-current dt,
.profile-update-mini-list dt {
  color: var(--muted);
  font-size: 12px;
}

.profile-update-current dd,
.profile-update-mini-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.profile-update-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-update-chip-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef5fb;
  color: #40556e;
  font-size: 12px;
}

.profile-update-media {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.profile-update-media h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
}

.profile-update-media img {
  display: block;
  width: min(180px, 100%);
  border-radius: 10px;
  object-fit: cover;
}

.profile-update-media a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.profile-update-change {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
}

.profile-update-change h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.profile-update-change small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.profile-update-diff--single {
  grid-template-columns: 1fr;
}

.profile-update-diff div {
  min-width: 0;
  border-radius: 10px;
  background: #fff;
  padding: 9px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.profile-update-diff span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-update-diff pre {
  overflow: auto;
  max-height: 180px;
  margin: 0;
  color: inherit;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.client-news-shell .client-news-filters.article-list-controls {
  grid-template-columns: 160px 190px minmax(240px, 1fr) minmax(180px, auto);
  align-items: end;
}

.client-news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.client-news-layout.has-active-news {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
}

.client-news-table td strong,
.client-news-table td small {
  display: block;
}

.client-news-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.client-news-thumb {
  display: block;
  width: 92px;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  background: #eef8ff;
  object-fit: cover;
}

.client-news-no-image {
  color: #94a3b8;
  font-weight: 800;
}

.client-news-table .article-title--edit {
  color: #0868c1;
}

.client-news-actions {
  display: flex;
  gap: 5px;
  width: max-content;
}

.client-news-status.is-submitted {
  background: #fff3d9;
  color: #b85c14;
}

.client-news-status.is-published {
  background: #dcf8ed;
  color: #168575;
}

.client-news-status.is-rejected {
  background: #ffe4e6;
  color: #be123c;
}

.client-news-status.is-needs_update {
  background: #fff7ed;
  color: #c2410c;
}

.client-news-status.is-hidden,
.client-news-status.is-draft {
  background: #f1f5f9;
  color: #64748b;
}

.client-news-detail {
  align-self: start;
  padding: 18px;
}

.client-news-detail[hidden] {
  display: none;
}

.client-news-detail-image {
  width: 100%;
  max-height: 260px;
  margin: 0 0 14px;
  border-radius: 12px;
  background: #eef8ff;
  object-fit: cover;
}

.client-news-body {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #dbe8f2;
  border-radius: 12px;
  background: #fbfdff;
  color: #1f2b46;
  font-size: 13px;
  line-height: 1.55;
}

.client-news-body p {
  margin: 0;
}

.teacher-video-intro-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: #dcf8ed;
  color: #168575;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.teacher-video-detail {
  align-self: start;
  padding: 18px;
}

.teacher-video-detail[hidden] {
  display: none;
}

.teacher-video-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.teacher-video-detail-head span {
  display: block;
  color: #159eef;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.teacher-video-detail-head h2 {
  margin: 4px 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.08;
}

.teacher-video-detail-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.teacher-video-detail-close {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.teacher-video-preview {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 14px;
  background: #17212b;
  color: #fff;
  text-decoration: none;
}

.teacher-video-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  opacity: .9;
}

.teacher-video-preview span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  color: #17212b;
  font-weight: 900;
  transform: translate(-50%, -50%);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
}

.teacher-video-meta {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.teacher-video-meta dt {
  color: var(--muted);
  font-weight: 900;
}

.teacher-video-meta dd {
  margin: 0;
  font-weight: 900;
  word-break: break-word;
}

.teacher-video-ralmix,
.teacher-video-comment {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.teacher-video-ralmix {
  margin-bottom: 12px;
}

.teacher-video-ralmix input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  outline: none;
}

.teacher-video-intro-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.teacher-video-intro-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #159eef;
}

.teacher-video-comment textarea {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  resize: vertical;
  outline: none;
}

[data-document-reject-editor] > td { background: #f8fafc; }
[data-document-reject-form] { max-width: min(32rem, calc(100vw - 3rem)); }
[data-document-reject-form] .teacher-video-comment { gap: 4px; }
[data-document-reject-form] textarea { min-height: 54px; padding: 6px 8px; }
[data-document-reject-form] textarea:focus-visible { outline: 2px solid #0878f8; outline-offset: 1px; }
.document-reject-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.document-reject-actions button { min-height: 34px; cursor: pointer; }
.document-reject-actions .document-reject-confirm { border-color: #b91c1c; background: #b91c1c; }
.document-reject-actions [data-document-reject-cancel] {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.document-reject-actions button:disabled { opacity: .55; cursor: wait; }
[data-document-reject-error] { margin: 4px 0 0; color: #b42318; white-space: normal; }
[data-document-reject-error]:empty { display: none; }
.document-reject-reason { display: block; max-width: 20rem; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.document-reject-reason > summary { cursor: pointer; }
.document-reject-reason > p { margin: 4px 0 0; }

.teacher-video-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Course moderation: full client-facing preview */
[data-course-moderation-detail]{grid-column:1/-1;max-width:none!important;padding:0!important;overflow:hidden}
.course-review-head{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 22px;border-bottom:1px solid #dce7f2;background:#fff}.course-review-head span{color:#66788e;font-size:12px}.course-review-head h2{margin:4px 0 0;color:#17212b;font-size:24px}.course-review-head button{min-height:36px;padding:0 14px;border:1px solid #d5e1ed;border-radius:9px;background:#fff;color:#40536b}
.course-review-layout{display:grid;grid-template-columns:minmax(0,1fr) 350px;align-items:start;background:#eef5fa}.course-client-preview{margin:18px;border:1px solid #d9e5f0;border-radius:18px;background:#fff;box-shadow:0 14px 32px rgba(22,42,70,.08);overflow:hidden}.course-client-hero{padding:38px;background:linear-gradient(125deg,#17212b,#159eef);color:#fff}.course-client-hero>span{font-size:12px;letter-spacing:.08em;text-transform:uppercase;opacity:.8}.course-client-hero h1{max-width:720px;margin:12px 0 9px;font-size:34px;line-height:1.08}.course-client-hero p{max-width:680px;margin:0;color:rgba(255,255,255,.82);font-size:15px;line-height:1.5}.course-client-hero>div{display:flex;align-items:center;gap:16px;margin-top:24px}.course-client-hero b{font-size:28px}.course-client-hero button{min-height:42px;padding:0 22px;border:0;border-radius:9px;background:#ff8a3d;color:#fff;font-weight:800}
.course-client-facts{display:grid;grid-template-columns:repeat(4,1fr);border-bottom:1px solid #e1eaf3}.course-client-facts div{display:grid;gap:4px;padding:16px 20px;border-right:1px solid #e1eaf3}.course-client-facts div:last-child{border-right:0}.course-client-facts span{color:#718196;font-size:11px}.course-client-facts strong{color:#17212b;font-size:13px}.course-client-section{padding:22px 28px;border-bottom:1px solid #e5edf4}.course-client-section h3{margin:0 0 12px;font-size:20px}.course-client-section h4{margin:18px 0 6px}.course-client-section>p{margin:0;color:#586b82;line-height:1.6}.course-client-section ul{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0;padding:0;list-style:none}.course-client-section li{padding:11px 12px;border-radius:9px;background:#edf8fb;color:#34546d}.course-client-section li:before{content:"✓";margin-right:8px;color:#19a66b}.course-client-section details{margin-top:9px;border:1px solid #dbe6f0;border-radius:11px;overflow:hidden}.course-client-section summary{display:flex;justify-content:space-between;gap:12px;padding:13px 15px;background:#f7fafc;cursor:pointer}.course-client-section summary span{color:#718196;font-size:12px}.course-client-section details div p{display:grid;grid-template-columns:38px 1fr;gap:8px;margin:0;padding:10px 15px;border-top:1px solid #e5edf4;color:#52667e}.course-client-section details div p span{color:#159eef}.course-client-quiz{display:flex;justify-content:space-between;gap:12px;margin-bottom:10px;padding:13px;border-radius:10px;background:#edf8fb}.course-client-quiz span,.course-client-question span{color:#687b91;font-size:12px}.course-client-question{display:flex;justify-content:space-between;gap:12px;padding:10px 3px;border-top:1px solid #e5edf4}.course-client-certificate{display:grid;grid-template-columns:42px 1fr;gap:12px;margin:22px 28px;padding:16px;border:1px solid rgba(72,203,185,.38);border-radius:12px;background:#edfbf8}.course-client-certificate>span{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#48cbb9;color:#fff}.course-client-certificate strong{display:block}.course-client-certificate p{margin:4px 0 0;color:#52756f}.course-client-teacher{display:flex;justify-content:space-between;gap:12px;padding:18px 28px;background:#f7fafc}.course-client-teacher span{color:#718196}
.course-review-decision{position:sticky;top:18px;display:grid;gap:15px;min-height:100%;padding:22px;border-left:1px solid #d9e5f0;background:#fff}.course-review-decision h3{margin:0;font-size:20px}.course-review-status{justify-self:start;padding:6px 9px;border-radius:999px;background:#fff3e8;color:#b85c14;font-size:11px}.course-review-decision dl{display:grid;grid-template-columns:85px 1fr;gap:9px;margin:0;padding:14px;border-radius:11px;background:#f7fafc}.course-review-decision dt{color:#718196}.course-review-decision dd{margin:0;color:#263b54}.course-review-decision dd small{display:block;margin-top:3px;color:#7c8da0}.course-review-decision .teacher-video-comment{display:grid;gap:6px}.course-review-decision .teacher-video-comment>span{color:#718196;font-size:12px;line-height:1.45}.course-review-decision textarea{width:100%;min-height:150px;padding:11px;border:1px solid #ccdbe9;border-radius:10px;resize:vertical}.course-review-actions{display:grid;gap:8px}.course-review-actions button{min-height:42px;border:0;border-radius:9px;color:#fff;font-weight:800}.course-review-actions .is-approve{background:#1ba968}.course-review-actions .is-update{background:#ff8a3d}.course-review-actions .is-reject{background:#dc3f45}.course-review-actions .is-hide{background:#6c7b8d}
@media(max-width:1180px){.course-review-layout{grid-template-columns:1fr}.course-review-decision{position:static;border-top:1px solid #d9e5f0;border-left:0}.course-client-facts{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.course-review-head{align-items:flex-start}.course-client-preview{margin:10px}.course-client-hero{padding:24px}.course-client-hero h1{font-size:27px}.course-client-facts,.course-client-section ul{grid-template-columns:1fr}.course-client-facts div{border-right:0;border-bottom:1px solid #e1eaf3}.course-client-section{padding:18px}.course-client-quiz,.course-client-question{display:grid}.course-review-decision{padding:18px}}

/* Course moderation controls */
.course-table-actions{display:flex;align-items:center;gap:6px;white-space:nowrap}.course-table-action{display:inline-flex;align-items:center;gap:6px;width:auto!important;min-width:0!important;min-height:30px!important;padding:0 10px!important;border:1px solid #d4e1ed!important;border-radius:8px!important;background:#fff!important;box-shadow:none!important;color:#40556e!important;font-size:12px!important;font-weight:700!important}.course-table-action span{display:grid;place-items:center;width:16px;height:16px;border-radius:5px;background:#edf5fb;color:#159eef;font-size:12px}.course-table-action.is-approve{border-color:#bde4d1!important;background:#f4fbf7!important;color:#168450!important}.course-table-action.is-approve span{background:#dff6e9;color:#168450}.course-table-action:hover{transform:translateY(-1px);box-shadow:0 5px 14px rgba(35,65,95,.1)!important}
.course-review-head button{display:inline-flex;align-items:center;gap:6px;width:auto!important;min-width:0!important;min-height:34px!important;padding:0 11px!important;border-radius:8px!important;font-size:12px!important}.course-review-head button span{color:#77889b;font-size:17px;line-height:1}
.course-review-status{display:inline-flex!important;align-items:center;width:max-content!important;min-width:0!important;height:26px!important;min-height:0!important;padding:0 10px!important;border-radius:999px!important;line-height:1!important}
.course-review-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.course-review-actions button{display:grid;grid-template-columns:28px minmax(0,1fr);grid-template-rows:auto auto;column-gap:9px;align-items:center;min-height:58px!important;padding:9px 11px!important;border:1px solid transparent!important;border-radius:10px!important;background:#fff!important;box-shadow:none!important;color:#24384f!important;text-align:left!important}.course-review-actions button>span{grid-row:1/3;display:grid;place-items:center;width:28px;height:28px;border-radius:8px;font-size:16px}.course-review-actions button>b{font-size:12px;line-height:1.2}.course-review-actions button>small{color:#7a8b9d;font-size:10px;line-height:1.2}.course-review-actions .is-approve{border-color:#bce5d1!important;background:#f3fbf7!important}.course-review-actions .is-approve>span{background:#dff6e9;color:#168450}.course-review-actions .is-update{border-color:#f2d3b8!important;background:#fff9f3!important}.course-review-actions .is-update>span{background:#ffead7;color:#c6671d}.course-review-actions .is-reject{border-color:#efc4c7!important;background:#fff7f7!important}.course-review-actions .is-reject>span{background:#fde4e5;color:#c83f45}.course-review-actions .is-hide{border-color:#d7e0e8!important;background:#f8fafc!important}.course-review-actions .is-hide>span{background:#e9eef3;color:#607286}.course-review-actions button:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 7px 16px rgba(31,59,88,.1)!important}.course-review-actions button:disabled{opacity:.55;cursor:wait}.course-review-message{min-height:18px;margin:0;color:#66788e;font-size:12px}.course-review-message.is-error{color:#c83f45}.course-review-message.is-success{color:#168450}
@media(max-width:560px){.course-review-actions{grid-template-columns:1fr}.course-table-actions{display:grid}.course-table-action{width:100%!important}}

/* Course moderation layout */
.course-moderation-shell{display:grid!important;width:100%;min-height:0!important;gap:12px;background:transparent!important}.course-moderation-toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,340px) auto;align-items:center;gap:14px;width:100%;padding:0 18px 12px;border-bottom:1px solid var(--admin-line);background:#fff}.course-moderation-toolbar>input[type="search"]{width:100%;min-height:38px;border:1px solid #d4e0eb;border-radius:9px;padding:0 12px}.course-status-tabs{display:flex;align-items:center;gap:4px;min-width:0;overflow-x:auto;padding:4px;border-radius:10px;background:#f1f5f8}.course-status-tabs button{flex:0 0 auto;min-height:30px!important;padding:0 10px!important;border:0!important;border-radius:7px!important;background:transparent!important;box-shadow:none!important;color:#64768a!important;font-size:11px!important;font-weight:700!important;white-space:nowrap}.course-status-tabs button.is-active{background:#fff!important;color:#17212b!important;box-shadow:0 2px 8px rgba(26,48,72,.09)!important}.course-moderation-layout,.course-moderation-layout.has-active-update{display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%;max-width:none;gap:12px}.course-moderation-table-panel{width:calc(100% - 36px);max-width:none;margin:0 18px!important}.course-moderation-table-panel .crm-table-wrap{width:100%}.course-moderation-table{width:100%!important;min-width:940px!important;table-layout:auto}.course-moderation-table th,.course-moderation-table td{padding:12px 14px}.course-moderation-table th:first-child{width:25%}.course-moderation-table th:last-child{width:150px}
.course-table-status{display:inline-flex;align-items:center;gap:6px;min-height:26px;padding:0 9px;border-radius:999px;background:#f0f4f7;color:#5f7184;font-size:11px;white-space:nowrap}.course-table-status i{display:grid;place-items:center;width:16px;height:16px;border-radius:50%;background:#dce5ec;color:#607286;font-size:10px;font-style:normal}.course-table-status.is-pending_review{background:#fff7ed;color:#b85c14}.course-table-status.is-pending_review i{background:#ffe4c7;color:#c6671d}.course-table-status.is-approved{background:#edf9f2;color:#168450}.course-table-status.is-approved i{background:#d8f2e3;color:#168450}.course-table-status.is-rejected{background:#fff1f2;color:#c83f45}.course-table-status.is-rejected i{background:#fbdadd;color:#c83f45}.course-table-status.is-needs_update{background:#fff7ed;color:#b85c14}.course-table-status.is-needs_update i{background:#ffe4c7;color:#c6671d}.course-table-status.is-hidden{background:#f1f4f7;color:#657587}
[data-course-moderation-detail]{width:calc(100% - 36px);margin:0 18px 18px}.course-review-layout{display:flex;flex-direction:column;align-items:stretch}.course-review-decision{order:-1;position:static;display:grid;grid-template-columns:170px minmax(250px,.8fr) minmax(300px,1.1fr);grid-template-rows:auto auto;gap:12px 18px;min-height:0!important;height:auto;padding:16px 18px;border:0;border-bottom:1px solid #d9e5f0;background:#fff}.course-review-decision>.course-review-status{grid-column:1;grid-row:1}.course-review-decision>h3{grid-column:1;grid-row:2;align-self:start}.course-review-decision>dl{grid-column:2;grid-row:1/3}.course-review-decision>.teacher-video-comment{grid-column:3;grid-row:1/3}.course-review-decision textarea{min-height:86px}.course-review-decision>.course-review-message{grid-column:1/-1;min-height:0}.course-review-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:7px}.course-review-actions button{display:inline-flex;grid-template-columns:none;grid-template-rows:none;gap:7px;width:auto;min-width:0;min-height:34px!important;padding:0 10px!important;border-radius:8px!important;text-align:center!important}.course-review-actions button>span{display:grid;grid-row:auto;width:21px;height:21px;border-radius:6px;font-size:12px}.course-review-actions button>b{font-size:11px}.course-review-actions button>small{display:none}
@media(max-width:1100px){.course-moderation-toolbar{grid-template-columns:1fr}.course-review-decision{grid-template-columns:1fr 1fr}.course-review-decision>.course-review-status,.course-review-decision>h3{grid-column:1}.course-review-decision>dl{grid-column:1;grid-row:3}.course-review-decision>.teacher-video-comment{grid-column:2;grid-row:1/4}.course-review-actions{grid-column:1/-1}.course-review-decision>.course-review-message{grid-column:1/-1}}
@media(max-width:720px){.course-moderation-table-panel,[data-course-moderation-detail]{width:calc(100% - 20px);margin-left:10px!important;margin-right:10px!important}.course-review-decision{grid-template-columns:1fr}.course-review-decision>*{grid-column:1!important;grid-row:auto!important}.course-review-actions{display:grid;grid-template-columns:1fr 1fr}.course-review-actions button{width:100%}}
.course-moderation-table{min-width:760px!important}
.course-moderation-table th:first-child{width:38%}
.course-moderation-table th:nth-child(4){width:158px}
.course-moderation-table td:nth-child(4){font-size:12px;white-space:nowrap}
.course-moderation-table .course-teacher-link{display:inline;padding:0;border:0;background:none;color:#1165b2;font:inherit;font-weight:700;text-align:start;cursor:pointer}
.course-moderation-table .course-teacher-link:hover,.course-moderation-table .course-teacher-link:focus-visible{text-decoration:underline}

@media (max-width: 1120px) {
  .teacher-video-layout.has-active-video {
    grid-template-columns: 1fr;
  }

  .teacher-profile-update-layout.has-active-update {
    grid-template-columns: 1fr;
  }

  .teacher-video-detail {
    order: -1;
  }

  .teacher-profile-update-detail {
    order: -1;
  }

  .teacher-videos-shell .teacher-video-filters.article-list-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .teacher-videos-shell .teacher-video-filters.article-list-controls {
    grid-template-columns: 1fr;
  }

  .teacher-video-table {
    min-width: 920px;
  }

  .teacher-video-meta {
    grid-template-columns: 1fr;
  }

  .teacher-video-detail {
    padding: 14px;
  }
}

/* Typography weight normalization */
body.crm-page :where(p,a,button,input,select,textarea,label,li,dt,dd,small,span,em,time,summary,th,td,b,strong){font-weight:400!important}
body.crm-page :where(h1,h2,h3,h4,h5,h6),
body.crm-page :where(h1,h2,h3,h4,h5,h6) :where(span,strong,b,a){font-weight:800!important}
.moderation-template-shell .moderation-template-filters {
  grid-template-columns: minmax(190px, 1.4fr) repeat(5, minmax(120px, 1fr));
}
.moderation-template-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 16px; align-items: start; }
.moderation-template-layout:has(.moderation-template-drawer[hidden]) { grid-template-columns: minmax(0, 1fr); }
.moderation-template-editor-head { align-items: center; flex-wrap: wrap; }
.moderation-template-editor-head .article-actions--icons { margin-left: auto; }
.moderation-template-footer { justify-content: flex-start; margin: 12px 0; }
.teacher-video-detail-actions .moderation-template-picker, [data-support-chat-reply] .support-chat-template-picker { min-height: 36px; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--ink); font: inherit; }
.teacher-video-detail-actions .moderation-template-picker { width: 220px; }
[data-support-chat-reply] .support-chat-template-picker { grid-column: 1 / -1; width: min(280px, 100%); }
.moderation-template-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.moderation-template-actions button, .moderation-template-variables button, .moderation-compose-quick button, .moderation-compose-list button { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--ink); cursor: pointer; }
.moderation-template-drawer form, .moderation-compose-dialog form { display: grid; gap: 12px; }
.moderation-template-drawer label, .moderation-compose-dialog label { display: grid; gap: 5px; font-weight: 700; }
.moderation-template-drawer input:not([type="checkbox"]), .moderation-template-drawer select, .moderation-template-drawer textarea, .moderation-compose-dialog input:not([type="checkbox"]), .moderation-compose-dialog select, .moderation-compose-dialog textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: #fff; color: var(--ink); font: inherit; }
.moderation-template-drawer textarea, .moderation-compose-dialog textarea { resize: vertical; }
.moderation-template-drawer label:has([type="checkbox"]), .moderation-compose-dialog label:has([type="checkbox"]) { display: flex; align-items: center; }
.moderation-compose-dialog { width: min(850px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--line); border-radius: 16px; padding: 20px; color: var(--ink); }
.moderation-compose-dialog::backdrop { background: rgb(16 24 40 / 60%); }
.moderation-compose-controls { display: grid; grid-template-columns: 150px auto minmax(160px, 1fr); gap: 10px; align-items: end; }
.moderation-compose-list { max-height: 250px; overflow: auto; display: grid; gap: 6px; }
.moderation-compose-list article { display: flex; justify-content: space-between; gap: 12px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.moderation-compose-list article strong, .moderation-compose-list article small { display: block; }
.moderation-compose-list article p { margin: 4px 0 0; }
.moderation-compose-quick { display: flex; flex-wrap: wrap; gap: 5px; }
.moderation-compose-variables { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
[data-template-error], [data-compose-error] { color: #b91c1c; }
@media (max-width: 950px) { .moderation-template-layout { grid-template-columns: minmax(0, 1fr); } .moderation-template-shell .moderation-template-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .moderation-template-shell .moderation-template-filters, .moderation-compose-controls, .moderation-compose-variables { grid-template-columns: minmax(0, 1fr); } .moderation-compose-dialog { padding: 12px; } }

/* Shared CRM actions: consistent icons, spacing and accessible hit targets. */
.crm-page .crm-action-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 40px !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: var(--crm-action-color, #159eef) !important;
  color: #fff !important;
  box-shadow: none !important;
  text-decoration: none !important;
  vertical-align: middle;
  cursor: pointer;
}
.crm-page .crm-action-icon--approve { --crm-action-color: #16a34a; }
.crm-page .crm-action-icon--reject { --crm-action-color: #dc2626; }
.crm-page .crm-action-icon--profile { --crm-action-color: #334155; }
.crm-page .crm-action-icon--update { --crm-action-color: #b45309; }
.crm-page .crm-action-icon--hide { --crm-action-color: #64748b; }
.crm-page .crm-action-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.crm-page .crm-action-icon svg circle { fill: none; }
.crm-page .crm-action-icon:focus-visible { outline: 3px solid #0f172a; outline-offset: 2px; }
.crm-page .crm-action-icon:hover:not(:disabled) { filter: brightness(.92); transform: none !important; }
.crm-page .crm-action-icon:disabled { opacity: .5; cursor: not-allowed; }
.crm-page :is(.teacher-video-actions, .teacher-photo-actions, .teacher-video-detail-actions, .course-table-actions, .course-review-actions, .materials-admin__actions, .materials-admin__detail-actions, .manual-payment-detail-actions) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: auto;
}
@media (pointer: coarse) {
  .crm-page .crm-action-icon { flex-basis: 44px !important; width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; }
}

.moderation-status-tabs { margin: 0; gap: 6px; }
.moderation-status-tabs button { min-height: 36px; padding: 0 12px; cursor: pointer; }
.teacher-videos-shell .teacher-video-filters.article-list-controls,
.teacher-photos-shell .teacher-photo-filters.article-list-controls,
.client-news-shell .client-news-filters.article-list-controls { grid-template-columns: 150px minmax(240px, 1fr) auto; }
.teacher-profile-updates-shell .teacher-profile-update-filters.article-list-controls { grid-template-columns: minmax(240px, 1fr) auto; }
@media (max-width: 700px) {
  .teacher-videos-shell .teacher-video-filters.article-list-controls,
  .teacher-photos-shell .teacher-photo-filters.article-list-controls,
  .client-news-shell .client-news-filters.article-list-controls,
  .teacher-profile-updates-shell .teacher-profile-update-filters.article-list-controls { grid-template-columns: minmax(0, 1fr); height: auto; }
}

.teacher-videos-shell,
.teacher-photos-shell,
.teacher-profile-updates-shell {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: center;
}
.teacher-profile-updates-shell { grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); }
.teacher-videos-shell > .moderation-status-tabs,
.teacher-photos-shell > .moderation-status-tabs,
.teacher-profile-updates-shell > .moderation-status-tabs { grid-column: 1; }
.teacher-videos-shell > form,
.teacher-photos-shell > form,
.teacher-profile-updates-shell > form { grid-column: 2; width: 100%; height: auto; margin: 0; }
.teacher-videos-shell > .teacher-video-layout,
.teacher-photos-shell > .teacher-photo-layout,
.teacher-profile-updates-shell > .teacher-profile-update-layout { grid-column: 1 / -1; }
.teacher-videos-shell .teacher-video-filters.article-list-controls,
.teacher-photos-shell .teacher-photo-filters.article-list-controls { grid-template-columns: 130px minmax(0, 1fr); }
.teacher-profile-updates-shell .teacher-profile-update-filters.article-list-controls { grid-template-columns: minmax(0, 1fr); }
.teacher-videos-shell form input[type="search"],
.teacher-photos-shell form input[type="search"],
.teacher-profile-updates-shell form input[type="search"] { min-width: 0; width: 100%; }
.teacher-videos-shell [data-teacher-video-message]:empty,
.teacher-photos-shell [data-teacher-photo-message]:empty,
.teacher-profile-updates-shell [data-teacher-profile-update-message]:empty { display: none; }
.teacher-videos-shell [data-teacher-video-message]:not(:empty),
.teacher-photos-shell [data-teacher-photo-message]:not(:empty),
.teacher-profile-updates-shell [data-teacher-profile-update-message]:not(:empty) { grid-column: 1 / -1; }

.moderation-status-tabs :is([data-moderation-status="pending"], [data-moderation-status="needs_review"], [data-moderation-status="submitted"], [data-materials-status="pending_review"]) { --moderation-tab-color: #9a4d00; --moderation-tab-bg: #fff1de; --moderation-tab-border: #efbd76; }
.moderation-status-tabs :is([data-moderation-status="approved"], [data-moderation-status="published"], [data-materials-status="published"]) { --moderation-tab-color: #166534; --moderation-tab-bg: #e9f8ee; --moderation-tab-border: #8ed4a5; }
.moderation-status-tabs :is([data-moderation-status="rejected"], [data-materials-status="rejected"]) { --moderation-tab-color: #b42318; --moderation-tab-bg: #fff0ef; --moderation-tab-border: #efaaa5; }
.moderation-status-tabs :is([data-moderation-status="hidden"], [data-materials-status="blocked"]) { --moderation-tab-color: #475569; --moderation-tab-bg: #eef2f5; --moderation-tab-border: #cbd5e1; }
.moderation-status-tabs :is([data-moderation-status="needs_update"], [data-materials-status="needs_changes"]) { --moderation-tab-color: #a56211; --moderation-tab-bg: #fff8ed; --moderation-tab-border: #f2d5a0; }
.teacher-videos-shell > .moderation-status-tabs,
.teacher-photos-shell > .moderation-status-tabs,
.teacher-profile-updates-shell > .moderation-status-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #f1f5f8;
}
.moderation-status-tabs button:is([data-moderation-status], [data-materials-status]) {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  color: var(--moderation-tab-color, #64768a);
  background: transparent;
  white-space: nowrap;
}
.moderation-status-tabs .profile-recheck-count:not([hidden]) {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-inline-start: 3px;
  padding: 0 3px;
  border-radius: 999px;
  background: #c92326;
  color: #fff;
  font-size: 10px;
}
.moderation-status-tabs button.is-active:is([data-moderation-status], [data-materials-status]) {
  color: var(--moderation-tab-color, #17212b);
  background: var(--moderation-tab-bg, #fff);
  box-shadow: 0 2px 8px rgba(26, 48, 72, .09), inset 0 -2px 0 var(--moderation-tab-border, #d4e0eb);
}
@media (max-width: 700px) {
  .teacher-videos-shell,
  .teacher-photos-shell,
  .teacher-profile-updates-shell { grid-template-columns: minmax(0, 1fr); }
  .teacher-videos-shell > form,
  .teacher-photos-shell > form,
  .teacher-profile-updates-shell > form { grid-column: 1; }
}
@media (max-width: 700px) {
  .teacher-videos-shell .teacher-video-filters.article-list-controls,
  .teacher-photos-shell .teacher-photo-filters.article-list-controls { grid-template-columns: minmax(0, 1fr); }
}

.crm-page .teacher-photo-table .teacher-photo-actions,
.crm-page .teacher-video-table .teacher-video-actions,
.crm-page .teacher-profile-update-table .teacher-photo-actions {
  flex-wrap: nowrap;
  width: max-content;
  max-width: none;
  white-space: nowrap;
}
.crm-page .teacher-photo-table .teacher-photo-actions > *,
.crm-page .teacher-video-table .teacher-video-actions > *,
.crm-page .teacher-profile-update-table .teacher-photo-actions > * { flex-shrink: 0; }

.crm-page .teacher-video-table th:last-child,
.crm-page .teacher-video-table td:last-child {
  width: 230px;
  min-width: 230px;
}
.crm-page .teacher-video-table .teacher-video-actions {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  min-width: max-content;
}

.crm-event-notices {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 10000;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.crm-event-notice {
  display: flex;
  align-items: center;
  border: 1px solid #cce1ef;
  border-left: 4px solid #168de6;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(14, 37, 64, .18);
  color: #172841;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  pointer-events: auto;
}
.crm-event-notice-link {
  flex: 1;
  min-width: 0;
  padding: 12px 8px 12px 16px;
  color: inherit;
  text-decoration: none;
}
.crm-event-notice-close {
  flex: none;
  align-self: stretch;
  width: 44px;
  border: 0;
  background: transparent;
  color: #60758d;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.crm-event-notice-close:hover,
.crm-event-notice-close:focus-visible { color: #d9303e; }
.crm-event-notice.is-payment { border-left-color: #16a36c; }
.crm-event-notice:hover { background: #f4faff; }

@media (max-width: 760px) {
  body.crm-page:has(> .crm-mobile-bar) { padding-top: 52px; }
  body.crm-page.crm-mobile-menu-open { overflow: hidden; }
  .crm-mobile-bar { position: fixed; inset: 0 0 auto; z-index: 35; display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 4px 12px; background: var(--admin-navy); color: #fff; }
  .crm-mobile-menu-toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
  .crm-mobile-menu-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  .crm-mobile-menu-toggle span { font-size: 22px; line-height: 1; }
  .crm-page .crm-sidebar { top: 52px; width: min(280px, 86vw); min-height: 0; height: calc(100dvh - 52px); transform: translateX(-110%); visibility: hidden; overscroll-behavior: contain; }
  .crm-page.crm-mobile-menu-open .crm-sidebar { transform: none; visibility: visible; }
  .crm-mobile-menu-backdrop:not([hidden]) { position: fixed; inset: 52px 0 0; z-index: 29; display: block; width: 100%; border: 0; padding: 0; background: rgba(16,28,48,.45); }
  .crm-page .crm-shell { width: 100%; min-width: 0; margin-left: 0; }
  .crm-page .crm-event-notices { top: 60px; right: 8px; max-width: calc(100vw - 16px); }
}
.crm-event-sound-enable { width: 100%; padding: 12px 16px; border-left-color: #e59b20; text-align: left; cursor: pointer; }
@media (max-width: 600px) {
  .crm-event-notices { top: 8px; right: 8px; }
}

/* Isolated UGC management keeps the existing CRM layout and controls intact. */
.crm-ugc-frame { display:block; width:100%; height:calc(100dvh - 100px); min-height:520px; border:0; background:#fff; }

/* Compact Support Chat composer; the emoji control is inserted after the textarea. */
.support-chat-thread { container-type: inline-size; }
body.crm-page .support-chat-thread form[data-support-chat-reply] {
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr) repeat(2, 40px);
  align-items: end;
  gap: 8px;
  padding: 10px;
}
body.crm-page .support-chat-thread form[data-support-chat-reply]:has(> .chat-emoji-trigger) {
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr) repeat(3, 40px);
}
body.crm-page .support-chat-thread [data-support-chat-reply] .support-chat-template-picker {
  grid-column: 1;
  width: 100%;
  min-width: 0;
  height: 40px;
  margin: 0;
}
body.crm-page .support-chat-thread [data-support-chat-reply] textarea { grid-column: 2; margin: 0; }
body.crm-page .support-chat-thread [data-support-chat-reply] .support-chat-image-picker { grid-column: -3; margin: 0; }
body.crm-page .support-chat-thread [data-support-chat-reply] .support-chat-send {
  grid-column: -2;
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  background: #16a34a;
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
body.crm-page .support-chat-thread [data-support-chat-reply] .support-chat-send:hover { background: #15803d; }
body.crm-page .support-chat-thread [data-support-chat-reply] .support-chat-send:disabled { opacity: .55; cursor: wait; }
body.crm-page .support-chat-thread [data-support-chat-reply] :is(.support-chat-file-name, .support-chat-upload-error) { margin: 0; }
body.crm-page .support-chat-thread [data-support-chat-reply] :is(.support-chat-file-name, .support-chat-upload-error):empty { display: none; }
@container (max-width: 640px) {
  body.crm-page .support-chat-thread form[data-support-chat-reply] { grid-template-columns: minmax(0, 1fr) repeat(2, 40px); }
  body.crm-page .support-chat-thread form[data-support-chat-reply]:has(> .chat-emoji-trigger) { grid-template-columns: minmax(0, 1fr) repeat(3, 40px); }
  body.crm-page .support-chat-thread [data-support-chat-reply] .support-chat-template-picker { grid-column: 1 / -1; width: min(220px, 100%); }
  body.crm-page .support-chat-thread [data-support-chat-reply] textarea { grid-column: 1; }
}

/* Pending registrations: compact list, message composer and existing application history. */
.pending-registration-shell { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; align-content: start; gap: 0; min-width: 0; min-height: 0; }
.pending-registration-table { table-layout: fixed; min-width: 1050px; width: 100%; background: #fff; }
.pending-registration-table th:nth-child(1) { width: 5%; }
.pending-registration-table th:nth-child(2) { width: 18%; }
.pending-registration-table th:nth-child(3) { width: 8%; }
.pending-registration-table th:nth-child(4) { width: 9%; }
.pending-registration-table th:nth-child(5) { width: 14%; }
.pending-registration-table th:nth-child(6) { width: 9%; }
.pending-registration-table th:nth-child(7) { width: 13%; }
.pending-registration-table th:nth-child(8) { width: 17%; }
.pending-registration-table th:nth-child(9) { width: 7%; }
.pending-registration-table td { padding: 8px 10px; vertical-align: middle; overflow-wrap: anywhere; font-size: 13px; }
.pending-registration-table td small { display: block; margin-top: 4px; color: #708097; font-size: 11px; line-height: 1.4; }
.pending-registration-role,
.pending-registration-journey { display: inline-flex; align-items: center; gap: 4px; }
.pending-registration-role-letter,
.pending-registration-method { display: inline-grid; place-items: center; width: 23px; height: 23px; }
.pending-registration-role-letter { border-radius: 6px; background: #e8f5ff; color: #087db9; font-weight: 700; }
.pending-registration-method { color: #62778d; }
.pending-registration-method svg,
.pending-registration-journey svg { width: 15px; height: 15px; }
.pending-registration-journey .teacher-activity-milestone { width: 24px; height: 24px; border-radius: 6px; }
.pending-registration-table tr.is-active td { background: #eef8ff; }
.pending-registration-table .pending-registration-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-registration-badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 12px; line-height: 1.3; font-weight: 700; }
.pending-registration-badge.is-neutral { background: #eef2f6; color: #63758a; }
.pending-registration-badge.is-green { background: #e5f7ed; color: #13854b; }
.pending-registration-badge.is-orange { background: #fff2df; color: #b7680b; }
.pending-registration-badge.is-blue { background: #e8f5ff; color: #087db9; }
.pending-registration-badge.is-red { background: #ffebed; color: #d42e40; }
.pending-registration-open { min-height: 30px; padding: 0 8px; border: 0; border-radius: 7px; background: #149ff1; color: #fff; font: inherit; cursor: pointer; }
.pending-registration-action-buttons { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; width: max-content; }
.pending-registration-action-buttons > button { flex: 0 0 auto; }
.pending-registration-action-buttons > .pending-registration-pre-review { margin-left: 0; }
.pending-registration-photo-tabs { grid-column: 1 / -1; margin: 0; padding: 8px 12px; }
.pending-registration-pre-review { width: 30px; height: 30px; margin-left: 5px; border: 1px solid #149ff1; border-radius: 7px; background: #e8f5ff; color: #087db9; font-family: inherit; font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; }
.pending-registration-pre-review:disabled { border-color: #bde6cc; background: #e5f7ed; color: #13854b; cursor: default; }
.pending-registration-pagination { margin-top: 12px; justify-content: flex-end; }
.pending-registration-detail { position: fixed; z-index: 60; inset: 16px 16px 16px auto; width: min(560px, calc(100vw - 32px)); overflow: auto; padding: 18px; border: 1px solid #dbe5ed; border-radius: 14px; background: #fff; box-shadow: 0 12px 45px #17264033; }
.pending-registration-detail[hidden] { display: none; }
.pending-registration-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pending-registration-detail-head div { min-width: 0; overflow-wrap: anywhere; }
.pending-registration-detail-head small { color: #159cf4; font-size: 12px; font-weight: 700; }
.pending-registration-detail-head h2 { margin: 5px 0; font-size: 23px; line-height: 1.2; }
.pending-registration-detail-head span, .pending-registration-meta { color: #6d7b91; font-size: 12px; }
.pending-registration-close { flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: #ffebed; color: #de253b; font-size: 30px; line-height: 1; cursor: pointer; }
.pending-registration-email-form { display: grid; gap: 10px; margin: 15px 0; padding: 14px; background: #f7fafc; border: 1px solid #e2eaf0; border-radius: 10px; }
.pending-registration-email-form h3 { font-size: 16px; margin: 0; }
.pending-registration-email-form label { display: grid; gap: 5px; color: #53647a; font-size: 12px; font-weight: 700; }
.pending-registration-email-form input, .pending-registration-email-form select[data-template-picker], .pending-registration-detail textarea { box-sizing: border-box; width: 100%; min-width: 0; border: 1px solid #d6e1ec; border-radius: 7px; padding: 10px; background: #fff; color: #172640; font: inherit; }
.pending-registration-detail textarea { resize: vertical; min-height: 90px; }
.pending-registration-email-form textarea { min-height: 160px; }
.pending-registration-send { justify-self: start; min-height: 38px; border: 0; border-radius: 8px; padding: 0 18px; background: #16a34a; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.pending-registration-send:hover { background: #15803d; }
.pending-registration-detail button:disabled, .pending-registration-open:disabled { opacity: .5; cursor: wait; }
.pending-registration-feedback { margin: 0; font-size: 12px; color: #18834b; overflow-wrap: anywhere; }
.pending-registration-feedback.is-error { color: #d42e40; }
.pending-registration-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e3eaf0; overflow-wrap: anywhere; }
.pending-registration-section summary { cursor: pointer; color: #52647a; font-size: 13px; font-weight: 700; }
.pending-registration-section article { padding: 12px 0; border-bottom: 1px solid #e3eaf0; }
.pending-registration-section article small { display: block; color: #708097; }
.pending-registration-section article p, .pending-registration-section pre { white-space: pre-wrap; font: inherit; font-size: 12px; }
.pending-registration-section dl { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 2fr); gap: 8px; font-size: 12px; }
.pending-registration-section dt { color: #708097; }
.pending-registration-section dd { margin: 0; }
.pending-registration-section img { display: block; max-width: min(240px, 100%); max-height: 320px; object-fit: contain; }
.pending-registration-section > button { margin: 8px 5px 0 0; padding: 8px 10px; border: 1px solid #d6e1ec; border-radius: 7px; background: #f2f7fc; color: #186da1; cursor: pointer; }

/* Pending registration filters use the same column controls as other CRM lists. */
.pending-registration-table th { padding: 6px 10px; vertical-align: top; }
.pending-registration-table th select, .pending-registration-table th input { box-sizing: border-box; display: block; width: 100%; min-width: 0; min-height: 30px; margin-top: 6px; padding: 4px 6px; border: 1px solid #d6e1ec; border-radius: 6px; background: #fff; color: #52647a; font: inherit; font-size: 11px; text-transform: none; }
.pending-registration-date-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-top: 6px; }
.pending-registration-table .pending-registration-date-filters input { margin-top: 0; }

/* Keep the pending list toolbar and counters on one compact row. */
[data-crm-view="pending-registrations"] > .article-admin-head { height: 50px; padding: 0 14px; }
[data-crm-view="pending-registrations"] > .article-admin-head h1 { font-size: 22px; }
[data-crm-view="pending-registrations"] > .article-admin-head { height: auto; min-height: 50px; flex-direction: row; flex-wrap: wrap; gap: 4px 16px; padding-block: 8px; }
[data-crm-view="pending-registrations"] [data-pending-registration-message] { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin: 0; color: #65778d; font-size: 12px; line-height: 1.4; }
[data-crm-view="pending-registrations"] [data-pending-registration-message] span { color: inherit; font-size: inherit; line-height: inherit; }
[data-crm-view="pending-registrations"] [data-pending-registration-message] strong { font-size: 14px; font-weight: 700 !important; }
[data-crm-view="pending-registrations"] [data-pending-registration-message] .is-registered { color: #166534; }
[data-crm-view="pending-registrations"] .pending-registration-shell > [data-pending-registration-search][hidden] { display: none; }
.pending-registration-table .pending-registration-user-filter { display: grid; grid-template-columns: minmax(0, 1fr) repeat(2, 28px); align-items: center; gap: 4px; margin-top: 6px; }
.pending-registration-table .pending-registration-user-filter input { margin: 0; }
.pending-registration-user-filter button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid #d6e1ec; border-radius: 6px; background: #fff; color: #52647a; cursor: pointer; }
.pending-registration-user-filter button:hover { background: #eaf5ff; }
.pending-registration-user-filter button:focus-visible { outline: 2px solid #0878f8; outline-offset: 1px; }
.pending-registration-user-filter button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pending-registration-shell > .article-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; margin: 0; padding: 8px 12px; }
.pending-registration-shell > .article-filters :is(input, select, button) { width: auto; min-width: 0; min-height: 34px; padding: 0 10px; font: inherit; font-size: 12px; font-weight: 600; }
.pending-registration-shell > .article-filters input[type="search"] { flex: 1 1 220px; min-width: 160px; }
.pending-registration-shell > .article-filters select { flex: 0 0 128px; }
.pending-registration-shell > .article-filters button { flex: 0 0 auto; white-space: nowrap; }
.pending-registration-shell > .article-filters [data-pending-registration-clear] { border: 1px solid #d6e1ec; background: #fff; color: #52647a; }
.pending-registration-shell > [data-pending-registration-message] { max-width: 250px; margin: 0; padding: 8px 12px 8px 0; color: #65778d; font-size: 12px; line-height: 1.4; }
.pending-registration-shell > [data-pending-registration-list] { grid-column: 1 / -1; min-width: 0; }
.pending-registration-table th select, .pending-registration-table th input { min-height: 28px; }
@media (max-width: 900px) {
  .pending-registration-shell { grid-template-columns: minmax(0, 1fr); }
  .pending-registration-shell > [data-pending-registration-message] { max-width: none; padding: 0 12px 8px; }
}

.site-lead-shell > .site-lead-list { grid-column: 1 / -1; min-width: 0; }
.site-lead-shell > [data-site-lead-message] { margin: 0; padding: 8px 12px; color: #65778d; font-size: 12px; }
.site-lead-shell > [data-site-lead-message].is-error { color: #d42e40; }
.site-lead-shell [data-site-lead-clear] { border: 1px solid #d6e1ec; background: #fff; color: #52647a; }
.site-lead-shell [data-site-lead-pages]:empty { display: none; }
.site-lead-shell [data-site-lead-pages] { padding: 0 12px 8px; }
[data-site-lead-detail] .site-lead-actions { margin-top: 12px; }
[data-site-lead-detail] :is(dd, .site-lead-original-message) { white-space: pre-wrap; }

.support-chat-customer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.support-chat-public-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 1px solid #cfe2f4;
  border-radius: 10px;
  background: #eef7ff;
  color: #137ac0;
  text-decoration: none;
}
.support-chat-public-profile:hover { background: #dfefff; }
.support-chat-public-profile:focus-visible { outline: 2px solid #1380ce; outline-offset: 3px; }
.support-chat-public-profile svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Keep registration counts in the filter row instead of a separate card row. */
[data-crm-view="leads"] .crm-hero--filters-only {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}
[data-crm-view="leads"] .crm-hero--filters-only .crm-summary {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
[data-crm-view="leads"] .crm-hero--filters-only .crm-summary article {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 5px 8px;
  border-radius: 9px;
  box-shadow: none;
}
[data-crm-view="leads"] .crm-hero--filters-only .crm-summary svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: #1687c8;
}
[data-crm-view="leads"] .crm-hero--filters-only .crm-summary article:nth-child(2) svg { color: #a66b11; }
[data-crm-view="leads"] .crm-hero--filters-only .crm-summary article:nth-child(3) svg { color: #18814d; }
[data-crm-view="leads"] .crm-hero--filters-only .crm-summary article:nth-child(4) svg { color: #6856b7; }
[data-crm-view="leads"] .crm-hero--filters-only .crm-summary strong {
  margin: 0;
  font-size: 15px;
  line-height: 1;
}
[data-crm-view="leads"] .crm-hero--filters-only .crm-filters {
  flex: 1 1 510px;
  min-width: 0;
  margin-left: auto;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 160px) auto;
}
@media (max-width: 820px) {
  [data-crm-view="leads"] .crm-hero--filters-only { align-items: stretch; }
  [data-crm-view="leads"] .crm-hero--filters-only .crm-filters {
    width: 100%;
    margin-left: 0;
    grid-template-columns: 1fr;
  }
}

/* Registration search and reviewer counts share a compact action group. */
[data-crm-view="leads"] .crm-filter-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
}
[data-crm-view="leads"] .crm-moderator-totals {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
[data-crm-view="leads"] .crm-moderator-totals[hidden] { display: none; }
[data-crm-view="leads"] .crm-moderator-totals > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 14px;
}
[data-crm-view="leads"] .crm-moderator-totals .crm-reviewer-badge {
  width: 22px;
  height: 22px;
  font-size: 12px;
}
[data-crm-view="leads"] .crm-moderator-totals strong { font-size: 14px; }
@media (max-width: 820px) {
  [data-crm-view="leads"] .crm-filter-actions { justify-content: flex-start; }
}

/* Compact manual reply counts in support section headers. */
[data-crm-view="support-tickets"] .support-head-actions,
[data-crm-view="support-chats"] .support-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}
.crm-support-reply-totals {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.crm-support-reply-totals > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
.crm-support-reply-totals .crm-reviewer-badge { width: 22px; height: 22px; font-size: 12px; }
.crm-support-reply-totals strong { font-size: 14px; }
@media (max-width: 820px) {
  [data-crm-view="support-tickets"] .article-admin-head,
  [data-crm-view="support-chats"] .article-admin-head { height: auto; min-height: 68px; flex-wrap: wrap; padding-block: 10px; }
  [data-crm-view="support-tickets"] .support-head-actions,
  [data-crm-view="support-chats"] .support-head-actions { flex-wrap: wrap; justify-content: flex-start; }
}

/* Keep reply tools beside the conversation, leaving the composer for the message. */
.support-chat-tools { display: grid; gap: 10px; min-width: 0; margin-top: 18px; }
.support-chat-tools h3 { margin: 0; font-size: 14px; }
.support-chat-tools .support-template-picker,
.support-chat-tools .support-chat-template-picker,
.support-chat-tools .telegram-reply-channel { width: 100%; max-width: 100%; min-width: 0; }
.support-chat-tools .telegram-reply-channel { min-height: 40px; padding: 7px 10px; border: 1px solid var(--admin-line); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; }
.support-chat-route-label { padding: 9px 10px; border: 1px solid var(--admin-line); border-radius: 6px; background: #fff; font-size: 13px; }
body.crm-page .support-chat-thread form[data-support-chat-reply] { grid-template-columns: minmax(0, 1fr) repeat(2, 40px); }
body.crm-page .support-chat-thread form[data-support-chat-reply]:has(> .chat-emoji-trigger) { grid-template-columns: minmax(0, 1fr) repeat(3, 40px); }
body.crm-page .support-chat-thread [data-support-chat-reply] textarea { grid-column: 1; }
@media (max-width: 900px) {
  .support-chat-admin { grid-template-rows: auto minmax(0, 1fr) auto; }
  .support-chat-context { display: block; border-left: 0; border-top: 1px solid var(--admin-line); padding: 10px 14px; overflow: visible; }
  .support-chat-context .support-chat-customer { display: none; }
  .support-chat-tools { margin: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .support-chat-tools h3 { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .support-chat-tools { grid-template-columns: minmax(0, 1fr); }
}

/* Review edits against the last approved course before opening the full preview. */
.course-review-changes { margin: 16px 18px 0; padding: 18px; border: 1px solid #d9e5f0; border-radius: 12px; background: #fff; }
.course-review-changes h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; font-size: 18px; }
.course-review-changes h3 span { padding: 2px 8px; border-radius: 999px; background: #e8f4fd; color: #075c95; font-size: 12px; }
.course-review-changes > p { margin: 0 0 12px; color: #526779; font-size: 13px; }
.course-review-change { display: grid; grid-template-columns: minmax(140px, .7fr) repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 0; border-top: 1px solid #e1eaf3; }
.course-review-change > strong { font-size: 13px; overflow-wrap: anywhere; }
.course-review-change small { display: block; margin-bottom: 5px; color: #62768b; font-size: 11px; }
.course-review-change pre { margin: 0; font: inherit; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.course-review-change > div:last-child pre { font-weight: 600; }
.course-review-full-preview { margin: 12px 18px 18px; }
.course-review-full-preview > summary { cursor: pointer; padding: 11px 14px; border: 1px solid #d9e5f0; border-radius: 8px; background: #fff; font-weight: 600; }
.course-review-full-preview .course-client-preview { margin: 12px 0 0; }
@media (max-width: 720px) {
  .course-review-changes { margin: 10px 10px 0; padding: 12px; }
  .course-review-change { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-review-change > strong { grid-column: 1 / -1; }
  .course-review-full-preview { margin: 10px; }
}

/* The moderation preview uses the same private course page as the teacher cabinet. */
.course-review-full-course{margin:16px 18px 18px;overflow:hidden;border:1px solid #d9e5f0;border-radius:12px;background:#fff}
.course-review-preview-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;padding:10px 14px;border-bottom:1px solid #d9e5f0}
.course-review-preview-toolbar a{color:#075c95;font-weight:600}
.course-review-full-course iframe{display:block;width:100%;height:min(76vh,960px);min-height:540px;border:0;background:#fff}
.course-review-full-preview>.course-review-full-course{margin:12px 0 0}
@media(max-width:720px){.course-review-full-course{margin:10px}.course-review-full-course iframe{height:70vh;min-height:440px}}

.course-review-submitted{padding:20px 24px;border-top:1px solid #d9e5f0}
.course-review-submitted h3{margin:0 0 5px;font-size:20px}.course-review-submitted>p{color:#526779;font-size:13px}.course-review-submitted h4{margin:20px 0 10px;font-size:17px}
.course-review-module,.course-review-lesson{margin:8px 0;border:1px solid #d9e5f0;border-radius:9px;background:#fff}
.course-review-module>summary,.course-review-lesson>summary{cursor:pointer;padding:12px 14px;font-weight:700}.course-review-module>summary{background:#eef6fc}.course-review-module>summary small{margin-left:8px;color:#62768b;font-weight:500}
.course-review-module>.course-review-lesson{margin:8px 12px}.course-review-lesson-body{padding:4px 15px 15px;border-top:1px solid #e5edf4;white-space:pre-wrap;overflow-wrap:anywhere}.course-review-lesson-body h5{margin:14px 0 5px}.course-review-lesson-body p{margin:10px 0}
@media(max-width:720px){.course-review-submitted{padding:14px}}
/* Two isolated, read-only views of a submitted course. */
.course-review-view-tabs{display:flex;gap:5px;padding:10px 14px 0;border-bottom:1px solid #cedfe9;background:#fff}
.course-review-view-tabs button{padding:10px 14px;border:0;border-bottom:3px solid transparent;background:transparent;color:#42596c;font-family:inherit;font-size:14px;font-weight:600;line-height:1.2;cursor:pointer}
.course-review-view-tabs button[aria-selected="true"]{border-bottom-color:#2d9bcc;color:#135878}
.course-review-view-tabs button:focus-visible,.course-draft-steps button:focus-visible{outline:3px solid #318fbe;outline-offset:2px}
.course-draft-preview{--cp-navy:#102943;--cp-blue:#1679ab;--cp-line:#cedfe9;max-width:1300px;margin:0 auto;padding:22px;color:var(--cp-navy);font-size:14px;line-height:1.45}
.course-draft-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}.course-draft-heading h3{margin:0;font-size:clamp(23px,2.6vw,34px);line-height:1.15;letter-spacing:-.035em}.course-draft-heading span{padding:4px 8px;border-radius:5px;background:#f5f5f5;color:#234e6a;font-size:12px;white-space:nowrap}
.course-draft-steps{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:2px;padding:4px;margin-bottom:12px;background:#fff;container:course-draft-tabs / inline-size}
.course-draft-steps button{display:flex;align-items:center;justify-content:center;gap:4px;min-height:36px;padding:5px 6px;border:0;border-radius:999px;background:#fff;color:#4b657a;font-family:inherit;font-size:13px;font-weight:500;line-height:1.2;cursor:pointer;text-align:center}
.course-draft-steps button i{font-style:normal}.course-draft-steps button[aria-current="step"]{background:#151515;color:#e4e9ed}.course-draft-steps button:hover:not([aria-current="step"]){background:#f5f5f5}
.course-draft-panel{min-height:270px;padding:clamp(12px,1.4vw,19px);border:1px solid var(--cp-line);border-radius:12px;background:#fff}.course-draft-panel>h3{margin:0 0 15px;font-size:17px}.course-draft-panel .course-review-submitted{padding:0;border:0}.course-draft-panel .course-review-submitted>h3{display:none}
.course-draft-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.course-draft-field{display:grid;align-content:start;gap:4px;min-width:0;color:var(--cp-navy);font-size:13px;font-weight:600}.course-draft-field span{color:#4b657a}.course-draft-field>div{min-height:35px;padding:8px 10px;border:1px solid #bdcfdc;border-radius:7px;background:#fff;font-weight:400;white-space:pre-wrap;overflow-wrap:anywhere}
.course-draft-media{margin-top:16px;padding:16px;border:1px solid var(--cp-line);border-radius:12px}.course-draft-media h3{margin:0 0 12px;font-size:17px}.course-draft-media img{display:block;width:min(100%,320px);max-height:240px;margin-bottom:12px;border-radius:9px;object-fit:cover}.course-draft-faq{padding:10px 0;border-top:1px solid #d9e5f0}.course-draft-faq p{margin:6px 0 0;white-space:pre-wrap}
@media(max-width:1100px){.course-draft-steps{grid-template-columns:repeat(5,minmax(0,1fr))}}@media(max-width:720px){.course-draft-preview{padding:12px}.course-draft-steps{grid-template-columns:repeat(3,minmax(0,1fr))}.course-draft-fields{grid-template-columns:1fr}.course-draft-heading{align-items:flex-start;flex-direction:column}}
