:root {
  --bg-page: #f0e8dc;
  --bg-surface: #fffdf7;
  --bg-soft: #f8f1e7;
  --brand-red: #c91f26;
  --brand-red-dark: #a91820;
  --ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --ink: #242321;
  --muted: #746f68;
  --line: #e2d4c4;
  --rose: #f7dfe0;
  --success: #627b52;
  --success-bg: #edf3e7;
  --warning: #85520c;
  --warning-bg: #f8dfb8;
  --shadow: 0 2px 8px rgba(36, 35, 33, 0.05), 0 16px 38px rgba(36, 35, 33, 0.1);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overscroll-behavior-x: none;
  overscroll-behavior-y: auto;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(201, 31, 38, 0.08), transparent 28%),
    linear-gradient(180deg, #f7f0e7 0%, var(--bg-page) 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.workspace,
.admin-nav,
.modal-panel,
.lesson-modal-panel,
.planner-create-modal,
.modal-backdrop,
.lesson-modal-backdrop,
.message-thread,
.communication-thread,
.table-scroll,
.erp-table,
.overview-planner-shell,
.work-schedule-scroll,
.work-coverage-scroll,
.picker-popover {
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.admin-shell {
  margin: 0 auto;
  max-width: none;
  min-height: 100dvh;
  overscroll-behavior: contain;
  padding: max(18px, env(safe-area-inset-top)) 18px 32px;
  width: 100%;
}

.telegram-swipe-lock {
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
}

html.telegram-swipe-lock,
body.telegram-swipe-lock {
  height: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.admin-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.admin-brand {
  min-width: 0;
}

.mobile-menu-button {
  align-items: center;
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(36, 35, 33, 0.08);
  color: var(--brand-red);
  display: none;
  flex: 0 0 auto;
  height: 48px;
  justify-content: center;
  padding: 0;
  position: relative;
  width: 48px;
}

.mobile-menu-button span {
  background: currentColor;
  border-radius: 999px;
  display: block;
  height: 2px;
  position: absolute;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  width: 20px;
}

.mobile-menu-button span:nth-child(1) {
  transform: translateY(-7px);
}

.mobile-menu-button span:nth-child(3) {
  transform: translateY(7px);
}

.sidebar-open .mobile-menu-button span:nth-child(1) {
  transform: rotate(45deg);
}

.sidebar-open .mobile-menu-button span:nth-child(2) {
  opacity: 0;
}

.sidebar-open .mobile-menu-button span:nth-child(3) {
  transform: rotate(-45deg);
}

.brand-logo {
  display: block;
  max-width: 194px;
  width: min(42vw, 194px);
}

.header-subtitle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  margin: 4px 0 0;
}

.status-pill {
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
  padding: 9px 12px;
  white-space: nowrap;
}

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

.admin-nav {
  align-content: start;
  background: rgba(255, 253, 247, 0.74);
  border: 1px solid rgba(226, 212, 196, 0.82);
  border-radius: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  isolation: isolate;
  overflow: hidden;
  padding: 10px;
  position: sticky;
  top: 18px;
}

.overview-tab .admin-nav {
  margin-top: 0;
}

.admin-nav::before {
  background: var(--brand-red);
  border-radius: 20px;
  content: "";
  height: var(--nav-active-height, 58px);
  left: 10px;
  position: absolute;
  right: 10px;
  top: 0;
  transform: translateY(var(--nav-active-top, 10px));
  transition:
    transform 0.34s var(--ease-out-soft),
    height 0.34s var(--ease-out-soft);
  z-index: 0;
}

.nav-indicator-static .admin-nav::before {
  transition: none;
}

.nav-scrim {
  background: rgba(36, 35, 33, 0.28);
  border: 0;
  display: none;
  inset: 0;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 0.2s ease;
  z-index: 42;
}

.sidebar-calendar-mini {
  background: rgba(248, 241, 231, 0.68);
  border: 1px solid rgba(226, 212, 196, 0.82);
  border-radius: 20px;
  display: grid;
  gap: 9px;
  padding: 11px;
  position: relative;
  z-index: 1;
}

.mini-calendar-head {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
}

.mini-calendar-head strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 820;
  text-align: center;
}

.mini-calendar-nav {
  align-items: center;
  background: rgba(255, 253, 247, 0.88);
  border: 1px solid rgba(226, 212, 196, 0.9);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 18px;
  font-weight: 840;
  height: 28px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 28px;
}

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

.mini-calendar-weekdays span {
  color: rgba(116, 111, 104, 0.72);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.mini-calendar-days button,
.mini-calendar-gap {
  align-items: center;
  border-radius: 9px;
  display: inline-flex;
  height: 25px;
  justify-content: center;
}

.mini-calendar-days button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  padding: 0;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.12s ease;
}

.mini-calendar-days button:hover,
.mini-calendar-days button:focus-visible {
  background: rgba(201, 31, 38, 0.08);
  color: var(--brand-red);
  outline: 0;
}

.mini-calendar-days button:active {
  transform: scale(0.94);
}

.mini-calendar-days button.active {
  background: var(--brand-red);
  color: #fff;
}

.mini-calendar-days button.today:not(.active) {
  background: rgba(201, 31, 38, 0.12);
  color: var(--brand-red);
}

.sidebar-nav-list {
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.nav-tab {
  background: transparent;
  border: 0;
  border-radius: 20px;
  color: var(--muted);
  display: grid;
  gap: 3px;
  min-height: 62px;
  padding: 10px 12px;
  position: relative;
  text-align: left;
  transition:
    color 0.18s ease,
    transform 0.12s ease;
  z-index: 1;
}

.nav-tab:active {
  transform: scale(0.985);
}

.nav-tab span {
  color: inherit;
  font-size: 15px;
  font-weight: 820;
}

.nav-tab small {
  color: inherit;
  font-size: 12px;
  line-height: 1.22;
  opacity: 0.88;
}

.nav-tab.active {
  color: #fff;
}

.workspace {
  min-width: 0;
}

.workspace-enter {
  animation: workspace-in 0.22s var(--ease-out-soft);
}

.access-screen {
  margin: 0 auto;
  max-width: 720px;
}

.access-panel {
  display: grid;
  gap: 14px;
  margin-top: 32px;
}

.auth-note,
.auth-error {
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.35;
  margin: 0;
  padding: 12px 14px;
}

.auth-note {
  background: rgba(255, 253, 247, 0.78);
  border: 1px solid var(--line);
  color: var(--muted);
}

.auth-error {
  background: rgba(201, 31, 38, 0.08);
  border: 1px solid rgba(201, 31, 38, 0.22);
  color: var(--brand-red);
  font-weight: 760;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-actions .link-btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

.access-denied-panel {
  gap: 20px;
  margin: 0 auto;
  max-width: 760px;
  overflow: visible;
  padding: clamp(28px, 5vw, 52px);
  position: relative;
}

.access-denied-screen {
  align-items: center;
  display: grid;
  min-height: calc(100dvh - 56px);
}

.access-denied-screen .title {
  max-width: 680px;
}

.access-denied-copy {
  max-width: 650px;
}

.access-denied-button {
  min-height: 58px;
  padding-inline: 28px;
}

.access-denied-mark {
  align-items: center;
  background: var(--rose);
  border-radius: 24px;
  color: var(--brand-red);
  display: inline-flex;
  height: 64px;
  justify-content: center;
  margin-bottom: 4px;
  position: relative;
  width: 64px;
}

.access-denied-mark span {
  background: currentColor;
  border-radius: 999px;
  height: 5px;
  position: absolute;
  width: 30px;
}

.access-denied-mark span:first-child {
  transform: rotate(45deg);
}

.access-denied-mark span:last-child {
  transform: rotate(-45deg);
}

.telegram-login-card {
  background: rgba(248, 241, 231, 0.8);
  border: 1px solid var(--line);
  border-radius: 22px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.telegram-login-widget {
  align-items: center;
  background: var(--bg-surface);
  border: 1px dashed rgba(201, 31, 38, 0.28);
  border-radius: 18px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  min-height: 58px;
  overflow: hidden;
  text-align: center;
}

.telegram-login-widget iframe {
  display: block;
}

.telegram-login-widget span,
.auth-helper {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
}

.token-fallback {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px 14px;
}

.token-fallback summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 780;
}

.token-fallback .field {
  margin-top: 12px;
}

.token-fallback .auth-actions {
  margin-top: 10px;
}

.page-head {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 4px 0 18px;
}

.kicker {
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 860;
  letter-spacing: 1.5px;
  line-height: 1.25;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.title {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 860;
  line-height: 0.98;
  margin: 0;
}

.lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.42;
  margin: 10px 0 0;
  max-width: 690px;
}

.panel {
  background: rgba(255, 253, 247, 0.96);
  border: 1px solid rgba(226, 212, 196, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 18px;
}

.section-head,
.card-top {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.section-title,
.item-title {
  font-size: 20px;
  font-weight: 850;
  line-height: 1.12;
  margin: 0;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.38;
  margin: 7px 0 0;
}

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

.metric-card {
  align-items: start;
  background: rgba(255, 253, 247, 0.95);
  border: 1px solid rgba(226, 212, 196, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  grid-template-columns: 48px 1fr;
  min-height: 128px;
  padding: 16px;
}

.metric-card > div {
  min-width: 0;
}

.metric-icon {
  align-items: center;
  background: var(--rose);
  border-radius: 16px;
  color: var(--brand-red);
  display: inline-flex;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.metric-icon svg {
  height: 25px;
  width: 25px;
}

.metric-card strong {
  display: block;
  font-size: 30px;
  font-weight: 880;
  line-height: 1;
}

.metric-card > div > span {
  display: block;
  font-size: 14px;
  font-weight: 780;
  margin-top: 5px;
}

.metric-card small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.25;
  margin-top: 5px;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.overview-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.overview-stat {
  align-items: start;
  background: rgba(255, 253, 247, 0.95);
  border: 1px solid rgba(226, 212, 196, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  grid-template-columns: 48px 1fr;
  min-height: 118px;
  padding: 16px;
}

.overview-stat > div {
  min-width: 0;
}

.overview-stat strong {
  display: block;
  font-size: 30px;
  font-weight: 880;
  line-height: 1;
}

.overview-stat > div > span {
  display: block;
  font-size: 15px;
  font-weight: 820;
  line-height: 1.16;
  margin-top: 5px;
}

.overview-stat small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.25;
  margin-top: 6px;
}

.day-overview-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
}

.overview-panel {
  display: grid;
  gap: 14px;
  min-height: 220px;
}

.overview-panel-main {
  grid-row: span 2;
}

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

.overview-row {
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  display: grid;
  gap: 14px;
  grid-template-columns: 124px minmax(0, 1fr) auto;
  min-height: 74px;
  padding: 14px 16px;
  text-align: left;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
}

.overview-row:hover {
  background: rgba(255, 250, 242, 0.98);
  border-color: rgba(207, 28, 39, 0.34);
  box-shadow: 0 12px 28px rgba(64, 43, 24, 0.08);
}

.overview-row:active {
  transform: scale(0.99);
}

.overview-row time {
  color: var(--brand-red);
  font-size: 18px;
  font-weight: 880;
  line-height: 1.08;
}

.overview-row span {
  min-width: 0;
}

.overview-row strong,
.overview-row em {
  display: block;
  min-width: 0;
}

.overview-row strong {
  font-size: 18px;
  font-style: normal;
  font-weight: 880;
  line-height: 1.12;
}

.overview-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.3;
  margin-top: 5px;
}

.overview-row > b:not(.badge) {
  background: rgba(207, 28, 39, 0.08);
  border-radius: 999px;
  color: var(--brand-red);
  font-size: 12px;
  font-weight: 860;
  padding: 7px 10px;
  white-space: nowrap;
}

.overview-internal-row {
  background: rgba(236, 229, 220, 0.62);
}

.overview-internal-row.note-event {
  background: #fff4ee;
}

.overview-day-timeline {
  background: rgba(248, 241, 231, 0.62);
  border: 1px solid var(--line);
  border-radius: 20px;
  display: grid;
  overflow: hidden;
}

.overview-time-row {
  align-items: stretch;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(226, 212, 196, 0.82);
  color: inherit;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  min-height: 58px;
  padding: 0;
  text-align: left;
  width: 100%;
}

.overview-time-row:last-child {
  border-bottom: 0;
}

.overview-time-row > time {
  align-items: center;
  background: rgba(255, 253, 247, 0.42);
  border-right: 1px solid rgba(226, 212, 196, 0.82);
  color: rgba(116, 111, 104, 0.72);
  display: flex;
  font-size: 12px;
  font-weight: 620;
  justify-content: center;
  line-height: 1.15;
  padding: 0 8px;
  text-align: center;
}

.overview-time-row-free {
  cursor: pointer;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.overview-time-row-free:hover,
.overview-time-row-free:focus-visible {
  background: rgba(201, 31, 38, 0.055);
  box-shadow: inset 0 0 0 1px rgba(201, 31, 38, 0.16);
  outline: 0;
}

.overview-time-row-free:active {
  transform: scale(0.995);
}

.overview-time-empty {
  display: block;
  min-width: 0;
  position: relative;
}

.overview-time-events {
  display: grid;
  gap: 8px;
  grid-column: 2 / -1;
  min-width: 0;
  padding: 8px 10px;
}

.overview-time-event {
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid rgba(201, 31, 38, 0.22);
  border-radius: 14px;
  color: inherit;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 50px;
  padding: 10px 12px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
  width: 100%;
}

.overview-time-event:hover {
  border-color: rgba(201, 31, 38, 0.5);
  box-shadow: 0 8px 20px rgba(64, 43, 24, 0.08);
}

.overview-time-event:active {
  transform: scale(0.99);
}

.overview-time-event-internal {
  background: rgba(236, 229, 220, 0.62);
  border-color: rgba(116, 111, 104, 0.24);
}

.overview-time-event.note-event {
  background: #fff4ee;
  border-color: rgba(201, 31, 38, 0.2);
}

.overview-time-event span {
  min-width: 0;
}

.overview-time-event strong,
.overview-time-event small {
  display: block;
  min-width: 0;
}

.overview-time-event strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 860;
  line-height: 1.15;
}

.overview-time-event small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  margin-top: 3px;
}

.overview-time-event em {
  background: rgba(201, 31, 38, 0.08);
  border-radius: 999px;
  color: var(--brand-red);
  font-size: 11px;
  font-style: normal;
  font-weight: 840;
  padding: 6px 8px;
  white-space: nowrap;
}

.confirmation-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.overview-empty {
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  min-height: 86px;
  padding: 18px;
  text-align: center;
}

.overview-info-panel {
  align-content: start;
  gap: 12px;
}

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

.overview-info-group {
  background: rgba(248, 241, 231, 0.58);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.overview-info-group h3 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 860;
  line-height: 1.18;
  margin: 0;
}

.overview-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-chip-list span {
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid rgba(226, 212, 196, 0.86);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.15;
  padding: 8px 10px;
}

.overview-planner-page {
  display: grid;
  gap: 14px;
}

.overview-planner-head {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.overview-planner-head h1 {
  font-size: clamp(30px, 3.6vw, 48px);
  font-weight: 880;
  line-height: 0.98;
  margin: 0;
}

.overview-planner-head p:not(.kicker) {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
  margin: 8px 0 0;
}

.overview-status-strip {
  align-items: center;
  background: rgba(255, 253, 247, 0.76);
  border: 1px solid rgba(226, 212, 196, 0.78);
  border-radius: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
}

.overview-status-strip button {
  align-items: baseline;
  background: rgba(248, 241, 231, 0.7);
  border: 1px solid rgba(226, 212, 196, 0.76);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 760;
  gap: 6px;
  line-height: 1.15;
  padding: 8px 11px;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.overview-status-strip button:not(:disabled):hover,
.overview-status-strip button:not(:disabled):focus-visible {
  background: #fffdf7;
  border-color: rgba(201, 31, 38, 0.26);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.06);
  outline: 0;
}

.overview-status-strip button:disabled {
  cursor: default;
  opacity: 0.62;
}

.overview-status-strip strong {
  color: var(--brand-red);
  font-size: 15px;
  font-weight: 900;
}

.overview-status-strip .has-conflicts {
  background: #fff0f0;
  border-color: rgba(201, 31, 38, 0.24);
  color: var(--brand-red);
}

.overview-status-strip .has-coverage-warning {
  background: #fff7ef;
  border-color: rgba(133, 82, 12, 0.2);
  color: var(--warning);
}

.overview-focus-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overview-focus-card {
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid rgba(226, 212, 196, 0.84);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(36, 35, 33, 0.055);
  color: inherit;
  display: grid;
  gap: 5px;
  min-height: 104px;
  padding: 13px 14px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
}

.overview-focus-card:not(:disabled):hover,
.overview-focus-card:not(:disabled):focus-visible {
  border-color: rgba(201, 31, 38, 0.28);
  box-shadow: 0 10px 24px rgba(64, 43, 24, 0.08);
  outline: 0;
  transform: translateY(-1px);
}

.overview-focus-card:disabled {
  cursor: default;
}

.overview-focus-card span {
  color: var(--brand-red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.05px;
  line-height: 1;
  text-transform: uppercase;
}

.overview-focus-card strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 880;
  line-height: 1.08;
}

.overview-focus-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.25;
}

.overview-focus-busy {
  background: #fff4f3;
  border-color: rgba(201, 31, 38, 0.18);
}

.overview-focus-free,
.overview-focus-ok {
  background: #f1f4ea;
  border-color: rgba(98, 123, 82, 0.2);
}

.overview-focus-risk {
  background: #fff0f0;
  border-color: rgba(201, 31, 38, 0.24);
}

.overview-focus-warning,
.overview-focus-thin {
  background: #fff7ef;
  border-color: rgba(133, 82, 12, 0.18);
}

.overview-team-strip,
.overview-availability-strip,
.overview-resource-strip,
.overview-outside-strip,
.overview-request-strip,
.overview-membership-strip,
.overview-confirmation-strip {
  align-items: center;
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid rgba(226, 212, 196, 0.84);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(36, 35, 33, 0.06);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(170px, 0.28fr) minmax(0, 1fr);
  padding: 14px;
}

.overview-availability-strip,
.overview-resource-strip,
.overview-outside-strip,
.overview-request-strip,
.overview-membership-strip {
  align-items: stretch;
}

.overview-availability-strip h2,
.overview-resource-strip h2,
.overview-outside-strip h2,
.overview-request-strip h2,
.overview-membership-strip h2 {
  font-size: 18px;
  font-weight: 860;
  line-height: 1.12;
  margin: 0;
}

.overview-membership-strip > div:first-child > span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  margin-top: 4px;
}

.overview-request-strip > div:first-child > span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  margin-top: 4px;
}

.overview-availability-strip > div:first-child > span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  margin-top: 4px;
}

.overview-availability-gap-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.availability-gap-card {
  background: #fff7ef;
  border: 1px solid rgba(133, 82, 12, 0.18);
  border-radius: 15px;
  color: inherit;
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 11px 12px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
}

.availability-gap-card:hover,
.availability-gap-card:focus-visible {
  border-color: rgba(201, 31, 38, 0.3);
  box-shadow: 0 8px 18px rgba(64, 43, 24, 0.08);
  outline: 0;
  transform: translateY(-1px);
}

.availability-gap-closed {
  background: #fff0f0;
  border-color: rgba(201, 31, 38, 0.24);
}

.availability-gap-teacher {
  background: #fff6f4;
  border-color: rgba(201, 31, 38, 0.18);
}

.availability-gap-admin {
  background: #fff7ef;
  border-color: rgba(133, 82, 12, 0.18);
}

.availability-gap-card span {
  color: var(--brand-red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1;
  text-transform: uppercase;
}

.availability-gap-card strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 870;
  line-height: 1.1;
}

.availability-gap-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.25;
}

.availability-gap-card em {
  color: var(--brand-red);
  font-size: 11px;
  font-style: normal;
  font-weight: 860;
  line-height: 1;
  margin-top: 2px;
}

.overview-request-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.overview-request-card {
  background: rgba(248, 241, 231, 0.72);
  border: 1px solid rgba(226, 212, 196, 0.9);
  border-radius: 15px;
  color: inherit;
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 11px 12px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
}

.overview-request-card:hover,
.overview-request-card:focus-visible,
.overview-request-card.active {
  border-color: rgba(201, 31, 38, 0.3);
  box-shadow: 0 8px 18px rgba(64, 43, 24, 0.08);
  outline: 0;
  transform: translateY(-1px);
}

.overview-request-trial {
  background: #fff4f3;
  border-color: rgba(201, 31, 38, 0.18);
}

.overview-request-card span {
  color: var(--brand-red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1;
  text-transform: uppercase;
}

.overview-request-card strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 870;
  line-height: 1.1;
}

.overview-request-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.25;
}

.overview-request-card em {
  color: var(--brand-red);
  font-size: 11px;
  font-style: normal;
  font-weight: 860;
  line-height: 1;
  margin-top: 2px;
}

.overview-membership-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.membership-risk-card {
  background: #fff7ef;
  border: 1px solid rgba(133, 82, 12, 0.18);
  border-radius: 15px;
  color: inherit;
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 11px 12px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
}

.membership-risk-card:hover,
.membership-risk-card:focus-visible,
.membership-risk-card.active {
  border-color: rgba(201, 31, 38, 0.3);
  box-shadow: 0 8px 18px rgba(64, 43, 24, 0.08);
  outline: 0;
  transform: translateY(-1px);
}

.membership-risk-card.critical {
  background: #fff0f0;
  border-color: rgba(201, 31, 38, 0.24);
}

.membership-risk-card span {
  color: var(--brand-red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1;
  text-transform: uppercase;
}

.membership-risk-card strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 870;
  line-height: 1.1;
}

.membership-risk-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.25;
}

.membership-risk-card em {
  color: var(--brand-red);
  font-size: 11px;
  font-style: normal;
  font-weight: 860;
  line-height: 1;
  margin-top: 2px;
}

.overview-resource-cards {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.resource-state-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 15px;
  color: inherit;
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 11px 12px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
}

.resource-state-card:hover,
.resource-state-card:focus-visible {
  border-color: rgba(201, 31, 38, 0.28);
  box-shadow: 0 8px 18px rgba(64, 43, 24, 0.08);
  outline: 0;
  transform: translateY(-1px);
}

.resource-state-card:disabled {
  cursor: default;
}

.resource-state-card:disabled:hover,
.resource-state-card:disabled:focus-visible {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.resource-state-card strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 870;
  line-height: 1.1;
}

.resource-state-status {
  color: var(--brand-red);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.9px;
  line-height: 1;
  text-transform: uppercase;
}

.resource-state-card span,
.resource-state-card small,
.resource-state-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 720;
  line-height: 1.25;
}

.resource-state-card.free {
  background: #f1f4ea;
  border-color: rgba(98, 123, 82, 0.2);
}

.resource-state-card.busy {
  background: #fbf1e3;
  border-color: rgba(133, 82, 12, 0.14);
}

.resource-state-card.upcoming {
  background: #f8f1e7;
  border-color: rgba(226, 212, 196, 0.94);
}

.resource-state-card.closed {
  background: rgba(248, 241, 231, 0.54);
  border-color: rgba(226, 212, 196, 0.82);
  opacity: 0.72;
}

.resource-state-card.has-conflict {
  background: #fff0f0;
  border-color: rgba(201, 31, 38, 0.24);
}

.resource-state-card.has-conflict em {
  color: var(--brand-red);
  font-weight: 850;
}

.overview-outside-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.outside-slot-card {
  background: #eef3f1;
  border: 1px solid rgba(44, 112, 99, 0.18);
  border-radius: 15px;
  color: inherit;
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 11px 12px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
}

.outside-slot-card:hover,
.outside-slot-card:focus-visible {
  border-color: rgba(201, 31, 38, 0.28);
  box-shadow: 0 8px 18px rgba(64, 43, 24, 0.08);
  outline: 0;
  transform: translateY(-1px);
}

.outside-slot-card strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 870;
  line-height: 1.1;
}

.outside-slot-card span,
.outside-slot-card small,
.outside-slot-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 720;
  line-height: 1.25;
}

.outside-slot-card-lesson {
  background: #eef3f1;
}

.outside-slot-card-internal {
  background: #fbf1e3;
  border-color: rgba(133, 82, 12, 0.14);
}

.outside-slot-card.has-conflict {
  background: #fff0f0;
  border-color: rgba(201, 31, 38, 0.24);
}

.outside-slot-card.has-conflict em {
  color: var(--brand-red);
  font-weight: 850;
}

.overview-workbench {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(286px, 0.28fr);
}

.overview-team-strip h2,
.overview-resource-strip h2,
.overview-confirmation-strip h2 {
  font-size: 18px;
  font-weight: 860;
  line-height: 1.12;
  margin: 0;
}

.overview-team-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-team-body {
  display: grid;
  gap: 10px;
}

.overview-role-coverage {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.overview-role-coverage span {
  align-items: baseline;
  background: rgba(248, 241, 231, 0.72);
  border: 1px solid rgba(226, 212, 196, 0.78);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 780;
  gap: 5px;
  line-height: 1;
  padding: 7px 10px;
}

.overview-role-coverage strong {
  color: var(--brand-red);
  font-size: 14px;
  font-weight: 900;
}

.overview-role-coverage .thin {
  background: #fff0f0;
  border-color: rgba(201, 31, 38, 0.24);
  color: var(--brand-red);
}

.overview-coverage-warnings {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.coverage-warning {
  background: #fff7ef;
  border: 1px solid rgba(133, 82, 12, 0.16);
  border-radius: 14px;
  color: inherit;
  display: grid;
  gap: 3px;
  min-height: 52px;
  padding: 9px 10px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
}

.coverage-warning:hover,
.coverage-warning:focus-visible {
  border-color: rgba(201, 31, 38, 0.28);
  box-shadow: 0 8px 18px rgba(64, 43, 24, 0.08);
  outline: 0;
  transform: translateY(-1px);
}

.coverage-warning strong {
  color: var(--brand-red);
  font-size: 12px;
  font-weight: 880;
  line-height: 1.1;
}

.coverage-warning span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.22;
}

.coverage-red {
  background: #fff0f0;
  border-color: rgba(201, 31, 38, 0.24);
}

.team-chip {
  align-items: flex-start;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 4px;
  min-height: 48px;
  min-width: 136px;
  padding: 8px 10px;
}

.team-chip strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.05;
}

.team-chip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.16;
}

.team-chip small span {
  display: block;
  font-weight: 830;
}

.team-chip small em {
  color: rgba(116, 111, 104, 0.82);
  display: block;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.overview-team-empty {
  background: #fff6f4;
  border: 1px solid rgba(201, 31, 38, 0.18);
  border-radius: 18px;
  color: var(--muted);
  display: grid;
  gap: 8px;
  max-width: 440px;
  padding: 12px;
}

.overview-team-empty strong {
  color: var(--brand-red);
  font-size: 14px;
  font-weight: 880;
}

.overview-team-empty span {
  font-size: 13px;
  font-weight: 720;
  line-height: 1.28;
}

.team-chip-admin {
  background: #fff4ef;
  border-color: rgba(201, 31, 38, 0.18);
}

.team-chip-teacher {
  background: #f1f4ea;
  border-color: rgba(98, 123, 82, 0.22);
}

.team-chip-vocal {
  background: #f4eee4;
  border-color: rgba(133, 82, 12, 0.18);
}

.team-chip-speech {
  background: #eef3f1;
  border-color: rgba(44, 112, 99, 0.2);
}

.overview-planner-shell {
  background: rgba(255, 253, 247, 0.82);
  border: 1px solid rgba(226, 212, 196, 0.9);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: auto;
}

.overview-attention-queue {
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid rgba(226, 212, 196, 0.84);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(36, 35, 33, 0.06);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.overview-attention-head {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.overview-attention-head h2 {
  font-size: 18px;
  font-weight: 860;
  line-height: 1.12;
  margin: 0;
}

.overview-attention-head span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  margin-top: 4px;
}

.overview-attention-head > strong {
  align-items: center;
  background: var(--rose);
  border-radius: 999px;
  color: var(--brand-red);
  display: inline-flex;
  font-size: 15px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  min-width: 34px;
  padding: 0 10px;
}

.overview-attention-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -4px;
}

.attention-summary-chip {
  align-items: center;
  background: rgba(248, 241, 231, 0.78);
  border: 1px solid rgba(226, 212, 196, 0.88);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 820;
  gap: 5px;
  line-height: 1;
  min-height: 26px;
  padding: 6px 9px;
}

.attention-summary-chip b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.attention-summary-urgent {
  background: rgba(201, 31, 38, 0.08);
  border-color: rgba(201, 31, 38, 0.16);
  color: var(--brand-red);
}

.attention-summary-urgent b {
  color: var(--brand-red);
}

.overview-attention-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.attention-item {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 15px;
  color: inherit;
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px 12px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
}

.attention-item:hover,
.attention-item:focus-visible {
  border-color: rgba(201, 31, 38, 0.28);
  box-shadow: 0 8px 18px rgba(64, 43, 24, 0.08);
  outline: 0;
  transform: translateY(-1px);
}

.attention-item.active {
  border-color: rgba(201, 31, 38, 0.42);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.08), 0 10px 22px rgba(64, 43, 24, 0.08);
}

.attention-item strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 860;
  line-height: 1.15;
}

.attention-kind {
  color: var(--brand-red);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 1.1px;
  line-height: 1;
  text-transform: uppercase;
}

.attention-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.attention-action-label {
  align-items: center;
  border-top: 1px solid rgba(226, 212, 196, 0.72);
  color: var(--brand-red);
  display: flex;
  font-size: 11px;
  font-weight: 860;
  justify-content: space-between;
  line-height: 1;
  margin-top: 2px;
  padding-top: 8px;
}

.attention-action-label::after {
  content: "›";
  font-size: 18px;
  line-height: 0.8;
}

.attention-red {
  background: #fff4f3;
  border-color: rgba(201, 31, 38, 0.18);
}

.attention-green {
  background: #f1f4ea;
  border-color: rgba(98, 123, 82, 0.2);
}

.attention-sand {
  background: #fbf1e3;
  border-color: rgba(133, 82, 12, 0.14);
}

.attention-neutral {
  background: rgba(248, 241, 231, 0.72);
  border-color: rgba(226, 212, 196, 0.9);
}

.overview-planner-grid {
  display: grid;
  grid-template-columns: 88px repeat(var(--resource-count), minmax(150px, 1fr));
  min-width: 760px;
}

.overview-mobile-schedule,
.overview-mobile-day-pulse {
  display: none;
}

.overview-shift-preview,
.work-schedule-mobile-summary {
  display: none;
}

.overview-planner-corner,
.overview-resource-head,
.overview-planner-time,
.overview-planner-cell {
  border: 0;
  border-bottom: 1px solid rgba(226, 212, 196, 0.72);
  border-right: 1px solid rgba(226, 212, 196, 0.72);
}

.overview-planner-corner,
.overview-resource-head {
  background: rgba(255, 253, 247, 0.96);
  min-height: 58px;
  position: sticky;
  top: 0;
  z-index: 3;
}

.overview-planner-corner {
  align-items: center;
  color: rgba(116, 111, 104, 0.8);
  display: flex;
  font-size: 11px;
  font-weight: 850;
  justify-content: center;
  left: 0;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  z-index: 4;
}

.overview-resource-head {
  display: grid;
  gap: 3px;
  justify-content: start;
  padding: 12px 12px 10px;
}

.overview-resource-head strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 860;
  line-height: 1.1;
}

.overview-resource-head span {
  color: rgba(116, 111, 104, 0.76);
  font-size: 11px;
  font-weight: 760;
}

.overview-planner-time {
  align-items: start;
  background: rgba(248, 241, 231, 0.62);
  color: rgba(116, 111, 104, 0.84);
  display: flex;
  font-size: 11px;
  font-weight: 760;
  justify-content: center;
  left: 0;
  line-height: 1.2;
  min-height: 64px;
  padding: 12px 6px 0;
  position: sticky;
  text-align: center;
  z-index: 2;
}

.overview-planner-cell {
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.72), rgba(248, 241, 231, 0.5)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 31px,
      rgba(226, 212, 196, 0.24) 32px
    );
  min-height: 64px;
  padding: 7px;
}

.overview-planner-cell:last-child,
.overview-resource-head:last-child {
  border-right: 0;
}

.overview-planner-cell-free {
  -webkit-appearance: none;
  appearance: none;
  color: rgba(116, 111, 104, 0.34);
  display: grid;
  gap: 3px;
  justify-content: flex-start;
  place-content: start;
  text-align: left;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
  width: 100%;
}

.overview-planner-cell-free span {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.34;
  transition: opacity 0.18s ease;
}

.overview-planner-cell-free small {
  color: rgba(116, 111, 104, 0.5);
  font-size: 10px;
  font-weight: 780;
  line-height: 1.12;
  opacity: 0.58;
}

.overview-planner-cell-free.no-teacher small,
.overview-planner-cell-free.no-admin small {
  color: rgba(201, 31, 38, 0.58);
}

.overview-planner-cell-free:hover,
.overview-planner-cell-free:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 244, 239, 0.78), rgba(248, 241, 231, 0.52)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 31px,
      rgba(201, 31, 38, 0.12) 32px
    );
  box-shadow: inset 0 0 0 1px rgba(201, 31, 38, 0.16);
  color: rgba(201, 31, 38, 0.56);
  outline: 0;
}

.overview-planner-cell-free.selected {
  background:
    linear-gradient(180deg, rgba(255, 242, 241, 0.92), rgba(248, 241, 231, 0.6)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 31px,
      rgba(201, 31, 38, 0.16) 32px
    );
  box-shadow: inset 0 0 0 2px rgba(201, 31, 38, 0.2);
  color: rgba(201, 31, 38, 0.72);
}

.overview-planner-cell-free:hover span,
.overview-planner-cell-free:focus-visible span,
.overview-planner-cell-free:hover small,
.overview-planner-cell-free:focus-visible small {
  opacity: 0.9;
}

.overview-planner-cell-busy {
  display: grid;
  gap: 6px;
}

.overview-planner-cell-busy.has-conflict {
  background:
    linear-gradient(180deg, rgba(255, 244, 243, 0.88), rgba(248, 241, 231, 0.52)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 31px,
      rgba(201, 31, 38, 0.12) 32px
    );
}

.overview-planner-cell-busy.stacked {
  align-content: start;
}

.overview-planner-event {
  background: #ffd8bd;
  border: 1px solid rgba(201, 31, 38, 0.16);
  border-radius: 8px;
  border-top: 6px solid #19ad91;
  box-shadow: 0 7px 16px rgba(64, 43, 24, 0.08);
  color: inherit;
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 7px 8px 8px;
  text-align: left;
  transition:
    box-shadow 0.18s ease,
    transform 0.14s ease;
  width: 100%;
}

.overview-planner-event:hover,
.overview-planner-event:focus-visible {
  box-shadow: 0 10px 20px rgba(64, 43, 24, 0.14);
  outline: 0;
  transform: translateY(-1px);
}

.overview-planner-event.selected {
  box-shadow: 0 0 0 2px rgba(201, 31, 38, 0.24), 0 12px 22px rgba(64, 43, 24, 0.14);
}

.overview-planner-event.has-conflict {
  background: #ffe5e1;
  border-color: rgba(201, 31, 38, 0.32);
  border-top-color: var(--brand-red);
}

.overview-planner-event-internal {
  background: #d3efe5;
  border-color: rgba(98, 123, 82, 0.2);
  border-top-color: #627b52;
}

.overview-planner-event.note-event {
  background: #ffe7da;
  border-color: rgba(201, 31, 38, 0.18);
  border-top-color: var(--brand-red);
}

.overview-planner-event time {
  color: rgba(36, 35, 33, 0.72);
  font-size: 10px;
  font-weight: 880;
  line-height: 1.1;
}

.overview-planner-event strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 870;
  line-height: 1.12;
}

.overview-planner-event small {
  color: rgba(36, 35, 33, 0.68);
  font-size: 10px;
  font-weight: 680;
  line-height: 1.18;
}

.planner-event-type {
  background: rgba(255, 253, 247, 0.62);
  border-radius: 999px;
  color: rgba(36, 35, 33, 0.64);
  font-size: 9px;
  font-style: normal;
  font-weight: 820;
  justify-self: start;
  line-height: 1;
  padding: 4px 6px;
}

.planner-event-alert {
  background: rgba(201, 31, 38, 0.09);
  border: 1px solid rgba(201, 31, 38, 0.14);
  border-radius: 7px;
  display: grid;
  gap: 1px;
  margin-top: 3px;
  padding: 5px 6px;
}

.planner-event-alert b {
  color: var(--brand-red);
  font-size: 10px;
  font-weight: 880;
  line-height: 1.1;
}

.planner-event-alert em {
  color: rgba(116, 111, 104, 0.86);
  font-size: 9px;
  font-style: normal;
  font-weight: 740;
  line-height: 1.15;
}

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

.overview-confirmation-strip .overview-row {
  border-radius: 14px;
  min-height: 58px;
  padding: 10px 12px;
}

.overview-empty.compact {
  min-height: 58px;
  padding: 14px;
}

.overview-inspector {
  align-content: start;
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid rgba(226, 212, 196, 0.9);
  border-radius: 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: 15px;
  position: sticky;
  scroll-padding: 18px;
  top: 18px;
}

.inspector-head h2 {
  font-size: 24px;
  font-weight: 880;
  line-height: 1.02;
  margin: 0;
}

.inspector-head p:not(.kicker) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.32;
  margin: 7px 0 0;
}

.availability-mini {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 5px;
  padding: 11px 12px;
}

.availability-mini > strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.availability-mini-grid {
  display: grid;
  gap: 6px;
}

.availability-mini-group {
  background: rgba(255, 253, 247, 0.76);
  border: 1px solid rgba(226, 212, 196, 0.82);
  border-radius: 12px;
  display: grid;
  gap: 6px;
  padding: 8px 9px;
}

.availability-mini-group strong {
  color: var(--brand-red);
  font-size: 10px;
  font-weight: 860;
  letter-spacing: 0.6px;
  line-height: 1;
  text-transform: uppercase;
}

.availability-mini-group em {
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
  line-height: 1.2;
}

.availability-mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.availability-mini-actions button,
.availability-mini-actions small {
  align-items: center;
  background: rgba(201, 31, 38, 0.08);
  border: 1px solid rgba(201, 31, 38, 0.14);
  border-radius: 999px;
  color: var(--brand-red);
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  min-height: 26px;
  padding: 5px 8px;
}

.availability-mini-actions button {
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.12s ease;
}

.availability-mini-actions button:hover,
.availability-mini-actions button:focus-visible {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
  outline: 0;
}

.availability-mini-actions button:active {
  transform: scale(0.96);
}

.availability-mini-actions small {
  background: rgba(248, 241, 231, 0.86);
  border-color: rgba(226, 212, 196, 0.82);
  color: var(--muted);
}

.availability-mini-group.thin {
  background: rgba(248, 241, 231, 0.58);
}

.availability-mini-group.thin em {
  color: rgba(116, 111, 104, 0.66);
}

.availability-mini-group.has-blocked {
  border-color: rgba(201, 31, 38, 0.16);
}

.availability-mini-blocked {
  display: grid;
  gap: 4px;
}

.availability-mini-blocked-person,
.availability-mini-blocked small {
  align-items: center;
  background: rgba(248, 241, 231, 0.76);
  border: 1px solid rgba(226, 212, 196, 0.9);
  border-radius: 10px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  justify-content: space-between;
  min-height: 25px;
  padding: 5px 7px;
}

.availability-mini-blocked-person b {
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
}

.availability-mini-blocked-person em {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-align: right;
}

.availability-mini-blocked-person.availability-busy,
.availability-mini-blocked-person.availability-outside,
.availability-mini-blocked-person.availability-off {
  background: rgba(201, 31, 38, 0.055);
  border-color: rgba(201, 31, 38, 0.16);
}

.availability-mini-blocked-person.availability-busy b,
.availability-mini-blocked-person.availability-outside b,
.availability-mini-blocked-person.availability-off b {
  color: var(--brand-red);
}

.availability-mini-blocked small {
  display: inline-flex;
  font-size: 10px;
  font-weight: 820;
  justify-content: center;
  text-transform: lowercase;
}

.availability-mini span,
.inspector-detail-list span,
.inspector-detail-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 720;
  line-height: 1.25;
}

.slot-conflict-panel {
  background: #fff1f1;
  border: 1px solid rgba(201, 31, 38, 0.22);
  border-radius: 16px;
  display: grid;
  gap: 8px;
  padding: 11px 12px;
}

.slot-conflict-panel > strong {
  color: var(--brand-red);
  font-size: 13px;
  font-weight: 880;
}

.slot-conflict-panel > div {
  display: grid;
  gap: 7px;
}

.slot-conflict-panel span {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 720;
  gap: 2px;
  line-height: 1.25;
}

.slot-conflict-panel b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 860;
}

.planner-action-panel {
  background: rgba(255, 253, 247, 0.86);
  border: 1px solid rgba(226, 212, 196, 0.86);
  border-radius: 18px;
  display: grid;
  gap: 10px;
  padding: 11px;
}

.planner-action-head {
  display: grid;
  gap: 3px;
}

.planner-action-head strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 880;
  line-height: 1.1;
}

.planner-action-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.25;
}

.planner-action-grid {
  display: grid;
  gap: 7px;
}

.planner-action {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 11px;
  text-align: left;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
}

.planner-action:hover,
.planner-action:focus-visible,
.planner-action.active {
  background: #fff4f3;
  border-color: rgba(201, 31, 38, 0.34);
  box-shadow: 0 7px 18px rgba(64, 43, 24, 0.08);
  outline: 0;
}

.planner-action:active {
  transform: scale(0.985);
}

.planner-action strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 860;
  line-height: 1.1;
}

.planner-slot-context {
  background: rgba(248, 241, 231, 0.62);
  border: 1px solid rgba(226, 212, 196, 0.78);
  border-radius: 16px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 10px;
}

.planner-slot-context div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.planner-slot-context span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 840;
  letter-spacing: 0.8px;
  line-height: 1;
  text-transform: uppercase;
}

.planner-slot-context strong {
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 860;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-action span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.planner-inspector-form,
.inspector-detail-list {
  display: grid;
  gap: 10px;
}

.inspector-detail-list > div {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 15px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.inspector-detail-list strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.15;
}

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

.student-membership-inspector {
  background: rgba(255, 253, 247, 0.86);
  border: 1px solid rgba(226, 212, 196, 0.86);
  border-radius: 18px;
  display: grid;
  gap: 4px;
  padding: 13px;
}

.student-membership-inspector.low {
  background: #fff4f3;
  border-color: rgba(201, 31, 38, 0.22);
  box-shadow: inset 0 -3px 0 rgba(201, 31, 38, 0.18);
}

.student-membership-inspector span,
.student-membership-inspector em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
  line-height: 1.2;
}

.student-membership-inspector strong {
  color: var(--brand-red);
  font-size: 32px;
  font-weight: 880;
  line-height: 0.95;
}

.overview-student-bookings {
  display: grid;
  gap: 8px;
}

.overview-student-bookings > strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.student-booking-link {
  background: rgba(248, 241, 231, 0.68);
  border: 1px solid rgba(226, 212, 196, 0.86);
  border-radius: 14px;
  color: inherit;
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  text-align: left;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.student-booking-link:hover,
.student-booking-link:focus-visible {
  background: #fffdf7;
  border-color: rgba(201, 31, 38, 0.32);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.06);
  outline: 0;
}

.student-booking-link span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
}

.student-booking-link b {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.18;
}

.request-inspector-status {
  align-items: center;
  background: rgba(248, 241, 231, 0.62);
  border: 1px solid rgba(226, 212, 196, 0.82);
  border-radius: 14px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 10px 11px;
}

.request-inspector-status span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  text-align: right;
}

.request-inspector-message {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
}

.request-inspector-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.inspector-student-add {
  align-items: end;
  grid-template-columns: 1fr auto;
}

.inspector-student-add.attention-focus,
.booking-status-row.attention-focus-row {
  border-color: rgba(201, 31, 38, 0.28);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.08);
}

.attention-focus-note {
  background: rgba(201, 31, 38, 0.08);
  border: 1px solid rgba(201, 31, 38, 0.18);
  color: var(--brand-red);
}

.attention-focus-button {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
}

.inspector-bookings {
  gap: 8px;
}

.inspector-status-note .compact-textarea {
  min-height: 84px;
}

.overview-inspector .booking-status-row {
  border-radius: 15px;
  padding: 10px;
}

.overview-inspector .lesson-form-section {
  border-radius: 18px;
  gap: 10px;
  padding: 12px;
}

.overview-inspector .discipline-grid,
.overview-inspector .picker-grid {
  grid-template-columns: 1fr;
}

.overview-inspector .discipline-option {
  min-height: 76px;
  padding: 13px;
}

.overview-inspector .discipline-option strong {
  font-size: 17px;
}

.overview-inspector .discipline-option span,
.overview-inspector .picker-button small,
.overview-inspector .picker-button em {
  font-size: 11px;
}

.overview-inspector .picker-button {
  min-height: 72px;
  padding: 12px 13px;
}

.overview-inspector .picker-button strong {
  font-size: 17px;
}

.overview-inspector .picker-popover {
  max-height: min(280px, 46vh);
}

.inspector-form-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.analytics-panels {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.analytics-status-panel {
  grid-column: 1 / -1;
}

.analytics-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.analytics-list article,
.analytics-list button {
  -webkit-appearance: none;
  appearance: none;
  background: #f7f8fa;
  border: 1px solid var(--admin-border, #dde3ec);
  border-radius: 12px;
  color: inherit;
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  text-align: left;
  width: 100%;
}

.analytics-list span,
.analytics-list em {
  color: var(--admin-muted, #687082);
  font-size: 11px;
  font-style: normal;
  font-weight: 780;
  line-height: 1.15;
}

.analytics-list strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.12;
}

.analytics-load-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.analytics-load-list div {
  display: grid;
  gap: 6px;
}

.analytics-load-list span {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.analytics-load-list strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-load-list em {
  color: var(--admin-muted, #687082);
  flex: 0 0 auto;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.analytics-load-list i {
  background: #eef1f5;
  border-radius: 999px;
  display: block;
  height: 8px;
  overflow: hidden;
  position: relative;
}

.analytics-load-list i::before {
  background: rgba(201, 31, 38, 0.58);
  border-radius: inherit;
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: var(--load-width, 8%);
}

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

.count-row {
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.count-row span {
  color: var(--muted);
  font-weight: 760;
}

.count-row strong {
  color: var(--brand-red);
  font-size: 22px;
}

.broadcast-grid,
.event-editor-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.broadcast-history-panel {
  grid-column: 1 / -1;
}

.stack,
.request-list,
.timeline-list,
.student-list,
.broadcast-history,
.event-list {
  display: grid;
  gap: 12px;
}

.broadcast-history-item {
  align-items: start;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}

.broadcast-history-item div {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.broadcast-history-item strong {
  color: var(--text);
  font-size: 15px;
}

.broadcast-history-item span,
.broadcast-history-item p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
}

.request-mini {
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 10px;
  grid-template-columns: 10px 1fr;
  padding: 12px;
}

.request-mini strong {
  display: block;
  font-size: 15px;
}

.request-mini small {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.dot {
  background: var(--brand-red);
  border-radius: 999px;
  height: 10px;
  width: 10px;
}

.dot-waiting_user {
  background: var(--success);
}

.dot-in_progress {
  background: #d58a20;
}

.timeline-slot {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 108px 1fr auto;
  padding: 12px 0;
}

.timeline-slot:last-child {
  border-bottom: 0;
}

.timeline-slot time {
  color: var(--brand-red);
  font-weight: 820;
}

.timeline-slot strong,
.timeline-slot span {
  display: block;
}

.timeline-slot span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.note-chip,
.badge {
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-style: normal;
  font-weight: 820;
  padding: 7px 10px;
  white-space: nowrap;
}

.badge-new,
.badge-action {
  background: var(--brand-red);
  color: #fff;
}

.badge-in_progress,
.note-payment {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-waiting_user,
.badge-planned,
.badge-confirmed,
.badge-attended,
.badge-written_off,
.note-teacher {
  background: var(--success-bg);
  color: var(--success);
}

.badge-closed,
.badge-cancelled,
.badge-no_show,
.badge-cancelled_student,
.badge-cancelled_studio,
.badge-no_write_off,
.badge-free_next,
.note-internal {
  background: #e8e0d7;
  color: var(--muted);
}

.note-event {
  background: #ffe7da;
  color: var(--brand-red);
}

.note-contract {
  background: #efe5ff;
  color: #6e3eb7;
}

.note-urgent {
  background: var(--brand-red);
  color: #fff;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.filter-chip {
  background: rgba(255, 253, 247, 0.88);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 800;
  min-height: 42px;
  padding: 9px 13px;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.12s ease;
}

.filter-chip:active {
  transform: scale(0.98);
}

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

.requests-workbench {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(286px, 0.32fr);
}

.request-card {
  cursor: pointer;
  display: grid;
  gap: 12px;
}

.request-card .actions {
  align-items: center;
}

.request-card.selected {
  border-color: rgba(201, 31, 38, 0.38);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.08), var(--shadow);
}

.message-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  font-family: inherit;
  line-height: 1.42;
  margin: 0;
  padding: 13px;
  white-space: pre-wrap;
}

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

.btn {
  align-items: center;
  border: 1px solid var(--brand-red);
  border-radius: 15px;
  display: inline-flex;
  font-weight: 820;
  justify-content: center;
  min-height: 46px;
  padding: 10px 15px;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.12s ease,
    box-shadow 0.18s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--brand-red);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--brand-red);
}

.btn.compact {
  min-height: 40px;
  padding: 8px 12px;
}

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

.work-summary-card {
  background: rgba(255, 253, 247, 0.96);
  border: 1px solid rgba(226, 212, 196, 0.9);
  border-radius: 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 5px;
  padding: 16px;
}

.work-summary-card span,
.work-summary-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.work-summary-card strong {
  color: var(--brand-red);
  font-size: 36px;
  font-weight: 880;
  line-height: 0.95;
}

.work-schedule-panel {
  display: grid;
  gap: 14px;
}

.work-schedule-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.work-schedule-scroll {
  overflow-x: auto;
  padding-bottom: 2px;
}

.work-schedule-grid {
  display: grid;
  gap: 8px;
  min-width: 980px;
}

.work-schedule-month {
  gap: 6px;
  min-width: max(1540px, calc(184px + var(--schedule-day-count, 31) * 118px));
}

.work-schedule-head,
.work-schedule-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 184px repeat(var(--schedule-day-count, 7), minmax(96px, 1fr));
}

.work-schedule-month .work-schedule-head,
.work-schedule-month .work-schedule-row {
  gap: 6px;
  grid-template-columns: 184px repeat(var(--schedule-day-count, 31), 118px);
}

.work-schedule-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 840;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.work-schedule-head span {
  padding: 0 10px;
}

.work-schedule-head span:not(:first-child) {
  align-items: center;
  background: rgba(248, 241, 231, 0.58);
  border: 1px solid rgba(226, 212, 196, 0.72);
  border-radius: 14px;
  display: grid;
  gap: 2px;
  justify-items: center;
  min-height: 42px;
  padding: 7px 6px;
  text-align: center;
}

.work-schedule-head strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
}

.work-schedule-head small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.work-person,
.work-shift-cell {
  border-radius: 16px;
  min-height: 62px;
}

.work-person {
  background: rgba(248, 241, 231, 0.76);
  border: 1px solid rgba(226, 212, 196, 0.88);
  display: grid;
  gap: 8px;
  padding: 12px;
}

.work-person strong {
  font-size: 17px;
  font-weight: 860;
  line-height: 1.05;
}

.role-chip {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 830;
  justify-self: start;
  line-height: 1;
  padding: 7px 9px;
}

.role-admin {
  background: #fff0f0;
  border-color: rgba(201, 31, 38, 0.22);
  color: var(--brand-red);
}

.role-teacher {
  background: #edf3e7;
  border-color: rgba(98, 123, 82, 0.24);
  color: var(--success);
}

.role-vocal {
  background: #f5ebff;
  border-color: rgba(110, 62, 183, 0.2);
  color: #6e3eb7;
}

.role-speech {
  background: #eef3f1;
  border-color: rgba(44, 112, 99, 0.2);
  color: #2c7063;
}

.work-shift-cell {
  align-items: center;
  background: rgba(255, 253, 247, 0.82);
  border: 1px solid rgba(226, 212, 196, 0.82);
  color: var(--muted);
  display: flex;
  justify-content: center;
  padding: 10px;
  text-align: center;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.work-shift-cell:focus-within {
  background: #fffdf7;
  border-color: rgba(201, 31, 38, 0.38);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.08);
}

.work-shift-input {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: 0;
  min-width: 0;
  outline: 0;
  padding: 0;
  text-align: center;
  width: 100%;
}

.work-shift-input::placeholder {
  color: rgba(116, 111, 104, 0.32);
}

.work-shift-cell.active {
  background: var(--bg-surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.work-shift-cell.active.role-admin {
  box-shadow: inset 0 -3px 0 rgba(201, 31, 38, 0.28);
}

.work-shift-cell.active.role-teacher {
  box-shadow: inset 0 -3px 0 rgba(98, 123, 82, 0.28);
}

.work-shift-cell.active.role-vocal {
  box-shadow: inset 0 -3px 0 rgba(110, 62, 183, 0.24);
}

.work-shift-cell.active.role-speech {
  box-shadow: inset 0 -3px 0 rgba(44, 112, 99, 0.24);
}

.work-shift-cell.off {
  background: rgba(248, 241, 231, 0.46);
  color: rgba(116, 111, 104, 0.54);
  font-size: 12px;
  font-weight: 760;
}

.work-schedule-month .work-person,
.work-schedule-month .work-shift-cell {
  border-radius: 12px;
  min-height: 48px;
}

.work-schedule-month .work-person {
  padding: 9px 10px;
}

.work-schedule-month .work-person strong {
  font-size: 14px;
}

.work-schedule-month .role-chip {
  font-size: 9px;
  padding: 5px 7px;
}

.work-schedule-month .work-shift-cell {
  padding: 8px;
}

.work-schedule-month .work-shift-input {
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

.work-coverage-section {
  background: rgba(255, 253, 247, 0.72);
  border: 1px solid rgba(226, 212, 196, 0.72);
  border-radius: 20px;
  display: grid;
  gap: 14px;
  overflow: hidden;
  padding: 14px;
}

.work-coverage-head {
  align-items: stretch;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.work-coverage-head-prominent {
  background: rgba(248, 241, 231, 0.58);
  border: 1px solid rgba(226, 212, 196, 0.72);
  border-radius: 18px;
  padding: 13px 14px;
}

.work-coverage-head .kicker {
  margin: 0;
}

.work-coverage-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-align: right;
}

.work-coverage-now {
  display: grid;
  gap: 4px;
}

.work-coverage-now strong {
  color: var(--brand-red);
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.92;
}

.work-coverage-now span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
}

.work-coverage-period {
  align-content: center;
  display: grid;
  gap: 5px;
  justify-items: end;
  min-width: 180px;
}

.work-coverage-period span {
  max-width: 220px;
}

.work-coverage-scroll {
  overflow-x: auto;
  padding-bottom: 2px;
}

.work-coverage-grid {
  display: grid;
  gap: 10px;
  margin: 0;
}

.work-coverage-grid.work-coverage-week {
  grid-template-columns: repeat(var(--coverage-day-count, 7), minmax(112px, 1fr));
  min-width: 780px;
}

.work-coverage-grid.work-coverage-month {
  grid-template-columns: repeat(var(--coverage-day-count, 31), 112px);
  min-width: calc(var(--coverage-day-count, 31) * 112px + (var(--coverage-day-count, 31) - 1) * 10px);
}

.work-schedule-panel .work-coverage-section {
  margin: 0 0 4px;
}

.work-coverage-card {
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid rgba(226, 212, 196, 0.9);
  border-radius: 18px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.work-coverage-card div {
  align-items: end;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.work-coverage-card .kicker {
  margin: 0;
}

.work-coverage-card strong {
  font-size: 28px;
  font-weight: 880;
  line-height: 0.9;
}

.work-coverage-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
}

.work-coverage-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  line-height: 1;
}

.work-coverage-card.thin {
  background: #fff6f4;
  border-color: rgba(201, 31, 38, 0.18);
}

.calendar-panel {
  background: rgba(255, 253, 247, 0.7);
  border: 1px solid rgba(226, 212, 196, 0.9);
  border-radius: 26px;
  box-shadow: var(--shadow);
  margin-top: 18px;
  overflow: hidden;
  padding: 14px;
}

.calendar-toolbar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 2px 2px 12px;
}

.calendar-controls {
  align-items: flex-end;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.calendar-planner-days {
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid rgba(226, 212, 196, 0.84);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(36, 35, 33, 0.06);
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  padding: 10px;
}

.calendar-planner-days button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  display: grid;
  gap: 3px;
  min-height: 52px;
  padding: 7px 4px;
  text-align: center;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.12s ease;
}

.calendar-planner-days button:hover,
.calendar-planner-days button:focus-visible {
  background: rgba(201, 31, 38, 0.08);
  border-color: rgba(201, 31, 38, 0.16);
  color: var(--brand-red);
  outline: 0;
}

.calendar-planner-days button:active {
  transform: scale(0.96);
}

.calendar-planner-days button.active {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
}

.calendar-planner-days button.today:not(.active) {
  background: #fff2f1;
  color: var(--brand-red);
}

.calendar-planner-days span {
  font-size: 9px;
  font-weight: 820;
  text-transform: uppercase;
}

.calendar-planner-days strong {
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.calendar-nav {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.calendar-nav strong {
  color: var(--muted);
  font-size: 14px;
  min-width: 72px;
  text-align: center;
}

.icon-btn {
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand-red);
  display: inline-flex;
  font-size: 22px;
  font-weight: 860;
  height: 38px;
  justify-content: center;
  line-height: 1;
  width: 38px;
}

.modal-backdrop {
  align-items: center;
  animation: modal-backdrop-in 0.2s ease;
  background: rgba(36, 35, 33, 0.34);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 35;
}

.lesson-modal-backdrop {
  align-items: center;
  z-index: 38;
}

.modal-panel {
  animation: modal-panel-in 0.28s var(--ease-out-soft);
  background: var(--bg-surface);
  border: 1px solid rgba(226, 212, 196, 0.95);
  border-radius: 30px;
  box-shadow: 0 24px 70px rgba(36, 35, 33, 0.28);
  display: grid;
  gap: 16px;
  max-height: calc(100dvh - 48px);
  max-width: 720px;
  overflow: auto;
  padding: 24px;
  position: relative;
  width: min(720px, 100%);
}

.lesson-modal-panel {
  animation: lesson-modal-in 0.34s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 920px;
  transform-origin: 50% 46%;
  width: min(920px, calc(100vw - 48px));
}

.modal-close {
  align-items: center;
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid rgba(226, 212, 196, 0.95);
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(36, 35, 33, 0.08);
  color: var(--brand-red);
  display: inline-flex;
  font-size: 0;
  height: 46px;
  justify-content: center;
  position: absolute;
  right: 18px;
  top: 18px;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
  width: 46px;
}

.modal-close::before,
.modal-close::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 4px;
  position: absolute;
  width: 20px;
}

.modal-close::before {
  transform: rotate(45deg);
}

.modal-close::after {
  transform: rotate(-45deg);
}

.modal-close:hover,
.modal-close:focus-visible {
  background: #fff2f1;
  border-color: rgba(201, 31, 38, 0.34);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.08), 0 10px 20px rgba(36, 35, 33, 0.1);
  outline: 0;
}

.modal-close:active {
  transform: scale(0.96);
}

.modal-head {
  padding-right: 60px;
}

.modal-title {
  font-size: clamp(30px, 4vw, 46px);
}

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

.detail-item {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 6px;
  padding: 13px;
}

.detail-item-wide {
  grid-column: 1 / -1;
}

.detail-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.detail-item strong {
  font-size: 16px;
  line-height: 1.28;
}

.modal-divider {
  background: var(--line);
  height: 1px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slot-note {
  border-radius: 16px;
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px;
}

.slot-note strong {
  font-size: 13px;
}

.slot-note span {
  font-size: 13px;
  line-height: 1.35;
}

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

.booking-status-row {
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(160px, 1fr) auto;
  padding: 12px;
}

.booking-status-row strong,
.booking-status-row span {
  display: block;
}

.booking-status-row span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 3px;
}

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

.student-list {
  gap: 8px;
}

.students-workbench {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(286px, 0.32fr);
}

.list-head,
.student-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 1.35fr 1fr 0.8fr 1.1fr 1fr auto;
}

.list-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  padding: 0 14px 2px;
}

.student-row {
  cursor: pointer;
  padding: 14px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
}

.student-row:hover {
  border-color: rgba(201, 31, 38, 0.24);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.05), var(--shadow);
}

.student-row.selected {
  border-color: rgba(201, 31, 38, 0.38);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.08), var(--shadow);
}

.student-main {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 48px 1fr;
  min-width: 0;
}

.student-avatar {
  align-items: center;
  background: var(--rose);
  border-radius: 16px;
  color: var(--brand-red);
  display: inline-flex;
  font-size: 22px;
  font-weight: 880;
  height: 48px;
  justify-content: center;
  width: 48px;
}

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

.student-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-cell span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

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

.teachers-workbench {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(286px, 0.32fr);
}

.settings-metric-row {
  border-bottom: 1px solid var(--admin-border, #dde3ec);
  border-top: 1px solid var(--admin-border, #dde3ec);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settings-metric-row > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
}

.settings-metric-row > span + span {
  border-left: 1px solid var(--admin-border, #dde3ec);
}

.settings-metric-row span span {
  color: var(--admin-muted, #687082);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.settings-metric-row strong {
  color: var(--ink, #242321);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.05;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-metric-row small {
  color: var(--admin-muted, #687082);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-row {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1fr) 220px auto auto;
  padding: 16px;
}

.teacher-card-button {
  align-items: center;
  color: inherit;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
  width: 100%;
}

.teacher-card-button:active {
  transform: scale(0.99);
}

.teacher-card-button:hover {
  border-color: rgba(201, 31, 38, 0.35);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.06), var(--shadow);
}

.teacher-card-button.selected {
  border-color: rgba(201, 31, 38, 0.38);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.08), var(--shadow);
}

.teacher-limit-pill {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 820;
  padding: 10px 14px;
  white-space: nowrap;
}

.teacher-open-mark {
  color: var(--brand-red);
  font-size: 30px;
  font-weight: 720;
  line-height: 1;
}

.teacher-create-row {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) 140px auto;
}

.membership-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.slot-student-add {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
}

.student-modal .booking-status-row {
  grid-template-columns: minmax(0, 1fr);
}

.event-list {
  gap: 8px;
}

.event-row {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: inherit;
  display: grid;
  gap: 4px;
  padding: 13px;
  text-align: left;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
}

.event-row:active {
  transform: scale(0.99);
}

.event-row.active {
  background: #fff7f6;
  border-color: rgba(201, 31, 38, 0.44);
  box-shadow: 0 0 0 2px rgba(201, 31, 38, 0.1);
}

.event-row strong {
  font-size: 16px;
  line-height: 1.18;
}

.event-row span,
.event-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.25;
}

.textarea,
.input {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  outline: 0;
  padding: 11px 13px;
  width: 100%;
}

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

.compact-textarea {
  min-height: 104px;
}

.input {
  min-height: 48px;
}

.broadcast-preview {
  min-height: 300px;
}

.textarea:focus,
.input:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.1);
}

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

.label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

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

.compact-form {
  margin-top: 14px;
}

.lesson-form-panel {
  max-width: 860px;
}

.lesson-form {
  display: grid;
  gap: 18px;
}

.lesson-form-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lesson-form-summary span,
.availability-warning-chip {
  background: rgba(248, 241, 231, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.15;
  padding: 8px 10px;
}

.lesson-form-summary .availability-available,
.inspector-detail-list .availability-available {
  background: #eef4e8;
  border-color: rgba(98, 123, 82, 0.18);
  color: var(--success);
}

.lesson-form-summary .availability-unknown,
.inspector-detail-list .availability-unknown {
  background: #fbf1e3;
  border-color: rgba(133, 82, 12, 0.14);
  color: var(--warning);
}

.availability-warning-chip,
.lesson-form-summary .availability-off,
.lesson-form-summary .availability-outside,
.inspector-detail-list .availability-off,
.inspector-detail-list .availability-outside {
  background: #fff1f1;
  border-color: rgba(201, 31, 38, 0.18);
  color: var(--brand-red);
}

.availability-warning {
  background: #fff4f3;
  border: 1px solid rgba(201, 31, 38, 0.18);
  border-radius: 18px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.availability-warning strong {
  color: var(--brand-red);
  font-size: 14px;
  font-weight: 860;
}

.availability-warning span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.recurring-preview {
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid rgba(226, 212, 196, 0.9);
  border-radius: 18px;
  display: grid;
  gap: 7px;
  padding: 12px 14px;
}

.recurring-preview.has-conflicts {
  background: #fff5f3;
  border-color: rgba(201, 31, 38, 0.2);
}

.recurring-preview strong {
  color: var(--brand-red);
  font-size: 13px;
  font-weight: 880;
}

.recurring-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
  line-height: 1.25;
}

.recurring-preview div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recurring-date-chip {
  background: rgba(248, 241, 231, 0.78);
  border: 1px solid rgba(226, 212, 196, 0.86);
  border-radius: 12px;
  color: var(--ink);
  display: grid;
  gap: 2px;
  font-size: 11px;
  font-style: normal;
  font-weight: 820;
  line-height: 1.1;
  padding: 7px 9px;
}

.recurring-date-chip b {
  color: var(--ink);
  font-size: 11px;
  font-weight: 860;
}

.recurring-date-chip span {
  color: var(--success);
  font-size: 10px;
  font-weight: 820;
  line-height: 1.1;
}

.recurring-date-chip.has-conflict {
  background: #fff1f1;
  border-color: rgba(201, 31, 38, 0.22);
}

.recurring-date-chip.has-conflict span,
.recurring-date-chip.has-conflict b {
  color: var(--brand-red);
}

.lesson-form-section {
  background: rgba(246, 239, 229, 0.52);
  border: 1px solid var(--line);
  border-radius: 22px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

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

.discipline-option {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 5px;
  min-height: 106px;
  padding: 17px;
  text-align: left;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
}

.discipline-option input {
  inline-size: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.discipline-option strong {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.1;
}

.discipline-option span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
}

.discipline-option.active,
.discipline-option:has(input:checked) {
  background: rgba(201, 31, 38, 0.08);
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.08);
}

.discipline-option:active {
  transform: scale(0.99);
}

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

.picker-field {
  min-width: 0;
  position: relative;
}

.picker-field.open {
  z-index: 18;
}

.picker-button {
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: inherit;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 86px;
  padding: 15px 16px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
  width: 100%;
}

.picker-button:active {
  transform: scale(0.99);
}

.picker-button:hover,
.picker-button:focus-visible,
.picker-button.active {
  border-color: rgba(201, 31, 38, 0.42);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.08);
  outline: 0;
}

.picker-button span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.picker-button small,
.picker-button em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
  line-height: 1.2;
}

.picker-button strong {
  font-size: 20px;
  font-weight: 860;
  line-height: 1.1;
}

.picker-button b {
  color: var(--brand-red);
  font-size: 28px;
  font-weight: 740;
}

.picker-popover {
  animation: picker-popover-in 0.18s var(--ease-out-soft);
  background: rgba(255, 253, 247, 0.98);
  border: 1px solid rgba(226, 212, 196, 0.96);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(36, 35, 33, 0.16);
  left: 0;
  max-height: min(320px, 42vh);
  overflow: auto;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 48;
}

.picker-field-date .picker-popover,
.picker-field-time .picker-popover {
  max-height: min(260px, 34vh);
}

.picker-field.drop-up .picker-popover {
  bottom: calc(100% + 8px);
  top: auto;
}

.picker-popover-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
  margin: 2px 4px 8px;
}

.picker-options {
  display: grid;
  gap: 8px;
}

.picker-option-group {
  display: grid;
  gap: 7px;
}

.picker-option-group + .picker-option-group {
  border-top: 1px solid rgba(226, 212, 196, 0.72);
  margin-top: 3px;
  padding-top: 10px;
}

.picker-option-group > p {
  color: var(--brand-red);
  font-size: 10px;
  font-weight: 880;
  letter-spacing: 0.7px;
  line-height: 1;
  margin: 0 4px;
}

.picker-option {
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: inherit;
  display: flex;
  font-weight: 820;
  justify-content: space-between;
  min-height: 52px;
  padding: 12px 14px;
  text-align: left;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
  width: 100%;
}

.picker-option:active {
  transform: scale(0.99);
}

.picker-option.active {
  background: #fff2f1;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.08);
  color: var(--brand-red);
}

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

.picker-option strong {
  font-size: 15px;
  font-weight: 850;
  line-height: 1.12;
}

.picker-option small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.2;
}

.picker-option.availability-off,
.picker-option.availability-outside,
.picker-option.availability-busy {
  opacity: 0.62;
}

.picker-option.availability-available small {
  color: var(--success);
}

.picker-option.availability-off small,
.picker-option.availability-outside small,
.picker-option.availability-busy small {
  color: var(--brand-red);
}

.picker-option.availability-busy {
  background: #fff6f4;
  border-color: rgba(201, 31, 38, 0.18);
}

.picker-option b {
  color: var(--brand-red);
}

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

.checkbox-field {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-weight: 780;
  gap: 10px;
}

.checkbox-field input {
  accent-color: var(--brand-red);
  height: 20px;
  width: 20px;
}

.event-admin-card {
  display: grid;
  gap: 12px;
}

.status-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-flow span {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 820;
  padding: 9px 12px;
}

.empty,
.empty-inline {
  color: var(--muted);
  padding: 28px 18px;
  text-align: center;
}

.toast {
  background: rgba(36, 35, 33, 0.92);
  border-radius: 999px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  color: #fff;
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
  opacity: 0;
  padding: 12px 16px;
  pointer-events: none;
  position: fixed;
  text-align: center;
  transform: translate(-50%, 16px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: 40;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes workspace-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-backdrop-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modal-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes lesson-modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes picker-popover-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1240px) {
  .overview-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.25fr);
  }

  .requests-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.3fr);
  }

  .students-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.3fr);
  }

  .teachers-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.3fr);
  }

  .overview-planner-grid {
    grid-template-columns: 76px repeat(var(--resource-count), minmax(128px, 1fr));
    min-width: 620px;
  }

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

  .overview-inspector {
    padding: 14px;
  }
}

@media (max-width: 980px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .overview-workbench {
    grid-template-columns: 1fr;
  }

  .requests-workbench {
    grid-template-columns: 1fr;
  }

  .students-workbench {
    grid-template-columns: 1fr;
  }

  .teachers-workbench {
    grid-template-columns: 1fr;
  }

  .overview-inspector {
    max-height: none;
    position: static;
  }

  .overview-team-strip,
  .overview-availability-strip,
  .overview-resource-strip,
  .overview-outside-strip,
  .overview-request-strip,
  .overview-membership-strip,
  .overview-confirmation-strip {
    grid-template-columns: 1fr;
  }

  .overview-resource-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .overview-tab .admin-nav {
    margin-top: 0;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .sidebar-open .mobile-menu-button {
    background: var(--bg-surface);
    left: 14px;
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    z-index: 50;
  }

  .admin-nav {
    background: var(--bg-surface);
    border-color: rgba(226, 212, 196, 0.95);
    border-radius: 0 28px 28px 0;
    bottom: 0;
    display: grid;
    gap: 6px;
    left: 0;
    max-width: min(300px, 86vw);
    opacity: 1;
    overflow-y: auto;
    padding: calc(max(14px, env(safe-area-inset-top)) + 58px) 10px max(14px, env(safe-area-inset-bottom));
    position: fixed;
    top: 0;
    transform: translateX(calc(-100% - 12px));
    transition: transform 0.36s var(--ease-out-soft);
    will-change: transform;
    width: min(300px, 86vw);
    z-index: 46;
  }

  .nav-tab {
    border-radius: 16px;
    min-height: 48px;
    padding: 8px 12px;
    width: 100%;
  }

  .nav-tab span {
    font-size: 14px;
  }

  .nav-tab small {
    font-size: 11px;
    line-height: 1.18;
  }

  .admin-nav::before {
    border-radius: 16px;
  }

  .nav-scrim {
    display: block;
  }

  .sidebar-open .admin-nav {
    transform: translateX(0);
  }

  .sidebar-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

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

  .overview-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .day-overview-grid {
    grid-template-columns: 1fr;
  }

  .overview-panel-main {
    grid-row: auto;
  }

  .broadcast-grid,
  .event-editor-grid {
    grid-template-columns: 1fr;
  }

  .student-row {
    align-items: flex-start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 640px) {
  .admin-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .page-head,
  .section-head,
  .card-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-header {
    align-items: flex-start;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    justify-content: start;
  }

  .access-screen .mobile-menu-button {
    display: none;
  }

  .status-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .metric-grid,
  .dashboard-grid,
  .overview-stats,
  .work-summary-grid,
  .day-overview-grid,
  .analytics-panels,
  .broadcast-grid,
    .event-editor-grid,
    .discipline-grid,
    .picker-grid,
    .overview-focus-strip,
    .teacher-row,
    .overview-resource-cards,
    .overview-attention-list,
  .student-row,
  .slot-student-add,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .list-head {
    display: none;
  }

  .calendar-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-controls {
    align-items: stretch;
    justify-items: stretch;
    width: 100%;
  }

  .calendar-nav {
    justify-content: space-between;
    width: 100%;
  }

  .calendar-panel {
    border-radius: 22px;
    margin-left: 0;
    margin-right: 0;
    padding: 10px;
  }

  .overview-row {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .overview-row > b:not(.badge),
  .confirmation-row .badge {
    justify-self: start;
  }

  .overview-time-row {
    grid-template-columns: 104px minmax(0, 1fr);
    min-height: 54px;
  }

  .overview-time-row > time {
    font-size: 11px;
  }

  .overview-time-event {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .overview-time-event em {
    justify-self: start;
  }

  .overview-planner-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .overview-planner-grid {
    grid-template-columns: 72px repeat(var(--resource-count), minmax(136px, 1fr));
    min-width: 620px;
  }

  .overview-planner-corner,
  .overview-resource-head {
    min-height: 52px;
  }

  .overview-planner-cell,
  .overview-planner-time {
    min-height: 58px;
  }

  .inspector-student-add {
    grid-template-columns: 1fr;
  }

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

  .work-coverage-head {
    flex-direction: column;
  }

  .work-coverage-period {
    justify-items: start;
    min-width: 0;
  }

  .work-coverage-head span,
  .work-coverage-period span {
    text-align: left;
  }

  .work-schedule-toolbar {
    justify-content: stretch;
  }

  .work-schedule-toolbar .btn {
    flex: 1 1 140px;
  }

  .work-schedule-grid {
    min-width: 860px;
  }

  .timeline-slot {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .actions .btn,
  .page-head .btn,
  .modal-actions .btn {
    width: 100%;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 12px;
  }

  .modal-panel {
    border-radius: 26px;
    max-height: calc(100dvh - 24px);
    padding: 20px;
  }

  .lesson-modal-backdrop {
    align-items: flex-end;
  }

  .lesson-modal-panel {
    border-radius: 28px 28px 0 0;
    max-height: calc(100dvh - 12px);
    width: 100%;
  }

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

  .modal-head {
    padding-right: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* ERP sidebar/layout pass */
body {
  background: #f6f3ed;
}

.admin-shell {
  padding: 0;
}

.admin-layout {
  align-items: stretch;
  display: grid;
  gap: 0;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100dvh;
}

.admin-nav {
  background: #fbfaf7;
  border: 0;
  border-right: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 0;
  box-shadow: none;
  gap: 14px;
  height: 100dvh;
  overflow: auto;
  padding: 18px 14px;
  position: sticky;
  top: 0;
}

.admin-nav::before {
  display: none;
}

.sidebar-brand-lockup {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 42px;
  padding: 0 4px 2px;
}

.sidebar-brand-mark {
  align-items: center;
  background: var(--brand-red);
  border-radius: 9px;
  color: #fff;
  display: inline-flex;
  font-size: 16px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  line-height: 1;
  width: 34px;
}

.sidebar-brand-lockup strong {
  color: var(--ink);
  display: block;
  font-size: 14px;
  font-weight: 880;
  line-height: 1.1;
}

.sidebar-brand-lockup small {
  color: rgba(116, 111, 104, 0.86);
  display: block;
  font-size: 11px;
  font-weight: 720;
  line-height: 1.2;
  margin-top: 2px;
}

.sidebar-calendar-mini {
  background: #fff;
  border-color: rgba(36, 35, 33, 0.08);
  border-radius: 14px;
  gap: 8px;
  padding: 10px;
}

.mini-calendar-nav {
  background: #f6f3ed;
  border-color: rgba(36, 35, 33, 0.08);
  border-radius: 9px;
  height: 26px;
  width: 26px;
}

.mini-calendar-days button,
.mini-calendar-gap {
  border-radius: 7px;
  height: 24px;
}

.mini-calendar-days button.active {
  background: var(--brand-red);
  box-shadow: 0 5px 14px rgba(201, 31, 38, 0.18);
}

.sidebar-nav-list {
  gap: 3px;
}

.nav-tab {
  align-items: center;
  border-radius: 10px;
  display: grid;
  gap: 9px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  min-height: 42px;
  padding: 8px 9px;
}

.nav-tab:hover,
.nav-tab:focus-visible {
  background: rgba(36, 35, 33, 0.045);
  color: var(--ink);
  outline: 0;
}

.nav-tab.active {
  background: rgba(201, 31, 38, 0.08);
  color: var(--brand-red);
}

.nav-icon {
  align-items: center;
  color: inherit;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.nav-icon svg {
  height: 16px;
  width: 16px;
}

.nav-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.nav-copy span {
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
}

.nav-copy small {
  color: rgba(116, 111, 104, 0.84);
  font-size: 10px;
  font-weight: 680;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-tab.active .nav-copy small {
  color: rgba(201, 31, 38, 0.72);
}

.nav-badge {
  align-items: center;
  background: rgba(36, 35, 33, 0.06);
  border-radius: 999px;
  color: rgba(116, 111, 104, 0.92);
  display: inline-flex;
  font-size: 10px;
  font-weight: 850;
  height: 21px;
  justify-content: center;
  min-width: 21px;
  padding: 0 6px;
}

.nav-tab.active .nav-badge {
  background: rgba(201, 31, 38, 0.12);
  color: var(--brand-red);
}

.workspace {
  height: 100dvh;
  overflow: auto;
  padding: 0 24px 32px;
}

.overview-planner-page {
  gap: 12px;
  max-width: 1440px;
  padding-top: 0;
}

.overview-planner-head {
  align-items: center;
  background: rgba(246, 243, 237, 0.94);
  border-bottom: 1px solid rgba(36, 35, 33, 0.08);
  margin: 0 -24px 12px;
  padding: 18px 24px 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.overview-planner-head h1 {
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: 0;
}

.overview-planner-head p:not(.kicker) {
  font-size: 13px;
  margin-top: 5px;
}

.overview-head-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.erp-segmented {
  align-items: center;
  background: #ebe6dc;
  border: 1px solid rgba(36, 35, 33, 0.07);
  border-radius: 12px;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
}

.erp-segmented button {
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: rgba(116, 111, 104, 0.92);
  font-size: 12px;
  font-weight: 820;
  min-height: 32px;
  padding: 7px 11px;
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}

.erp-segmented button:not(:disabled):hover,
.erp-segmented button:not(:disabled):focus-visible {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  outline: 0;
}

.erp-segmented button.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(36, 35, 33, 0.1);
  color: var(--ink);
}

.overview-planner-head .btn {
  border-radius: 10px;
  min-height: 38px;
  padding: 9px 13px;
}

.overview-status-strip {
  background: transparent;
  border: 0;
  border-radius: 0;
  gap: 6px;
  padding: 0;
}

.overview-status-strip button {
  background: #fff;
  border-color: rgba(36, 35, 33, 0.08);
  border-radius: 10px;
  min-height: 34px;
  padding: 7px 10px;
}

.overview-focus-strip {
  background: #fff;
  border: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 14px;
  gap: 8px;
  padding: 6px;
}

.overview-focus-card {
  background: transparent;
  border-color: transparent;
  border-radius: 10px;
  box-shadow: none;
  min-height: 76px;
  padding: 11px 12px;
}

.overview-focus-card:not(:last-child)::after {
  background: rgba(36, 35, 33, 0.08);
  bottom: 12px;
  content: "";
  position: absolute;
  right: -4px;
  top: 12px;
  width: 1px;
}

.overview-focus-card {
  position: relative;
}

.overview-focus-card:not(:disabled):hover,
.overview-focus-card:not(:disabled):focus-visible {
  background: rgba(201, 31, 38, 0.045);
  box-shadow: none;
}

.overview-focus-card strong {
  font-size: 14px;
}

.overview-focus-card small {
  font-size: 11px;
}

.overview-team-strip,
.overview-availability-strip,
.overview-resource-strip,
.overview-outside-strip,
.overview-request-strip,
.overview-membership-strip,
.overview-confirmation-strip,
.overview-attention-queue {
  background: #fff;
  border-color: rgba(36, 35, 33, 0.08);
  border-radius: 14px;
  box-shadow: none;
  gap: 10px;
  grid-template-columns: minmax(160px, 0.22fr) minmax(0, 1fr);
  padding: 12px;
}

.overview-team-strip h2,
.overview-resource-strip h2,
.overview-confirmation-strip h2,
.overview-availability-strip h2,
.overview-request-strip h2,
.overview-membership-strip h2,
.overview-attention-head h2 {
  font-size: 16px;
}

.overview-team-chips,
.overview-availability-gap-list,
.overview-resource-cards,
.overview-request-list,
.overview-membership-list,
.overview-attention-list {
  gap: 7px;
}

.team-chip,
.availability-gap-card,
.resource-state-card,
.overview-request-card,
.membership-risk-card,
.attention-item,
.outside-slot-card {
  border-color: rgba(36, 35, 33, 0.08);
  border-radius: 11px;
  box-shadow: none;
  min-height: auto;
  padding: 9px 10px;
}

.team-chip {
  min-width: 124px;
}

.overview-role-coverage span,
.attention-summary-chip {
  background: #f6f3ed;
  border-color: rgba(36, 35, 33, 0.08);
}

.overview-workbench {
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.28fr);
}

.overview-planner-shell {
  background: #fff;
  border-color: rgba(36, 35, 33, 0.08);
  border-radius: 14px;
  box-shadow: none;
}

.overview-planner-grid {
  grid-template-columns: 84px repeat(var(--resource-count), minmax(168px, 1fr));
}

.overview-planner-corner,
.overview-resource-head {
  background: #fbfaf7;
  min-height: 48px;
}

.overview-planner-time,
.overview-planner-cell {
  min-height: 58px;
}

.overview-planner-time {
  background: #fbfaf7;
  font-size: 10px;
  padding-top: 10px;
}

.overview-planner-cell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(251, 250, 247, 0.72)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 28px,
      rgba(36, 35, 33, 0.045) 29px
    );
  padding: 6px;
}

.overview-planner-event {
  border-radius: 8px;
  box-shadow: none;
  min-height: 44px;
  padding: 6px 8px 7px;
}

.overview-planner-event strong {
  font-size: 12px;
}

.overview-inspector {
  background: #fff;
  border-color: rgba(36, 35, 33, 0.08);
  border-radius: 14px;
  box-shadow: none;
  max-height: calc(100dvh - 94px);
  top: 74px;
}

.inspector-head h2 {
  font-size: 21px;
}

@media (max-width: 980px) {
  .admin-layout {
    display: block;
  }

  .admin-layout > .mobile-menu-button {
    display: inline-flex;
    left: 14px;
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    z-index: 50;
  }

  .workspace {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding: 0 14px 24px;
  }

  .admin-nav {
    border-radius: 0 18px 18px 0;
    bottom: 0;
    box-shadow: 12px 0 30px rgba(36, 35, 33, 0.12);
    display: grid;
    height: auto;
    left: 0;
    max-width: min(300px, 86vw);
    overflow-y: auto;
    padding: calc(max(14px, env(safe-area-inset-top)) + 58px) 10px max(14px, env(safe-area-inset-bottom));
    position: fixed;
    top: 0;
    transform: translateX(calc(-100% - 12px));
    transition: transform 0.36s var(--ease-out-soft);
    width: min(300px, 86vw);
    z-index: 46;
  }

  .sidebar-open .admin-nav {
    transform: translateX(0);
  }

  .overview-planner-head {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 64px;
    padding-right: 14px;
  }

  .overview-team-strip,
  .overview-availability-strip,
  .overview-resource-strip,
  .overview-outside-strip,
  .overview-request-strip,
  .overview-membership-strip,
  .overview-confirmation-strip,
  .overview-attention-queue {
    grid-template-columns: 1fr;
  }

  .overview-focus-card:not(:last-child)::after {
    display: none;
  }

  .overview-resource-cards,
  .overview-availability-gap-list,
  .overview-request-list,
  .overview-membership-list,
  .overview-attention-list {
    grid-template-columns: 1fr;
  }
}

/* ERP-wide admin surface */
.workspace > .page-head {
  align-items: flex-start;
  border-bottom: 1px solid rgba(36, 35, 33, 0.08);
  gap: 18px;
  margin: 0 0 14px;
  padding: 2px 0 18px;
}

.workspace > .page-head > div:first-child {
  min-width: 0;
}

.workspace > .page-head .title {
  font-size: clamp(30px, 3.1vw, 42px);
  letter-spacing: 0;
  line-height: 1.04;
}

.workspace > .page-head .lead {
  font-size: 14px;
  line-height: 1.38;
  margin-top: 7px;
  max-width: 680px;
}

.erp-head-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.erp-stat-card {
  background: #fff;
  border: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 14px;
  box-shadow: none;
  display: grid;
  gap: 4px;
  min-width: 128px;
  padding: 12px 14px;
}

.erp-stat-card strong {
  color: var(--ink);
  font-size: 26px;
  font-weight: 880;
  line-height: 1;
}

.erp-stat-card span {
  color: var(--brand-red);
  font-size: 13px;
  font-weight: 820;
  line-height: 1.15;
}

.erp-stat-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.2;
}

.erp-stat-green span {
  color: var(--success);
}

.erp-stat-red span {
  color: var(--brand-red);
}

.erp-tabs {
  align-items: center;
  border-bottom: 1px solid rgba(36, 35, 33, 0.08);
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  overflow-x: auto;
  padding: 0 0 14px;
}

.erp-tabs button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: #6f7480;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 800;
  min-height: 38px;
  padding: 9px 14px;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.erp-tabs button:hover,
.erp-tabs button:focus-visible {
  background: rgba(201, 31, 38, 0.055);
  color: var(--brand-red);
  outline: 0;
}

.erp-tabs button.active {
  background: rgba(201, 31, 38, 0.08);
  color: var(--brand-red);
}

.erp-toolbar {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr) auto;
  margin: 0 0 14px;
}

.erp-search {
  align-items: center;
  background: #f0f1f3;
  border: 1px solid rgba(36, 35, 33, 0.05);
  border-radius: 13px;
  color: #777d89;
  display: grid;
  gap: 9px;
  grid-template-columns: 18px minmax(0, 1fr);
  min-height: 42px;
  padding: 0 12px;
}

.erp-search svg {
  height: 17px;
  width: 17px;
}

.erp-search input {
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 720;
  min-width: 0;
  outline: 0;
}

.erp-search input::placeholder {
  color: #878c95;
}

.erp-toolbar-filters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.erp-filter-pill {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 13px;
  color: #6f7480;
  display: inline-flex;
  font-size: 13px;
  font-weight: 780;
  min-height: 38px;
  padding: 8px 12px;
}

.erp-toolbar-action {
  justify-self: end;
}

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

.erp-kpi-grid .erp-stat-card {
  min-height: 104px;
  padding: 16px;
}

.requests-workbench,
.students-workbench,
.teachers-workbench {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.28fr);
}

.erp-table {
  background: #fff;
  border: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(36, 35, 33, 0.03);
  overflow-x: auto;
  overflow-y: hidden;
}

.erp-table-head,
.erp-table-row {
  align-items: center;
  display: grid;
  gap: 16px;
}

.erp-table-head {
  background: #f1f2f4;
  border-bottom: 1px solid rgba(36, 35, 33, 0.08);
  color: #6f7480;
  font-size: 12px;
  font-weight: 820;
  min-height: 44px;
  padding: 0 16px;
}

.erp-table-row {
  background: #fff;
  border: 0;
  border-bottom: 1px solid rgba(36, 35, 33, 0.08);
  color: inherit;
  min-height: 72px;
  padding: 13px 16px;
  text-align: left;
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease;
  width: 100%;
}

.erp-table-row:last-child {
  border-bottom: 0;
}

button.erp-table-row:hover,
button.erp-table-row:focus-visible {
  background: #fbfaf7;
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.38);
  outline: 0;
}

.erp-table-row.selected {
  background: rgba(201, 31, 38, 0.045);
  box-shadow: inset 3px 0 0 var(--brand-red);
}

.erp-table-row > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.erp-table-row b {
  color: var(--ink);
  display: block;
  font-size: 14px;
  font-weight: 820;
  line-height: 1.16;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-table-row small {
  color: #6f7480;
  display: block;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-table-row {
  grid-template-columns:
    minmax(100px, 0.72fr)
    minmax(132px, 0.95fr)
    minmax(104px, 0.68fr)
    minmax(170px, 1.3fr)
    64px;
  gap: 10px;
  min-width: 100%;
}

.student-table-row {
  grid-template-columns:
    minmax(180px, 1.35fr)
    minmax(132px, 0.9fr)
    minmax(112px, 0.72fr)
    minmax(132px, 0.88fr)
    64px;
  gap: 10px;
  min-width: 100%;
}

.teacher-table-row {
  grid-template-columns:
    minmax(180px, 1.35fr)
    minmax(142px, 1fr)
    minmax(112px, 0.78fr)
    minmax(104px, 0.68fr)
    64px;
  gap: 10px;
  min-width: 100%;
}

.erp-person-cell {
  align-items: center;
  display: grid !important;
  gap: 11px !important;
  grid-template-columns: 38px minmax(0, 1fr);
}

.erp-avatar {
  align-items: center;
  background: var(--rose);
  border-radius: 12px;
  color: var(--brand-red);
  display: inline-flex;
  font-size: 17px;
  font-weight: 880;
  height: 38px;
  justify-content: center;
  text-transform: uppercase;
  width: 38px;
}

.erp-status {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 820;
  justify-self: start;
  min-height: 26px;
  padding: 6px 10px;
  white-space: nowrap;
}

.erp-status-active {
  background: #e8f4e9;
  color: #4a9b58;
}

.erp-status-trial {
  background: #f1f3e9;
  color: #707b58;
}

.erp-status-lead {
  background: #fff0cf;
  color: #b17a0b;
}

.erp-status-frozen,
.erp-status-neutral {
  background: #edf0f5;
  color: #6f7480;
}

.erp-row-action {
  color: var(--brand-red);
  font-size: 13px;
  font-weight: 840;
  justify-self: end;
  white-space: nowrap;
}

.teacher-list {
  gap: 12px;
}

.erp-create-row {
  border-radius: 16px;
  box-shadow: none;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 250px) 130px auto;
  margin-bottom: 12px;
  padding: 14px;
}

.erp-create-row .item-title {
  font-size: 18px;
}

.planner-by-staff .overview-resource-head {
  align-items: center;
  background: #fff;
}

.planner-by-staff .overview-resource-head strong {
  font-size: 13px;
}

.planner-by-staff .overview-resource-head span {
  color: #6f7480;
  font-size: 11px;
  font-weight: 720;
}

.tasks-board {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.28fr);
}

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

.task-row {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 16px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto minmax(120px, 0.22fr) auto;
  min-height: 86px;
  padding: 14px 16px;
}

.task-row.priority-high {
  border-color: rgba(201, 31, 38, 0.22);
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.78);
}

.task-row h3 {
  font-size: 17px;
  line-height: 1.14;
  margin: 0;
}

.task-row p:not(.kicker) {
  color: #6f7480;
  font-size: 13px;
  font-weight: 680;
  line-height: 1.3;
  margin: 5px 0 0;
}

.task-row > strong {
  color: #6f7480;
  font-size: 13px;
  font-weight: 820;
}

.task-row-actions {
  align-items: center;
  display: flex;
  gap: 5px;
  justify-self: end;
}

.task-complete-button {
  align-items: center;
  color: #21865f;
  display: inline-flex;
  font-size: 15px;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.task-aside {
  position: sticky;
  top: 74px;
}

.channel-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 14px;
}

.channel-strip article {
  background: #fff;
  border: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 14px;
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 12px 14px;
}

.channel-strip article strong {
  font-size: 15px;
  font-weight: 860;
}

.channel-strip article span {
  color: var(--success);
  font-size: 12px;
  font-weight: 780;
}

.channel-strip article.muted span {
  color: #6f7480;
}

.communications-workbench {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 0.28fr) minmax(0, 1fr) minmax(250px, 0.24fr);
}

.communication-inbox,
.communication-thread,
.communication-contact {
  min-height: 0;
}

.communication-inbox .erp-toolbar {
  grid-template-columns: 1fr;
  margin-bottom: 12px;
}

.communication-inbox-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.communication-inbox-head span {
  background: var(--rose);
  border-radius: 999px;
  color: var(--brand-red);
  font-size: 13px;
  font-weight: 900;
  padding: 5px 9px;
}

.communication-list {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.communication-item {
  background: #fbfaf7;
  border: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 13px;
  color: inherit;
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  text-align: left;
  transition:
    background 0.16s ease,
    border-color 0.16s ease;
}

.communication-item.active,
.communication-item:hover,
.communication-item:focus-visible {
  background: rgba(201, 31, 38, 0.045);
  border-color: rgba(201, 31, 38, 0.24);
  outline: 0;
}

.communication-item strong {
  font-size: 14px;
  font-weight: 860;
  line-height: 1.14;
}

.communication-item small,
.communication-item em {
  color: #6f7480;
  font-size: 12px;
  font-style: normal;
  line-height: 1.25;
}

.communication-channel {
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  justify-self: start;
  letter-spacing: 0.4px;
  padding: 4px 7px;
  text-transform: uppercase;
}

.communication-channel-telegram {
  background: #4b8fd8;
}

.communication-channel-webapp {
  background: var(--brand-red);
}

.communication-thread-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.communication-thread {
  display: flex;
  flex-direction: column;
}

.message-thread {
  align-content: start;
  display: grid;
  flex: 1;
  gap: 10px;
  margin-top: 18px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  scroll-behavior: auto;
}

.message-bubble {
  border-radius: 14px;
  display: grid;
  gap: 5px;
  max-width: 78%;
  padding: 12px 14px;
}

.message-bubble span {
  font-size: 11px;
  font-weight: 860;
  text-transform: uppercase;
}

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

.message-bubble.incoming {
  background: #f1f2f4;
  justify-self: start;
}

.message-bubble.outgoing {
  background: rgba(201, 31, 38, 0.09);
  justify-self: end;
}

.message-bubble.system {
  background: #fbfaf7;
  border: 1px dashed rgba(36, 35, 33, 0.16);
  color: #6f7480;
  justify-self: center;
  max-width: 100%;
}

.communication-compose {
  align-items: center;
  background: #fff;
  border-top: 1px solid rgba(36, 35, 33, 0.08);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: auto;
  padding-top: 14px;
  position: sticky;
  bottom: 0;
}

.client-card-head {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}

.client-avatar {
  align-items: center;
  background: #3f7ee8;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 900;
  height: 58px;
  justify-content: center;
  line-height: 1;
  width: 58px;
}

.client-card-head h2 {
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.05;
  margin: 2px 0 8px;
}

.client-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.client-tags span {
  background: rgba(26, 188, 110, 0.12);
  border-radius: 999px;
  color: #039b50;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  padding: 7px 9px;
}

.client-info-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.client-info-list div {
  align-items: baseline;
  border-bottom: 1px solid rgba(36, 35, 33, 0.08);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 10px 0;
}

.client-info-list dt {
  color: #6f7480;
  font-size: 13px;
  font-weight: 760;
}

.client-info-list dd {
  color: var(--ink);
  font-size: 14px;
  font-weight: 860;
  margin: 0;
  text-align: right;
  word-break: break-word;
}

.client-actions,
.client-history {
  border-top: 1px solid rgba(36, 35, 33, 0.12);
  margin-top: 18px;
  padding-top: 16px;
}

.client-actions h3,
.client-history h3 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 12px;
}

.client-actions > div {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-actions .btn {
  justify-content: center;
  min-height: 40px;
}

.client-history {
  display: grid;
  gap: 0;
}

.client-history article {
  align-items: baseline;
  border-bottom: 1px solid rgba(36, 35, 33, 0.08);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 0;
}

.client-history article:last-child {
  border-bottom: 0;
}

.client-history strong {
  color: var(--ink);
  display: block;
  font-size: 13px;
  font-weight: 860;
  line-height: 1.2;
}

.client-history span,
.client-history em {
  color: #6f7480;
  font-size: 12px;
  font-style: normal;
  font-weight: 720;
  white-space: nowrap;
}

.client-card-empty {
  display: grid;
  gap: 6px;
}

.lesson-visit-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

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

.lesson-visit-status {
  background: #f1f2f4;
  border: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 11px;
  color: #6f7480;
  font-size: 12px;
  font-weight: 850;
  min-height: 36px;
  padding: 8px 10px;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.lesson-visit-status:hover,
.lesson-visit-status:focus-visible,
.lesson-visit-status.active {
  background: rgba(201, 31, 38, 0.08);
  border-color: rgba(201, 31, 38, 0.24);
  color: var(--brand-red);
  outline: 0;
}

.lesson-visit-status.success.active,
.lesson-visit-status.success:hover {
  background: #e8f4e9;
  border-color: rgba(74, 155, 88, 0.22);
  color: #4a9b58;
}

.lesson-service-card,
.lesson-payment-card {
  background: #fbfaf7;
  border: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 13px;
  display: grid;
  gap: 4px;
  padding: 11px 12px;
}

.lesson-service-card span,
.lesson-payment-card span {
  color: #6f7480;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.lesson-service-card strong,
.lesson-payment-card strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 860;
  line-height: 1.16;
}

.lesson-service-card small,
.lesson-payment-card small {
  color: #6f7480;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.25;
}

.slot-inspector-hero {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid rgba(36, 35, 33, 0.08);
  display: grid;
  gap: 12px;
  grid-template-columns: 48px minmax(0, 1fr);
  margin: -14px -14px 12px;
  padding: 14px;
  position: relative;
}

.slot-inspector-avatar {
  align-items: center;
  background: #4f7fe7;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 20px;
  font-weight: 900;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.slot-inspector-hero h2 {
  font-size: 22px;
  font-weight: 880;
  line-height: 1.06;
  margin: 0;
}

.slot-inspector-hero span:not(.slot-inspector-avatar) {
  color: #6f7480;
  display: block;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.25;
  margin-top: 4px;
}

.slot-inspector-hero > b {
  background: #f1f2f4;
  border-radius: 999px;
  color: #6f7480;
  font-size: 11px;
  font-weight: 860;
  padding: 6px 9px;
  position: absolute;
  right: 14px;
  top: 14px;
}

.slot-command-panel {
  background: #fff;
  border-color: rgba(36, 35, 33, 0.08);
  border-radius: 14px;
  padding: 12px;
}

.slot-panel-head {
  align-items: start;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr);
}

.slot-panel-head strong {
  font-size: 16px;
  font-weight: 880;
  line-height: 1.12;
}

.slot-panel-head > span {
  color: #6f7480;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

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

.slot-command-grid .planner-action {
  border-radius: 12px;
  min-height: 72px;
  padding: 10px;
}

.slot-command-grid .planner-action strong {
  font-size: 13px;
}

.slot-command-grid .planner-action span {
  font-size: 11px;
}

.slot-side-card {
  background: #fff;
  border: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 14px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.slot-side-card-head {
  display: grid;
  gap: 3px;
}

.slot-side-card-head strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 880;
  line-height: 1.12;
}

.slot-side-card p {
  color: #6f7480;
  font-size: 13px;
  font-weight: 680;
  line-height: 1.35;
  margin: 0;
}

.slot-client-meta {
  display: grid;
  gap: 6px;
}

.slot-client-meta span {
  background: #fbfaf7;
  border: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  padding: 8px 9px;
}

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

.slot-quick-actions .btn {
  justify-content: center;
  width: 100%;
}

.slot-selected-mode {
  background: #fff;
  border: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 14px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.slot-selected-mode .lesson-form,
.slot-selected-mode .planner-inspector-form {
  gap: 12px;
}

.slot-selected-mode .lesson-form-section {
  background: #fbfaf7;
  border-color: rgba(36, 35, 33, 0.08);
  border-radius: 12px;
  padding: 11px;
}

.overview-empty-inspector .planner-slot-context {
  background: #fff;
  border-color: rgba(36, 35, 33, 0.08);
  border-radius: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-empty-inspector .availability-mini {
  background: #fff;
  border-color: rgba(36, 35, 33, 0.08);
  border-radius: 14px;
}

.workspace .panel:not(.modal-panel):not(.lesson-modal-panel) {
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(36, 35, 33, 0.03);
}

@media (max-width: 1240px) {
  .requests-workbench,
  .students-workbench,
  .teachers-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(286px, 0.3fr);
  }

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

  .communications-workbench {
    height: auto;
    grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
    min-height: 0;
    overflow: visible;
  }

  .communication-inbox,
  .communication-thread,
  .communication-contact {
    height: auto;
    min-height: 360px;
  }

  .communication-contact {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .requests-workbench,
  .students-workbench,
  .teachers-workbench {
    grid-template-columns: 1fr;
  }

  .erp-toolbar {
    grid-template-columns: 1fr;
  }

  .erp-toolbar-action {
    justify-self: start;
  }

  .tasks-board,
  .communications-workbench {
    grid-template-columns: 1fr;
  }

  .communication-inbox,
  .communication-thread,
  .communication-contact {
    min-height: 320px;
  }

  .task-aside {
    position: static;
  }
}

@media (max-width: 640px) {
  .workspace > .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .erp-head-stats,
  .erp-head-stats .erp-stat-card,
  .erp-kpi-grid {
    width: 100%;
  }

  .erp-head-stats {
    justify-content: stretch;
  }

  .erp-kpi-grid {
    grid-template-columns: 1fr;
  }

  .erp-create-row {
    grid-template-columns: 1fr;
  }

  .channel-strip,
  .task-row,
  .communication-compose {
    grid-template-columns: 1fr;
  }

  .task-row-actions {
    justify-self: start;
  }

  .message-bubble {
    max-width: 100%;
  }
}

/* Studio ERP density pass: flat, table-first admin UI */
:root {
  --bg-page: #f6f7f9;
  --bg-surface: #ffffff;
  --bg-soft: #f3f4f6;
  --line: #e4e7ec;
  --muted: #697080;
  --shadow: none;
  --erp-sidebar: #f8fafc;
  --erp-border: #e5e7eb;
  --erp-muted: #6b7280;
  --erp-row-hover: #fafafa;
  --erp-active: rgba(201, 31, 38, 0.08);
}

body {
  background: var(--bg-page);
}

.admin-shell {
  max-width: none;
  min-height: 100dvh;
  padding: 0;
}

.admin-layout {
  align-items: stretch;
  display: grid;
  gap: 0;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100dvh;
}

.admin-layout > .mobile-menu-button {
  display: none;
}

.admin-nav {
  align-content: stretch;
  background: var(--erp-sidebar);
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--erp-border);
  box-shadow: none;
  gap: 14px;
  height: 100dvh;
  overflow-y: auto;
  padding: 16px 12px;
  top: 0;
}

.admin-nav::before {
  display: none;
}

.sidebar-brand-lockup {
  border-bottom: 1px solid var(--erp-border);
  display: grid;
  gap: 10px;
  grid-template-columns: 36px minmax(0, 1fr);
  margin: -2px -2px 4px;
  padding: 0 2px 16px;
  position: relative;
  z-index: 1;
}

.sidebar-brand-mark {
  align-items: center;
  background: var(--brand-red);
  border-radius: 12px;
  color: #fff;
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.sidebar-brand-lockup strong,
.sidebar-brand-lockup small {
  display: block;
  min-width: 0;
}

.sidebar-brand-lockup strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.1;
}

.sidebar-brand-lockup small {
  color: var(--erp-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  margin-top: 2px;
}

.sidebar-calendar-mini {
  display: none;
}

.sidebar-nav-list {
  gap: 2px;
}

.nav-tab {
  align-items: center;
  border-radius: 10px;
  color: var(--erp-muted);
  display: grid;
  gap: 10px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  min-height: 42px;
  padding: 8px 10px;
}

.nav-tab:hover,
.nav-tab:focus-visible {
  background: #eef1f5;
  color: var(--ink);
  outline: 0;
}

.nav-tab.active {
  background: var(--erp-active);
  color: var(--brand-red);
}

.nav-icon {
  align-items: center;
  display: inline-flex;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.nav-icon svg {
  height: 17px;
  width: 17px;
}

.nav-copy {
  display: grid;
  gap: 0;
  min-width: 0;
}

.nav-tab span {
  font-size: 14px;
  font-weight: 760;
}

.nav-tab small {
  display: none;
}

.nav-badge {
  align-items: center;
  background: #eef0f4;
  border-radius: 999px;
  color: var(--erp-muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  height: 22px;
  justify-content: center;
  min-width: 22px;
  padding: 0 7px;
}

.nav-tab.active .nav-badge {
  background: var(--brand-red);
  color: #fff;
}

.workspace {
  background: var(--bg-page);
  min-height: 100dvh;
  overflow: visible;
  padding: 20px 24px 28px;
}

.workspace-enter {
  animation: none;
}

.workspace > .page-head,
.overview-planner-head {
  align-items: center;
  background: transparent;
  border-bottom: 1px solid var(--erp-border);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 0 16px;
  min-height: 72px;
  padding: 0 0 16px;
}

.workspace > .page-head .title,
.overview-planner-head h1 {
  font-size: clamp(28px, 2.4vw, 36px);
  font-weight: 780;
  line-height: 1.08;
}

.workspace > .page-head .lead,
.overview-planner-head p:not(.kicker) {
  color: var(--erp-muted);
  font-size: 14px;
  line-height: 1.35;
  margin-top: 6px;
  max-width: 760px;
}

.kicker {
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 1.8px;
  margin-bottom: 6px;
}

.panel,
.metric-card,
.overview-stat,
.erp-stat-card,
.work-summary-card,
.calendar-panel,
.overview-inspector,
.slot-side-card,
.slot-command-panel,
.slot-selected-mode {
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  box-shadow: none;
}

.panel {
  padding: 16px;
}

.section-title,
.item-title {
  font-size: 18px;
  font-weight: 760;
  line-height: 1.16;
}

.meta {
  color: var(--erp-muted);
  font-size: 13px;
  line-height: 1.35;
}

.btn {
  border-radius: 10px;
  font-size: 14px;
  font-weight: 760;
  min-height: 40px;
}

.btn.compact {
  min-height: 34px;
  padding: 7px 11px;
}

.input,
.textarea {
  background: #fff;
  border-color: var(--erp-border);
  border-radius: 10px;
}

.erp-tabs {
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.erp-tabs button {
  border-radius: 10px;
  font-size: 14px;
  min-height: 36px;
  padding: 8px 12px;
}

.erp-toolbar {
  grid-template-columns: minmax(260px, 400px) minmax(0, 1fr) auto;
}

.erp-search {
  background: #eff1f4;
  border-radius: 10px;
  min-height: 38px;
}

.erp-filter-pill,
.filter-chip,
.note-chip,
.badge,
.erp-status {
  border-radius: 999px;
  font-size: 12px;
  min-height: 26px;
  padding: 6px 10px;
}

.erp-head-stats,
.metric-grid,
.overview-stats,
.work-summary-grid {
  gap: 8px;
}

.erp-stat-card,
.metric-card,
.overview-stat,
.work-summary-card {
  align-items: center;
  display: grid;
  gap: 8px;
  min-height: 74px;
  padding: 12px 14px;
}

.metric-card,
.overview-stat {
  grid-template-columns: 36px minmax(0, 1fr);
}

.metric-icon {
  border-radius: 10px;
  height: 36px;
  width: 36px;
}

.metric-icon svg {
  height: 18px;
  width: 18px;
}

.metric-card strong,
.overview-stat strong,
.erp-stat-card strong,
.work-summary-card strong {
  font-size: 24px;
  font-weight: 780;
}

.metric-card > div > span,
.overview-stat > div > span,
.erp-stat-card span,
.work-summary-card span {
  font-size: 13px;
  font-weight: 760;
}

.metric-card small,
.overview-stat small,
.erp-stat-card small,
.work-summary-card small {
  color: var(--erp-muted);
  font-size: 12px;
}

.requests-workbench,
.students-workbench,
.teachers-workbench,
.tasks-board {
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: 14px;
  gap: 0;
  grid-template-columns: minmax(0, 1fr) 320px;
  overflow: hidden;
}

.requests-workbench > .erp-table,
.students-workbench > .erp-table,
.teachers-workbench .erp-table,
.task-list {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.erp-table {
  border-radius: 12px;
}

.erp-table-head {
  background: #f2f4f7;
  color: var(--erp-muted);
  min-height: 40px;
}

.erp-table-row {
  min-height: 60px;
  padding: 10px 14px;
}

.overview-inspector,
.task-aside,
.communication-contact {
  background: #fff;
  border: 0;
  border-left: 1px solid var(--erp-border);
  border-radius: 0;
  box-shadow: none;
  max-height: none;
  min-height: 100%;
  padding: 16px;
  position: sticky;
  top: 0;
}

.inspector-head h2 {
  font-size: 22px;
  font-weight: 780;
}

.inspector-detail-list div,
.slot-client-meta span,
.lesson-service-card,
.lesson-payment-card,
.availability-mini,
.slot-side-card,
.slot-selected-mode,
.planner-slot-context,
.slot-command-panel {
  background: #fafafa;
  border: 1px solid var(--erp-border);
  border-radius: 10px;
}

.tasks-board .task-aside {
  border-left: 1px solid var(--erp-border);
}

.task-list {
  background: #fff;
  display: grid;
  gap: 0;
}

.task-list::before {
  background: #f2f4f7;
  border-bottom: 1px solid var(--erp-border);
  color: var(--erp-muted);
  content: "Задача                                      Статус           Ответственный          Действие";
  display: block;
  font-size: 12px;
  font-weight: 820;
  min-height: 40px;
  padding: 12px 16px 0;
  white-space: pre;
}

.task-row {
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--erp-border);
  border-radius: 0;
  grid-template-columns: minmax(0, 1fr) 116px minmax(116px, 0.22fr) auto;
  min-height: 64px;
  padding: 10px 16px;
}

.task-row:last-child {
  border-bottom: 0;
}

.task-row:hover {
  background: var(--erp-row-hover);
}

.task-row.priority-high {
  border-color: var(--erp-border);
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.82);
}

.task-row h3 {
  font-size: 15px;
  font-weight: 760;
}

.task-row p:not(.kicker),
.task-row > strong {
  font-size: 12px;
}

.communications-workbench {
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: 14px;
  gap: 0;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  height: calc(100dvh - 184px);
  min-height: 520px;
  overflow: hidden;
}

.communication-inbox,
.communication-thread,
.communication-contact {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.communication-inbox {
  background: #fbfcfd;
  border-right: 1px solid var(--erp-border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.communication-thread {
  background: #fff;
  border-left: 0;
  border-right: 1px solid var(--erp-border);
  min-width: 0;
}

.communication-list {
  overflow: auto;
}

.communication-contact {
  overflow: auto;
  position: static;
  top: auto;
}

.communication-item {
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px;
}

.communication-item.active,
.communication-item:hover,
.communication-item:focus-visible {
  background: #f1f3f6;
  border-color: transparent;
}

.channel-strip {
  display: none;
}

.message-bubble {
  border-radius: 14px;
}

.message-bubble.outgoing {
  background: #ef6b6f;
  color: #fff;
}

.analytics-grid {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  margin-bottom: 12px;
}

.analytics-grid .metric-card {
  border-radius: 10px;
  min-height: 82px;
}

.analytics-grid .metric-icon {
  display: none;
}

.analytics-grid .metric-card {
  grid-template-columns: 1fr;
}

.analytics-panels,
.broadcast-grid,
.event-editor-grid {
  gap: 12px;
}

.count-list {
  gap: 0;
}

.count-row,
.broadcast-history-item,
.event-row {
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--erp-border);
  border-radius: 0;
  padding: 12px 0;
}

.count-row:last-child,
.broadcast-history-item:last-child,
.event-row:last-child {
  border-bottom: 0;
}

.broadcast-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.broadcast-history-panel {
  grid-column: 1 / -1;
}

.message-box {
  background: #f8fafc;
  border-color: var(--erp-border);
  border-radius: 10px;
}

.overview-planner-page {
  display: grid;
  gap: 14px;
}

.overview-status-strip {
  gap: 8px;
}

.overview-status-item {
  border-radius: 10px;
  min-height: 42px;
  padding: 8px 10px;
}

.overview-focus-strip,
.overview-team-strip,
.overview-resource-strip,
.overview-availability-strip,
.overview-request-strip,
.overview-membership-strip,
.overview-outside-strip,
.overview-attention-queue {
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: 14px;
  box-shadow: none;
  padding: 14px;
}

.overview-focus-grid,
.overview-resource-cards,
.overview-availability-gap-list,
.overview-request-list,
.overview-membership-list,
.overview-attention-list {
  gap: 0;
}

.overview-focus-card,
.availability-gap-card,
.resource-state-card,
.overview-request-card,
.membership-risk-card,
.outside-slot-card {
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--erp-border);
  border-radius: 0;
  box-shadow: none;
  min-height: 54px;
  padding: 10px 0;
}

.overview-focus-card:last-child,
.availability-gap-card:last-child,
.resource-state-card:last-child,
.overview-request-card:last-child,
.membership-risk-card:last-child,
.outside-slot-card:last-child {
  border-bottom: 0;
}

.overview-workbench,
.calendar-primary-workbench {
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: 14px;
  gap: 0;
  grid-template-columns: minmax(0, 1fr) 320px;
  overflow: hidden;
}

.overview-planner-grid {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.overview-planner-cell,
.overview-time-cell,
.overview-resource-head {
  border-color: var(--erp-border);
}

.overview-planner-cell-free {
  background: #fff;
}

.overview-planner-cell-free:hover,
.overview-planner-cell-free:focus-visible,
.overview-planner-cell-free.selected {
  background: rgba(201, 31, 38, 0.045);
}

.slot-inspector-hero {
  border-bottom-color: var(--erp-border);
  margin: -16px -16px 12px;
  padding: 14px 16px;
}

.slot-inspector-avatar {
  background: #4b7bec;
  border-radius: 999px;
  height: 42px;
  width: 42px;
}

.slot-inspector-hero h2 {
  font-size: 20px;
  font-weight: 780;
}

.slot-command-grid {
  gap: 0;
  grid-template-columns: 1fr;
}

.slot-command-grid .planner-action {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--erp-border);
  border-radius: 0;
  min-height: 50px;
  padding: 9px 0;
}

.slot-command-grid .planner-action:last-child {
  border-bottom: 0;
}

.slot-command-grid .planner-action:hover,
.slot-command-grid .planner-action:focus-visible,
.slot-command-grid .planner-action.active {
  background: transparent;
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.8);
  color: var(--brand-red);
  outline: 0;
  padding-left: 10px;
}

.work-summary-grid {
  display: none;
}

.work-schedule-panel {
  border-radius: 14px;
  gap: 12px;
}

.work-schedule-panel > .section-head {
  border-bottom: 1px solid var(--erp-border);
  padding-bottom: 12px;
}

.work-coverage-section {
  background: #fff;
  border-color: var(--erp-border);
  border-radius: 12px;
}

.work-coverage-head-prominent {
  background: #f8fafc;
  border-color: var(--erp-border);
  border-radius: 10px;
}

.work-coverage-card {
  background: #fff;
  border-color: var(--erp-border);
  border-radius: 10px;
  padding: 10px;
}

.work-schedule-scroll {
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  overflow: auto;
  padding: 0;
}

.work-schedule-grid {
  gap: 0;
  min-width: 1040px;
}

.work-schedule-month {
  min-width: max(1740px, calc(180px + var(--schedule-day-count, 31) * 132px));
}

.work-schedule-head,
.work-schedule-row {
  gap: 0;
  grid-template-columns: 180px repeat(var(--schedule-day-count, 7), minmax(120px, 1fr));
}

.work-schedule-month .work-schedule-head,
.work-schedule-month .work-schedule-row {
  gap: 0;
  grid-template-columns: 180px repeat(var(--schedule-day-count, 31), 132px);
}

.work-schedule-head {
  background: #f2f4f7;
}

.work-schedule-head > span,
.work-person,
.work-shift-cell {
  border: 0;
  border-bottom: 1px solid var(--erp-border);
  border-radius: 0;
  border-right: 1px solid var(--erp-border);
  min-height: 46px;
}

.work-schedule-row:last-child .work-person,
.work-schedule-row:last-child .work-shift-cell {
  border-bottom: 0;
}

.work-schedule-head > span {
  align-items: center;
  background: transparent;
  display: grid;
  justify-items: center;
  padding: 8px;
}

.work-person {
  background: #fbfcfd;
  gap: 4px;
  padding: 10px 12px;
}

.work-person strong {
  font-size: 15px;
  font-weight: 780;
}

.role-chip {
  font-size: 10px;
  padding: 5px 7px;
}

.work-shift-cell {
  background: #fff;
  padding: 0;
}

.work-shift-cell.active {
  background: #fff;
  box-shadow: inset 0 -2px 0 rgba(201, 31, 38, 0.22);
}

.work-shift-input {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  min-width: 116px;
  padding: 0 8px;
  white-space: nowrap;
}

.work-schedule-month .work-person,
.work-schedule-month .work-shift-cell {
  border-radius: 0;
  min-height: 42px;
}

.work-schedule-month .work-shift-input {
  font-size: 12px;
  min-width: 126px;
}

.event-editor-grid {
  grid-template-columns: 320px minmax(0, 1fr);
}

@media (max-width: 1240px) {
  .admin-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .requests-workbench,
  .students-workbench,
  .teachers-workbench,
  .tasks-board,
  .overview-workbench,
  .calendar-primary-workbench {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

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

@media (max-width: 980px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-layout > .mobile-menu-button {
    display: inline-flex;
    left: 14px;
    position: fixed;
    top: 14px;
    z-index: 70;
  }

  .admin-nav {
    bottom: 0;
    box-shadow: 18px 0 60px rgba(16, 24, 40, 0.18);
    height: 100dvh;
    left: 0;
    max-width: min(300px, calc(100vw - 56px));
    position: fixed;
    top: 0;
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    width: 300px;
    z-index: 60;
  }

  .sidebar-open .admin-nav {
    transform: translateX(0);
  }

  .workspace {
    padding: 76px 14px 24px;
  }

  .requests-workbench,
  .students-workbench,
  .teachers-workbench,
  .tasks-board,
  .communications-workbench,
  .overview-workbench,
  .calendar-primary-workbench,
  .broadcast-grid,
  .event-editor-grid {
    grid-template-columns: 1fr;
  }

  .overview-inspector,
  .task-aside,
  .communication-contact {
    border-left: 0;
    border-top: 1px solid var(--erp-border);
    min-height: auto;
    position: static;
  }

  .analytics-grid,
  .metric-grid,
  .overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .workspace > .page-head,
  .overview-planner-head {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .erp-toolbar,
  .task-row {
    grid-template-columns: 1fr;
  }

  .task-list::before {
    content: "Задачи";
  }

  .analytics-grid,
  .metric-grid,
  .overview-stats {
    grid-template-columns: 1fr;
  }
}

/* Remove remaining dashboard-card feel from dense ERP screens */
.tasks-board {
  grid-template-columns: 1fr;
}

.tasks-board .task-aside {
  display: none;
}

.metric-grid,
.analytics-grid,
.erp-kpi-grid,
.overview-stats {
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: 14px;
  display: grid;
  gap: 0;
  overflow: hidden;
}

.metric-card,
.analytics-grid .metric-card,
.erp-kpi-grid .erp-stat-card,
.overview-stat {
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--erp-border);
  min-height: 72px;
}

.metric-card:last-child,
.analytics-grid .metric-card:last-child,
.erp-kpi-grid .erp-stat-card:last-child,
.overview-stat:last-child {
  border-right: 0;
}

.erp-head-stats .erp-stat-card {
  border-radius: 10px;
  min-height: 58px;
  min-width: 112px;
  padding: 10px 12px;
}

.erp-head-stats .erp-stat-card strong {
  font-size: 22px;
}

.work-coverage-section {
  padding: 0;
}

.work-coverage-head-prominent {
  border: 0;
  border-bottom: 1px solid var(--erp-border);
  border-radius: 0;
  margin: 0;
}

.work-coverage-scroll {
  padding: 0;
}

.work-coverage-grid {
  gap: 0;
}

.work-coverage-card {
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--erp-border);
}

.work-coverage-card:last-child {
  border-right: 0;
}

.work-coverage-card strong {
  font-size: 22px;
}

.calendar-planner-days {
  border-radius: 14px;
  box-shadow: none;
}

.calendar-planner-days button {
  border-radius: 10px;
}

@media (max-width: 980px) {
  .metric-grid,
  .analytics-grid,
  .erp-kpi-grid,
  .overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card,
  .analytics-grid .metric-card,
  .erp-kpi-grid .erp-stat-card,
  .overview-stat {
    border-bottom: 1px solid var(--erp-border);
  }
}

@media (max-width: 640px) {
  .metric-grid,
  .analytics-grid,
  .erp-kpi-grid,
  .overview-stats {
    grid-template-columns: 1fr;
  }

  .metric-card,
  .analytics-grid .metric-card,
  .erp-kpi-grid .erp-stat-card,
  .overview-stat {
    border-right: 0;
  }
}

/* Keep the planner header out of the grid when cells receive focus. */
.overview-planner-head {
  position: static;
  z-index: auto;
}

.overview-planner-cell,
.overview-planner-event,
.overview-planner-cell-free {
  scroll-margin-top: 24px;
}

/* Interactive work schedule editor */
.work-schedule-workbench {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.work-schedule-inspector {
  border-radius: 14px;
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 16px;
  position: sticky;
  top: 20px;
}

.work-inspector-head {
  border-bottom: 1px solid var(--erp-border);
  display: grid;
  gap: 3px;
  margin: -16px -16px 14px;
  padding: 16px;
}

.work-inspector-head h2 {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.05;
}

.work-inspector-head span,
.work-inspector-block span {
  color: var(--erp-muted);
  font-size: 12px;
  font-weight: 680;
}

.work-inspector-block {
  border-bottom: 1px solid var(--erp-border);
  display: grid;
  gap: 10px;
  padding: 0 0 14px;
}

.work-inspector-block + .work-inspector-block {
  padding-top: 14px;
}

.work-inspector-block:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

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

.work-preset-grid button {
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  min-height: 38px;
  padding: 9px 10px;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}

.work-preset-grid button:hover,
.work-preset-grid button:focus-visible {
  background: rgba(201, 31, 38, 0.045);
  border-color: rgba(201, 31, 38, 0.28);
  outline: 0;
}

.work-preset-grid button.active {
  background: rgba(201, 31, 38, 0.08);
  border-color: rgba(201, 31, 38, 0.36);
  box-shadow: inset 3px 0 0 var(--brand-red);
  color: var(--brand-red);
}

.work-preset-grid button.danger {
  color: var(--erp-muted);
}

.work-preset-grid button.danger.active {
  background: #f8fafc;
  border-color: var(--erp-border);
  box-shadow: inset 3px 0 0 #98a2b3;
  color: #667085;
}

.work-inspector-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.work-shift-cell {
  cursor: text;
  position: relative;
}

.work-shift-cell:hover {
  background: rgba(201, 31, 38, 0.035);
}

.work-shift-cell.selected {
  background: rgba(201, 31, 38, 0.055);
  box-shadow:
    inset 0 0 0 2px rgba(201, 31, 38, 0.28),
    inset 0 -2px 0 rgba(201, 31, 38, 0.3);
}

.work-shift-cell.selected::after {
  background: var(--brand-red);
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 3px;
}

.work-schedule-head > span,
.work-schedule-head > span:not(:first-child) {
  align-items: center;
  background: #f2f4f7;
  border: 0;
  border-bottom: 1px solid var(--erp-border);
  border-radius: 0;
  border-right: 1px solid var(--erp-border);
  display: grid;
  justify-items: center;
  min-height: 46px;
  padding: 8px;
  text-align: center;
}

.work-schedule-head > span:first-child {
  justify-items: start;
}

@media (max-width: 1240px) {
  .work-schedule-workbench {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 980px) {
  .work-schedule-workbench {
    grid-template-columns: 1fr;
  }

  .work-schedule-inspector {
    max-height: none;
    position: static;
  }
}

/* Operations queue consolidation */
.operations-aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.operations-task-list {
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  display: grid;
  overflow: hidden;
}

.operations-task-item {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--admin-border);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 54px;
  padding: 9px 10px;
}

.operations-task-item:last-child {
  border-bottom: 0;
}

.operations-task-item.priority-high {
  box-shadow: inset 2px 0 0 rgba(201, 31, 38, 0.72);
}

.operations-task-item strong {
  color: var(--ink);
  display: block;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
}

.operations-task-item span {
  color: var(--admin-muted);
  display: block;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.25;
  margin-top: 2px;
}

.operations-task-item .btn {
  min-height: 28px;
  padding: 5px 8px;
}

.operations-hint {
  background: #fbfcfd;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.operations-hint strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
}

.operations-hint span {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.3;
}

@media (max-width: 980px) {
  .operations-task-item {
    grid-template-columns: 1fr;
  }
}

.overview-team-strip {
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  padding: 12px 14px;
}

.overview-team-head {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.overview-team-head .kicker {
  margin-bottom: 4px;
}

.overview-team-head h2 {
  font-size: 20px;
  font-weight: 860;
  line-height: 1.05;
}

.overview-team-body {
  display: grid;
  gap: 8px;
}

.overview-team-chips {
  border: 1px solid var(--erp-border);
  border-radius: 8px;
  display: grid;
  gap: 0;
  overflow: hidden;
}

.team-chip,
.team-chip-admin,
.team-chip-teacher,
.team-chip-vocal,
.team-chip-speech {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--erp-border);
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(130px, 0.8fr) minmax(170px, 1fr) minmax(120px, 0.6fr);
  min-height: 38px;
  padding: 8px 12px;
}

.team-chip:last-child {
  border-bottom: 0;
}

.team-chip strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 840;
  line-height: 1.15;
}

.team-chip span,
.team-chip em {
  color: var(--erp-muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.15;
}

.overview-role-coverage {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.overview-role-coverage span,
.overview-role-coverage .thin {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--erp-muted);
  font-size: 13px;
  font-weight: 760;
  padding: 0;
}

.overview-role-coverage strong {
  color: var(--brand-red);
  font-size: 18px;
  font-weight: 900;
}

/* Absolute final admin layout: keep this block last. */
.admin-layout {
  align-items: stretch;
  background: var(--admin-page, #f6f7f9);
  display: grid;
  gap: 0;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100dvh;
}

.admin-nav {
  align-content: start;
  align-items: stretch;
  background: #f8fafc;
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--admin-border, #e3e7ee);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100dvh;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 14px 10px 16px;
  position: sticky;
  top: 0;
}

.admin-nav::before,
.sidebar-calendar-mini,
.sidebar-brand-mark,
.sidebar-brand-lockup small {
  display: none;
}

.sidebar-brand-lockup {
  border-bottom: 1px solid var(--admin-border, #e3e7ee);
  display: block;
  margin: 0 0 8px;
  padding: 4px 4px 14px;
}

.sidebar-brand-lockup strong {
  color: var(--ink);
  display: block;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.sidebar-nav-list {
  align-content: start;
  display: grid;
  gap: 3px;
}

.nav-tab {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  color: var(--admin-muted, #687082);
  display: grid;
  gap: 9px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  min-height: 40px;
  padding: 8px 10px;
}

.nav-tab.active {
  background: var(--admin-active, rgba(201, 31, 38, 0.08));
  color: var(--brand-red);
}

.nav-copy > span {
  display: block;
  font-size: 14px;
  font-weight: 780;
  line-height: 1.12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-copy small {
  display: none;
}

.workspace {
  background: var(--admin-page, #f6f7f9);
  min-height: 100dvh;
  min-width: 0;
  overflow: visible;
  padding: 14px 16px 24px;
}

.workspace > .page-head,
.overview-planner-head {
  align-items: end;
  border-bottom: 1px solid var(--admin-border, #e3e7ee);
  gap: 14px;
  margin: 0 0 12px;
  min-height: 0;
  padding: 0 0 10px;
}

.workspace > .page-head .title,
.overview-planner-head h1 {
  font-size: clamp(23px, 1.6vw, 30px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
}

.workspace > .page-head .lead,
.overview-planner-head p:not(.kicker) {
  color: var(--admin-muted, #687082);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 4px;
  max-width: 880px;
}

.erp-head-stats,
.overview-status-strip,
.overview-focus-strip,
.overview-stats,
.metric-grid,
.analytics-grid,
.erp-kpi-grid {
  display: none;
}

.overview-team-strip,
.overview-resource-strip,
.overview-request-strip,
.overview-attention-queue,
.overview-workbench,
.calendar-primary-workbench,
.requests-workbench,
.students-workbench,
.teachers-workbench,
.tasks-board,
.communications-workbench,
.analytics-summary-table {
  background: #fff;
  border: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 12px;
  box-shadow: none;
}

.overview-team-strip,
.overview-resource-strip,
.overview-request-strip,
.overview-attention-queue {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  padding: 12px 14px;
}

.overview-team-head,
.overview-section-head,
.overview-attention-head {
  align-items: end;
  border-bottom: 1px solid var(--admin-border, #e3e7ee);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding-bottom: 8px;
}

.overview-team-head h2,
.overview-section-head h2,
.overview-attention-head h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 880;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

.overview-team-chips,
.overview-row-table,
.overview-resource-cards,
.overview-request-list,
.overview-attention-list {
  border: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 9px;
  display: grid;
  gap: 0;
  overflow: hidden;
}

.team-chip,
.team-chip-admin,
.team-chip-teacher,
.team-chip-vocal,
.team-chip-speech,
.resource-state-card,
.overview-request-card,
.attention-item,
.resource-state-card.free,
.resource-state-card.busy,
.resource-state-card.upcoming,
.resource-state-card.closed {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
  display: grid;
  gap: 10px;
  min-height: 46px;
  min-width: 0;
  padding: 9px 12px;
  text-align: left;
  transform: none;
  width: 100%;
}

.team-chip,
.team-chip-admin,
.team-chip-teacher,
.team-chip-vocal,
.team-chip-speech {
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1fr) minmax(130px, 0.55fr);
}

.resource-state-card,
.overview-request-card,
.attention-item,
.resource-state-card.free,
.resource-state-card.busy,
.resource-state-card.upcoming,
.resource-state-card.closed {
  grid-template-columns: minmax(126px, 0.82fr) minmax(170px, 1fr) minmax(160px, 1fr) minmax(88px, 0.42fr);
}

.team-chip:last-child,
.resource-state-card:last-child,
.overview-request-card:last-child,
.attention-item:last-child {
  border-bottom: 0;
}

.team-chip:hover,
.resource-state-card:hover,
.overview-request-card:hover,
.attention-item:hover,
.resource-state-card:focus-visible,
.overview-request-card:focus-visible,
.attention-item:focus-visible,
.resource-state-card.active,
.overview-request-card.active,
.attention-item.active {
  background: var(--admin-row-hover, #f9fafb);
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.72);
  outline: 0;
}

.team-chip strong,
.resource-state-card strong,
.overview-request-card strong,
.attention-item strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 860;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-chip span,
.team-chip em,
.resource-state-card span,
.resource-state-card small,
.overview-request-card small,
.attention-item span {
  color: var(--admin-muted, #687082);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.22;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resource-state-status,
.overview-request-card > span,
.attention-kind {
  color: var(--brand-red);
  font-size: 11px;
  font-style: normal;
  font-weight: 860;
  letter-spacing: 0.7px;
  line-height: 1.15;
  text-transform: uppercase;
}

.resource-state-card b,
.overview-request-card em,
.attention-action-label {
  color: var(--brand-red);
  font-size: 13px;
  font-style: normal;
  font-weight: 860;
  justify-self: end;
  line-height: 1.2;
}

.overview-role-coverage,
.overview-attention-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.overview-role-coverage span,
.overview-role-coverage .thin,
.attention-summary-chip {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--admin-muted, #687082);
  padding: 0;
}

.overview-role-coverage strong,
.attention-summary-chip b {
  color: var(--brand-red);
  font-size: 17px;
  font-weight: 900;
}

.overview-workbench,
.calendar-primary-workbench {
  gap: 0;
  grid-template-columns: minmax(0, 1fr) 318px;
  min-height: calc(100dvh - 188px);
  overflow: hidden;
}

.requests-workbench,
.students-workbench,
.teachers-workbench {
  gap: 0;
  grid-template-columns: minmax(0, 1fr) 330px;
  overflow: hidden;
}

.student-table-row {
  grid-template-columns:
    minmax(200px, 1.3fr)
    minmax(160px, 1fr)
    minmax(126px, 0.7fr)
    minmax(150px, 0.9fr)
    72px;
}

.request-table-row {
  grid-template-columns:
    minmax(124px, 0.68fr)
    minmax(156px, 0.9fr)
    minmax(128px, 0.72fr)
    minmax(210px, 1.25fr)
    72px;
}

.overview-inspector,
.work-schedule-inspector,
.student-inspector,
.request-inspector,
.teacher-inspector {
  border-bottom: 0;
  border-left: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 0;
  border-right: 0;
  border-top: 0;
  box-shadow: none;
  min-width: 0;
  padding: 16px;
}

.communications-workbench {
  display: grid;
  gap: 0;
  grid-template-columns: 282px minmax(0, 1fr) 318px;
  height: calc(100dvh - 104px);
  min-height: 560px;
  overflow: hidden;
}

.communication-inbox {
  background: #fbfcfd;
  border-right: 1px solid var(--admin-border, #e3e7ee);
}

.communication-thread {
  border-right: 1px solid var(--admin-border, #e3e7ee);
}

.analytics-summary-table {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 12px;
  overflow: hidden;
}

.analytics-summary-table div {
  align-items: start;
  border-bottom: 0;
  border-right: 1px solid var(--admin-border, #e3e7ee);
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr);
  min-height: 72px;
  padding: 12px 14px;
}

.analytics-summary-table span,
.analytics-summary-table strong,
.analytics-summary-table em {
  min-width: 0;
}

.analytics-summary-table strong {
  overflow-wrap: anywhere;
}

/* Final mobile admin override: keep operational toolbar chips compact. */
@media (max-width: 640px) {
  .erp-toolbar .erp-toolbar-filters {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .erp-toolbar .erp-filter-pill {
    background: #fff;
    border: 1px solid var(--admin-border, #dde3ec);
    border-radius: 999px;
    color: var(--admin-muted, #687082);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 850;
    min-height: 28px;
    padding: 5px 8px;
    width: auto;
  }

  .erp-toolbar .erp-filter-pill + .erp-filter-pill::before {
    content: none;
    margin-right: 0;
  }

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

  .analytics-summary-table div,
  .analytics-summary-table div:nth-child(3n),
  .analytics-summary-table div:last-child {
    border-right: 1px solid var(--admin-border, #e3e7ee);
    min-height: 68px;
    padding: 9px 10px;
  }

  .analytics-summary-table div:nth-child(2n) {
    border-right: 0;
  }

  .analytics-summary-table div:nth-child(n + 3) {
    border-top: 1px solid var(--admin-border, #e3e7ee);
  }

  .teachers-workbench .teacher-table {
    order: 1;
  }

  .teachers-workbench .teacher-create-row {
    order: 2;
  }

  .teachers-workbench .overview-inspector {
    order: 1;
  }

  .teachers-workbench .teacher-list {
    order: 2;
  }
}

.client-detail-panel {
  position: relative;
}

.client-detail-close {
  align-items: center;
  background: #fff;
  border: 1px solid var(--admin-border, #dde3ec);
  border-radius: 999px;
  color: var(--ink, #242321);
  display: none;
  font-size: 22px;
  font-weight: 760;
  height: 36px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 36px;
}

@media (max-width: 640px) {
  .erp-toolbar-filters {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .erp-filter-pill {
    background: #fff;
    border: 1px solid var(--admin-border, #dde3ec);
    border-radius: 999px;
    color: var(--admin-muted, #687082);
    display: inline-flex;
    font-size: 11px;
    font-weight: 850;
    min-height: 28px;
    padding: 5px 8px;
    width: auto;
  }

  .erp-filter-pill + .erp-filter-pill::before {
    content: none;
    margin-right: 0;
  }

  .teachers-workbench .teacher-table {
    order: 1;
  }

  .teachers-workbench .teacher-create-row {
    order: 2;
  }

  .teachers-workbench .overview-inspector {
    order: 1;
  }

  .teachers-workbench .teacher-list {
    order: 2;
  }
}

.analytics-summary-table div:last-child {
  border-right: 0;
}

.tasks-board {
  gap: 0;
  overflow: hidden;
}

.task-column {
  border-right: 1px solid var(--admin-border, #e3e7ee);
  padding: 14px;
}

.task-column:last-child {
  border-right: 0;
}

@media (max-width: 1360px) {
  .admin-layout {
    grid-template-columns: 208px minmax(0, 1fr);
  }

  .workspace {
    padding: 12px 14px 22px;
  }

  .communications-workbench {
    grid-template-columns: 264px minmax(0, 1fr) 300px;
  }

  .overview-workbench,
  .calendar-primary-workbench {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 1120px) {
  .admin-layout {
    grid-template-columns: 196px minmax(0, 1fr);
  }

  .requests-workbench,
  .students-workbench,
  .teachers-workbench,
  .communications-workbench,
  .overview-workbench,
  .calendar-primary-workbench {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .overview-inspector,
  .work-schedule-inspector,
  .student-inspector,
  .request-inspector,
  .teacher-inspector,
  .communication-contact {
    border-left: 0;
    border-top: 1px solid var(--admin-border, #e3e7ee);
  }

  .analytics-summary-table {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-summary-table div:nth-child(3n) {
    border-right: 0;
  }

  .analytics-summary-table div:nth-child(n + 4) {
    border-top: 1px solid var(--admin-border, #e3e7ee);
  }
}

@media (max-width: 980px) {
  .admin-layout {
    display: block;
  }

  .admin-layout > .mobile-menu-button {
    display: inline-flex;
    left: 12px;
    position: fixed;
    top: 12px;
    z-index: 60;
  }

  .admin-nav {
    box-shadow: 24px 0 50px rgba(15, 23, 42, 0.14);
    left: 0;
    max-width: min(82vw, 300px);
    position: fixed;
    top: 0;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    width: 300px;
    z-index: 55;
  }

  .sidebar-open .admin-nav {
    transform: translateX(0);
  }

  .workspace {
    padding: 72px 12px 20px;
  }

  .workspace > .page-head,
  .overview-planner-head,
  .overview-team-head,
  .overview-section-head,
  .overview-attention-head {
    align-items: start;
    flex-direction: column;
  }

  .overview-role-coverage,
  .overview-attention-summary {
    justify-content: flex-start;
  }

  .team-chip,
  .resource-state-card,
  .overview-request-card,
  .attention-item,
  .student-table-row,
  .request-table-row,
  .teacher-table-row {
    grid-template-columns: 1fr;
  }

  .resource-state-card b,
  .overview-request-card em,
  .attention-action-label {
    justify-self: start;
  }

  .erp-table-head {
    display: none;
  }

  .analytics-summary-table {
    grid-template-columns: 1fr;
  }

  .analytics-summary-table div,
  .analytics-summary-table div:nth-child(3n),
  .analytics-summary-table div:last-child {
    border-right: 0;
  }

  .analytics-summary-table div + div {
    border-top: 1px solid var(--admin-border, #e3e7ee);
  }
}

@media (max-width: 640px) {
  .workspace {
    padding-left: 10px;
    padding-right: 10px;
  }

  .workspace > .page-head .title,
  .overview-planner-head h1 {
    font-size: 24px;
  }
}

@media (max-width: 980px) {
  .overview-planner-shell {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .overview-planner-grid {
    min-width: 720px;
  }

  body {
    overflow-x: hidden;
  }
}

/* Kover admin polish 2026-06-15: one final layout layer over legacy blocks. */
:root {
  --admin-page: #f6f7f9;
  --admin-surface: #ffffff;
  --admin-soft: #f2f4f7;
  --admin-border: #e3e7ee;
  --admin-border-strong: #d8dde6;
  --admin-muted: #687082;
  --admin-muted-soft: #8a92a1;
  --admin-row-hover: #f9fafb;
  --admin-active: rgba(201, 31, 38, 0.08);
}

body {
  background: var(--admin-page);
  color: var(--ink);
}

.admin-shell {
  background: var(--admin-page);
  min-height: 100dvh;
  padding: 0;
}

.admin-layout {
  align-items: stretch;
  background: var(--admin-page);
  display: grid;
  gap: 0;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100dvh;
  width: 100%;
}

.admin-layout > .mobile-menu-button {
  display: none;
}

.admin-nav {
  align-content: start;
  align-items: stretch;
  background: #f8fafc;
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--admin-border);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100dvh;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 14px 10px 16px;
  position: sticky;
  top: 0;
}

.admin-nav::before,
.sidebar-calendar-mini,
.sidebar-brand-mark,
.sidebar-brand-lockup small {
  display: none;
}

.sidebar-brand-lockup {
  border-bottom: 1px solid var(--admin-border);
  display: block;
  margin: 0 0 8px;
  padding: 4px 4px 14px;
  position: relative;
  z-index: 1;
}

.sidebar-brand-lockup strong {
  color: var(--ink);
  display: block;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.sidebar-nav-list {
  align-content: start;
  display: grid;
  gap: 3px;
}

.nav-tab {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  color: var(--admin-muted);
  display: grid;
  gap: 9px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  min-height: 40px;
  padding: 8px 10px;
  position: relative;
  z-index: 1;
}

.nav-tab:hover,
.nav-tab:focus-visible {
  background: #edf0f4;
  color: var(--ink);
  outline: 0;
}

.nav-tab.active {
  background: var(--admin-active);
  color: var(--brand-red);
}

.nav-icon,
.nav-icon svg {
  height: 18px;
  width: 18px;
}

.nav-icon {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.nav-copy {
  display: block;
  min-width: 0;
}

.nav-copy > span {
  display: block;
  font-size: 14px;
  font-weight: 780;
  line-height: 1.12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-copy small {
  display: none;
}

.nav-badge {
  align-items: center;
  background: #edf0f4;
  border-radius: 999px;
  color: var(--admin-muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 860;
  height: 22px;
  justify-content: center;
  min-width: 22px;
  padding: 0 7px;
}

.nav-tab.active .nav-badge {
  background: var(--brand-red);
  color: #fff;
}

.workspace {
  background: var(--admin-page);
  min-height: 100dvh;
  min-width: 0;
  overflow: visible;
  padding: 14px 16px 24px;
}

.workspace-enter {
  animation: none;
}

.workspace > .page-head,
.overview-planner-head {
  align-items: end;
  background: transparent;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin: 0 0 12px;
  min-height: 0;
  padding: 0 0 10px;
}

.workspace > .page-head > div:first-child,
.overview-planner-head > div:first-child {
  min-width: 0;
}

.workspace > .page-head .kicker,
.overview-planner-head .kicker,
.overview-team-head .kicker,
.overview-section-head .kicker,
.overview-attention-head .kicker,
.panel .kicker {
  color: var(--brand-red);
  font-size: 10px;
  font-weight: 860;
  letter-spacing: 2px;
  line-height: 1.1;
  margin: 0 0 3px;
}

.workspace > .page-head .title,
.overview-planner-head h1 {
  color: var(--ink);
  font-size: clamp(23px, 1.6vw, 30px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

.workspace > .page-head .lead,
.overview-planner-head p:not(.kicker) {
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin: 4px 0 0;
  max-width: 880px;
}

.erp-head-stats,
.overview-status-strip,
.overview-focus-strip,
.overview-stats,
.metric-grid,
.analytics-grid,
.erp-kpi-grid {
  display: none;
}

.panel,
.metric-card,
.overview-stat,
.erp-stat-card,
.work-summary-card,
.calendar-panel,
.overview-inspector,
.slot-side-card,
.slot-command-panel,
.slot-selected-mode,
.overview-team-strip,
.overview-resource-strip,
.overview-availability-strip,
.overview-request-strip,
.overview-membership-strip,
.overview-outside-strip,
.overview-attention-queue,
.overview-workbench,
.calendar-primary-workbench,
.requests-workbench,
.students-workbench,
.teachers-workbench,
.tasks-board,
.communications-workbench,
.analytics-summary-table {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  box-shadow: none;
}

.overview-planner-page {
  display: grid;
  gap: 12px;
}

.overview-workbench,
.calendar-primary-workbench {
  gap: 0;
  grid-template-columns: minmax(0, 1fr) 318px;
  min-height: calc(100dvh - 188px);
  overflow: hidden;
}

.overview-planner-grid {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.overview-planner-cell,
.overview-time-cell,
.overview-resource-head,
.overview-planner-corner,
.overview-planner-time {
  border-color: var(--admin-border);
}

.overview-team-strip,
.overview-resource-strip,
.overview-request-strip,
.overview-attention-queue {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  padding: 12px 14px;
}

.overview-team-head,
.overview-section-head,
.overview-attention-head {
  align-items: end;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding-bottom: 8px;
}

.overview-team-head h2,
.overview-section-head h2,
.overview-attention-head h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 880;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

.overview-section-head > span,
.overview-attention-head span,
.overview-team-head span,
.overview-role-coverage span {
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.2;
}

.overview-team-body {
  display: grid;
  gap: 10px;
}

.overview-team-chips,
.overview-row-table,
.overview-resource-cards,
.overview-request-list,
.overview-attention-list {
  border: 1px solid var(--admin-border);
  border-radius: 9px;
  display: grid;
  gap: 0;
  overflow: hidden;
}

.team-chip,
.team-chip-admin,
.team-chip-teacher,
.team-chip-vocal,
.team-chip-speech,
.resource-state-card,
.overview-request-card,
.attention-item {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--admin-border);
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(126px, 0.82fr) minmax(170px, 1fr) minmax(160px, 1fr) minmax(88px, 0.42fr);
  min-height: 46px;
  min-width: 0;
  padding: 9px 12px;
  text-align: left;
  width: 100%;
}

.team-chip {
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1fr) minmax(130px, 0.55fr);
}

.team-chip:last-child,
.resource-state-card:last-child,
.overview-request-card:last-child,
.attention-item:last-child {
  border-bottom: 0;
}

.team-chip:hover,
.resource-state-card:hover,
.overview-request-card:hover,
.attention-item:hover,
.team-chip:focus-visible,
.resource-state-card:focus-visible,
.overview-request-card:focus-visible,
.attention-item:focus-visible {
  background: var(--admin-row-hover);
  outline: 0;
}

.resource-state-card.active,
.overview-request-card.active,
.attention-item.active {
  background: var(--admin-active);
}

.team-chip strong,
.resource-state-card strong,
.overview-request-card strong,
.attention-item strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 860;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-chip span,
.team-chip em,
.resource-state-card span,
.resource-state-card small,
.overview-request-card small,
.attention-item span {
  color: var(--admin-muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.22;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resource-state-status,
.overview-request-card > span,
.attention-kind {
  color: var(--brand-red);
  font-size: 11px;
  font-style: normal;
  font-weight: 860;
  letter-spacing: 0.7px;
  line-height: 1.15;
  text-transform: uppercase;
}

.resource-state-card b,
.overview-request-card em,
.attention-action-label {
  color: var(--brand-red);
  font-size: 13px;
  font-style: normal;
  font-weight: 860;
  justify-self: end;
  line-height: 1.2;
}

.overview-role-coverage,
.overview-attention-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.overview-role-coverage span,
.overview-role-coverage .thin,
.attention-summary-chip {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--admin-muted);
  padding: 0;
}

.overview-role-coverage strong,
.attention-summary-chip b {
  color: var(--brand-red);
  font-size: 17px;
  font-weight: 900;
}

.overview-empty.compact {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--admin-muted);
  padding: 10px 0;
}

.overview-coverage-warnings {
  display: grid;
  gap: 0;
}

.coverage-warning {
  align-items: center;
  background: #fff8f8;
  border: 1px solid #f0c7c9;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-height: 44px;
  padding: 9px 12px;
  text-align: left;
}

.overview-resource-strip {
  align-items: stretch;
}

.resource-state-card.free {
  background: #fbfdf8;
}

.resource-state-card.busy {
  background: #fff;
}

.resource-state-card.has-conflict {
  background: #fff5f5;
}

.requests-workbench,
.students-workbench,
.teachers-workbench {
  align-items: stretch;
  gap: 0;
  grid-template-columns: minmax(0, 1fr) 330px;
  overflow: hidden;
}

.requests-workbench > .erp-table,
.students-workbench > .erp-table,
.teachers-workbench > .erp-table {
  border: 0;
  border-radius: 0;
}

.erp-table-head,
.erp-table-row,
.student-table-row,
.request-table-row,
.teacher-table-row {
  min-width: 0;
}

.erp-table-head {
  background: #f5f6f8;
  border-bottom: 1px solid var(--admin-border);
  color: var(--admin-muted);
  font-size: 12px;
  min-height: 42px;
  padding: 10px 14px;
}

.erp-table-row {
  border-bottom: 1px solid var(--admin-border);
  min-height: 58px;
  padding: 10px 14px;
}

.erp-table-row:hover,
.erp-table-row:focus-visible {
  background: var(--admin-row-hover);
  outline: 0;
}

.student-table-row {
  grid-template-columns:
    minmax(200px, 1.3fr)
    minmax(160px, 1fr)
    minmax(126px, 0.7fr)
    minmax(150px, 0.9fr)
    72px;
}

.request-table-row {
  grid-template-columns:
    minmax(124px, 0.68fr)
    minmax(156px, 0.9fr)
    minmax(128px, 0.72fr)
    minmax(210px, 1.25fr)
    72px;
}

.overview-inspector,
.work-schedule-inspector,
.student-inspector,
.request-inspector,
.teacher-inspector {
  border-bottom: 0;
  border-left: 1px solid var(--admin-border);
  border-radius: 0;
  border-right: 0;
  border-top: 0;
  box-shadow: none;
  min-width: 0;
  padding: 16px;
}

.communications-workbench {
  display: grid;
  gap: 0;
  grid-template-columns: 282px minmax(0, 1fr) 318px;
  height: calc(100dvh - 104px);
  min-height: 560px;
  overflow: hidden;
}

.communication-inbox,
.communication-thread,
.communication-contact {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
}

.communication-inbox {
  background: #fbfcfd;
  border-right: 1px solid var(--admin-border);
}

.communication-thread {
  border-right: 1px solid var(--admin-border);
}

.communication-contact {
  background: #fff;
  overflow: auto;
}

.communication-item {
  border-radius: 8px;
  padding: 9px 10px;
}

.communication-item.active,
.communication-item:hover,
.communication-item:focus-visible {
  background: #f0f3f7;
  outline: 0;
}

.message-bubble {
  border-radius: 12px;
  max-width: min(78%, 520px);
}

.message-bubble.outgoing {
  background: #ef6b6f;
  color: #fff;
}

.message-box {
  background: #f8fafc;
  border-color: var(--admin-border);
  border-radius: 9px;
}

.analytics-summary-table {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 12px;
  overflow: hidden;
}

.analytics-summary-table div {
  align-items: start;
  border-bottom: 0;
  border-right: 1px solid var(--admin-border);
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 12px 14px;
}

.analytics-summary-table div:last-child {
  border-right: 0;
}

.analytics-summary-table span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
}

.analytics-summary-table strong {
  color: var(--brand-red);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.analytics-summary-table em {
  color: var(--admin-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.2;
}

.analytics-panels,
.broadcast-grid,
.event-editor-grid {
  gap: 12px;
}

.analytics-panels .panel,
.broadcast-grid .panel,
.event-editor-grid .panel {
  border-radius: 12px;
}

.tasks-board {
  gap: 0;
  overflow: hidden;
}

.task-column {
  border-right: 1px solid var(--admin-border);
  padding: 14px;
}

.task-column:last-child {
  border-right: 0;
}

.task-card {
  border-radius: 9px;
  box-shadow: none;
}

@media (max-width: 1360px) {
  .admin-layout {
    grid-template-columns: 208px minmax(0, 1fr);
  }

  .workspace {
    padding: 12px 14px 22px;
  }

  .communications-workbench {
    grid-template-columns: 264px minmax(0, 1fr) 300px;
  }

  .overview-workbench,
  .calendar-primary-workbench {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .team-chip,
  .resource-state-card,
  .overview-request-card,
  .attention-item {
    grid-template-columns: minmax(112px, 0.78fr) minmax(148px, 1fr) minmax(132px, 0.9fr) minmax(72px, 0.38fr);
  }
}

@media (max-width: 1120px) {
  .admin-layout {
    grid-template-columns: 196px minmax(0, 1fr);
  }

  .nav-copy > span {
    font-size: 13px;
  }

  .requests-workbench,
  .students-workbench,
  .teachers-workbench,
  .communications-workbench,
  .overview-workbench,
  .calendar-primary-workbench {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .overview-inspector,
  .work-schedule-inspector,
  .student-inspector,
  .request-inspector,
  .teacher-inspector,
  .communication-contact {
    border-left: 0;
    border-top: 1px solid var(--admin-border);
  }

  .communication-inbox,
  .communication-thread {
    border-right: 0;
    border-bottom: 1px solid var(--admin-border);
    min-height: 360px;
  }

  .analytics-summary-table {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-summary-table div:nth-child(3n) {
    border-right: 0;
  }

  .analytics-summary-table div:nth-child(n + 4) {
    border-top: 1px solid var(--admin-border);
  }
}

@media (max-width: 980px) {
  .admin-layout {
    display: block;
  }

  .admin-layout > .mobile-menu-button {
    display: inline-flex;
    left: 12px;
    position: fixed;
    top: 12px;
    z-index: 60;
  }

  .admin-nav {
    box-shadow: 24px 0 50px rgba(15, 23, 42, 0.14);
    left: 0;
    max-width: min(82vw, 300px);
    position: fixed;
    top: 0;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    width: 300px;
    z-index: 55;
  }

  .sidebar-open .admin-nav {
    transform: translateX(0);
  }

  .workspace {
    padding: 72px 12px 20px;
  }

  .workspace > .page-head,
  .overview-planner-head,
  .overview-team-head,
  .overview-section-head,
  .overview-attention-head {
    align-items: start;
    flex-direction: column;
  }

  .overview-role-coverage,
  .overview-attention-summary {
    justify-content: flex-start;
  }

  .team-chip,
  .resource-state-card,
  .overview-request-card,
  .attention-item {
    grid-template-columns: 1fr;
  }

  .resource-state-card b,
  .overview-request-card em,
  .attention-action-label {
    justify-self: start;
  }

  .student-table-row,
  .request-table-row,
  .teacher-table-row {
    grid-template-columns: 1fr;
  }

  .erp-table-head {
    display: none;
  }

  .analytics-summary-table {
    grid-template-columns: 1fr;
  }

  .analytics-summary-table div,
  .analytics-summary-table div:nth-child(3n),
  .analytics-summary-table div:last-child {
    border-right: 0;
  }

  .analytics-summary-table div + div {
    border-top: 1px solid var(--admin-border);
  }
}

@media (max-width: 640px) {
  .workspace {
    padding-left: 10px;
    padding-right: 10px;
  }

  .workspace > .page-head .title,
  .overview-planner-head h1 {
    font-size: 24px;
  }

  .overview-team-strip,
  .overview-resource-strip,
  .overview-request-strip,
  .overview-attention-queue,
  .panel,
  .overview-workbench,
  .calendar-primary-workbench,
  .requests-workbench,
  .students-workbench,
  .teachers-workbench,
  .tasks-board,
  .communications-workbench {
    border-radius: 10px;
  }
}

/* Overview operational strips as tables, not cards. */
.overview-section-head,
.overview-attention-head {
  align-items: end;
  border-bottom: 1px solid var(--erp-border);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding-bottom: 8px;
}

.overview-section-head h2,
.overview-attention-head h2 {
  font-size: 20px;
  font-weight: 860;
  line-height: 1.05;
  margin: 0;
}

.overview-section-head > span,
.overview-attention-head span {
  color: var(--erp-muted);
  font-size: 13px;
  font-weight: 760;
}

.overview-attention-head > strong {
  display: none;
}

.overview-attention-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin: 0;
}

.attention-summary-chip,
.attention-summary-urgent {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--erp-muted);
  min-height: 0;
  padding: 0;
}

.attention-summary-chip b {
  color: var(--brand-red);
  font-size: 16px;
}

.overview-resource-strip,
.overview-request-strip,
.overview-attention-queue {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  padding: 12px 14px;
}

.overview-row-table,
.overview-resource-cards,
.overview-request-list,
.overview-attention-list {
  border: 1px solid var(--erp-border);
  border-radius: 8px;
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
  overflow: hidden;
}

.resource-state-card,
.overview-request-card,
.attention-item,
.resource-state-card.free,
.resource-state-card.busy,
.resource-state-card.upcoming,
.resource-state-card.closed {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--erp-border);
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(130px, 0.62fr) minmax(210px, 1fr) minmax(190px, 1fr) minmax(110px, 0.45fr);
  min-height: 42px;
  padding: 9px 12px;
  text-align: left;
  transform: none;
}

.resource-state-card:last-child,
.overview-request-card:last-child,
.attention-item:last-child {
  border-bottom: 0;
}

.resource-state-card:hover,
.resource-state-card:focus-visible,
.overview-request-card:hover,
.overview-request-card:focus-visible,
.attention-item:hover,
.attention-item:focus-visible,
.attention-item.active {
  background: #f8fafc;
  border-color: transparent;
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.75);
  outline: 0;
  transform: none;
}

.resource-state-status,
.overview-request-card span,
.attention-kind {
  color: var(--brand-red);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1.1;
  text-transform: uppercase;
}

.resource-state-card strong,
.overview-request-card strong,
.attention-item strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.15;
}

.resource-state-card span,
.resource-state-card small,
.overview-request-card small,
.attention-item span {
  color: var(--erp-muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.2;
}

.resource-state-card b,
.overview-request-card em,
.attention-action-label {
  color: var(--brand-red);
  font-size: 13px;
  font-style: normal;
  font-weight: 820;
  justify-self: end;
  line-height: 1.1;
}

@media (max-width: 980px) {
  .overview-section-head,
  .overview-attention-head {
    align-items: start;
    flex-direction: column;
  }

  .resource-state-card,
  .overview-request-card,
  .attention-item {
    grid-template-columns: 1fr;
  }

  .resource-state-card b,
  .overview-request-card em,
  .attention-action-label {
    justify-self: start;
  }
}

/* Final ERP cleanup: no decorative tiles in operational screens. */
.sidebar-brand-lockup {
  display: block;
  margin: 0 0 8px;
  padding: 2px 4px 14px;
}

.sidebar-brand-mark,
.sidebar-brand-lockup small {
  display: none;
}

.sidebar-brand-lockup strong {
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.workspace > .page-head,
.overview-planner-head {
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 8px;
  min-height: 0;
  padding-bottom: 8px;
}

.workspace > .page-head .title,
.overview-planner-head h1 {
  font-size: clamp(22px, 1.55vw, 28px);
  letter-spacing: 0;
}

.workspace > .page-head .lead,
.overview-planner-head p:not(.kicker) {
  font-size: 12px;
  line-height: 1.25;
  margin-top: 3px;
  max-width: 860px;
}

.workspace > .page-head .kicker,
.overview-planner-head .kicker {
  font-size: 10px;
  margin-bottom: 3px;
}

.erp-head-stats {
  display: none;
}

.erp-tabs {
  border-bottom: 1px solid var(--erp-border);
  gap: 18px;
  margin-bottom: 10px;
  padding: 0;
}

.erp-tabs button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--erp-muted);
  min-height: 34px;
  padding: 6px 0 9px;
}

.erp-tabs button.active {
  background: transparent;
  border-color: var(--brand-red);
  color: var(--brand-red);
}

.erp-toolbar {
  margin-bottom: 10px;
}

.erp-filter-pill {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--erp-muted);
  min-height: 0;
  padding: 0;
}

.erp-filter-pill + .erp-filter-pill::before {
  color: #c7cbd1;
  content: "·";
  margin-right: 10px;
}

.overview-status-strip,
.overview-focus-strip,
.metric-grid,
.analytics-grid,
.erp-kpi-grid,
.overview-stats {
  display: none;
}

.overview-team-strip {
  align-items: start;
  border-radius: 10px;
  grid-template-columns: 220px minmax(0, 1fr);
  padding: 10px 12px;
}

.overview-team-chips {
  border: 1px solid var(--erp-border);
  border-radius: 10px;
  display: grid;
  gap: 0;
  overflow: hidden;
}

.team-chip,
.team-chip-admin,
.team-chip-teacher,
.team-chip-vocal,
.team-chip-speech {
  align-items: baseline;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--erp-border);
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(120px, 0.8fr) minmax(160px, 1fr) minmax(110px, 0.6fr);
  min-height: 40px;
  min-width: 0;
  padding: 9px 12px;
}

.team-chip:last-child {
  border-bottom: 0;
}

.team-chip strong {
  font-size: 15px;
  font-weight: 820;
}

.team-chip span,
.team-chip em {
  color: var(--erp-muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.2;
}

.overview-role-coverage {
  gap: 14px;
}

.overview-role-coverage span {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--erp-muted);
  padding: 0;
}

.overview-role-coverage strong {
  font-size: 16px;
}

.overview-inspector-idle .availability-mini,
.overview-empty-inspector .availability-mini {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--erp-border);
  border-radius: 0;
  padding: 0 0 12px;
}

.overview-inspector-idle > .btn {
  justify-content: center;
  min-height: 38px;
  width: 100%;
}

.communications-workbench {
  height: calc(100dvh - 118px);
}

.requests-workbench,
.students-workbench,
.teachers-workbench,
.tasks-board,
.overview-workbench,
.calendar-primary-workbench {
  border-radius: 10px;
}

.students-workbench,
.requests-workbench,
.teachers-workbench {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.student-table-row {
  grid-template-columns:
    minmax(220px, 1.45fr)
    minmax(170px, 1fr)
    minmax(132px, 0.75fr)
    minmax(170px, 0.9fr)
    72px;
}

.request-table-row {
  grid-template-columns:
    minmax(130px, 0.7fr)
    minmax(170px, 0.9fr)
    minmax(132px, 0.7fr)
    minmax(230px, 1.35fr)
    72px;
}

.analytics-summary-table {
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
  overflow: hidden;
}

.analytics-summary-table div {
  align-items: baseline;
  border-bottom: 1px solid var(--erp-border);
  border-right: 1px solid var(--erp-border);
  display: grid;
  gap: 3px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 10px 14px;
}

.analytics-summary-table div:nth-child(3n) {
  border-right: 0;
}

.analytics-summary-table div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.analytics-summary-table span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 820;
}

.analytics-summary-table strong {
  color: var(--brand-red);
  font-size: 22px;
  font-weight: 900;
}

.analytics-summary-table em {
  color: var(--erp-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  grid-column: 1 / -1;
}

.analytics-panels .panel,
.broadcast-grid .panel,
.event-editor-grid .panel {
  border-radius: 10px;
}

@media (max-width: 980px) {
  .analytics-summary-table {
    grid-template-columns: 1fr;
  }

  .analytics-summary-table div,
  .analytics-summary-table div:nth-child(3n),
  .analytics-summary-table div:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--erp-border);
    border-right: 0;
  }

  .analytics-summary-table div:last-child {
    border-bottom: 0;
  }

  .overview-team-strip {
    grid-template-columns: 1fr;
  }

  .team-chip {
    grid-template-columns: 1fr;
  }
}

/* Team strip final layout: compact table, no side title column. */
@media (max-width: 980px) {
  .overview-planner-shell {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .overview-planner-grid {
    min-width: 720px;
  }

  body {
    overflow-x: hidden;
  }
}

.overview-team-strip {
  align-items: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  padding: 12px 14px;
}

.overview-team-head {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.overview-team-head h2 {
  font-size: 20px;
  font-weight: 860;
}

.overview-team-chips {
  border: 1px solid var(--erp-border);
  border-radius: 8px;
  display: grid;
  gap: 0;
  overflow: hidden;
}

.team-chip,
.team-chip-admin,
.team-chip-teacher,
.team-chip-vocal,
.team-chip-speech {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--erp-border);
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(130px, 0.8fr) minmax(170px, 1fr) minmax(120px, 0.6fr);
  min-height: 38px;
  padding: 8px 12px;
}

.team-chip:last-child {
  border-bottom: 0;
}

.team-chip strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 840;
}

.team-chip span,
.team-chip em {
  color: var(--erp-muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 760;
}

.overview-role-coverage {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.overview-role-coverage span,
.overview-role-coverage .thin {
  background: transparent;
  border: 0;
  color: var(--erp-muted);
  padding: 0;
}

.overview-role-coverage strong {
  color: var(--brand-red);
  font-size: 18px;
  font-weight: 900;
}

/* Absolute final admin layout: keep this block last. */
.admin-layout {
  align-items: stretch;
  background: var(--admin-page, #f6f7f9);
  display: grid;
  gap: 0;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100dvh;
}

.admin-nav {
  align-content: start;
  align-items: stretch;
  background: #f8fafc;
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--admin-border, #e3e7ee);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100dvh;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 14px 10px 16px;
  position: sticky;
  top: 0;
}

.admin-nav::before,
.sidebar-calendar-mini,
.sidebar-brand-mark,
.sidebar-brand-lockup small {
  display: none;
}

.sidebar-brand-lockup {
  border-bottom: 1px solid var(--admin-border, #e3e7ee);
  display: block;
  margin: 0 0 8px;
  padding: 4px 4px 14px;
}

.sidebar-brand-lockup strong {
  color: var(--ink);
  display: block;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.sidebar-nav-list {
  align-content: start;
  display: grid;
  gap: 3px;
}

.nav-tab {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  color: var(--admin-muted, #687082);
  display: grid;
  gap: 9px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  min-height: 40px;
  padding: 8px 10px;
}

.nav-tab.active {
  background: var(--admin-active, rgba(201, 31, 38, 0.08));
  color: var(--brand-red);
}

.nav-copy > span {
  display: block;
  font-size: 14px;
  font-weight: 780;
  line-height: 1.12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-copy small {
  display: none;
}

.workspace {
  background: var(--admin-page, #f6f7f9);
  min-height: 100dvh;
  min-width: 0;
  overflow: visible;
  padding: 14px 16px 24px;
}

.workspace > .page-head,
.overview-planner-head {
  align-items: end;
  border-bottom: 1px solid var(--admin-border, #e3e7ee);
  gap: 14px;
  margin: 0 0 12px;
  min-height: 0;
  padding: 0 0 10px;
}

.workspace > .page-head .title,
.overview-planner-head h1 {
  font-size: clamp(23px, 1.6vw, 30px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
}

.workspace > .page-head .lead,
.overview-planner-head p:not(.kicker) {
  color: var(--admin-muted, #687082);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 4px;
  max-width: 880px;
}

.erp-head-stats,
.overview-status-strip,
.overview-focus-strip,
.overview-stats,
.metric-grid,
.analytics-grid,
.erp-kpi-grid {
  display: none;
}

.overview-team-strip,
.overview-resource-strip,
.overview-request-strip,
.overview-attention-queue,
.overview-workbench,
.calendar-primary-workbench,
.requests-workbench,
.students-workbench,
.teachers-workbench,
.tasks-board,
.communications-workbench,
.analytics-summary-table {
  background: #fff;
  border: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 12px;
  box-shadow: none;
}

.overview-team-strip,
.overview-resource-strip,
.overview-request-strip,
.overview-attention-queue {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  padding: 12px 14px;
}

.overview-team-head,
.overview-section-head,
.overview-attention-head {
  align-items: end;
  border-bottom: 1px solid var(--admin-border, #e3e7ee);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding-bottom: 8px;
}

.overview-team-head h2,
.overview-section-head h2,
.overview-attention-head h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 880;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

.overview-team-chips,
.overview-row-table,
.overview-resource-cards,
.overview-request-list,
.overview-attention-list {
  border: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 9px;
  display: grid;
  gap: 0;
  overflow: hidden;
}

.team-chip,
.team-chip-admin,
.team-chip-teacher,
.team-chip-vocal,
.team-chip-speech,
.resource-state-card,
.overview-request-card,
.attention-item,
.resource-state-card.free,
.resource-state-card.busy,
.resource-state-card.upcoming,
.resource-state-card.closed {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
  display: grid;
  gap: 10px;
  min-height: 46px;
  min-width: 0;
  padding: 9px 12px;
  text-align: left;
  transform: none;
  width: 100%;
}

.team-chip,
.team-chip-admin,
.team-chip-teacher,
.team-chip-vocal,
.team-chip-speech {
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1fr) minmax(130px, 0.55fr);
}

.resource-state-card,
.overview-request-card,
.attention-item,
.resource-state-card.free,
.resource-state-card.busy,
.resource-state-card.upcoming,
.resource-state-card.closed {
  grid-template-columns: minmax(126px, 0.82fr) minmax(170px, 1fr) minmax(160px, 1fr) minmax(88px, 0.42fr);
}

.team-chip:last-child,
.resource-state-card:last-child,
.overview-request-card:last-child,
.attention-item:last-child {
  border-bottom: 0;
}

.team-chip:hover,
.resource-state-card:hover,
.overview-request-card:hover,
.attention-item:hover,
.resource-state-card:focus-visible,
.overview-request-card:focus-visible,
.attention-item:focus-visible,
.resource-state-card.active,
.overview-request-card.active,
.attention-item.active {
  background: var(--admin-row-hover, #f9fafb);
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.72);
  outline: 0;
}

.team-chip strong,
.resource-state-card strong,
.overview-request-card strong,
.attention-item strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 860;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-chip span,
.team-chip em,
.resource-state-card span,
.resource-state-card small,
.overview-request-card small,
.attention-item span {
  color: var(--admin-muted, #687082);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.22;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resource-state-status,
.overview-request-card > span,
.attention-kind {
  color: var(--brand-red);
  font-size: 11px;
  font-style: normal;
  font-weight: 860;
  letter-spacing: 0.7px;
  line-height: 1.15;
  text-transform: uppercase;
}

.resource-state-card b,
.overview-request-card em,
.attention-action-label {
  color: var(--brand-red);
  font-size: 13px;
  font-style: normal;
  font-weight: 860;
  justify-self: end;
  line-height: 1.2;
}

.overview-role-coverage,
.overview-attention-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.overview-role-coverage span,
.overview-role-coverage .thin,
.attention-summary-chip {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--admin-muted, #687082);
  padding: 0;
}

.overview-role-coverage strong,
.attention-summary-chip b {
  color: var(--brand-red);
  font-size: 17px;
  font-weight: 900;
}

.overview-workbench,
.calendar-primary-workbench {
  gap: 0;
  grid-template-columns: minmax(0, 1fr) 318px;
  min-height: calc(100dvh - 188px);
  overflow: hidden;
}

.requests-workbench,
.students-workbench,
.teachers-workbench {
  gap: 0;
  grid-template-columns: minmax(0, 1fr) 330px;
  overflow: hidden;
}

.student-table-row {
  grid-template-columns:
    minmax(200px, 1.3fr)
    minmax(160px, 1fr)
    minmax(126px, 0.7fr)
    minmax(150px, 0.9fr)
    72px;
}

.request-table-row {
  grid-template-columns:
    minmax(124px, 0.68fr)
    minmax(156px, 0.9fr)
    minmax(128px, 0.72fr)
    minmax(210px, 1.25fr)
    72px;
}

.overview-inspector,
.work-schedule-inspector,
.student-inspector,
.request-inspector,
.teacher-inspector {
  border-bottom: 0;
  border-left: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 0;
  border-right: 0;
  border-top: 0;
  box-shadow: none;
  min-width: 0;
  padding: 16px;
}

.communications-workbench {
  display: grid;
  gap: 0;
  grid-template-columns: 282px minmax(0, 1fr) 318px;
  height: calc(100dvh - 104px);
  min-height: 560px;
  overflow: hidden;
}

.communication-inbox {
  background: #fbfcfd;
  border-right: 1px solid var(--admin-border, #e3e7ee);
}

.communication-thread {
  border-right: 1px solid var(--admin-border, #e3e7ee);
}

.analytics-summary-table {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 12px;
  overflow: hidden;
}

.analytics-summary-table div {
  align-items: start;
  border-bottom: 0;
  border-right: 1px solid var(--admin-border, #e3e7ee);
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 12px 14px;
}

.analytics-summary-table div:last-child {
  border-right: 0;
}

.tasks-board {
  gap: 0;
  overflow: hidden;
}

.task-column {
  border-right: 1px solid var(--admin-border, #e3e7ee);
  padding: 14px;
}

.task-column:last-child {
  border-right: 0;
}

@media (max-width: 1360px) {
  .admin-layout {
    grid-template-columns: 208px minmax(0, 1fr);
  }

  .workspace {
    padding: 12px 14px 22px;
  }

  .communications-workbench {
    grid-template-columns: 264px minmax(0, 1fr) 300px;
  }

  .overview-workbench,
  .calendar-primary-workbench {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 1120px) {
  .admin-layout {
    grid-template-columns: 196px minmax(0, 1fr);
  }

  .requests-workbench,
  .students-workbench,
  .teachers-workbench,
  .communications-workbench,
  .overview-workbench,
  .calendar-primary-workbench {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .overview-inspector,
  .work-schedule-inspector,
  .student-inspector,
  .request-inspector,
  .teacher-inspector,
  .communication-contact {
    border-left: 0;
    border-top: 1px solid var(--admin-border, #e3e7ee);
  }

  .analytics-summary-table {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-summary-table div:nth-child(3n) {
    border-right: 0;
  }

  .analytics-summary-table div:nth-child(n + 4) {
    border-top: 1px solid var(--admin-border, #e3e7ee);
  }
}

@media (max-width: 980px) {
  .admin-layout {
    display: block;
  }

  .admin-layout > .mobile-menu-button {
    display: inline-flex;
    left: 12px;
    position: fixed;
    top: 12px;
    z-index: 60;
  }

  .admin-nav {
    box-shadow: 24px 0 50px rgba(15, 23, 42, 0.14);
    left: 0;
    max-width: min(82vw, 300px);
    position: fixed;
    top: 0;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    width: 300px;
    z-index: 55;
  }

  .sidebar-open .admin-nav {
    transform: translateX(0);
  }

  .workspace {
    padding: 72px 12px 20px;
  }

  .workspace > .page-head,
  .overview-planner-head,
  .overview-team-head,
  .overview-section-head,
  .overview-attention-head {
    align-items: start;
    flex-direction: column;
  }

  .overview-role-coverage,
  .overview-attention-summary {
    justify-content: flex-start;
  }

  .team-chip,
  .resource-state-card,
  .overview-request-card,
  .attention-item,
  .student-table-row,
  .request-table-row,
  .teacher-table-row {
    grid-template-columns: 1fr;
  }

  .resource-state-card b,
  .overview-request-card em,
  .attention-action-label {
    justify-self: start;
  }

  .erp-table-head {
    display: none;
  }

  .analytics-summary-table {
    grid-template-columns: 1fr;
  }

  .analytics-summary-table div,
  .analytics-summary-table div:nth-child(3n),
  .analytics-summary-table div:last-child {
    border-right: 0;
  }

  .analytics-summary-table div + div {
    border-top: 1px solid var(--admin-border, #e3e7ee);
  }
}

@media (max-width: 640px) {
  .workspace {
    padding-left: 10px;
    padding-right: 10px;
  }

  .workspace > .page-head .title,
  .overview-planner-head h1 {
    font-size: 24px;
  }
}

/* Sidebar calendar and compact team density: final override. */
.admin-nav {
  gap: 7px;
}

.sidebar-calendar-mini {
  background: #fff;
  border: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 10px;
  box-shadow: none;
  display: grid;
  gap: 6px;
  margin: 0 0 4px;
  padding: 8px;
  position: relative;
  z-index: 1;
}

.mini-calendar-head {
  align-items: center;
  display: grid;
  gap: 4px;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
}

.mini-calendar-head strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 860;
  line-height: 1.1;
  text-align: center;
}

.mini-calendar-nav {
  align-items: center;
  background: #f7f8fa;
  border: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 7px;
  color: var(--admin-muted, #687082);
  display: inline-flex;
  font-size: 16px;
  font-weight: 860;
  height: 24px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 24px;
}

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

.mini-calendar-weekdays span {
  color: var(--admin-muted-soft, #8a92a1);
  font-size: 8px;
  font-weight: 860;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.mini-calendar-days button,
.mini-calendar-gap {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  height: 21px;
  justify-content: center;
  min-width: 0;
}

.mini-calendar-days button {
  background: transparent;
  border: 0;
  color: var(--admin-muted, #687082);
  font-size: 10px;
  font-weight: 780;
  padding: 0;
}

.mini-calendar-days button:hover,
.mini-calendar-days button:focus-visible {
  background: rgba(201, 31, 38, 0.08);
  color: var(--brand-red);
  outline: 0;
}

.mini-calendar-days button.active {
  background: var(--brand-red);
  color: #fff;
}

.mini-calendar-days button.today:not(.active) {
  background: rgba(201, 31, 38, 0.1);
  color: var(--brand-red);
}

.mini-calendar-summary {
  border-top: 1px solid var(--admin-border, #e3e7ee);
  display: grid;
  gap: 2px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-top: 6px;
}

.mini-calendar-summary strong,
.mini-calendar-summary span,
.mini-calendar-summary small {
  line-height: 1.15;
  min-width: 0;
}

.mini-calendar-summary strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 880;
}

.mini-calendar-summary span {
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 850;
  justify-self: end;
  white-space: nowrap;
}

.mini-calendar-summary small {
  color: var(--admin-muted, #687082);
  font-size: 10px;
  font-weight: 700;
  grid-column: 1 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-team-strip {
  gap: 6px;
  padding: 9px 12px;
}

.overview-team-head {
  gap: 10px;
  padding-bottom: 5px;
}

.overview-team-head h2 {
  font-size: 18px;
}

.overview-team-head .kicker {
  margin-bottom: 2px;
}

.overview-role-coverage {
  gap: 9px;
}

.overview-role-coverage span,
.overview-role-coverage .thin {
  font-size: 12px;
  line-height: 1.1;
}

.overview-role-coverage strong {
  font-size: 15px;
}

.overview-team-chips {
  border-radius: 7px;
}

.team-chip,
.team-chip-admin,
.team-chip-teacher,
.team-chip-vocal,
.team-chip-speech {
  gap: 8px;
  grid-template-columns: minmax(130px, 0.8fr) minmax(160px, 1fr) minmax(118px, 0.55fr);
  min-height: 32px;
  padding: 6px 10px;
}

.team-chip strong {
  font-size: 14px;
}

.team-chip span,
.team-chip em {
  font-size: 12px;
  line-height: 1.12;
}

@media (max-width: 980px) {
  .sidebar-calendar-mini {
    margin-top: 4px;
  }

  .overview-team-strip {
    padding: 10px;
  }

  .team-chip,
  .team-chip-admin,
  .team-chip-teacher,
  .team-chip-vocal,
  .team-chip-speech {
    gap: 4px;
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 8px 10px;
  }
}

/* Day planner interactions: final override. */
.overview-head-actions {
  align-items: flex-end;
  display: flex;
  justify-content: flex-end;
}

.overview-day-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.overview-day-controls .btn.compact {
  min-height: 34px;
  padding: 7px 12px;
}

.overview-day-stepper {
  align-items: center;
  background: #fff;
  border: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 10px;
  display: inline-flex;
  min-height: 34px;
  overflow: hidden;
}

.overview-day-stepper button {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  display: inline-flex;
  font-size: 20px;
  font-weight: 860;
  height: 34px;
  justify-content: center;
  padding: 0;
  width: 34px;
}

.overview-day-stepper button:hover,
.overview-day-stepper button:focus-visible {
  background: rgba(201, 31, 38, 0.08);
  color: var(--brand-red);
  outline: 0;
}

.overview-day-stepper strong {
  border-left: 1px solid var(--admin-border, #e3e7ee);
  border-right: 1px solid var(--admin-border, #e3e7ee);
  color: var(--ink);
  font-size: 14px;
  font-weight: 880;
  line-height: 1;
  padding: 0 12px;
  white-space: nowrap;
}

.erp-segmented.compact {
  min-height: 34px;
  padding: 2px;
}

.erp-segmented.compact button {
  font-size: 12px;
  min-height: 28px;
  padding: 5px 10px;
}

.overview-workbench {
  position: relative;
}

.planner-choice-popover {
  background: #fff;
  border: 1px solid rgba(226, 229, 235, 0.9);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(22, 25, 31, 0.16);
  display: grid;
  gap: 4px;
  left: min(47%, calc(100% - 380px));
  padding: 10px;
  position: absolute;
  top: 132px;
  width: 240px;
  z-index: 30;
}

.planner-choice-popover button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  display: grid;
  gap: 12px;
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 52px;
  padding: 8px 10px;
  text-align: left;
}

.planner-choice-popover button:hover,
.planner-choice-popover button:focus-visible {
  background: rgba(201, 31, 38, 0.08);
  outline: 0;
}

.planner-choice-popover span {
  align-items: center;
  background: #f3f5f8;
  border: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 10px;
  color: var(--brand-red);
  display: inline-flex;
  font-size: 18px;
  font-weight: 860;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.planner-choice-popover strong {
  font-size: 19px;
  font-weight: 820;
  letter-spacing: 0;
}

.overview-planner-cell-free {
  overflow: hidden;
  position: relative;
}

.overview-planner-cell-free span {
  background: #20b596;
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 860;
  left: 8px;
  line-height: 1;
  max-width: calc(100% - 16px);
  opacity: 0;
  padding: 5px 8px;
  position: absolute;
  right: 8px;
  text-align: left;
  top: 7px;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  white-space: nowrap;
}

.overview-planner-cell-free:hover span,
.overview-planner-cell-free:focus-visible span,
.overview-planner-cell-free.selected span {
  opacity: 1;
  transform: translateY(0);
}

.overview-planner-cell-free:hover,
.overview-planner-cell-free:focus-visible,
.overview-planner-cell-free.selected {
  background: linear-gradient(180deg, rgba(32, 181, 150, 0.1), rgba(32, 181, 150, 0.05));
}

.overview-planner-cell-free:hover small,
.overview-planner-cell-free:focus-visible small,
.overview-planner-cell-free.selected small {
  opacity: 0.45;
}

@media (max-width: 1180px) {
  .planner-choice-popover {
    left: 50%;
    top: 118px;
  }
}

@media (max-width: 760px) {
  .overview-head-actions,
  .overview-day-controls {
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
  }

  .overview-day-stepper,
  .overview-day-controls .btn.compact,
  .overview-day-controls .erp-segmented {
    width: 100%;
  }

  .overview-day-stepper strong {
    flex: 1;
    text-align: center;
  }

  .planner-choice-popover {
    left: 16px;
    right: 16px;
    top: 96px;
    width: auto;
  }
}

.certificate-request-workflow {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(204, 30, 43, 0.2);
  border-radius: 18px;
  background: linear-gradient(155deg, #fffdf8 0%, #f7efe5 100%);
  box-shadow: 0 10px 28px rgba(74, 49, 35, 0.08);
}

.certificate-request-workflow > img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 13px;
  border: 1px solid rgba(145, 110, 82, 0.16);
  box-shadow: 0 8px 22px rgba(71, 45, 26, 0.12);
}

.certificate-request-copy {
  display: grid;
  gap: 7px;
}

.certificate-workflow-kicker {
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.certificate-request-copy > strong {
  font-size: 18px;
  line-height: 1.18;
}

.certificate-issued-code {
  width: fit-content;
  padding: 7px 11px;
  border: 1px solid rgba(204, 30, 43, 0.32);
  border-radius: 10px;
  color: var(--red);
  background: rgba(255, 255, 255, 0.74);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

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

.certificate-delivery-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.certificate-delivery-fields label.full {
  grid-column: 1 / -1;
}

.certificate-delivery-fields span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.certificate-delivery-fields .input {
  width: 100%;
  min-width: 0;
}

.certificate-request-copy dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0 0;
}

.certificate-request-copy dl > div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(81, 65, 55, 0.08);
}

.certificate-request-copy dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.certificate-request-copy dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.certificate-payment-state {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-radius: 12px;
}

.certificate-payment-state b {
  font-size: 13px;
}

.certificate-payment-state span {
  font-size: 12px;
  line-height: 1.35;
}

.certificate-payment-state.waiting {
  color: #81551c;
  background: #fff4d8;
  border: 1px solid #efd49b;
}

.certificate-payment-state.paid {
  color: #236c46;
  background: #eaf8ef;
  border: 1px solid #b8e2c8;
}

.certificate-delivery-state {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-radius: 12px;
}

.certificate-delivery-state b {
  font-size: 13px;
}

.certificate-delivery-state span {
  font-size: 12px;
  line-height: 1.35;
}

.certificate-delivery-state.pending {
  color: #81551c;
  background: #fff4d8;
  border: 1px solid #efd49b;
}

.certificate-delivery-state.sent {
  color: #236c46;
  background: #eaf8ef;
  border: 1px solid #b8e2c8;
}

.certificate-delivery-state.failed {
  color: #9e2634;
  background: #fff0f2;
  border: 1px solid #efb7be;
}

.certificate-workflow-actions {
  display: grid;
  gap: 8px;
}

.certificate-workflow-actions .btn {
  width: 100%;
  min-height: 48px;
  white-space: normal;
}

.certificate-payment-url-field {
  display: grid;
  gap: 5px;
}

.certificate-payment-url-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.certificate-payment-url-field .input {
  width: 100%;
  min-width: 0;
}

@media (max-width: 480px) {
  .certificate-request-workflow {
    padding: 11px;
    border-radius: 15px;
  }

  .certificate-request-copy dl {
    grid-template-columns: 1fr;
  }

  .certificate-delivery-fields {
    grid-template-columns: 1fr;
  }

  .certificate-delivery-fields label.full {
    grid-column: 1;
  }
}

/* Full emoji catalog, communication scripts and stable mobile composer. */
.communications-page .communication-compose {
  grid-template-columns: minmax(0, 1fr) auto;
  position: relative;
}

.communication-compose-actions {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.communications-page .communication-compose .communication-compose-actions > button,
.communications-page .communication-compose .communication-emoji-control > button {
  flex: 0 0 36px;
  height: 36px;
  min-width: 36px;
  width: 36px;
}

.communications-page .communication-compose .communication-script-toggle,
.communications-page .communication-compose .communication-emoji-toggle {
  background: #eef1f5;
  color: #4b5260;
  font-size: 19px;
  font-weight: 900;
}

.communications-page .communication-compose .communication-script-toggle:hover,
.communications-page .communication-compose .communication-script-toggle:focus-visible,
.communications-page .communication-compose .communication-emoji-toggle:hover,
.communications-page .communication-compose .communication-emoji-toggle:focus-visible {
  background: #e2e7ed;
  color: var(--brand-red);
}

.communication-script-suggestions {
  background: #fff;
  border: 1px solid #dfe4eb;
  border-radius: 12px;
  bottom: calc(100% + 8px);
  box-shadow: 0 16px 46px rgba(24, 30, 42, 0.16);
  display: grid;
  left: 16px;
  max-height: min(420px, 64dvh);
  overflow: hidden;
  position: absolute;
  right: 16px;
  z-index: 52;
}

.communication-script-suggestions > header {
  align-items: baseline;
  border-bottom: 1px solid #e8ebef;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 10px 12px;
}

.communication-script-suggestions > header strong {
  color: #272b31;
  font-size: 13px;
}

.communication-script-suggestions > header span {
  color: #7b828e;
  font-size: 10px;
}

.communication-script-suggestion-list {
  display: grid;
  max-height: 330px;
  overflow-y: auto;
  padding: 6px;
}

.communications-page .communication-compose .communication-script-suggestion-list button {
  align-items: center;
  background: transparent;
  border-radius: 8px;
  color: #292d33;
  display: grid;
  gap: 9px;
  grid-template-columns: 42px minmax(0, 1fr);
  height: auto;
  justify-content: stretch;
  min-height: 52px;
  padding: 7px 9px;
  text-align: left;
  width: 100%;
}

.communications-page .communication-compose .communication-script-suggestion-list button:hover,
.communications-page .communication-compose .communication-script-suggestion-list button:focus-visible,
.communications-page .communication-compose .communication-script-suggestion-list button.active {
  background: #f2f4f7;
  color: #292d33;
}

.communication-script-suggestion-list button > b {
  background: #fff0f0;
  border-radius: 7px;
  color: var(--brand-red);
  font-size: 12px;
  padding: 7px 5px;
  text-align: center;
}

.communication-script-suggestion-list button > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.communication-script-suggestion-list button strong,
.communication-script-suggestion-list button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.communication-script-suggestion-list button strong {
  font-size: 12px;
}

.communication-script-suggestion-list button small {
  color: #737b88;
  font-size: 10px;
}

.communication-script-empty {
  color: #727986;
  font-size: 12px;
  line-height: 1.4;
  padding: 18px 14px;
  text-align: center;
}

.communication-emoji-control {
  position: relative;
}

.communication-emoji-picker {
  background: #fff;
  border: 1px solid #dfe4eb;
  border-radius: 14px;
  bottom: calc(100% + 10px);
  box-shadow: 0 18px 54px rgba(24, 30, 42, 0.2);
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  height: min(500px, 70dvh);
  overflow: hidden;
  padding: 10px;
  position: absolute;
  right: 0;
  width: min(390px, calc(100vw - 28px));
  z-index: 55;
}

.communication-emoji-source-tabs,
.communication-telegram-pack-tabs {
  display: flex;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.communication-emoji-source-tabs::-webkit-scrollbar,
.communication-telegram-pack-tabs::-webkit-scrollbar {
  display: none;
}

.communication-emoji-source-tabs {
  border-bottom: 1px solid #e7eaee;
  padding-bottom: 7px;
}

.communications-page .communication-compose .communication-emoji-source-tabs button,
.communications-page .communication-compose .communication-telegram-pack-tabs button {
  background: #f2f4f7;
  border-radius: 999px;
  color: #646c79;
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  height: 29px;
  min-width: 0;
  padding: 0 10px;
  width: auto;
}

.communications-page .communication-compose .communication-emoji-source-tabs button.active,
.communications-page .communication-compose .communication-telegram-pack-tabs button.active {
  background: #fff0f0;
  color: var(--brand-red);
}

.communication-telegram-pack-content {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.communication-telegram-pack-tabs {
  padding: 7px 0 2px;
}

.communication-emoji-picker-head a {
  color: var(--brand-red);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.communication-telegram-asset-grid {
  align-content: start;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(6, minmax(42px, 1fr));
  min-height: 0;
  overflow-y: auto;
  padding: 3px 1px;
}

.communication-telegram-asset-grid.stickers {
  grid-template-columns: repeat(4, minmax(58px, 1fr));
}

.communications-page .communication-compose .communication-telegram-asset-grid button {
  background: transparent;
  border-radius: 9px;
  height: 48px;
  min-width: 0;
  overflow: hidden;
  padding: 3px;
  position: relative;
  width: 100%;
}

.communications-page .communication-compose .communication-telegram-asset-grid.stickers button {
  height: 66px;
}

.communications-page .communication-compose .communication-telegram-asset-grid button:hover,
.communications-page .communication-compose .communication-telegram-asset-grid button:focus-visible {
  background: #edf0f4;
}

.communication-telegram-asset-grid button img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.communication-telegram-asset-grid button > span {
  align-items: center;
  display: flex;
  font-size: 20px;
  inset: 0;
  justify-content: center;
  position: absolute;
  z-index: -1;
}

.communication-telegram-pack-content footer {
  border-top: 1px solid #e7eaee;
  color: #818894;
  display: flex;
  font-size: 9px;
  justify-content: space-between;
  padding: 7px 2px 0;
}

.telegram-custom-emoji {
  display: inline-flex;
  height: 1.35em;
  margin: 0 0.04em;
  position: relative;
  vertical-align: -0.28em;
  width: 1.35em;
}

.telegram-custom-emoji > span {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: absolute;
}

.telegram-custom-emoji > img {
  height: 100%;
  object-fit: contain;
  position: relative;
  width: 100%;
  z-index: 1;
}

.communication-telegram-sticker {
  display: inline-flex;
  height: 132px;
  max-width: 180px;
  position: relative;
  width: 132px;
}

.communication-telegram-sticker img {
  height: 100%;
  object-fit: contain;
  position: relative;
  width: 100%;
  z-index: 1;
}

.communication-telegram-sticker > span {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: absolute;
}

.communication-delivery-failed {
  color: var(--brand-red);
  display: block;
  font-size: 10px;
  font-weight: 800;
  margin-top: 4px;
}

.communication-sticker-draft {
  align-items: center;
  background: #f5f7fa;
  border: 1px solid #e0e5eb;
  border-radius: 12px;
  display: grid;
  gap: 9px;
  grid-column: 1 / -1;
  grid-template-columns: 46px minmax(0, 1fr) 28px;
  padding: 6px 8px;
}

.communication-sticker-draft img {
  height: 46px;
  object-fit: contain;
  width: 46px;
}

.communication-sticker-draft > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.communication-sticker-draft strong {
  color: #2d3137;
  font-size: 11px;
}

.communication-sticker-draft small {
  color: #747c88;
  font-size: 9px;
}

.communications-page .communication-compose .communication-sticker-draft button {
  background: #e7ebf0;
  border-radius: 50%;
  color: #5c6470;
  height: 28px;
  min-width: 28px;
  padding: 0;
  width: 28px;
}

.communication-emoji-search {
  align-items: center;
  background: #f1f3f6;
  border-radius: 9px;
  display: grid;
  gap: 7px;
  grid-template-columns: 17px minmax(0, 1fr);
  padding: 0 10px;
}

.communication-emoji-search svg {
  color: #737b88;
  height: 16px;
  width: 16px;
}

.communication-emoji-search input {
  background: transparent;
  border: 0;
  color: #282c32;
  font: inherit;
  font-size: 13px;
  min-height: 38px;
  min-width: 0;
  outline: 0;
  width: 100%;
}

.communication-emoji-categories {
  border-bottom: 1px solid #e7eaee;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 7px 0 6px;
  scrollbar-width: none;
}

.communication-emoji-categories::-webkit-scrollbar {
  display: none;
}

.communications-page .communication-compose .communication-emoji-categories button,
.communications-page .communication-compose .communication-emoji-tones button,
.communications-page .communication-compose .communication-emoji-grid button {
  background: transparent;
  border-radius: 7px;
  color: #2c3036;
  flex: 0 0 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  width: 34px;
}

.communications-page .communication-compose .communication-emoji-categories button {
  font-size: 18px;
}

.communications-page .communication-compose .communication-emoji-categories button.active,
.communications-page .communication-compose .communication-emoji-categories button:hover,
.communications-page .communication-compose .communication-emoji-categories button:focus-visible,
.communications-page .communication-compose .communication-emoji-tones button.active,
.communications-page .communication-compose .communication-emoji-tones button:hover,
.communications-page .communication-compose .communication-emoji-grid button:hover,
.communications-page .communication-compose .communication-emoji-grid button:focus-visible {
  background: #edf0f4;
  color: #2c3036;
}

.communication-emoji-picker-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 7px 2px 5px;
}

.communication-emoji-picker-head > strong {
  color: #646c79;
  font-size: 10px;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.communication-emoji-tones {
  display: flex;
  gap: 1px;
}

.communications-page .communication-compose .communication-emoji-tones button {
  font-size: 15px;
  height: 25px;
  min-width: 25px;
  width: 25px;
}

.communication-emoji-grid {
  align-content: start;
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(8, minmax(34px, 1fr));
  min-height: 0;
  overflow-y: auto;
  padding: 3px 1px;
}

.communications-page .communication-compose .communication-emoji-grid button {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 23px;
  justify-self: center;
}

.communication-emoji-picker footer {
  border-top: 1px solid #e7eaee;
  color: #818894;
  display: flex;
  font-size: 9px;
  justify-content: space-between;
  padding: 7px 2px 0;
}

.communication-emoji-state,
.communication-emoji-empty {
  align-self: center;
  color: #757d89;
  font-size: 12px;
  grid-column: 1 / -1;
  justify-self: center;
  line-height: 1.4;
  padding: 20px;
  text-align: center;
}

.settings-group-scripts {
  grid-column: span 2;
}

.settings-group-note {
  color: #747c88;
  font-size: 11px;
  line-height: 1.4;
  margin: 0;
}

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

.settings-script-row {
  align-items: end;
  background: #f7f8fa;
  border: 1px solid #e4e8ed;
  border-radius: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: 92px minmax(180px, 0.42fr) 34px minmax(280px, 1fr);
  padding: 9px;
}

.settings-script-row label {
  display: grid;
  gap: 4px;
}

.settings-script-row label > span {
  color: #6e7683;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-script-row .input,
.settings-script-row .textarea {
  min-height: 36px;
}

.settings-script-text {
  grid-column: 4;
  grid-row: 1;
}

.settings-script-row .textarea {
  max-height: 110px;
  resize: vertical;
}

.settings-script-remove {
  align-self: end;
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  color: #9a3d42;
  cursor: pointer;
  font-size: 20px;
  height: 36px;
  width: 34px;
}

.settings-script-add {
  justify-self: start;
}

@media (max-width: 760px) {
  .communications-page .communication-compose {
    gap: 7px;
    grid-template-columns: minmax(0, 1fr);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .communications-page .communication-compose > textarea,
  .communication-compose-actions {
    grid-column: 1;
  }

  .communication-compose-actions {
    justify-content: flex-end;
    width: 100%;
  }

  .communications-page .communication-compose .communication-send-button {
    margin-left: auto;
  }

  .communication-emoji-picker,
  .communication-script-suggestions {
    bottom: calc(74px + env(safe-area-inset-bottom));
    left: 12px;
    position: fixed;
    right: 12px;
    width: auto;
  }

  .communication-emoji-picker {
    height: min(520px, 62dvh);
  }

  .communication-emoji-grid {
    grid-template-columns: repeat(7, minmax(34px, 1fr));
  }

  .settings-group-scripts {
    grid-column: auto;
  }

  .settings-script-row {
    grid-template-columns: 82px minmax(0, 1fr) 34px;
  }

  .settings-script-text {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 390px) {
  .communication-emoji-grid {
    grid-template-columns: repeat(6, minmax(34px, 1fr));
  }

  .communication-emoji-picker-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.communication-emoji-control {
  position: relative;
  flex: 0 0 auto;
}

.communications-page .communication-compose .communication-emoji-toggle {
  width: 38px;
  min-width: 38px;
  padding: 0;
  color: #4f4a45;
  font-size: 18px;
  background: transparent;
}

.communication-emoji-picker {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 38px);
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(28, 25, 23, 0.14);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(28, 25, 23, 0.16);
}

.communications-page .communication-compose .communication-emoji-picker button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 8px;
  font-size: 20px;
  background: transparent;
}

.communications-page .communication-compose .communication-emoji-picker button:hover,
.communications-page .communication-compose .communication-emoji-picker button:focus-visible {
  background: #f3f0eb;
}

.planner-event-service {
  display: block;
  overflow: hidden;
  color: rgba(55, 48, 42, 0.78);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.communication-teacher-filter {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  margin: 10px 12px 0;
  padding-top: 12px;
}

.communication-teacher-filter span,
.communication-client-link .field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.communication-teacher-filter select,
.communication-client-link select {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  min-height: 38px;
  padding: 7px 9px;
  width: 100%;
}

.communication-client-link {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 9px;
  padding-bottom: 14px;
}

.communication-client-link .state-note {
  font-size: 12px;
  margin: 0;
}

/* Planner shift correctness and compact team band: final override. */
.overview-planner-cell-offshift {
  align-items: start;
  background:
    linear-gradient(180deg, rgba(247, 248, 250, 0.82), rgba(247, 248, 250, 0.5)),
    repeating-linear-gradient(
      135deg,
      rgba(138, 146, 161, 0.08) 0,
      rgba(138, 146, 161, 0.08) 6px,
      transparent 6px,
      transparent 12px
    );
  color: var(--admin-muted-soft, #8a92a1);
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 8px;
}

.overview-planner-cell-offshift span {
  color: var(--admin-muted, #687082);
  font-size: 11px;
  font-weight: 820;
  line-height: 1;
  text-transform: uppercase;
}

.overview-planner-cell-offshift small {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
}

.overview-team-strip {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: 190px minmax(0, 1fr);
  padding: 8px 10px;
}

.overview-team-head {
  align-content: start;
  border: 0;
  display: grid;
  gap: 8px;
  padding: 0;
}

.overview-team-head h2 {
  font-size: 17px;
  line-height: 1.05;
  max-width: 150px;
}

.overview-role-coverage {
  align-items: start;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr;
}

.overview-role-coverage span,
.overview-role-coverage .thin {
  font-size: 11px;
}

.overview-role-coverage strong {
  font-size: 14px;
}

.overview-team-body {
  min-width: 0;
}

.overview-team-chips {
  border-radius: 8px;
}

.team-chip,
.team-chip-admin,
.team-chip-teacher,
.team-chip-vocal,
.team-chip-speech {
  gap: 10px;
  grid-template-columns: minmax(108px, 0.75fr) minmax(150px, 1fr) minmax(96px, 0.45fr);
  min-height: 28px;
  padding: 5px 9px;
}

.team-chip strong {
  font-size: 13px;
}

.team-chip span,
.team-chip em {
  font-size: 11px;
}

@media (max-width: 980px) {
  .overview-team-strip {
    grid-template-columns: 1fr;
  }

  .overview-team-head h2 {
    max-width: none;
  }

  .overview-role-coverage {
    grid-template-columns: repeat(3, minmax(0, max-content));
  }
}

/* Planner creation forms: final override. */
.planner-form-grid {
  display: grid;
  gap: 10px;
}

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

.planner-event-form,
.lesson-client-section {
  gap: 10px;
}

.lesson-client-section {
  background: #f8f9fb;
  border: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 12px;
  padding: 12px;
}

.lesson-recent-clients {
  border-top: 1px solid var(--admin-border, #e3e7ee);
  display: grid;
  gap: 4px;
  padding-top: 8px;
}

.lesson-recent-clients > strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.lesson-recent-clients button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 6px 8px;
  text-align: left;
}

.lesson-recent-clients button:hover,
.lesson-recent-clients button:focus-visible {
  background: rgba(201, 31, 38, 0.08);
  outline: 0;
}

.lesson-recent-clients span {
  font-size: 13px;
  font-weight: 780;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-recent-clients small {
  color: var(--admin-muted, #687082);
  font-size: 11px;
  font-weight: 680;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .planner-form-grid.two {
    grid-template-columns: 1fr;
  }
}

/* Half-hour free slot picking: final override. */
.overview-planner-cell-free-stack {
  background: #fff;
  display: grid;
  gap: 1px;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-height: 48px;
  overflow: hidden;
  padding: 0;
}

.overview-planner-half-slot {
  border: 0;
  border-radius: 0;
  min-height: 0;
  padding: 0;
  width: 100%;
}

.overview-planner-half-slot + .overview-planner-half-slot {
  border-top: 1px solid rgba(226, 229, 235, 0.9);
}

.overview-planner-half-slot span {
  top: 4px;
}

.overview-planner-half-slot small {
  bottom: 4px;
  left: 8px;
  max-width: calc(100% - 16px);
  overflow: hidden;
  position: absolute;
  right: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Planner toolbar and local slot popover: final override. */
.overview-planner-head-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--erp-border, #e3e7ee);
  display: flex;
  justify-content: flex-start;
  margin: 0 0 10px;
  min-height: 0;
  padding: 0 0 10px;
}

.overview-planner-head-toolbar .overview-head-actions {
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.overview-planner-head-toolbar .overview-day-controls {
  justify-content: flex-start;
  width: 100%;
}

.overview-day-controls .btn.compact,
.overview-day-stepper,
.overview-day-controls .erp-segmented.compact {
  background: #fff;
  border: 1px solid var(--erp-border, #e3e7ee);
  border-radius: 10px;
  box-shadow: none;
  min-height: 36px;
}

.overview-day-controls .btn.compact {
  color: var(--brand-red);
  font-size: 14px;
  font-weight: 850;
  justify-content: center;
  min-width: 92px;
  padding: 7px 14px;
}

.overview-day-stepper {
  min-width: 220px;
}

.overview-day-stepper button {
  color: var(--ink);
  height: 34px;
  width: 36px;
}

.overview-day-stepper strong {
  align-items: center;
  display: inline-flex;
  flex: 1;
  font-size: 14px;
  justify-content: center;
  min-width: 130px;
}

.overview-day-controls .erp-segmented.compact {
  background: #fff;
  gap: 2px;
  overflow: hidden;
}

.overview-day-controls .erp-segmented.compact button {
  border-radius: 8px;
  color: var(--admin-muted, #687082);
  font-size: 13px;
  font-weight: 820;
  min-height: 30px;
  padding: 5px 12px;
}

.overview-day-controls .erp-segmented.compact button.active,
.overview-day-controls .erp-segmented.compact button[aria-disabled="true"].active {
  background: rgba(201, 31, 38, 0.08);
  color: var(--brand-red);
}

.overview-planner-cell-free-stack {
  overflow: visible;
  position: relative;
}

.overview-planner-cell-free-stack .planner-choice-popover {
  background: #fff;
  border: 1px solid var(--erp-border, #e3e7ee);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(22, 25, 31, 0.16);
  display: grid;
  gap: 2px;
  left: 10px;
  padding: 6px;
  position: absolute;
  top: calc(var(--planner-choice-top, 2px) + 28px);
  width: 152px;
  z-index: 80;
}

.overview-planner-cell-free-stack .planner-choice-popover::before {
  background: #fff;
  border-left: 1px solid var(--erp-border, #e3e7ee);
  border-top: 1px solid var(--erp-border, #e3e7ee);
  content: "";
  height: 8px;
  left: 18px;
  position: absolute;
  top: -5px;
  transform: rotate(45deg);
  width: 8px;
}

.overview-planner-cell-free-stack .planner-choice-popover button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 8px;
  grid-template-columns: 24px minmax(0, 1fr);
  min-height: 34px;
  padding: 5px 7px;
  text-align: left;
}

.overview-planner-cell-free-stack .planner-choice-popover button:hover,
.overview-planner-cell-free-stack .planner-choice-popover button:focus-visible {
  background: rgba(201, 31, 38, 0.08);
  outline: 0;
}

.overview-planner-cell-free-stack .planner-choice-popover span {
  align-items: center;
  background: #f7f8fa;
  border: 1px solid var(--erp-border, #e3e7ee);
  border-radius: 7px;
  color: var(--brand-red);
  display: inline-flex;
  font-size: 15px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  position: static;
  transform: none;
  width: 24px;
}

.overview-planner-cell-free-stack .planner-choice-popover strong {
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0;
}

@media (max-width: 760px) {
  .overview-planner-head-toolbar {
    padding-bottom: 8px;
  }

  .overview-day-stepper,
  .overview-day-controls .btn.compact,
  .overview-day-controls .erp-segmented.compact {
    width: 100%;
  }

  .overview-planner-cell-free-stack .planner-choice-popover {
    left: 8px;
    width: 142px;
  }
}

/* Planner modal and interval labels: final override. */
.overview-planner-cell-offshift {
  display: grid;
  gap: 1px;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-height: 58px;
  overflow: hidden;
  padding: 0;
}

.overview-planner-half-offshift {
  align-content: center;
  display: grid;
  gap: 2px;
  min-height: 0;
  padding: 5px 8px;
}

.overview-planner-half-offshift + .overview-planner-half-offshift {
  border-top: 1px solid rgba(226, 229, 235, 0.9);
}

.overview-planner-half-offshift span {
  color: var(--admin-muted, #687082);
  font-size: 10px;
  font-weight: 860;
  line-height: 1;
  text-transform: uppercase;
}

.overview-planner-half-offshift small {
  color: var(--admin-muted, #687082);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.1;
}

.overview-planner-half-slot small {
  color: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  font-weight: 780;
}

.planner-modal-backdrop {
  align-items: center;
  background: rgba(22, 25, 31, 0.45);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 120;
}

.planner-create-modal {
  background: #fff;
  border: 1px solid var(--erp-border, #e3e7ee);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(22, 25, 31, 0.26);
  display: grid;
  gap: 14px;
  max-height: calc(100dvh - 48px);
  max-width: 1040px;
  overflow: auto;
  padding: 18px;
  width: min(1040px, calc(100vw - 48px));
}

.planner-create-modal-head {
  align-items: start;
  border-bottom: 1px solid var(--erp-border, #e3e7ee);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 36px;
  padding-bottom: 12px;
}

.planner-create-modal-head h2 {
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

.planner-create-modal-head span {
  color: var(--admin-muted, #687082);
  display: block;
  font-size: 13px;
  font-weight: 760;
  margin-top: 4px;
}

.modal-close-button {
  align-items: center;
  background: #f7f8fa;
  border: 1px solid var(--erp-border, #e3e7ee);
  border-radius: 9px;
  color: var(--ink);
  display: inline-flex;
  font-size: 22px;
  font-weight: 760;
  height: 36px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 36px;
}

.modal-close-button:hover,
.modal-close-button:focus-visible {
  background: rgba(201, 31, 38, 0.08);
  color: var(--brand-red);
  outline: 0;
}

.planner-create-modal .planner-slot-context {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planner-create-modal-body {
  min-width: 0;
}

.planner-create-modal .planner-inspector-form,
.planner-create-modal .lesson-form {
  max-width: none;
}

.planner-create-modal .lesson-form {
  display: grid;
  gap: 14px;
}

.planner-create-modal .discipline-grid,
.planner-create-modal .picker-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.planner-create-modal .lesson-client-section {
  background: #f8f9fb;
}

@media (max-width: 900px) {
  .planner-modal-backdrop {
    align-items: stretch;
    padding: 12px;
  }

  .planner-create-modal {
    max-height: calc(100dvh - 24px);
    width: calc(100vw - 24px);
  }

  .planner-create-modal .planner-slot-context,
  .planner-create-modal .discipline-grid,
  .planner-create-modal .picker-grid {
    grid-template-columns: 1fr;
  }
}

/* Planner cleanup: toolbar, quiet slots, compact creation modal. */
.overview-day-controls {
  gap: 10px;
}

.overview-day-stepper {
  min-width: 260px;
}

.overview-day-stepper strong {
  min-width: 172px;
}

.overview-planner-half-slot .slot-interval-label {
  background: transparent;
  border-radius: 0;
  color: rgba(104, 112, 130, 0.45);
  font-size: 11px;
  font-weight: 820;
  left: 8px;
  max-width: calc(100% - 16px);
  opacity: 1;
  padding: 0;
  top: 8px;
  transform: none;
}

.overview-planner-half-slot .slot-create-label {
  background: #20b596;
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 860;
  left: 8px;
  line-height: 1;
  max-width: calc(100% - 16px);
  opacity: 0;
  overflow: hidden;
  padding: 5px 8px;
  position: absolute;
  right: 8px;
  text-overflow: ellipsis;
  top: 4px;
  transform: translateY(3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  white-space: nowrap;
}

.overview-planner-half-slot:hover .slot-interval-label,
.overview-planner-half-slot:focus-visible .slot-interval-label,
.overview-planner-half-slot.selected .slot-interval-label {
  opacity: 0;
}

.overview-planner-half-slot:hover .slot-create-label,
.overview-planner-half-slot:focus-visible .slot-create-label,
.overview-planner-half-slot.selected .slot-create-label {
  opacity: 1;
  transform: translateY(0);
}

.overview-planner-half-slot:hover,
.overview-planner-half-slot:focus-visible,
.overview-planner-half-slot.selected {
  background: rgba(32, 181, 150, 0.06);
  box-shadow: inset 0 0 0 1px rgba(32, 181, 150, 0.22);
}

.overview-planner-half-offshift {
  background-color: #f3f5f8;
  background-image:
    repeating-linear-gradient(
      -45deg,
      rgba(116, 124, 140, 0.06) 0,
      rgba(116, 124, 140, 0.06) 8px,
      rgba(116, 124, 140, 0.11) 8px,
      rgba(116, 124, 140, 0.11) 16px
    );
  background-attachment: fixed;
  background-size: 22px 22px;
  box-shadow:
    inset 0 0 0 1px rgba(116, 124, 140, 0.13),
    inset 3px 0 0 rgba(116, 124, 140, 0.16);
  cursor: not-allowed;
  opacity: 1;
}

.overview-planner-half-offshift span {
  color: rgba(82, 89, 103, 0.72);
  font-size: 9px;
  letter-spacing: 0;
  text-transform: none;
}

.overview-planner-half-offshift small {
  color: rgba(82, 89, 103, 0.62);
  font-size: 10px;
}

.planner-create-modal {
  gap: 8px;
  max-width: 960px;
  padding: 12px;
  width: min(960px, calc(100vw - 48px));
}

.planner-create-modal-head {
  gap: 8px;
  padding-bottom: 10px;
}

.planner-create-modal-head h2 {
  font-size: 22px;
}

.planner-create-modal-head span {
  font-size: 12px;
}

.planner-create-modal .planner-slot-context {
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planner-create-modal .planner-slot-context > div {
  min-height: 48px;
  padding: 8px 11px;
}

.planner-create-modal #lessonForm {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.planner-create-modal #lessonForm > .lesson-form-summary,
.planner-create-modal #lessonForm > .availability-warning,
.planner-create-modal #lessonForm > .recurring-preview,
.planner-create-modal #lessonForm > .actions.full {
  grid-column: 1 / -1;
}

.planner-create-modal #lessonForm > .lesson-client-section {
  grid-column: 1;
}

.planner-create-modal #lessonForm > .lesson-visit-create-section {
  grid-column: 1 / -1;
}

.planner-create-modal #lessonForm > .lesson-service-section {
  grid-column: 2;
}

.planner-create-modal #lessonForm > .lesson-discipline-section {
  grid-column: 1;
}

.planner-create-modal #lessonForm > .lesson-when-section {
  grid-column: 1;
}

.planner-create-modal #lessonForm > .lesson-place-section {
  grid-column: 1 / -1;
}

.planner-create-modal .lesson-form-section,
.planner-create-modal .lesson-client-section {
  border-radius: 10px;
  padding: 9px;
}

.planner-create-modal .input,
.planner-create-modal .textarea,
.planner-create-modal select.input {
  font-size: 14px;
  min-height: 38px;
}

.planner-create-modal .field {
  gap: 5px;
}

.planner-create-modal .field .label,
.planner-create-modal .label {
  font-size: 11px;
}

.planner-create-modal .discipline-option,
.planner-create-modal .picker-button {
  border-radius: 9px;
  min-height: 52px;
  padding: 9px;
}

.planner-create-modal .discipline-option strong,
.planner-create-modal .picker-button strong {
  font-size: 16px;
}

.planner-create-modal .discipline-option span,
.planner-create-modal .picker-button small,
.planner-create-modal .picker-button em {
  font-size: 11px;
}

.planner-create-modal .planner-form-grid.two,
.planner-create-modal .discipline-grid,
.planner-create-modal .picker-grid {
  gap: 8px;
}

.planner-create-modal .lesson-recent-clients {
  max-height: 148px;
  overflow: auto;
}

.planner-create-modal .inspector-form-actions {
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .planner-create-modal #lessonForm,
  .planner-create-modal #lessonForm > .lesson-client-section,
  .planner-create-modal #lessonForm > .lesson-service-section,
  .planner-create-modal #lessonForm > .lesson-discipline-section,
  .planner-create-modal #lessonForm > .lesson-when-section,
  .planner-create-modal #lessonForm > .lesson-place-section {
    grid-column: 1 / -1;
  }
}

/* Booking form refinement. */
.planner-create-modal .lesson-form-section,
.planner-create-modal .lesson-client-section {
  background: #fbfaf8;
  border-color: rgba(226, 229, 235, 0.95);
}

.planner-create-modal .lesson-discipline-section {
  align-content: start;
  background: #fff;
}

.planner-create-modal .discipline-grid {
  grid-template-columns: 1fr;
}

.planner-create-modal .discipline-option {
  align-items: center;
  border-radius: 10px;
  display: grid;
  grid-template-areas:
    "title state"
    "meta state";
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 12px 14px;
}

.planner-create-modal .discipline-option::after {
  align-self: center;
  background: rgba(104, 112, 130, 0.12);
  border-radius: 999px;
  color: rgba(104, 112, 130, 0.72);
  content: "выбрать";
  font-size: 10px;
  font-weight: 860;
  grid-area: state;
  padding: 5px 8px;
  text-transform: uppercase;
}

.planner-create-modal .discipline-option.active {
  background: rgba(201, 31, 38, 0.07);
}

.planner-create-modal .discipline-option.active::after {
  background: var(--brand-red);
  color: #fff;
  content: "выбрано";
}

.planner-create-modal .discipline-option strong {
  font-size: 18px;
  grid-area: title;
}

.planner-create-modal .discipline-option span {
  color: rgba(104, 112, 130, 0.78);
  font-size: 12px;
  grid-area: meta;
}

.planner-create-modal .picker-button {
  align-items: center;
  border-radius: 10px;
  min-height: 64px;
  padding: 12px 14px;
}

.planner-create-modal .picker-button small {
  color: rgba(104, 112, 130, 0.86);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.planner-create-modal .picker-button strong {
  font-size: 18px;
}

.planner-create-modal .picker-button em {
  color: rgba(104, 112, 130, 0.74);
  font-size: 11px;
}

.planner-create-modal .picker-button b {
  background: rgba(201, 31, 38, 0.08);
  border-radius: 999px;
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 860;
  line-height: 1;
  padding: 7px 9px;
  white-space: nowrap;
}

.client-search-field {
  position: relative;
}

.client-result-list {
  display: grid;
  gap: 6px;
  max-height: 112px;
  overflow: auto;
}

.client-result-list .empty-inline {
  padding: 10px 8px;
}

.client-result-list button,
.selected-client-pill {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(226, 229, 235, 0.96);
  border-radius: 10px;
  color: var(--ink);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
  padding: 8px 10px;
  text-align: left;
}

.client-result-list button span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.client-result-list button:hover,
.client-result-list button:focus-visible,
.client-result-list button.active {
  border-color: rgba(201, 31, 38, 0.42);
  box-shadow: 0 0 0 2px rgba(201, 31, 38, 0.08);
  outline: 0;
}

.client-result-list span,
.selected-client-pill strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 860;
}

.client-result-list span b {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-result-list span em {
  color: rgba(104, 112, 130, 0.74);
  font-size: 10px;
  font-style: normal;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.client-result-list small,
.selected-client-pill small {
  color: rgba(104, 112, 130, 0.82);
  font-size: 11px;
  font-weight: 760;
}

.selected-client-pill {
  background: rgba(232, 245, 235, 0.88);
  border-color: rgba(91, 152, 96, 0.22);
}

.selected-client-pill span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.selected-client-pill button {
  background: #fff;
  border: 1px solid rgba(91, 152, 96, 0.22);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 820;
  padding: 6px 9px;
}

.lesson-client-stats {
  background: #fff;
  border: 1px solid rgba(226, 229, 235, 0.96);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.lesson-client-stat-line {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lesson-client-stat-line span {
  background: #f5f6f8;
  border-radius: 8px;
  color: rgba(104, 112, 130, 0.82);
  display: grid;
  font-size: 10px;
  font-weight: 780;
  gap: 2px;
  min-width: 0;
  padding: 7px;
}

.lesson-client-stat-line b {
  color: var(--ink);
  font-size: 15px;
  font-weight: 890;
  line-height: 1;
}

.lesson-client-membership-line {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.lesson-client-membership-line strong {
  color: var(--brand-red);
  font-size: 13px;
  font-weight: 880;
}

.lesson-client-membership-line span {
  color: rgba(104, 112, 130, 0.78);
  font-size: 11px;
  font-weight: 760;
}

.lesson-client-history {
  border-top: 1px solid rgba(226, 229, 235, 0.96);
  display: grid;
  gap: 6px;
  padding-top: 8px;
}

.lesson-client-history span {
  display: grid;
  gap: 2px;
}

.lesson-client-history b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 840;
}

.lesson-client-history small {
  color: rgba(104, 112, 130, 0.78);
  font-size: 11px;
  font-weight: 740;
}

.lesson-duration-row {
  background: #fff;
  border: 1px solid rgba(226, 229, 235, 0.96);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.lesson-duration-row > span {
  color: rgba(104, 112, 130, 0.86);
  font-size: 11px;
  font-weight: 860;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.lesson-duration-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lesson-duration-row button {
  background: #f4f6f8;
  border: 1px solid rgba(226, 229, 235, 0.96);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 840;
  padding: 7px 10px;
}

.lesson-duration-row button:hover,
.lesson-duration-row button:focus-visible,
.lesson-duration-row button.active {
  background: rgba(201, 31, 38, 0.08);
  border-color: rgba(201, 31, 38, 0.34);
  color: var(--brand-red);
  outline: 0;
}

.planner-create-modal .lesson-visit-create-section {
  background: #fff;
}

.planner-create-modal .lesson-draft-statuses {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status {
  align-content: center;
  display: grid;
  gap: 3px;
  min-height: 56px;
  text-align: left;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status strong {
  color: inherit;
  font-size: 14px;
  font-weight: 880;
}

.selected-client-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(250, 244, 236, 0.94));
  border: 1px solid rgba(226, 229, 235, 0.96);
  border-radius: 14px;
  display: grid;
  gap: 11px;
  padding: 12px;
}

.selected-client-card-head {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.selected-client-avatar {
  align-items: center;
  background: var(--brand-red);
  border-radius: 14px;
  color: #fff;
  display: inline-flex;
  font-size: 18px;
  font-weight: 920;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.selected-client-card-head div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.selected-client-card-head strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.08;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-client-card-head small {
  color: rgba(104, 112, 130, 0.78);
  font-size: 11px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-client-card-head button {
  background: #fff;
  border: 1px solid rgba(201, 31, 38, 0.18);
  border-radius: 999px;
  color: var(--brand-red);
  cursor: pointer;
  font-size: 11px;
  font-weight: 860;
  padding: 7px 10px;
}

.selected-client-details {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.selected-client-details div {
  border-top: 1px solid rgba(226, 229, 235, 0.86);
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 0;
}

.selected-client-details div:nth-child(odd) {
  padding-right: 10px;
}

.selected-client-details dt {
  color: rgba(104, 112, 130, 0.8);
  font-size: 10px;
  font-weight: 860;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.selected-client-details dd {
  color: var(--ink);
  font-size: 13px;
  font-weight: 820;
  line-height: 1.18;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status span {
  color: rgba(104, 112, 130, 0.76);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.15;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active span {
  color: rgba(201, 31, 38, 0.72);
}

.lesson-service-section {
  align-content: start;
}

.lesson-service-selected {
  background: #fff;
  border: 1px solid rgba(226, 229, 235, 0.96);
  border-radius: 12px;
  display: grid;
  gap: 6px;
  padding: 11px 12px;
}

.lesson-service-selected span {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.lesson-service-selected strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 880;
  line-height: 1.14;
}

.lesson-service-selected small,
.lesson-service-selected em {
  color: rgba(104, 112, 130, 0.8);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.22;
}

.lesson-service-selected b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 860;
  line-height: 1.2;
}

.lesson-service-selected.success {
  background: #eef8f0;
  border-color: rgba(74, 155, 88, 0.24);
}

.lesson-service-selected.success b {
  color: #4a9b58;
}

.lesson-service-selected.warning {
  background: #fff4f3;
  border-color: rgba(201, 31, 38, 0.2);
}

.lesson-service-selected.warning b {
  color: var(--brand-red);
}

.lesson-service-quick {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lesson-service-quick button,
.lesson-service-list button {
  background: #fff;
  border: 1px solid rgba(226, 229, 235, 0.96);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
  text-align: left;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.lesson-service-quick button {
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 10px;
}

.lesson-service-quick button strong {
  color: inherit;
  font-size: 13px;
  font-weight: 860;
  line-height: 1.12;
}

.lesson-service-quick button span {
  color: rgba(104, 112, 130, 0.8);
  font-size: 11px;
  font-weight: 760;
}

.lesson-service-list {
  display: grid;
  gap: 10px;
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}

.lesson-service-list > div {
  display: grid;
  gap: 5px;
}

.lesson-service-list > div > strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 880;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lesson-service-list button {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
}

.lesson-service-list button span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lesson-service-list button b {
  color: inherit;
  font-size: 13px;
  font-weight: 830;
  line-height: 1.15;
}

.lesson-service-list button small,
.lesson-service-list button em {
  color: rgba(104, 112, 130, 0.78);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  white-space: nowrap;
}

.lesson-service-quick button:hover,
.lesson-service-quick button:focus-visible,
.lesson-service-quick button.active,
.lesson-service-list button:hover,
.lesson-service-list button:focus-visible,
.lesson-service-list button.active {
  background: rgba(201, 31, 38, 0.07);
  border-color: rgba(201, 31, 38, 0.34);
  box-shadow: 0 0 0 2px rgba(201, 31, 38, 0.08);
  color: var(--brand-red);
  outline: 0;
}

@media (max-width: 900px) {
  .planner-create-modal .lesson-draft-statuses,
  .lesson-service-quick {
    grid-template-columns: 1fr;
  }
}

.clients-workbench {
  display: grid;
  grid-template-columns: minmax(520px, 0.92fr) minmax(460px, 0.78fr);
  min-height: calc(100dvh - 220px);
}

.clients-workbench > .erp-table {
  min-width: 0;
}

.client-detail-panel {
  background: #fff;
  display: block;
  overflow: auto;
}

.client-profile-list {
  border-top: 1px solid rgba(36, 35, 33, 0.08);
}

.client-profile-editor {
  background: #fbfcfd;
  border: 1px solid rgba(36, 35, 33, 0.1);
  border-radius: 14px;
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
}

.client-profile-editor-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.client-profile-editor-head > span {
  color: var(--erp-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.client-profile-editor-actions {
  align-items: center;
  display: flex;
  gap: 7px;
}

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

.client-profile-grid label {
  color: var(--erp-muted);
  display: grid;
  font-size: 10px;
  font-weight: 870;
  gap: 5px;
  letter-spacing: 0.08em;
  min-width: 0;
  text-transform: uppercase;
}

.client-profile-grid label.wide {
  grid-column: 1 / -1;
}

.client-profile-grid .input {
  font-size: 13px;
  min-height: 34px;
  padding: 7px 9px;
}

.client-profile-editor.readonly .input {
  background: rgba(246, 247, 249, 0.9);
  border-color: rgba(36, 35, 33, 0.08);
  color: var(--ink);
  cursor: default;
}

.client-profile-editor.editing .input {
  background: #fff;
  border-color: rgba(201, 31, 38, 0.28);
  box-shadow: 0 0 0 3px rgba(201, 31, 38, 0.06);
}

.client-profile-editor .input:disabled {
  opacity: 1;
}

.client-profile-editor .btn {
  justify-content: center;
}

.client-profile-editor .btn-outline,
.client-profile-editor .btn-ghost {
  background: #fff;
  color: var(--brand-red);
}

.client-profile-editor .btn-ghost {
  border-color: rgba(36, 35, 33, 0.12);
  color: var(--erp-muted);
}

.client-profile-check {
  border-radius: 12px;
  font-size: 20px;
  line-height: 1;
  min-width: 42px;
  padding-left: 0;
  padding-right: 0;
}

.client-context-list {
  border-top: 1px solid rgba(36, 35, 33, 0.08);
  margin-top: 12px;
}

.client-action-panel {
  background: #fff;
  border: 1px solid rgba(36, 35, 33, 0.1);
  border-radius: 14px;
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
}

.client-action-panel h3 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0;
}

.client-action-panel .kicker {
  margin: 0;
}

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

.client-membership-strip {
  background: #f7faf6;
  border: 1px solid rgba(91, 151, 95, 0.22);
  border-radius: 14px;
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
}

.client-membership-strip.low {
  background: #fff7f7;
  border-color: rgba(201, 31, 38, 0.22);
}

.client-membership-strip span,
.client-membership-strip em {
  color: var(--erp-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
}

.client-membership-strip strong {
  color: var(--ink);
  display: block;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  margin-top: 4px;
}

.client-membership-strip .membership-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-payment-summary {
  background: #fff;
  border: 1px solid var(--admin-border, #dde3ec);
  border-radius: 12px;
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 11px 12px;
}

.client-payment-summary.empty {
  background: #f7f8fa;
}

.client-payment-summary span {
  color: var(--admin-muted, #687082);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.client-payment-summary strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
}

.client-payment-summary em {
  color: var(--admin-muted, #687082);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.2;
}

.client-next-booking {
  background: #f7f9ff;
  border: 1px solid rgba(71, 111, 214, 0.18);
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 11px 12px;
  text-align: left;
  width: 100%;
}

.client-next-booking.empty {
  background: #f7f8fa;
  cursor: default;
}

.client-next-booking:hover,
.client-next-booking:focus-visible {
  border-color: rgba(71, 111, 214, 0.34);
  box-shadow: inset 3px 0 0 rgba(71, 111, 214, 0.34);
  outline: none;
}

.client-next-booking span {
  color: var(--admin-muted, #687082);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.client-next-booking strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
}

.client-next-booking em {
  color: var(--admin-muted, #687082);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.2;
}

.client-stat-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.client-stat-grid div {
  background: #f6f7f9;
  border: 1px solid rgba(36, 35, 33, 0.08);
  border-radius: 12px;
  padding: 10px;
}

.client-stat-grid strong {
  color: var(--ink);
  display: block;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.client-stat-grid span {
  color: var(--erp-muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  margin-top: 5px;
}

.client-message-panel {
  display: grid;
  gap: 10px;
}

.client-message-panel textarea {
  min-height: 84px;
  resize: vertical;
}

.client-message-panel .btn {
  justify-content: center;
}

@media (max-width: 1180px) {
  .clients-workbench {
    grid-template-columns: 1fr;
  }

  .client-detail-panel {
    border-left: 0;
    border-top: 1px solid var(--admin-border, #e3e7ee);
  }
}

@media (max-width: 720px) {
  .client-stat-grid,
  .client-membership-strip .membership-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-profile-grid,
  .client-action-buttons {
    grid-template-columns: 1fr;
  }
}

.planner-break-segment {
  border: 0;
  cursor: grab;
  text-align: left;
}

.planner-break-segment:active {
  cursor: grabbing;
}

.overview-planner-half-offshift.planner-break-segment {
  background:
    linear-gradient(180deg, rgba(247, 248, 250, 0.76), rgba(247, 248, 250, 0.66)),
    repeating-linear-gradient(
      135deg,
      rgba(201, 31, 38, 0.12) 0,
      rgba(201, 31, 38, 0.12) 8px,
      rgba(201, 31, 38, 0.03) 8px,
      rgba(201, 31, 38, 0.03) 16px
    );
  box-shadow: inset 0 0 0 1px rgba(201, 31, 38, 0.16);
}

.planner-break-segment span,
.planner-break-segment small {
  color: #9f2529;
}

.planner-break-segment:hover,
.planner-break-segment:focus-visible,
.planner-break-segment.selected {
  box-shadow:
    inset 0 0 0 1px rgba(201, 31, 38, 0.36),
    0 0 0 2px rgba(201, 31, 38, 0.08);
  outline: 0;
}

.planner-break-segment.dragging {
  opacity: 0.62;
}

.overview-planner-half-slot.break-drop-target {
  background: rgba(32, 181, 150, 0.14);
  box-shadow: inset 0 0 0 2px rgba(32, 181, 150, 0.52);
}

.overview-planner-event[data-planner-slot-drag] {
  cursor: grab;
  padding-right: 24px;
  position: relative;
}

.overview-planner-event[data-planner-slot-drag]:active {
  cursor: grabbing;
}

.overview-planner-event.dragging {
  opacity: 0.58;
}

.planner-event-students {
  align-self: end;
  color: rgba(36, 35, 33, 0.72);
  display: grid;
  gap: 2px;
  font-size: 12px;
  font-style: normal;
  font-weight: 840;
  grid-area: student;
  line-height: 1.08;
  min-width: 0;
  overflow: hidden;
}

.planner-event-students b,
.planner-event-students span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-event-students b {
  color: rgba(36, 35, 33, 0.78);
  font-size: 12px;
  font-weight: 880;
}

.planner-event-students span {
  color: rgba(36, 35, 33, 0.54);
  font-size: 10px;
  font-weight: 820;
}

.planner-event-resize {
  background: transparent;
  border: 0;
  border-radius: 0;
  bottom: 0;
  cursor: ns-resize;
  height: 14px;
  opacity: 0;
  position: absolute;
  left: 0;
  right: 0;
  width: auto;
  z-index: 3;
}

.planner-event-resize:hover,
.planner-event-resize:focus-visible {
  background: transparent;
  box-shadow: none;
  opacity: 0;
}

.overview-planner-half-slot.slot-drop-target {
  background: rgba(32, 181, 150, 0.16);
  box-shadow: inset 0 0 0 2px rgba(32, 181, 150, 0.62);
}

.overview-planner-time,
.overview-planner-cell {
  height: var(--planner-hour-height, 80px);
  min-height: var(--planner-hour-height, 80px);
}

.overview-planner-time {
  align-items: center;
  font-size: 10px;
  justify-content: center;
  line-height: 1;
  padding: 0 4px;
  white-space: nowrap;
}

.overview-planner-cell {
  overflow: visible;
  position: relative;
}

.overview-planner-cell-busy {
  display: block;
  padding: 0;
  z-index: 8;
}

.overview-planner-cell-continuation {
  pointer-events: none;
}

.overview-planner-event-shell {
  height: var(--event-height-px, 52px);
  left: 6px;
  position: absolute;
  right: 6px;
  top: var(--event-top-px, 4px);
  z-index: 24;
}

.overview-planner-event-shell .overview-planner-event {
  align-content: stretch;
  background: #f9d7c6;
  border: 1px solid rgba(174, 76, 57, 0.2);
  border-top: 0;
  box-shadow: 0 3px 8px rgba(64, 43, 24, 0.08);
  display: grid;
  gap: 2px 7px;
  grid-template-areas:
    "head head"
    "student title"
    "type type"
    "alert alert";
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 18px minmax(0, 1fr) auto auto;
  height: 100%;
  overflow: hidden;
  min-height: 0;
  padding: 0 6px 4px;
}

.overview-planner-event-shell .overview-planner-event.is-compact {
  gap: 0 6px;
  grid-template-areas:
    "head head"
    "student title";
  grid-template-rows: 16px minmax(0, 1fr);
  padding: 0 6px 3px;
}

.overview-planner-event-shell .overview-planner-event-internal,
.overview-planner-event-shell .overview-planner-event.note-event {
  background: #efe5d8;
  border-color: rgba(133, 104, 65, 0.22);
  border-top: 0;
}

.overview-planner-event-shell.resizing .overview-planner-event {
  box-shadow:
    0 0 0 2px rgba(32, 181, 150, 0.28),
    0 14px 28px rgba(32, 181, 150, 0.18);
}

.planner-event-delete {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 14px;
  justify-content: center;
  opacity: 0;
  position: absolute;
  right: 6px;
  top: 2px;
  transition: opacity 0.14s ease, transform 0.14s ease;
  width: 14px;
  z-index: 30;
}

.planner-event-head {
  align-items: center;
  background: #b94b3f;
  color: #fff;
  display: grid;
  gap: 6px;
  grid-area: head;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0 -6px;
  min-width: 0;
  padding: 2px 6px 3px;
}

.overview-planner-event.is-compact .planner-event-head {
  gap: 4px;
  padding: 1px 6px 2px;
}

.overview-planner-event-internal .planner-event-head,
.overview-planner-event.note-event .planner-event-head {
  background: #856841;
}

.overview-planner-event-shell:hover .planner-event-delete,
.overview-planner-event-shell:focus-within .planner-event-delete {
  opacity: 0.96;
}

.planner-event-delete:hover,
.planner-event-delete:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  outline: 0;
  transform: scale(1.04);
}

.overview-planner-event-shell.delete-pending .planner-event-delete {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  font-size: 8px;
  height: 15px;
  letter-spacing: 0.02em;
  opacity: 1;
  padding: 0 7px;
  text-transform: uppercase;
  width: 76px;
}

.planner-event-resize {
  background: transparent;
  border-radius: 0;
  bottom: 0;
  cursor: ns-resize;
  height: 14px;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  width: auto;
}

.planner-event-resize:hover,
.planner-event-resize:focus-visible,
.overview-planner-event-shell.resizing .planner-event-resize {
  background: transparent;
  opacity: 0;
}

.availability-mini-blocked-person.availability-break,
.picker-option.availability-break {
  background: #fff6f4;
  border-color: rgba(201, 31, 38, 0.18);
}

.availability-mini-blocked-person.availability-break b,
.picker-option.availability-break small {
  color: var(--brand-red);
}

.picker-option.availability-break {
  opacity: 0.72;
}

.overview-planner-event time {
  color: #fff;
  font-size: 11px;
  line-height: 1.05;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-planner-event.is-compact time {
  font-size: 10px;
}

.overview-planner-event strong {
  align-self: end;
  color: rgba(36, 35, 33, 0.96);
  font-size: 13px;
  grid-area: title;
  line-height: 1.08;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-planner-event.is-compact strong {
  align-self: center;
  font-size: 12px;
  line-height: 1;
}

.overview-planner-event small {
  box-sizing: border-box;
  color: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  line-height: 1.05;
  max-width: 104px;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  transition: padding-right 0.14s ease, max-width 0.14s ease;
  white-space: nowrap;
}

.overview-planner-event-shell:hover .planner-event-head small,
.overview-planner-event-shell:focus-within .planner-event-head small {
  max-width: 128px;
  padding-right: 17px;
}

.overview-planner-event-shell.delete-pending .planner-event-head small {
  max-width: 176px;
  padding-right: 84px;
}

.overview-planner-event.is-compact small {
  font-size: 9px;
  max-width: 96px;
}

.overview-planner-event-shell:hover .overview-planner-event.is-compact .planner-event-head small,
.overview-planner-event-shell:focus-within .overview-planner-event.is-compact .planner-event-head small {
  max-width: 120px;
  padding-right: 17px;
}

.overview-planner-event-shell.delete-pending .overview-planner-event.is-compact .planner-event-head small {
  max-width: 176px;
  padding-right: 84px;
}

.overview-planner-event.is-compact .planner-event-students {
  align-self: center;
  line-height: 1;
}

.overview-planner-event.is-compact .planner-event-students b {
  font-size: 11px;
}

.overview-planner-event.is-compact .planner-event-students span {
  display: none;
}

.planner-event-type {
  grid-area: type;
  line-height: 1;
}

.planner-event-alert {
  grid-area: alert;
}

.overview-planner-event.is-compact .planner-event-type,
.overview-planner-event.is-compact .planner-event-alert {
  display: none;
}

/* Communications subnav and broadcasts */
.nav-tab.has-subnav {
  gap: 6px;
  grid-template-columns: 18px minmax(0, 1fr) auto auto;
}

.nav-tab.has-subnav .nav-copy > span {
  font-size: 13px;
  letter-spacing: -0.01em;
}

.nav-chevron {
  color: var(--admin-muted, #687082);
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.nav-submenu {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 2px;
  margin: -1px 0 6px;
  padding: 0;
  width: 100%;
}

.nav-submenu button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--admin-muted, #687082);
  font-size: 13px;
  font-weight: 850;
  min-height: 32px;
  padding: 7px 12px 7px 40px;
  text-align: left;
  width: 100%;
}

.nav-submenu button:hover,
.nav-submenu button:focus-visible,
.nav-submenu button.active {
  background: rgba(201, 31, 38, 0.08);
  color: var(--brand-red);
  outline: 0;
}

.overview-broadcast-reminder {
  align-items: center;
  background: #fff;
  border: 1px solid var(--erp-border, #e3e7ee);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 8px 10px;
}

.overview-broadcast-reminder.is-late {
  background: #fff8f4;
  border-color: rgba(201, 31, 38, 0.22);
}

.overview-broadcast-reminder .kicker {
  font-size: 10px;
  line-height: 1;
  margin: 0 0 2px;
}

.overview-broadcast-reminder strong {
  color: var(--ink);
  display: block;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  margin: 0;
}

.overview-broadcast-reminder span {
  color: var(--admin-muted, #687082);
  display: block;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.25;
  margin-top: 2px;
}

.overview-broadcast-reminder .btn {
  min-height: 34px;
  padding: 7px 12px;
  width: auto;
}

.broadcast-grid {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(280px, 0.95fr) minmax(280px, 1fr);
}

.broadcast-grid .panel {
  border-radius: 12px;
}

.broadcast-audience-panel {
  display: grid;
  gap: 12px;
}

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

.broadcast-audience-chip {
  background: #fff;
  border: 1px solid var(--erp-border, #e3e7ee);
  border-radius: 10px;
  color: var(--ink);
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 10px;
  text-align: left;
}

.broadcast-audience-chip:hover,
.broadcast-audience-chip:focus-visible,
.broadcast-audience-chip.active {
  background: rgba(201, 31, 38, 0.07);
  border-color: rgba(201, 31, 38, 0.45);
  outline: 0;
}

.broadcast-audience-chip strong {
  font-size: 14px;
  font-weight: 900;
}

.broadcast-audience-chip span {
  color: var(--admin-muted, #687082);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.compact-field {
  max-width: 220px;
}

.broadcast-recipient-head {
  align-items: end;
  border-top: 1px solid var(--erp-border, #e3e7ee);
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
}

.broadcast-recipient-head strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.broadcast-recipient-head span {
  color: var(--admin-muted, #687082);
  font-size: 12px;
  font-weight: 760;
}

.broadcast-recipient-list,
.broadcast-custom-list {
  border: 1px solid var(--erp-border, #e3e7ee);
  border-radius: 10px;
  display: grid;
  max-height: 310px;
  overflow: auto;
}

.broadcast-recipient-list div,
.broadcast-recipient-check {
  align-items: center;
  border-bottom: 1px solid var(--erp-border, #e3e7ee);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 9px 10px;
}

.broadcast-recipient-check {
  cursor: pointer;
  grid-template-columns: 18px minmax(0, 1fr);
}

.broadcast-recipient-list div:last-child,
.broadcast-recipient-check:last-child {
  border-bottom: 0;
}

.broadcast-recipient-list strong,
.broadcast-recipient-check strong {
  color: var(--ink);
  display: block;
  font-size: 13px;
  font-weight: 880;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.broadcast-recipient-list span,
.broadcast-recipient-check small {
  color: var(--admin-muted, #687082);
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.broadcast-recipient-check input {
  accent-color: var(--brand-red);
  height: 16px;
  width: 16px;
}

@media (max-width: 1180px) {
  .broadcast-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .overview-broadcast-reminder {
    align-items: stretch;
    display: grid;
  }

  .broadcast-audience-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin visual-language consolidation: dense operational surface. */
:root {
  --bg-page: #f4f5f7;
  --bg-surface: #fff;
  --bg-soft: #f6f7f9;
  --line: #e2e6ed;
  --rose: #f3e4e6;
  --shadow: 0 1px 2px rgba(31, 35, 45, 0.04), 0 10px 24px rgba(31, 35, 45, 0.08);
  --admin-bg: #f4f5f7;
  --admin-surface: #fff;
  --admin-soft: #f6f7f9;
  --admin-border: #e2e6ed;
  --admin-muted: #687082;
  --admin-active: rgba(201, 31, 38, 0.075);
}

body {
  background: var(--admin-bg);
}

.admin-shell {
  padding: 0;
}

.workspace {
  background: var(--admin-bg);
}

.admin-nav,
.sidebar-calendar-mini,
.workspace .panel:not(.modal-panel):not(.lesson-modal-panel),
.erp-table,
.overview-planner-shell,
.overview-inspector,
.calendar-panel,
.work-coverage-section,
.overview-broadcast-reminder,
.planner-create-modal,
  .modal-panel,
  .client-action-panel,
  .client-membership-strip,
  .client-next-booking,
  .client-profile-editor,
  .client-stat-grid div,
.slot-side-card,
.slot-selected-mode,
.slot-command-panel,
.lesson-service-card,
.lesson-payment-card,
.broadcast-grid .panel,
.broadcast-history-item,
.request-mini,
.message-box,
.task-row,
.work-summary-card,
.work-coverage-card,
.student-membership-inspector,
.request-inspector-status,
.inspector-detail-list > div,
.recurring-preview,
.availability-warning,
.lesson-form-section,
.selected-client-card,
.lesson-service-selected,
.lesson-client-stats,
.lesson-duration-row,
.broadcast-audience-chip,
.broadcast-recipient-list,
.broadcast-custom-list,
.client-result-list button,
.selected-client-pill,
.event-row,
.detail-item,
.booking-status-row {
  background: var(--admin-surface);
  border-color: var(--admin-border);
  border-radius: 12px;
  box-shadow: none;
}

.workspace > .page-head {
  gap: 14px;
  margin-bottom: 12px;
  padding-bottom: 14px;
}

.workspace > .page-head .title {
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1.02;
}

.workspace > .page-head .lead {
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.32;
  max-width: 760px;
}

.kicker {
  color: var(--brand-red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1;
  margin-bottom: 6px;
}

.section-title,
.client-action-panel h3,
.client-actions h3,
.client-history h3,
.broadcast-recipient-head strong,
.slot-panel-head strong {
  font-size: 16px;
  line-height: 1.12;
}

.lead,
.label,
.field .label,
.client-info-list dt,
.client-info-list dd,
.client-history span,
.client-history em,
.slot-side-card p,
.broadcast-audience-chip span,
.broadcast-recipient-head span,
.broadcast-recipient-list span,
.broadcast-recipient-check small {
  color: var(--admin-muted);
}

.btn {
  border-radius: 10px;
  font-size: 13px;
  font-weight: 850;
  min-height: 36px;
  padding: 8px 12px;
}

.btn.compact {
  min-height: 32px;
  padding: 6px 10px;
}

.btn-secondary,
.client-profile-editor .btn-outline,
.client-profile-editor .btn-ghost {
  background: #fff;
  border-color: rgba(201, 31, 38, 0.38);
  color: var(--brand-red);
}

.btn-secondary:hover,
.btn-secondary:focus-visible,
.client-profile-editor .btn-outline:hover,
.client-profile-editor .btn-outline:focus-visible {
  background: var(--admin-active);
  outline: 0;
}

.input,
.textarea,
select.input,
.planner-create-modal .input,
.planner-create-modal .textarea,
.planner-create-modal select.input {
  background: #fff;
  border-color: var(--admin-border);
  border-radius: 10px;
  font-size: 13px;
  min-height: 36px;
  padding: 8px 10px;
}

.textarea {
  min-height: 96px;
}

.compact-textarea,
.client-message-panel textarea {
  min-height: 76px;
}

.textarea:focus,
.input:focus {
  border-color: rgba(201, 31, 38, 0.48);
  box-shadow: 0 0 0 2px rgba(201, 31, 38, 0.08);
}

.form-grid,
.compact-form,
.lesson-form,
.planner-inspector-form,
.inspector-detail-list,
.stack,
.request-list,
.timeline-list,
.student-list,
.broadcast-history,
.event-list,
.task-list {
  gap: 8px;
}

.panel {
  padding: 14px;
}

.modal-backdrop,
.planner-modal-backdrop {
  background: rgba(22, 25, 31, 0.42);
  padding: 16px;
}

.modal-panel,
.planner-create-modal {
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(22, 25, 31, 0.2);
  gap: 10px;
  padding: 14px;
}

.modal-panel {
  max-width: 760px;
}

.lesson-modal-panel,
.planner-create-modal {
  max-width: 1040px;
  width: min(1040px, calc(100vw - 32px));
}

.modal-head {
  padding-right: 44px;
}

.modal-title,
.planner-create-modal-head h2 {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.04;
}

.planner-create-modal-head {
  align-items: center;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 34px;
  padding-bottom: 10px;
}

.modal-close,
.modal-close-button {
  background: var(--admin-soft);
  border-color: var(--admin-border);
  border-radius: 9px;
  box-shadow: none;
  color: var(--ink);
  height: 34px;
  right: 14px;
  top: 14px;
  width: 34px;
}

.modal-close::before,
.modal-close::after {
  height: 2px;
  width: 16px;
}

.modal-close:hover,
.modal-close:focus-visible,
.modal-close-button:hover,
.modal-close-button:focus-visible {
  background: var(--admin-active);
  border-color: rgba(201, 31, 38, 0.26);
  box-shadow: none;
  color: var(--brand-red);
}

.lesson-form-section,
.planner-create-modal .lesson-form-section,
.planner-create-modal .lesson-client-section,
.slot-selected-mode .lesson-form-section {
  background: #fff;
  border-color: var(--admin-border);
  border-radius: 10px;
  gap: 8px;
  padding: 10px;
}

.planner-create-modal #lessonForm {
  gap: 8px;
}

.planner-create-modal .planner-slot-context {
  background: #fff;
  border-color: var(--admin-border);
  border-radius: 10px;
  gap: 0;
}

.planner-create-modal .planner-slot-context > div {
  min-height: 42px;
  padding: 7px 10px;
}

.discipline-grid,
.picker-grid,
.planner-create-modal .discipline-grid,
.planner-create-modal .picker-grid {
  gap: 8px;
}

.discipline-option,
.picker-button,
.planner-create-modal .discipline-option,
.planner-create-modal .picker-button {
  background: #fff;
  border-color: var(--admin-border);
  border-radius: 10px;
  min-height: 48px;
  padding: 9px 10px;
}

.discipline-option strong,
.picker-button strong,
.planner-create-modal .discipline-option strong,
.planner-create-modal .picker-button strong {
  font-size: 15px;
  line-height: 1.12;
}

.discipline-option span,
.picker-button small,
.picker-button em,
.planner-create-modal .discipline-option span,
.planner-create-modal .picker-button small,
.planner-create-modal .picker-button em {
  color: var(--admin-muted);
  font-size: 11px;
}

.discipline-option.active,
.discipline-option:has(input:checked),
.picker-button:hover,
.picker-button:focus-visible,
.picker-button.active,
.planner-create-modal .discipline-option.active {
  background: var(--admin-active);
  border-color: rgba(201, 31, 38, 0.3);
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.72);
  color: var(--ink);
}

.planner-create-modal .discipline-option::after {
  background: var(--admin-soft);
  border-radius: 8px;
  color: var(--admin-muted);
  font-size: 9px;
  padding: 4px 6px;
}

.planner-create-modal .discipline-option.active::after {
  background: var(--brand-red);
  color: #fff;
}

.picker-popover,
.planner-choice-popover {
  background: #fff;
  border-color: var(--admin-border);
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(22, 25, 31, 0.14);
  padding: 6px;
}

.picker-options,
.picker-option-group,
.client-result-list,
.lesson-service-list,
.broadcast-recipient-list,
.broadcast-custom-list {
  gap: 4px;
}

.picker-option,
.planner-choice-popover button,
.lesson-service-list button,
.lesson-service-quick button,
.client-result-list button,
.selected-client-pill,
.broadcast-audience-chip,
.broadcast-recipient-list div,
.broadcast-recipient-check {
  border-radius: 9px;
  min-height: 38px;
  padding: 8px 10px;
}

.picker-option.active,
.lesson-service-quick button.active,
.lesson-service-list button.active,
.lesson-service-quick button:hover,
.lesson-service-quick button:focus-visible,
.lesson-service-list button:hover,
.lesson-service-list button:focus-visible,
.client-result-list button:hover,
.client-result-list button:focus-visible,
.client-result-list button.active,
.broadcast-audience-chip:hover,
.broadcast-audience-chip:focus-visible,
.broadcast-audience-chip.active {
  background: var(--admin-active);
  border-color: rgba(201, 31, 38, 0.28);
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.58);
  color: var(--ink);
}

.lesson-service-selected,
.selected-client-card,
.lesson-client-stats,
.lesson-duration-row,
.client-action-panel,
.client-profile-editor,
.client-membership-strip,
.client-next-booking,
.client-message-panel,
.student-membership-inspector,
.request-inspector-status,
.inspector-detail-list > div {
  gap: 8px;
  padding: 10px;
}

.lesson-service-selected.warning,
.client-membership-strip.low,
.availability-warning,
.recurring-preview.has-conflicts,
.event-row.active,
.student-membership-inspector.low,
.attention-focus-note {
  background: rgba(201, 31, 38, 0.055);
  border-color: rgba(201, 31, 38, 0.24);
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.42);
}

.lesson-service-selected.success,
.selected-client-pill,
.lesson-form-summary .availability-available,
.inspector-detail-list .availability-available {
  background: rgba(74, 155, 88, 0.08);
  border-color: rgba(74, 155, 88, 0.2);
}

.selected-client-card {
  background: #fff;
}

.selected-client-avatar,
.student-avatar,
.erp-avatar,
.client-avatar,
.slot-inspector-avatar {
  border-radius: 10px;
  height: 38px;
  width: 38px;
}

.selected-client-card-head,
.client-card-head {
  gap: 10px;
}

.client-avatar {
  font-size: 16px;
}

.client-card-head {
  margin-bottom: 12px;
}

.client-card-head h2 {
  font-size: 21px;
  line-height: 1.06;
  margin-bottom: 6px;
}

.client-tags {
  gap: 5px;
}

.client-tags span,
.erp-status,
.note-chip,
.badge,
.role-chip,
.status-pill,
.lesson-form-summary span,
.availability-warning-chip {
  border-radius: 8px;
  font-size: 11px;
  min-height: 0;
  padding: 5px 7px;
}

.client-info-list div,
.client-history article,
.selected-client-details div,
.broadcast-history-item,
.timeline-slot,
.count-row {
  padding-bottom: 8px;
  padding-top: 8px;
}

.client-actions,
.client-history,
.client-context-list {
  margin-top: 12px;
  padding-top: 12px;
}

.client-actions > div,
.client-action-buttons,
.slot-quick-actions,
.client-membership-strip .membership-actions {
  gap: 6px;
}

.client-profile-grid {
  gap: 6px;
}

.client-profile-grid .input {
  min-height: 32px;
  padding: 6px 8px;
}

.client-profile-editor.editing .input {
  border-color: rgba(201, 31, 38, 0.32);
  box-shadow: 0 0 0 2px rgba(201, 31, 38, 0.06);
}

.client-membership-strip strong,
.student-membership-inspector strong,
.work-summary-card strong,
.work-coverage-now strong,
.work-coverage-card strong,
.count-row strong {
  font-size: 22px;
  line-height: 1;
}

.analytics-summary-table,
.status-flow,
.work-summary-grid,
.client-stat-grid,
.erp-kpi-grid,
.broadcast-grid,
.event-editor-grid,
.requests-workbench,
.students-workbench,
.teachers-workbench,
.tasks-board,
.communications-workbench,
.clients-workbench {
  gap: 12px;
}

.analytics-summary-table div,
.count-row,
.task-row,
.overview-request-card,
.request-card,
.student-row,
.teacher-row,
.teacher-card-button,
.event-row,
.work-summary-card,
.work-coverage-card,
.broadcast-history-item {
  border-radius: 12px;
  box-shadow: none;
  padding: 10px 12px;
}

.task-row,
.student-row,
.teacher-row,
.erp-table-row {
  min-height: 58px;
}

.task-row h3,
.event-row strong,
.request-mini strong,
.broadcast-history-item strong {
  font-size: 14px;
}

.message-bubble {
  border-radius: 10px;
  max-width: 82%;
  padding: 9px 11px;
  overflow-wrap: anywhere;
}

.message-bubble.outgoing {
  background: var(--brand-red);
  color: #fff;
  justify-self: end;
}

.message-bubble span {
  font-size: 10px;
  letter-spacing: 0.04em;
}

.message-bubble p {
  font-size: 13px;
}

.message-bubble.outgoing span,
.message-bubble.outgoing p {
  color: #fff;
}

.communication-compose {
  padding-top: 10px;
}

.broadcast-grid .panel,
.event-editor-grid .panel,
.broadcast-history-panel {
  padding: 12px;
}

.broadcast-audience-grid {
  gap: 6px;
}

.broadcast-audience-chip {
  min-height: 58px;
}

.broadcast-audience-chip strong {
  font-size: 13px;
}

.broadcast-recipient-list,
.broadcast-custom-list {
  max-height: 260px;
}

.work-summary-grid {
  margin-bottom: 10px;
}

.work-summary-card,
.work-coverage-card {
  gap: 4px;
}

.work-person,
.work-shift-cell,
.work-coverage-section,
.calendar-panel,
.calendar-planner-days,
.calendar-planner-days button,
.icon-btn {
  border-radius: 10px;
}

.calendar-panel {
  padding: 12px;
}

.calendar-toolbar {
  gap: 10px;
  padding-bottom: 10px;
}

.calendar-planner-days {
  gap: 4px;
  padding: 6px;
}

.calendar-planner-days button {
  min-height: 42px;
  padding: 5px 4px;
}

.event-row.active,
.request-card.selected,
.student-row.selected,
.teacher-card-button.selected,
.erp-table-row.selected {
  background: var(--admin-active);
  border-color: rgba(201, 31, 38, 0.28);
  box-shadow: inset 3px 0 0 var(--brand-red);
}

.filter-chip,
.erp-filter-pill,
.overview-day-controls .btn.compact,
.overview-day-controls .erp-segmented.compact,
.overview-day-stepper {
  border-radius: 10px;
}

.filter-chip.active,
.erp-tabs button.active,
.calendar-planner-days button.active {
  background: var(--admin-active);
  border-color: rgba(201, 31, 38, 0.24);
  color: var(--brand-red);
}

.planner-break-segment:hover,
.planner-break-segment:focus-visible,
.planner-break-segment.selected {
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.58);
}

.overview-planner-event-shell .overview-planner-event {
  border-radius: 8px;
}

.overview-planner-event-shell .overview-planner-event,
.overview-planner-event-shell .overview-planner-event.is-compact {
  box-shadow: 0 1px 4px rgba(31, 35, 45, 0.08);
}

@media (max-width: 900px) {
  .modal-backdrop,
  .planner-modal-backdrop {
    padding: 10px;
  }

  .modal-panel,
  .planner-create-modal {
    max-height: calc(100dvh - 20px);
    width: calc(100vw - 20px);
  }

  .planner-create-modal #lessonForm,
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status,
.lesson-service-quick button,
.lesson-service-list button,
.discipline-option,
.picker-button,
.planner-create-modal .discipline-option,
.planner-create-modal .picker-button {
  background: #fff;
  border-color: var(--admin-border);
  box-shadow: none;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status:hover,
.planner-create-modal .lesson-draft-statuses .lesson-visit-status:focus-visible,
.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active,
.lesson-service-quick button:hover,
.lesson-service-quick button:focus-visible,
.lesson-service-quick button.active,
.lesson-service-list button:hover,
.lesson-service-list button:focus-visible,
.lesson-service-list button.active,
.discipline-option.active,
.discipline-option:has(input:checked),
.picker-button:hover,
.picker-button:focus-visible,
.picker-button.active,
.planner-create-modal .discipline-option.active,
.planner-create-modal .picker-button.active {
  background: #fff;
  border-color: rgba(201, 31, 38, 0.24);
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.62);
  color: var(--ink);
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active strong,
.lesson-service-quick button.active strong,
.lesson-service-list button.active b,
.discipline-option.active strong,
.discipline-option:has(input:checked) strong,
.planner-create-modal .discipline-option.active strong {
  color: var(--brand-red);
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active span,
.lesson-service-quick button.active span,
.lesson-service-list button.active small,
.lesson-service-list button.active em {
  color: var(--admin-muted);
}

.lesson-service-selected.warning,
.lesson-service-selected.success,
.lesson-service-selected {
  background: #fff;
  border-color: var(--admin-border);
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.48);
}

.lesson-service-selected.success {
  box-shadow: inset 3px 0 0 rgba(74, 155, 88, 0.55);
}

.lesson-service-selected.warning {
  box-shadow: inset 3px 0 0 rgba(201, 31, 38, 0.55);
}

.planner-create-modal .discipline-option::after {
  background: var(--admin-soft);
  color: var(--admin-muted);
}

.planner-create-modal .discipline-option.active::after {
  background: var(--admin-active);
  color: var(--brand-red);
}

/* Booking modal density pass: no decorative side rails, no masonry gaps. */
.planner-create-modal {
  max-width: 980px;
  width: min(980px, calc(100vw - 32px));
}

.planner-create-modal #lessonForm {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.planner-create-modal .lesson-form-columns {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.planner-create-modal .lesson-form-column {
  align-content: start;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.planner-create-modal .lesson-form-section,
.planner-create-modal .lesson-client-section {
  align-content: start;
  background: #fff;
  border-color: var(--admin-border);
  padding: 9px;
}

.planner-create-modal .lesson-visit-create-section {
  grid-column: 1 / -1;
}

.planner-create-modal .lesson-draft-statuses {
  gap: 6px;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status {
  min-height: 48px;
  padding: 8px 10px;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status:hover,
.planner-create-modal .lesson-draft-statuses .lesson-visit-status:focus-visible,
.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active,
.planner-create-modal .lesson-service-quick button:hover,
.planner-create-modal .lesson-service-quick button:focus-visible,
.planner-create-modal .lesson-service-quick button.active,
.planner-create-modal .lesson-service-list button:hover,
.planner-create-modal .lesson-service-list button:focus-visible,
.planner-create-modal .lesson-service-list button.active,
.planner-create-modal .client-result-list button:hover,
.planner-create-modal .client-result-list button:focus-visible,
.planner-create-modal .client-result-list button.active,
.planner-create-modal .discipline-option:hover,
.planner-create-modal .discipline-option:focus-visible,
.planner-create-modal .discipline-option.active,
.planner-create-modal .picker-button:hover,
.planner-create-modal .picker-button:focus-visible,
.planner-create-modal .picker-button.active {
  background: #fff;
  border-color: rgba(201, 31, 38, 0.32);
  box-shadow: none;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active,
.planner-create-modal .lesson-service-quick button.active,
.planner-create-modal .lesson-service-list button.active,
.planner-create-modal .client-result-list button.active,
.planner-create-modal .discipline-option.active {
  background: rgba(201, 31, 38, 0.035);
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active strong,
.planner-create-modal .lesson-service-quick button.active strong,
.planner-create-modal .lesson-service-list button.active b,
.planner-create-modal .client-result-list button.active strong,
.planner-create-modal .discipline-option.active strong {
  color: var(--brand-red);
}

.planner-create-modal .lesson-service-selected,
.planner-create-modal .lesson-service-selected.warning,
.planner-create-modal .lesson-service-selected.success {
  background: #fff;
  border-color: var(--admin-border);
  box-shadow: none;
}

.planner-create-modal .lesson-service-selected.warning,
.planner-create-modal .lesson-service-selected.success {
  border-color: rgba(201, 31, 38, 0.24);
}

.planner-create-modal .lesson-service-selected.success {
  border-color: rgba(74, 155, 88, 0.24);
}

.planner-create-modal .discipline-option {
  padding: 10px 12px;
}

.planner-create-modal .discipline-option.active::after {
  background: rgba(201, 31, 38, 0.08);
  color: var(--brand-red);
}

.planner-create-modal .lesson-service-list {
  max-height: 190px;
}

.planner-create-modal .client-result-list {
  max-height: 96px;
}

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

/* Booking modal admin pass: compact fields, one source of truth for write-off. */
.planner-create-modal {
  max-width: 920px;
  width: min(920px, calc(100vw - 32px));
}

.planner-create-modal .lesson-form-columns {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr);
}

.planner-create-modal .lesson-form-section,
.planner-create-modal .lesson-client-section {
  border-radius: 10px;
  padding: 8px;
}

.planner-create-modal .lesson-service-summary-section {
  gap: 6px;
}

.planner-create-modal .lesson-service-selected,
.planner-create-modal .lesson-service-selected.warning,
.planner-create-modal .lesson-service-selected.success {
  align-items: start;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 10px 12px;
}

.planner-create-modal .lesson-service-selected span {
  display: grid;
  gap: 2px;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
}

.planner-create-modal .lesson-service-selected span small {
  align-self: start;
  grid-column: 2;
  grid-row: 1;
  text-align: right;
  white-space: nowrap;
}

.planner-create-modal .lesson-service-selected span strong {
  font-size: clamp(16px, 1.25vw, 20px);
  line-height: 1.05;
}

.planner-create-modal .lesson-service-selected b,
.planner-create-modal .lesson-service-selected em {
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.2;
}

.planner-create-modal .picker-grid {
  gap: 6px;
}

.planner-create-modal .picker-button {
  border-radius: 8px;
  min-height: 42px;
  padding: 7px 8px 7px 10px;
}

.planner-create-modal .picker-button span {
  gap: 1px;
}

.planner-create-modal .picker-button small {
  font-size: 10px;
  letter-spacing: 0.08em;
}

.planner-create-modal .picker-button strong {
  font-size: 17px;
  line-height: 1.05;
}

.planner-create-modal .picker-button em {
  font-size: 11px;
  line-height: 1.05;
}

.planner-create-modal .picker-button b {
  align-items: center;
  background: transparent;
  border: 0;
  color: transparent;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  justify-self: end;
  overflow: hidden;
  width: 24px;
}

.planner-create-modal .picker-button b::after {
  color: var(--brand-red);
  content: "›";
  font-size: 24px;
  line-height: 1;
}

.planner-create-modal .picker-field.open .picker-button b::after {
  content: "×";
  font-size: 18px;
}

.planner-create-modal .picker-popover {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(35, 38, 45, 0.14);
  max-height: 260px;
  overflow: auto;
  padding: 6px;
}

.planner-create-modal .picker-popover-meta {
  font-size: 12px;
  margin: 2px 4px 4px;
}

.planner-create-modal .picker-options,
.planner-create-modal .picker-option-group {
  gap: 3px;
}

.planner-create-modal .picker-option-group > p {
  font-size: 10px;
  margin: 5px 4px 3px;
}

.planner-create-modal .picker-option {
  border-radius: 7px;
  min-height: 34px;
  padding: 6px 8px;
}

.planner-create-modal .picker-option strong {
  font-size: 15px;
}

.planner-create-modal .picker-option small {
  font-size: 11px;
}

.planner-create-modal .picker-option b {
  font-size: 15px;
}

.planner-create-modal .lesson-place-section .picker-grid {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  .planner-create-modal {
    width: min(920px, calc(100vw - 20px));
  }

  .planner-create-modal .lesson-form-columns {
    grid-template-columns: 1fr;
  }
}

/* Booking modal system pass: dense admin sections and compact selectors. */
.planner-create-modal #lessonForm > .lesson-when-section,
.planner-create-modal #lessonForm > .lesson-place-section,
.planner-create-modal #lessonForm > .lesson-visit-create-section,
.planner-create-modal #lessonForm > .lesson-form-columns {
  grid-column: 1 / -1;
}

.planner-create-modal #lessonForm > .lesson-when-section {
  order: 1;
}

.planner-create-modal #lessonForm > .lesson-place-section {
  order: 2;
}

.planner-create-modal #lessonForm > .lesson-visit-create-section {
  order: 3;
}

.planner-create-modal #lessonForm > .lesson-form-columns {
  order: 4;
}

.planner-create-modal #lessonForm > .actions.full {
  order: 5;
}

.planner-create-modal .lesson-form-columns {
  align-items: start;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.86fr);
}

.planner-create-modal .lesson-form-section,
.planner-create-modal .lesson-client-section {
  background: #fff;
  border-color: var(--admin-border);
  border-radius: 8px;
  box-shadow: none;
  gap: 8px;
  overflow: visible;
  padding: 8px;
  position: relative;
}

.planner-create-modal .lesson-form-section > .kicker,
.planner-create-modal .lesson-client-section > .kicker {
  align-items: center;
  background: #f5f6f8;
  border-bottom: 1px solid var(--admin-border);
  color: var(--admin-ink);
  display: flex;
  font-size: 11px;
  font-weight: 900;
  gap: 0;
  letter-spacing: 0.08em;
  line-height: 1;
  margin: -8px -8px 6px;
  min-height: 28px;
  padding: 8px 10px;
}

.planner-create-modal .lesson-when-section .picker-grid,
.planner-create-modal .lesson-place-section .picker-grid {
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.planner-create-modal .picker-button,
.planner-create-modal .picker-field .picker-button {
  align-items: center;
  background: #fff;
  border-color: var(--admin-border);
  border-radius: 7px;
  box-shadow: none;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 22px;
  min-height: 38px;
  padding: 7px 8px 7px 10px;
}

.planner-create-modal .picker-button span,
.planner-create-modal .picker-field .picker-button span {
  align-items: baseline;
  display: grid;
  gap: 7px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
}

.planner-create-modal .picker-button small,
.planner-create-modal .picker-field .picker-button small {
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.planner-create-modal .picker-button strong,
.planner-create-modal .picker-field .picker-button strong {
  color: var(--admin-ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-create-modal .picker-button em,
.planner-create-modal .picker-field .picker-button em {
  display: none;
}

.planner-create-modal .picker-button b,
.planner-create-modal .picker-field .picker-button b {
  align-items: center;
  background: transparent;
  border: 0;
  color: transparent;
  display: inline-flex;
  height: 22px;
  justify-content: center;
  justify-self: end;
  overflow: hidden;
  padding: 0;
  width: 22px;
}

.planner-create-modal .picker-button b::after,
.planner-create-modal .picker-field .picker-button b::after {
  color: var(--brand-red);
  content: "›";
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.planner-create-modal .picker-field.open .picker-button b::after {
  content: "×";
  font-size: 18px;
}

.planner-create-modal .picker-field-time .picker-popover,
.planner-create-modal .picker-field-date .picker-popover,
.planner-create-modal .picker-popover {
  background: #fff;
  border-color: var(--admin-border);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(35, 38, 45, 0.14);
  max-height: 245px;
  min-width: min(280px, calc(100vw - 48px));
  padding: 5px;
}

.planner-create-modal .picker-popover-meta {
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 850;
  margin: 2px 4px 4px;
}

.planner-create-modal .picker-options,
.planner-create-modal .picker-option-group {
  gap: 2px;
}

.planner-create-modal .picker-option,
.planner-create-modal .picker-field .picker-option {
  background: #fff;
  border-color: transparent;
  border-radius: 6px;
  min-height: 30px;
  padding: 5px 7px;
}

.planner-create-modal .picker-option strong,
.planner-create-modal .picker-field .picker-option strong {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.05;
}

.planner-create-modal .picker-option small,
.planner-create-modal .picker-field .picker-option small,
.planner-create-modal .picker-option b,
.planner-create-modal .picker-field .picker-option b {
  font-size: 11px;
}

.planner-create-modal .picker-option.active,
.planner-create-modal .picker-field .picker-option.active {
  background: #f1f3f6;
  border-color: transparent;
  box-shadow: none;
}

.planner-create-modal .lesson-duration-row {
  background: #f6f7f9;
  border-radius: 7px;
  margin-top: 6px;
  min-height: 34px;
  padding: 5px 6px;
}

.planner-create-modal .lesson-duration-row > span {
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.planner-create-modal .lesson-duration-row button {
  min-height: 28px;
  padding: 5px 9px;
}

.planner-create-modal .lesson-status-options {
  gap: 6px;
}

.planner-create-modal .lesson-status-option {
  border-radius: 7px;
  min-height: 42px;
  padding: 8px 10px;
}

.planner-create-modal .lesson-status-option strong {
  font-size: 16px;
  line-height: 1.05;
}

.planner-create-modal .lesson-status-option span {
  font-size: 11px;
  line-height: 1.1;
}

.planner-create-modal .planner-create-modal-head {
  gap: 4px;
  padding-bottom: 10px;
}

.planner-create-modal .planner-create-modal-head h2 {
  font-size: clamp(24px, 2.1vw, 28px);
  line-height: 0.95;
}

.planner-create-modal .lesson-place-section .picker-button strong {
  font-size: 16px;
}

.planner-create-modal .lesson-place-section .picker-button {
  min-height: 44px;
}

.planner-create-modal .lesson-place-section .picker-button span {
  align-items: start;
  gap: 3px;
  grid-template-columns: 1fr;
}

.planner-create-modal .lesson-place-section .picker-grid {
  grid-template-columns: minmax(130px, 0.78fr) minmax(220px, 1.22fr);
}

.planner-create-modal .lesson-service-summary-section .lesson-service-selected,
.planner-create-modal .lesson-service-summary-section .lesson-service-selected.warning,
.planner-create-modal .lesson-service-summary-section .lesson-service-selected.success {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  gap: 7px;
  padding: 3px 2px 6px;
}

.planner-create-modal .lesson-service-summary-section .lesson-service-selected span {
  align-items: start;
  border-bottom: 1px solid var(--admin-border);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-bottom: 7px;
}

.planner-create-modal .lesson-service-summary-section .lesson-service-selected span strong {
  color: var(--admin-ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.08;
}

.planner-create-modal .lesson-service-summary-section .lesson-service-selected span small {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 900;
  grid-column: 2;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
}

.planner-create-modal .lesson-service-summary-section .lesson-service-selected b {
  color: var(--admin-ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
}

.planner-create-modal .lesson-service-summary-section .lesson-service-selected em {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
}

.planner-create-modal .lesson-service-summary-section .lesson-service-selected.warning b {
  color: var(--brand-red);
}

.planner-create-modal .lesson-service-summary-section .lesson-service-selected.success b {
  color: #3f8750;
}

/* Booking modal no nested cards: section border is enough, inner controls are rows. */
.planner-create-modal .lesson-draft-statuses {
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status,
.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active,
.planner-create-modal .client-result-list button,
.planner-create-modal .client-result-list button.active,
.planner-create-modal .selected-client-card,
.planner-create-modal .discipline-option,
.planner-create-modal .discipline-option.active,
.planner-create-modal .picker-button,
.planner-create-modal .picker-button.active,
.planner-create-modal .picker-field .picker-button,
.planner-create-modal .picker-field .picker-button.active {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status,
.planner-create-modal .client-result-list button,
.planner-create-modal .discipline-option,
.planner-create-modal .picker-button,
.planner-create-modal .picker-field .picker-button {
  border-top: 1px solid var(--admin-border);
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status {
  min-height: 42px;
  padding: 8px 10px;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status + .lesson-visit-status {
  border-left: 1px solid var(--admin-border);
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active,
.planner-create-modal .client-result-list button.active,
.planner-create-modal .discipline-option.active {
  box-shadow: inset 3px 0 0 var(--brand-red);
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active {
  background: rgba(201, 31, 38, 0.035);
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status strong {
  font-size: 16px;
  line-height: 1.05;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status span {
  font-size: 11px;
  line-height: 1.1;
}

.planner-create-modal .client-search-field .input {
  background: transparent;
  border-color: var(--admin-border);
  border-left: 0;
  border-radius: 0;
  border-right: 0;
  border-top: 0;
  min-height: 38px;
  padding-left: 0;
  padding-right: 0;
}

.planner-create-modal .client-result-list {
  gap: 0;
  max-height: none;
}

.planner-create-modal .client-result-list button {
  min-height: 44px;
  padding: 8px 2px 8px 8px;
}

.planner-create-modal .selected-client-card {
  border-top: 1px solid var(--admin-border);
  padding: 8px 0 0;
}

.planner-create-modal .discipline-grid {
  gap: 0;
}

.planner-create-modal .discipline-option {
  min-height: 50px;
  padding: 8px 10px;
}

.planner-create-modal .discipline-option::after,
.planner-create-modal .discipline-option.active::after {
  background: transparent;
  color: var(--admin-muted);
  padding: 0;
}

.planner-create-modal .discipline-option.active::after {
  color: var(--brand-red);
}

.planner-create-modal .lesson-when-section .picker-grid,
.planner-create-modal .lesson-place-section .picker-grid {
  gap: 0;
}

.planner-create-modal .lesson-when-section .picker-button,
.planner-create-modal .lesson-place-section .picker-button {
  min-height: 40px;
  padding: 8px 8px 8px 10px;
}

.planner-create-modal .lesson-when-section .picker-field + .picker-field .picker-button,
.planner-create-modal .lesson-place-section .picker-field + .picker-field .picker-button {
  border-left: 1px solid var(--admin-border);
}

.planner-create-modal .lesson-duration-row {
  background: transparent;
  border-top: 1px solid var(--admin-border);
  border-radius: 0;
  margin-top: 0;
  padding: 8px 0 0;
}

.planner-create-modal .lesson-service-summary-section .lesson-service-selected.is-empty {
  align-items: center;
  min-height: 48px;
  padding: 4px 2px;
}

.planner-create-modal .lesson-service-summary-section .lesson-service-selected.is-empty b {
  color: var(--admin-muted);
  font-size: 18px;
}

.planner-create-modal #lessonForm,
.planner-create-modal .lesson-form-columns,
.planner-create-modal .lesson-form-column,
.planner-create-modal .lesson-when-section,
.planner-create-modal .lesson-place-section {
  overflow: visible;
}

.planner-create-modal .picker-field.open {
  position: relative;
  z-index: 120;
}

.planner-create-modal .lesson-when-section:has(.picker-field.open),
.planner-create-modal .lesson-place-section:has(.picker-field.open) {
  z-index: 110;
}

.planner-create-modal .picker-field.open .picker-popover {
  z-index: 160;
}

.planner-create-modal .client-picker-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--admin-border);
  color: var(--admin-ink);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 42px;
  padding: 8px 2px 8px 8px;
  text-align: left;
  width: 100%;
}

.planner-create-modal .client-picker-toggle:hover,
.planner-create-modal .client-picker-toggle:focus-visible,
.planner-create-modal .client-picker-toggle.active {
  background: rgba(201, 31, 38, 0.035);
  outline: 0;
}

.planner-create-modal .client-picker-toggle span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.planner-create-modal .client-picker-toggle small {
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
}

.planner-create-modal .client-picker-toggle strong {
  color: var(--admin-ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-create-modal .client-picker-toggle b {
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.planner-create-modal .client-picker-panel {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(22, 25, 31, 0.12);
  display: grid;
  gap: 6px;
  left: 8px;
  padding: 8px;
  position: absolute;
  right: 8px;
  top: calc(100% - 8px);
  z-index: 150;
}

.planner-create-modal .client-picker-panel .client-result-list {
  max-height: 190px;
  overflow: auto;
}

.planner-create-modal .lesson-client-section:has(.client-picker-panel) {
  z-index: 130;
}

/* Booking modal affordance pass: compact controls must still read as clickable. */
.planner-create-modal .picker-button,
.planner-create-modal .picker-button.active,
.planner-create-modal .picker-field .picker-button,
.planner-create-modal .picker-field .picker-button.active,
.planner-create-modal .client-picker-toggle,
.planner-create-modal .lesson-draft-statuses .lesson-visit-status,
.planner-create-modal .discipline-option,
.planner-create-modal .discipline-option.active {
  background: #f8f9fb;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  box-shadow: none;
  cursor: pointer;
}

.planner-create-modal .picker-button:hover,
.planner-create-modal .picker-button:focus-visible,
.planner-create-modal .picker-button.active,
.planner-create-modal .picker-field .picker-button:hover,
.planner-create-modal .picker-field .picker-button:focus-visible,
.planner-create-modal .picker-field .picker-button.active,
.planner-create-modal .client-picker-toggle:hover,
.planner-create-modal .client-picker-toggle:focus-visible,
.planner-create-modal .client-picker-toggle.active,
.planner-create-modal .lesson-draft-statuses .lesson-visit-status:hover,
.planner-create-modal .lesson-draft-statuses .lesson-visit-status:focus-visible,
.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active,
.planner-create-modal .discipline-option:hover,
.planner-create-modal .discipline-option:focus-visible,
.planner-create-modal .discipline-option.active {
  background: #fff;
  border-color: rgba(201, 31, 38, 0.34);
  outline: 0;
}

.planner-create-modal .picker-button,
.planner-create-modal .picker-field .picker-button {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 7px 8px 7px 10px;
}

.planner-create-modal .picker-button b,
.planner-create-modal .picker-field .picker-button b {
  background: rgba(201, 31, 38, 0.08);
  border-radius: 999px;
  color: var(--brand-red);
  font-size: 10px;
  font-weight: 900;
  height: 22px;
  letter-spacing: 0.02em;
  overflow: visible;
  padding: 0 7px;
  text-transform: uppercase;
  width: auto;
}

.planner-create-modal .picker-button b::after,
.planner-create-modal .picker-field .picker-button b::after {
  color: inherit;
  content: "›";
  font-size: 14px;
  margin-left: 5px;
}

.planner-create-modal .picker-field.open .picker-button b::after {
  content: "×";
  font-size: 12px;
}

.planner-create-modal .lesson-place-section .picker-button span {
  align-items: baseline;
  gap: 7px;
  grid-template-columns: auto minmax(0, 1fr);
}

.planner-create-modal .lesson-place-section .picker-button strong {
  font-size: 17px;
}

.planner-create-modal .lesson-duration-row {
  align-items: center;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 7px 0 0;
  white-space: nowrap;
}

.planner-create-modal .lesson-duration-row > span {
  flex: 0 0 auto;
}

.planner-create-modal .lesson-duration-row > div {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.planner-create-modal .lesson-duration-row button {
  flex: 0 0 auto;
}

.planner-create-modal .lesson-draft-statuses {
  gap: 6px;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status,
.planner-create-modal .lesson-draft-statuses .lesson-visit-status + .lesson-visit-status {
  border: 1px solid var(--admin-border);
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status {
  min-height: 48px;
  padding: 8px 64px 8px 10px;
  position: relative;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status::after {
  background: #eef1f5;
  border-radius: 999px;
  color: var(--admin-muted);
  content: "Выбрать";
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.03em;
  padding: 5px 7px;
  position: absolute;
  right: 8px;
  text-transform: uppercase;
  top: 50%;
  transform: translateY(-50%);
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active {
  background: rgba(201, 31, 38, 0.035);
  border-color: rgba(201, 31, 38, 0.36);
  box-shadow: none;
  color: var(--ink);
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active strong {
  color: var(--brand-red);
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status.active::after {
  background: var(--brand-red);
  color: #fff;
  content: "Выбран";
}

.planner-create-modal .discipline-grid {
  gap: 6px;
}

.planner-create-modal .discipline-option,
.planner-create-modal .discipline-option.active {
  border-top: 1px solid var(--admin-border);
  min-height: 46px;
}

.planner-create-modal .discipline-option::after,
.planner-create-modal .discipline-option.active::after {
  background: #eef1f5;
  border-radius: 999px;
  color: var(--admin-muted);
  padding: 5px 7px;
}

.planner-create-modal .discipline-option.active {
  background: rgba(201, 31, 38, 0.035);
  border-color: rgba(201, 31, 38, 0.36);
  box-shadow: none;
  color: var(--ink);
}

.planner-create-modal .discipline-option.active strong {
  color: var(--brand-red);
}

.planner-create-modal .discipline-option.active::after {
  background: var(--brand-red);
  color: #fff;
}

.planner-create-modal .client-picker-toggle {
  border-top: 1px solid var(--admin-border);
}

.communication-item {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
  position: relative;
}

.communication-item .communication-channel {
  grid-column: 1;
}

.communication-item-time {
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 850;
  grid-column: 2;
  justify-self: end;
  line-height: 1.1;
  padding-top: 2px;
}

.communication-item strong {
  grid-column: 1 / -1;
}

.communication-item .communication-waiting {
  color: var(--brand-red);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  grid-column: 1 / -1;
  line-height: 1.25;
}

.nav-tab.has-subnav {
  gap: 6px;
  grid-template-columns: 18px minmax(0, 1fr) auto auto;
}

.nav-tab.has-subnav .nav-copy > span {
  font-size: 13px;
  letter-spacing: -0.01em;
}

.nav-tab.has-subnav .nav-copy small {
  display: none;
}

.nav-submenu {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 2px;
  margin: -1px 0 6px;
  padding: 0;
  width: 100%;
}

.nav-submenu button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--admin-muted);
  display: grid;
  font-size: 13px;
  font-weight: 850;
  gap: 9px;
  grid-template-columns: 18px minmax(0, 1fr);
  justify-content: flex-start;
  min-height: 32px;
  padding: 7px 10px 7px 38px;
  text-align: left;
  width: 100%;
}

.nav-submenu-icon {
  align-items: center;
  color: currentColor;
  display: flex;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.nav-submenu-icon svg {
  height: 17px;
  width: 17px;
}

.nav-submenu button:hover,
.nav-submenu button:focus-visible {
  background: rgba(31, 35, 45, 0.045);
  color: var(--ink);
  outline: 0;
}

.nav-submenu button.active {
  background: rgba(201, 31, 38, 0.09);
  color: var(--brand-red);
}

.broadcast-audience-grid {
  gap: 7px;
}

.broadcast-audience-chip {
  display: grid;
  gap: 5px;
  min-height: 62px;
  padding: 9px 10px;
}

.broadcast-audience-chip span {
  align-items: start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.broadcast-audience-chip strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.1;
}

.broadcast-audience-chip small {
  color: var(--brand-red);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.broadcast-audience-chip em {
  color: var(--admin-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.25;
}

.broadcast-audience-chip.active {
  background: rgba(201, 31, 38, 0.07);
  border-color: rgba(201, 31, 38, 0.28);
  box-shadow: none;
}

.broadcast-rule-note {
  background: var(--admin-soft);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
}

.broadcast-rule-note strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.broadcast-rule-note span {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

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

.broadcast-message-actions .btn {
  width: 100%;
}

.broadcast-message-actions .btn:first-child {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .planner-create-modal .lesson-form-columns,
  .planner-create-modal .lesson-when-section .picker-grid,
  .planner-create-modal .lesson-place-section .picker-grid {
    grid-template-columns: 1fr;
  }

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

  .broadcast-message-actions .btn:first-child {
    grid-column: auto;
  }
}

/* Work schedule clarity pass */
.work-schedule-workbench {
  align-items: stretch;
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr) 300px;
}

.work-schedule-panel {
  border-radius: 10px 0 0 10px;
  gap: 0;
  overflow: hidden;
}

.work-schedule-panel-head {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 16px;
}

.work-schedule-panel-head .section-title {
  font-size: 24px;
  line-height: 1.05;
}

.work-schedule-panel-head .meta {
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 720;
  margin-top: 4px;
}

.work-schedule-panel-head .work-schedule-toolbar {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.work-schedule-panel .work-coverage-section {
  background: #fbfcfd;
  border: 0;
  border-bottom: 1px solid var(--admin-border);
  border-radius: 0;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
}

.work-coverage-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.work-coverage-now {
  align-items: baseline;
  display: flex;
  gap: 10px;
}

.work-coverage-now .kicker {
  margin: 0;
}

.work-coverage-now strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
}

.work-coverage-now span {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 720;
}

.work-coverage-mode {
  background: var(--admin-soft);
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 5px 8px;
  text-transform: uppercase;
}

.work-coverage-scroll {
  overflow-x: auto;
  padding: 0;
}

.work-coverage-grid {
  gap: 4px;
}

.work-coverage-grid.work-coverage-week {
  grid-template-columns: repeat(var(--coverage-day-count, 7), minmax(86px, 1fr));
  min-width: 0;
}

.work-coverage-grid.work-coverage-month {
  grid-template-columns: repeat(var(--coverage-day-count, 31), 86px);
  min-width: calc(var(--coverage-day-count, 31) * 86px + (var(--coverage-day-count, 31) - 1) * 4px);
}

.work-coverage-card {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  gap: 2px;
  min-height: 48px;
  padding: 7px 8px;
}

.work-coverage-card div {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.work-coverage-card strong,
.work-coverage-card b {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.work-coverage-card b {
  color: var(--brand-red);
}

.work-coverage-card span,
.work-coverage-card small {
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.1;
}

.work-coverage-card.thin {
  background: #fffafa;
  border-color: rgba(201, 31, 38, 0.22);
}

.work-schedule-scroll {
  border: 0;
  border-radius: 0;
  overflow: auto;
}

.work-schedule-grid {
  gap: 0;
  min-width: 940px;
}

.work-schedule-month {
  min-width: max(1480px, calc(156px + var(--schedule-day-count, 31) * 104px));
}

.work-schedule-head,
.work-schedule-row {
  gap: 0;
  grid-template-columns: 156px repeat(var(--schedule-day-count, 7), minmax(100px, 1fr));
}

.work-schedule-month .work-schedule-head,
.work-schedule-month .work-schedule-row {
  grid-template-columns: 156px repeat(var(--schedule-day-count, 31), 104px);
}

.work-schedule-head {
  background: #f2f4f7;
}

.work-schedule-head > span,
.work-schedule-head > span:not(:first-child),
.work-person,
.work-shift-cell {
  border: 0;
  border-bottom: 1px solid var(--admin-border);
  border-radius: 0;
  border-right: 1px solid var(--admin-border);
  min-height: 44px;
}

.work-schedule-head > span {
  color: var(--admin-muted);
  display: grid;
  gap: 1px;
  justify-items: center;
  padding: 7px 8px;
}

.work-schedule-head > span:first-child {
  justify-items: start;
}

.work-schedule-head strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.work-schedule-head small {
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 760;
}

.work-person {
  align-content: center;
  background: #fbfcfd;
  gap: 3px;
  padding: 8px 10px;
}

.work-person strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.05;
}

.role-chip {
  background: transparent;
  border: 0;
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 820;
  padding: 0;
}

.work-shift-cell {
  background: #fff;
  cursor: pointer;
  min-height: 44px;
  padding: 0;
}

.work-shift-cell:hover {
  background: #fbfcfd;
}

.work-shift-cell.active {
  background: #fff;
  box-shadow: inset 0 -2px 0 rgba(102, 112, 133, 0.18);
}

.work-shift-cell.active.role-admin {
  box-shadow: inset 0 -2px 0 rgba(201, 31, 38, 0.35);
}

.work-shift-cell.active.role-vocal {
  box-shadow: inset 0 -2px 0 rgba(98, 123, 82, 0.35);
}

.work-shift-cell.active.role-speech {
  box-shadow: inset 0 -2px 0 rgba(44, 112, 99, 0.32);
}

.work-shift-cell.off {
  background: #f8fafc;
}

.work-shift-cell.selected {
  background: #fff8f8;
  box-shadow:
    inset 0 0 0 2px rgba(201, 31, 38, 0.2),
    inset 0 -2px 0 rgba(201, 31, 38, 0.38);
}

.work-shift-cell.selected::after {
  display: none;
}

.work-shift-input {
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  height: 100%;
  min-width: 0;
  padding: 0 8px;
  text-align: center;
  white-space: nowrap;
}

.work-shift-cell.off .work-shift-input {
  color: #b5bdca;
  font-weight: 760;
}

.work-schedule-month .work-person,
.work-schedule-month .work-shift-cell {
  min-height: 40px;
}

.work-schedule-month .work-shift-input {
  font-size: 12px;
  min-width: 0;
}

.work-schedule-inspector {
  background: #fff;
  border-left: 1px solid var(--admin-border);
  border-radius: 0 10px 10px 0;
  box-shadow: none;
  max-height: none;
  overflow: auto;
  padding: 0;
  position: sticky;
  top: 12px;
}

.work-inspector-head {
  background: #fbfcfd;
  border-bottom: 1px solid var(--admin-border);
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 14px;
}

.work-inspector-head h2 {
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.work-inspector-head span {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
}

.work-inspector-block {
  border-bottom: 1px solid var(--admin-border);
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.work-inspector-block + .work-inspector-block {
  padding-top: 12px;
}

.work-inspector-selected {
  align-items: center;
  background: #fff;
  display: flex;
  justify-content: space-between;
}

.work-inspector-selected div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.work-inspector-selected span,
.work-inspector-block span,
.work-day-team-row small {
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.work-inspector-selected strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.05;
}

.work-inspector-selected > b {
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  color: var(--admin-muted);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 9px;
}

.work-inspector-selected > b.active {
  background: #eef8f0;
  border-color: #d6ead9;
  color: #3d7a45;
}

.work-inspector-selected > b.off {
  background: #f2f4f7;
}

.work-inspector-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.work-inspector-row .kicker {
  margin: 0;
}

.work-inspector-row span {
  max-width: 150px;
  text-align: right;
}

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

.work-preset-grid button {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  min-height: 34px;
  padding: 7px 8px;
}

.work-preset-grid button:hover,
.work-preset-grid button:focus-visible {
  background: #f8fafc;
  border-color: rgba(201, 31, 38, 0.28);
  outline: 0;
}

.work-preset-grid button.active {
  background: #fff8f8;
  border-color: rgba(201, 31, 38, 0.32);
  box-shadow: none;
  color: var(--brand-red);
}

.work-preset-grid button.danger {
  color: var(--admin-muted);
}

.work-preset-grid button.danger.active {
  background: #f2f4f7;
  border-color: var(--admin-border);
  box-shadow: none;
  color: var(--admin-muted);
}

.work-day-team-list {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.work-day-team-row {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--admin-border);
  color: var(--ink);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 42px;
  padding: 8px 10px;
  text-align: left;
}

.work-day-team-row:last-child {
  border-bottom: 0;
}

.work-day-team-row:hover,
.work-day-team-row:focus-visible,
.work-day-team-row.selected {
  background: #fbfcfd;
  outline: 0;
}

.work-day-team-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.work-day-team-row strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-day-team-row b {
  color: var(--admin-muted);
  flex: 0 0 auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

@media (max-width: 1240px) {
  .work-schedule-workbench {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .work-schedule-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .work-schedule-panel-head .work-schedule-toolbar {
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .work-schedule-workbench {
    grid-template-columns: 1fr;
  }

  .work-schedule-panel,
  .work-schedule-inspector {
    border-radius: 10px;
  }

  .work-schedule-inspector {
    border-left: 0;
    border-top: 1px solid var(--admin-border);
    position: static;
  }
}

/* Main screen employee week drilldown */
button.team-chip {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  font: inherit;
}

.team-chip,
.team-chip-admin,
.team-chip-teacher,
.team-chip-vocal,
.team-chip-speech {
  grid-template-columns: minmax(130px, 0.9fr) minmax(160px, 1fr) minmax(120px, 0.55fr) minmax(86px, 0.36fr);
}

.team-chip:hover,
.team-chip:focus-visible,
.team-chip.active {
  background: #f9fafb;
  box-shadow: none;
  outline: 0;
}

.team-chip.active {
  background: #fff8f8;
  box-shadow: inset 0 0 0 1px rgba(201, 31, 38, 0.22);
}

.team-chip b {
  color: var(--brand-red);
  font-size: 12px;
  font-weight: 860;
  justify-self: end;
  line-height: 1.15;
  white-space: nowrap;
}

.team-week-hint,
.employee-week-head span {
  color: var(--admin-muted, #687082);
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 4px;
}

.employee-week-panel {
  background: #fff;
  border: 1px solid var(--admin-border, #e3e7ee);
  border-radius: 12px;
  display: grid;
  gap: 0;
  overflow: hidden;
}

.employee-week-head {
  background: #fff;
  border-bottom: 1px solid var(--admin-border, #e3e7ee);
  padding: 12px 14px;
}

.employee-week-scroll {
  overflow-x: auto;
}

.employee-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(174px, 1fr));
  min-width: 1260px;
}

.employee-week-day {
  background: #fff;
  border-right: 1px solid var(--admin-border, #e3e7ee);
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.employee-week-day:last-child {
  border-right: 0;
}

.employee-week-day header {
  background: #fbfcfd;
  border-bottom: 1px solid var(--admin-border, #e3e7ee);
  display: grid;
  gap: 2px;
  min-height: 70px;
  padding: 10px 12px;
}

.employee-week-day header span {
  color: var(--brand-red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.employee-week-day header strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
}

.employee-week-day header small {
  color: var(--admin-muted, #687082);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
}

.employee-week-slots {
  display: grid;
  grid-auto-rows: 34px;
}

.employee-week-cell {
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--admin-border, #e3e7ee);
  color: var(--admin-muted, #687082);
  display: grid;
  font: inherit;
  gap: 1px;
  min-width: 0;
  padding: 5px 8px;
  text-align: left;
}

.employee-week-cell.free {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.employee-week-cell.free:hover,
.employee-week-cell.free:focus-visible,
.employee-week-cell.free.selected {
  background: #fff8f8;
  box-shadow: inset 0 0 0 1px rgba(201, 31, 38, 0.2);
  outline: 0;
}

.employee-week-cell span {
  color: #9aa2af;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.1;
}

.employee-week-cell small {
  color: #b2bac6;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.1;
}

.employee-week-cell.blocked {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(230, 234, 241, 0.92) 0,
      rgba(230, 234, 241, 0.92) 8px,
      rgba(244, 246, 250, 0.92) 8px,
      rgba(244, 246, 250, 0.92) 16px
    );
}

.employee-week-cell.blocked span,
.employee-week-cell.blocked small {
  color: #7b8494;
}

.employee-week-cell.break {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 233, 205, 0.92) 0,
      rgba(255, 233, 205, 0.92) 8px,
      rgba(255, 246, 233, 0.92) 8px,
      rgba(255, 246, 233, 0.92) 16px
    );
  cursor: pointer;
}

.employee-week-cell.continuation {
  background: #fff3ea;
}

.employee-week-cell.busy {
  padding: 3px;
}

.employee-week-slot {
  -webkit-appearance: none;
  appearance: none;
  background: #fff3ea;
  border: 1px solid rgba(201, 31, 38, 0.18);
  border-left: 3px solid rgba(201, 31, 38, 0.72);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 1px;
  min-height: 28px;
  min-width: 0;
  padding: 4px 6px;
  text-align: left;
}

.employee-week-slot:hover,
.employee-week-slot:focus-visible {
  background: #ffece1;
  outline: 0;
}

.employee-week-slot time,
.employee-week-slot small {
  color: var(--admin-muted, #687082);
  font-size: 10px;
  font-weight: 820;
  line-height: 1.05;
}

.employee-week-slot strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-week-slot span {
  color: #5f6878;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .team-chip,
  .team-chip-admin,
  .team-chip-teacher,
  .team-chip-vocal,
  .team-chip-speech {
    grid-template-columns: 1fr;
  }

  .team-chip b {
    justify-self: start;
  }

  .employee-week-grid {
    grid-template-columns: repeat(7, 172px);
  }
}

.settings-control-panel {
  background: #fff;
  border: 1px solid var(--admin-border, #dde3ec);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.settings-control-head {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-width: 0;
}

.settings-control-head h2 {
  color: var(--ink, #242321);
  font-size: 26px;
  font-weight: 940;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
}

.settings-control-head p {
  color: var(--erp-muted, #687082);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.28;
  margin: 6px 0 0;
  max-width: 720px;
}

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

.settings-control-wide {
  grid-column: 1 / -1;
}

.settings-control-wide .textarea {
  min-height: 92px;
}

.settings-control-status {
  align-items: center;
  border-top: 1px solid var(--admin-border, #dde3ec);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  padding-top: 12px;
}

.settings-control-status span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-control-status b {
  color: var(--ink, #242321);
  font-size: 15px;
  font-weight: 920;
  line-height: 1.1;
}

.settings-control-status small {
  color: var(--erp-muted, #687082);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
}

.settings-team-section {
  display: grid;
  gap: 10px;
}

.sales-page-grid {
  display: grid;
  gap: 12px;
}

.sales-configurator {
  background: var(--admin-surface, #fff);
  border: 1px solid var(--admin-border, #dde3ec);
  border-radius: 12px;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(380px, 0.58fr);
  min-height: 0;
  overflow: hidden;
}

.client-sale-action-panel .sales-configurator {
  border-radius: 10px;
  grid-template-columns: 1fr;
}

.sales-catalog-panel,
.sale-summary-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.sales-catalog-panel {
  border-right: 1px solid var(--admin-border, #dde3ec);
}

.client-sale-action-panel .sales-catalog-panel {
  border-right: 0;
  border-bottom: 1px solid var(--admin-border, #dde3ec);
}

.sale-selector-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.sale-selector-label {
  color: var(--erp-muted, #687082);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.sale-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sale-choice {
  -webkit-appearance: none;
  appearance: none;
  align-items: flex-start;
  background: #f6f7f9;
  border: 1px solid rgba(36, 35, 33, 0.09);
  border-radius: 9px;
  color: var(--erp-muted, #687082);
  cursor: pointer;
  display: grid;
  gap: 2px;
  min-height: 42px;
  min-width: 104px;
  padding: 8px 10px;
  text-align: left;
}

.sale-choice span {
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.sale-choice small {
  color: var(--erp-muted, #687082);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.1;
}

.sale-choice:hover,
.sale-choice:focus-visible {
  border-color: rgba(201, 31, 38, 0.32);
  color: var(--brand-red, #c91f26);
  outline: 0;
}

.sale-choice.active {
  background: #fff;
  border-color: rgba(201, 31, 38, 0.48);
  color: var(--brand-red, #c91f26);
  box-shadow: inset 3px 0 0 var(--brand-red, #c91f26);
}

.segment-grid .sale-choice {
  flex: 1 1 132px;
}

.group-grid .sale-choice,
.payment-grid .sale-choice,
.installment-grid .sale-choice,
.internal-grid .sale-choice {
  min-width: 112px;
}

.sales-product-list {
  border: 1px solid var(--admin-border, #dde3ec);
  border-radius: 10px;
  display: grid;
  overflow: hidden;
}

.sale-product-row {
  -webkit-appearance: none;
  appearance: none;
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--admin-border, #dde3ec);
  color: var(--ink, #242321);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  padding: 10px 12px;
  text-align: left;
}

.sale-product-row:last-child {
  border-bottom: 0;
}

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

.sale-product-row strong {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sale-product-row em,
.sale-product-row b {
  color: var(--erp-muted, #687082);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.1;
}

.sale-product-row:hover,
.sale-product-row:focus-visible,
.sale-product-row.active {
  background: #fbfcfd;
  outline: 0;
}

.sale-product-row.active {
  box-shadow: inset 3px 0 0 var(--brand-red, #c91f26);
}

.sale-product-row.active strong,
.sale-product-row.active b {
  color: var(--brand-red, #c91f26);
}

.sale-summary-panel {
  align-content: start;
  background: #fbfcfd;
}

.sale-summary-head {
  border-bottom: 1px solid var(--admin-border, #dde3ec);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-bottom: 12px;
}

.sale-summary-head h3 {
  color: var(--ink, #242321);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

.sale-summary-head span,
.sale-summary-head > strong {
  color: var(--erp-muted, #687082);
  font-size: 13px;
  font-weight: 850;
}

.sale-summary-head > strong {
  color: var(--ink, #242321);
  white-space: nowrap;
}

.sale-client {
  align-items: center;
  background: #fff;
  border: 1px solid var(--admin-border, #dde3ec);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}

.sale-client span {
  color: var(--ink, #242321);
  font-size: 14px;
  font-weight: 900;
}

.sale-client small {
  color: var(--erp-muted, #687082);
  font-size: 12px;
  font-weight: 800;
}

.sale-client-empty {
  align-items: start;
  display: grid;
  gap: 3px;
}

.sale-client-picker {
  display: grid;
  gap: 8px;
}

.sale-client-picker-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.sale-client-picker-head > span:not(.sale-selector-label) {
  color: var(--erp-muted, #687082);
  font-size: 12px;
  font-weight: 760;
}

.sale-client-search {
  display: block;
}

.sale-client-results {
  border: 1px solid var(--admin-border, #dde3ec);
  border-radius: 10px;
  display: grid;
  max-height: 270px;
  overflow: auto;
}

.sale-client-option {
  -webkit-appearance: none;
  appearance: none;
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--admin-border, #dde3ec);
  color: var(--ink, #242321);
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  padding: 9px 10px;
  text-align: left;
}

.sale-client-option:last-child {
  border-bottom: 0;
}

.sale-client-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sale-client-option strong {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sale-client-option small {
  color: var(--erp-muted, #687082);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sale-client-option b {
  color: var(--erp-muted, #687082);
  font-size: 11px;
  font-weight: 900;
}

.sale-client-option:hover,
.sale-client-option:focus-visible,
.sale-client-option.selected {
  background: #fbfcfd;
  outline: 0;
}

.sale-client-option.selected {
  box-shadow: inset 3px 0 0 var(--brand-red, #c91f26);
}

.sale-client-option.selected b,
.sale-client-option.selected strong {
  color: var(--brand-red, #c91f26);
}

.sale-client-empty-state {
  background: #fff;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.sale-client-empty-state strong {
  color: var(--ink, #242321);
  font-size: 13px;
  font-weight: 900;
}

.sale-client-empty-state span {
  color: var(--erp-muted, #687082);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
}

.sale-summary-grid,
.sale-bonus-table {
  border: 1px solid var(--admin-border, #dde3ec);
  border-radius: 10px;
  display: grid;
  overflow: hidden;
}

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

.sale-summary-grid div,
.sale-bonus-table div {
  background: #fff;
  border-bottom: 1px solid var(--admin-border, #dde3ec);
  display: grid;
  gap: 3px;
  padding: 9px 10px;
}

.sale-summary-grid div:nth-child(odd) {
  border-right: 1px solid var(--admin-border, #dde3ec);
}

.sale-summary-grid div:nth-last-child(-n + 2),
.sale-bonus-table div:last-child {
  border-bottom: 0;
}

.sale-summary-grid span,
.sale-bonus-table span {
  color: var(--erp-muted, #687082);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.sale-summary-grid b,
.sale-bonus-table b {
  color: var(--ink, #242321);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
}

.sale-bonus-table {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sale-bonus-table div {
  border-bottom: 0;
  border-right: 1px solid var(--admin-border, #dde3ec);
}

.sale-bonus-table div:last-child {
  border-right: 0;
}

.sale-custom-amount small {
  color: var(--erp-muted, #687082);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
}

.sale-amount-input {
  max-width: 220px;
}

.sale-note,
.empty-inline {
  color: var(--erp-muted, #687082);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
  margin: 0;
}

.sale-create-button {
  justify-content: center;
}

.sale-create-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.sales-history-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.sales-order-list {
  border: 1px solid var(--admin-border, #dde3ec);
  border-radius: 10px;
  display: grid;
  overflow: hidden;
}

.sales-order-list article {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--admin-border, #dde3ec);
  display: grid;
  gap: 10px;
  grid-template-columns: 96px minmax(0, 1fr) minmax(160px, 0.45fr) auto;
  padding: 9px 11px;
}

.sales-order-list article:last-child {
  border-bottom: 0;
}

.sales-order-list span,
.sales-order-list em {
  color: var(--erp-muted, #687082);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.sales-order-list strong,
.sales-order-list b {
  color: var(--ink, #242321);
  font-size: 13px;
  font-weight: 900;
  min-width: 0;
}

.sales-order-list strong {
  display: grid;
  gap: 3px;
}

.sales-order-list strong small {
  color: var(--erp-muted, #687082);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.15;
}

@media (max-width: 1180px) {
  .sales-configurator {
    grid-template-columns: 1fr;
  }

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

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

  .sales-catalog-panel {
    border-bottom: 1px solid var(--admin-border, #dde3ec);
    border-right: 0;
  }
}

@media (max-width: 720px) {
  .settings-control-panel {
    border-radius: 12px;
    gap: 10px;
    padding: 12px;
  }

  .settings-control-head {
    display: grid;
  }

  .settings-control-head h2 {
    font-size: 22px;
  }

  .settings-control-head .btn {
    justify-content: center;
    width: 100%;
  }

  .settings-control-grid,
  .settings-control-status {
    grid-template-columns: 1fr;
  }

  .settings-control-status .btn {
    justify-content: center;
    width: 100%;
  }

  .sale-client-results {
    max-height: 230px;
  }

  .sale-client-option {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .sale-summary-grid,
  .sale-bonus-table,
  .sales-order-list article {
    grid-template-columns: 1fr;
  }

  .sale-summary-grid div,
  .sale-summary-grid div:nth-child(odd),
  .sale-bonus-table div {
    border-right: 0;
  }

  .sale-summary-grid div:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--admin-border, #dde3ec);
  }

  .sale-summary-grid div:last-child {
    border-bottom: 0;
  }
}

/* Final mobile admin pass */
@media (max-width: 980px) {
  html,
  body {
    overflow-x: hidden;
  }

  html.telegram-swipe-lock,
  body.telegram-swipe-lock {
    height: 100%;
    overflow: hidden;
  }

  body.telegram-swipe-lock .admin-shell,
  body.telegram-swipe-lock .admin-layout {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  body.telegram-swipe-lock .workspace {
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-x: none;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
  }

  .admin-shell {
    padding: 0;
  }

  .admin-layout {
    display: block;
    min-height: 100svh;
  }

  .workspace {
    gap: 14px;
    max-width: none;
    min-width: 0;
    padding: calc(58px + env(safe-area-inset-top, 0px)) 12px 18px;
    width: 100%;
  }

  .workspace > .page-head,
  .overview-planner-head {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    margin: 0;
    padding: 0 0 12px;
  }

  .workspace > .page-head .title,
  .overview-planner-head h1 {
    font-size: 30px;
    line-height: 1;
  }

  .workspace > .page-head .lead,
  .overview-planner-head p:not(.kicker) {
    font-size: 15px;
    line-height: 1.28;
  }

  .admin-layout > .mobile-menu-button,
  .mobile-menu-button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--admin-border, #dde3ec);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(23, 30, 44, 0.12);
    display: flex;
    height: 42px;
    justify-content: center;
    left: max(12px, env(safe-area-inset-left, 0px));
    position: fixed;
    top: max(10px, env(safe-area-inset-top, 0px));
    width: 42px;
    z-index: 90;
  }

  .admin-layout > .mobile-menu-button span,
  .mobile-menu-button span {
    background: var(--ink, #242321);
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 18px;
  }

  .admin-nav {
    border: 1px solid var(--admin-border, #dde3ec);
    border-radius: 16px;
    bottom: 10px;
    box-shadow: 0 24px 60px rgba(23, 30, 44, 0.28);
    left: max(10px, env(safe-area-inset-left, 0px));
    max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px));
    overflow: auto;
    padding: 14px 12px;
    position: fixed;
    top: max(10px, env(safe-area-inset-top, 0px));
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.18s ease;
    width: min(320px, calc(100vw - 20px));
    z-index: 88;
  }

  .admin-nav::before {
    display: none;
  }

  .sidebar-open .admin-nav {
    transform: translateX(0);
  }

  .nav-scrim {
    background: rgba(23, 30, 44, 0.42);
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.16s ease;
    z-index: 80;
  }

  .sidebar-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .brand-card {
    align-items: center;
    grid-template-columns: 44px 1fr;
    min-height: auto;
    padding: 6px 2px 12px;
  }

  .brand-card h1 {
    font-size: 28px;
  }

  .mini-calendar {
    border-radius: 12px;
    padding: 10px;
  }

  .nav-list {
    gap: 4px;
  }

  .nav-item,
  .nav-parent {
    border-radius: 10px;
    min-height: 42px;
    padding: 9px 10px;
  }

  .nav-submenu {
    margin: 4px 0 6px 34px;
    padding: 5px;
  }

  .panel,
  .calendar-panel,
  .overview-inspector,
  .overview-broadcast-reminder,
  .planner-create-modal,
  .modal-panel,
  .lesson-modal-panel,
  .workspace .panel:not(.modal-panel):not(.lesson-modal-panel) {
    border-radius: 14px;
  }

  .panel,
  .workspace .panel:not(.modal-panel):not(.lesson-modal-panel) {
    padding: 12px;
  }

  .erp-toolbar,
  .overview-head-actions,
  .calendar-toolbar,
  .work-schedule-panel-head,
  .work-schedule-toolbar {
    align-items: stretch;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .erp-toolbar-filters,
  .filters,
  .actions,
  .modal-actions,
  .broadcast-message-actions {
    align-items: stretch;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .btn,
  .erp-toolbar-action,
  .sale-create-button {
    min-height: 42px;
    width: 100%;
  }

  .overview-stats,
  .overview-focus-strip,
  .overview-team-strip,
  .overview-resource-strip,
  .overview-availability-strip,
  .overview-request-strip,
  .overview-membership-strip,
  .overview-outside-strip,
  .overview-attention-queue,
  .overview-workbench,
  .calendar-primary-workbench,
  .requests-workbench,
  .students-workbench,
  .broadcast-grid,
  .sales-configurator,
  .work-schedule-workbench,
  .communications-workbench {
    grid-template-columns: 1fr !important;
  }

  .overview-status-strip,
  .overview-team-chips,
  .overview-resource-cards,
  .overview-availability-gap-list,
  .overview-request-list,
  .overview-membership-list,
  .overview-attention-list {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .overview-planner-shell,
  .work-schedule-scroll,
  .erp-table,
  .sales-order-list,
  .table-scroll,
  .calendar-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .overview-planner-grid {
    min-width: max(720px, calc(88px + var(--resource-count, 4) * 150px));
  }

  .work-schedule-panel {
    border-radius: 14px;
    overflow: visible;
  }

  .work-schedule-inspector {
    border-left: 0;
    border-radius: 14px;
    max-height: none;
    position: static;
  }

  .work-schedule-grid {
    min-width: 760px;
  }

  .work-schedule-month {
    min-width: max(1120px, calc(132px + var(--schedule-day-count, 31) * 82px));
  }

  .work-schedule-head,
  .work-schedule-row {
    grid-template-columns: 132px repeat(var(--schedule-day-count, 7), minmax(86px, 1fr));
  }

  .work-schedule-month .work-schedule-head,
  .work-schedule-month .work-schedule-row {
    grid-template-columns: 132px repeat(var(--schedule-day-count, 31), 82px);
  }

  .communication-inbox,
  .communication-thread,
  .communication-contact {
    min-height: auto;
    width: 100%;
  }

  .communication-thread-head {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .message-thread {
    max-height: 58dvh;
    min-height: 280px;
    padding-right: 0;
  }

  .message-bubble {
    max-width: 92%;
  }

  .communication-compose {
    align-items: stretch;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .lesson-modal-backdrop,
  .modal-backdrop {
    align-items: stretch;
    overflow-y: auto;
    padding: 8px;
  }

  .lesson-modal-panel,
  .modal-panel,
  .planner-create-modal {
    border-radius: 16px;
    max-height: calc(100dvh - 16px);
    max-width: none;
    overflow: auto;
    padding: 14px;
    width: 100%;
  }

  .modal-head,
  .planner-create-modal-head {
    padding-right: 42px;
  }

  .modal-close,
  .modal-close-button {
    height: 38px;
    right: 12px;
    top: 12px;
    width: 38px;
  }

  .lesson-form,
  .planner-create-modal #lessonForm,
  .lesson-form-columns,
  .planner-create-modal .lesson-form-columns,
  .lesson-form-column,
  .picker-grid,
  .discipline-grid,
  .booking-status-row,
  .lesson-draft-statuses,
  .lesson-status-options,
  .lesson-service-quick,
  .lesson-place-section .picker-grid,
  .lesson-when-section .picker-grid {
    grid-template-columns: 1fr !important;
  }

  .lesson-form {
    gap: 10px;
  }

  .lesson-form-section,
  .planner-create-modal .lesson-form-section,
  .planner-create-modal .lesson-client-section {
    border-radius: 12px;
    gap: 9px;
    padding: 10px;
  }

  .discipline-option,
  .planner-create-modal .discipline-option,
  .picker-button,
  .planner-create-modal .picker-button,
  .client-picker-toggle,
  .lesson-draft-statuses .lesson-visit-status {
    border-radius: 10px;
    min-height: 54px;
    padding: 10px 12px;
  }

  .discipline-option strong,
  .planner-create-modal .discipline-option strong,
  .picker-button strong,
  .planner-create-modal .picker-button strong {
    font-size: 18px;
  }

  .picker-button b,
  .planner-create-modal .picker-button b {
    font-size: 18px;
  }

  .picker-popover,
  .planner-create-modal .picker-popover,
  .picker-field.open .picker-popover,
  .planner-create-modal .picker-field.open .picker-popover {
    border-radius: 12px;
    box-shadow: 0 18px 52px rgba(23, 30, 44, 0.24);
    left: 12px !important;
    max-height: min(420px, calc(100dvh - 124px));
    position: fixed !important;
    right: 12px !important;
    top: calc(66px + env(safe-area-inset-top, 0px)) !important;
    width: auto;
    z-index: 130;
  }

  .picker-option,
  .planner-create-modal .picker-option {
    border-radius: 9px;
    min-height: 44px;
    padding: 9px 10px;
  }

  .input,
  .textarea,
  select.input {
    min-height: 42px;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding-left: 10px;
    padding-right: 10px;
  }

  .workspace > .page-head .title,
  .overview-planner-head h1 {
    font-size: 26px;
  }

  .workspace > .page-head .kicker,
  .overview-planner-head .kicker,
  .panel .kicker {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .panel,
  .workspace .panel:not(.modal-panel):not(.lesson-modal-panel) {
    padding: 10px;
  }

  .erp-table {
    border-radius: 12px;
  }

  .erp-table-head {
    display: none;
  }

  .erp-table-row {
    align-items: start;
    display: grid;
    gap: 6px;
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .overview-stat,
  .overview-focus-card,
  .overview-request-card,
  .communication-item {
    border-radius: 10px;
    padding: 10px;
  }

  .calendar-planner-days {
    gap: 3px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .calendar-planner-days button {
    border-radius: 8px;
    min-height: 34px;
    padding: 5px 2px;
  }

  .lesson-modal-panel,
  .modal-panel,
  .planner-create-modal {
    border-radius: 14px;
    padding: 12px;
  }

  .modal-title,
  .planner-create-modal-head h2 {
    font-size: 26px;
    line-height: 1;
  }

  .lesson-form-summary {
    gap: 6px;
  }

  .lesson-form-summary span,
  .availability-warning-chip {
    border-radius: 8px;
    font-size: 11px;
    padding: 6px 7px;
  }

  .message-thread {
    max-height: 55dvh;
    min-height: 240px;
  }

  .message-bubble {
    border-radius: 12px;
    max-width: 96%;
    padding: 10px 11px;
  }

  .sales-order-list article,
  .sale-summary-grid,
  .sale-bonus-table {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .workspace {
    padding-left: 8px;
    padding-right: 8px;
  }

  .workspace > .page-head .title,
  .overview-planner-head h1,
  .modal-title,
  .planner-create-modal-head h2 {
    font-size: 23px;
  }

  .btn,
  .erp-toolbar-action,
  .input,
  .textarea,
  select.input {
    font-size: 15px;
  }

  .work-schedule-grid {
    min-width: 680px;
  }

  .overview-planner-grid {
    min-width: 680px;
  }

  .admin-nav {
    width: calc(100vw - 16px);
  }

  .message-thread {
    min-height: 220px;
  }
}

/* Mobile overview: compact operational layout. */
@media (max-width: 760px) {
  .overview-planner-page {
    gap: 10px;
  }

  .overview-planner-head-toolbar {
    border-bottom: 0;
    margin: 0;
    padding: 0;
  }

  .overview-planner-head-toolbar .overview-head-actions {
    display: block;
    width: 100%;
  }

  .overview-day-controls {
    display: grid;
    gap: 8px;
    grid-template-columns: 92px minmax(0, 1fr);
    width: 100%;
  }

  .overview-day-controls .btn.compact,
  .overview-day-stepper {
    border-radius: 12px;
    min-height: 42px;
    width: 100%;
  }

  .overview-day-controls .btn.compact {
    font-size: 15px;
    min-width: 0;
    padding: 8px 10px;
  }

  .overview-day-stepper {
    min-width: 0;
  }

  .overview-day-stepper button {
    height: 40px;
    width: 40px;
  }

  .overview-day-stepper strong {
    font-size: 14px;
    min-width: 0;
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-status-strip {
    background: transparent;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
  }

  .overview-status-strip button {
    align-items: center;
    background: #fff;
    border-color: var(--erp-border, #e3e7ee);
    border-radius: 999px;
    display: inline-flex;
    gap: 6px;
    min-height: 32px;
    padding: 6px 10px;
    width: auto;
  }

  .overview-status-strip button.is-zero {
    display: none;
  }

  .overview-status-strip strong {
    font-size: 15px;
    line-height: 1;
  }

  .overview-status-strip span {
    font-size: 12px;
    line-height: 1.05;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-status-strip small,
  .overview-status-strip em {
    display: none;
  }

  .overview-focus-strip {
    display: none;
  }

  .overview-mobile-day-pulse {
    background: #fff;
    border: 1px solid var(--erp-border, #e3e7ee);
    border-radius: 12px;
    display: grid;
    gap: 8px;
    padding: 10px;
  }

  .overview-mobile-day-pulse header {
    align-items: start;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .overview-mobile-day-pulse .kicker {
    font-size: 9px;
    letter-spacing: 0.16em;
    margin: 0 0 2px;
  }

  .overview-mobile-day-pulse header strong {
    color: var(--ink);
    display: block;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.05;
  }

  .overview-mobile-day-pulse header button,
  .overview-mobile-pulse-empty {
    -webkit-appearance: none;
    appearance: none;
    background: #fff;
    border: 1px solid rgba(201, 31, 38, 0.34);
    border-radius: 9px;
    color: var(--brand-red);
    font-size: 12px;
    font-weight: 900;
    min-height: 32px;
    padding: 6px 10px;
    text-align: center;
  }

  .overview-mobile-pulse-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-mobile-pulse-grid span {
    background: #f7f8fa;
    border: 1px solid var(--erp-border, #e3e7ee);
    border-radius: 9px;
    min-width: 0;
    padding: 7px 8px;
  }

  .overview-mobile-pulse-grid small {
    color: var(--admin-muted, #687082);
    display: block;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
    margin-bottom: 4px;
    text-transform: uppercase;
  }

  .overview-mobile-pulse-grid b {
    color: var(--ink);
    display: block;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-mobile-pulse-grid em {
    color: var(--admin-muted, #687082);
    display: block;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    line-height: 1.15;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-mobile-shift-bars {
    border-top: 1px solid var(--erp-border, #e3e7ee);
    display: grid;
    gap: 5px;
    padding-top: 8px;
  }

  .overview-mobile-shift-bar {
    -webkit-appearance: none;
    appearance: none;
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    display: grid;
    gap: 7px;
    grid-template-columns: 66px minmax(0, 1fr) auto;
    min-height: 22px;
    padding: 0;
    text-align: left;
    width: 100%;
  }

  .overview-mobile-shift-bar span {
    color: var(--ink);
    font-size: 11px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-mobile-shift-bar i {
    background: #eef1f5;
    border-radius: 999px;
    display: block;
    height: 8px;
    overflow: hidden;
    position: relative;
  }

  .overview-mobile-shift-bar i::before {
    background: rgba(201, 31, 38, 0.58);
    border-radius: inherit;
    bottom: 0;
    content: "";
    left: var(--bar-left, 0);
    position: absolute;
    top: 0;
    width: var(--bar-width, 0);
  }

  .overview-mobile-shift-bar.role-vocal i::before {
    background: rgba(107, 133, 84, 0.66);
  }

  .overview-mobile-shift-bar.role-speech i::before {
    background: rgba(44, 112, 99, 0.66);
  }

  .overview-mobile-shift-bar small {
    color: var(--admin-muted, #687082);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
    white-space: nowrap;
  }

  .overview-mobile-pulse-empty {
    border-style: dashed;
    padding: 8px 10px;
    width: 100%;
  }

  .overview-mobile-day-pulse > em {
    color: var(--admin-muted, #687082);
    font-size: 10px;
    font-style: normal;
    font-weight: 820;
    line-height: 1.15;
  }

  .overview-broadcast-reminder {
    align-items: center;
    background: #fff;
    border-color: var(--erp-border, #e3e7ee);
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 9px 10px;
  }

  .overview-broadcast-reminder.is-late {
    background: #fff;
    border-color: rgba(201, 31, 38, 0.18);
  }

  .overview-broadcast-reminder .kicker {
    font-size: 9px;
    letter-spacing: 0.16em;
  }

  .overview-broadcast-reminder strong {
    font-size: 13px;
  }

  .overview-broadcast-reminder span {
    font-size: 10px;
  }

  .overview-broadcast-reminder .btn {
    border-radius: 9px;
    font-size: 12px;
    min-height: 32px;
    padding: 6px 10px;
    width: auto;
  }

  .overview-workbench {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr !important;
  }

  .overview-planner-page:not(.calendar-planner-page) .overview-planner-shell,
  .overview-planner-page:not(.calendar-planner-page) .overview-inspector {
    display: none;
  }

  .overview-mobile-schedule {
    display: grid;
    gap: 8px;
  }

  .overview-mobile-schedule-card {
    background: #fff;
    border: 1px solid var(--erp-border, #e3e7ee);
    border-radius: 12px;
    box-shadow: none;
    display: grid;
    gap: 8px;
    padding: 10px;
  }

  .overview-mobile-schedule-card header {
    align-items: start;
    border-bottom: 1px solid var(--erp-border, #e3e7ee);
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding-bottom: 8px;
  }

  .overview-mobile-schedule-card header strong {
    color: var(--ink);
    display: block;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.05;
  }

  .overview-mobile-schedule-card header span {
    color: var(--admin-muted, #687082);
    display: block;
    font-size: 12px;
    font-weight: 760;
    line-height: 1.15;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-mobile-schedule-card header small {
    color: var(--admin-muted, #687082);
    font-size: 11px;
    font-weight: 850;
    line-height: 1.1;
    text-align: right;
    white-space: nowrap;
  }

  .overview-mobile-schedule-slots {
    display: grid;
    gap: 6px;
  }

  .overview-mobile-schedule-slot {
    -webkit-appearance: none;
    appearance: none;
    background: #f7f8fa;
    border: 1px solid var(--erp-border, #e3e7ee);
    border-radius: 9px;
    color: inherit;
    display: grid;
    gap: 2px 8px;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 7px 8px;
    text-align: left;
  }

  .overview-mobile-schedule-slot time {
    color: var(--brand-red);
    font-size: 11px;
    font-weight: 900;
    grid-row: span 2;
    line-height: 1.1;
    min-width: 78px;
  }

  .overview-mobile-schedule-slot strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-mobile-schedule-slot span {
    color: var(--admin-muted, #687082);
    font-size: 10px;
    font-weight: 760;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-mobile-schedule-empty {
    color: var(--admin-muted, #687082);
    font-size: 12px;
    font-weight: 760;
    margin: 0;
  }

  .overview-mobile-schedule-empty.muted {
    color: var(--admin-muted-soft, #8a92a1);
  }

  .overview-mobile-free-ranges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .overview-mobile-free-ranges button,
  .overview-mobile-free-ranges span {
    align-items: center;
    background: #fff;
    border: 1px solid var(--erp-border, #e3e7ee);
    border-radius: 999px;
    color: var(--admin-muted, #687082);
    display: inline-flex;
    font-size: 11px;
    font-weight: 850;
    min-height: 28px;
    padding: 5px 9px;
  }

  .overview-mobile-free-ranges button {
    color: var(--brand-red);
  }

  .overview-shift-preview {
    background: #fff;
    border: 1px solid var(--erp-border, #e3e7ee);
    border-radius: 12px;
    display: grid;
    gap: 8px;
    padding: 10px;
  }

  .overview-shift-preview header,
  .work-schedule-mobile-summary header {
    align-items: start;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .overview-shift-preview .kicker,
  .work-schedule-mobile-summary .kicker {
    font-size: 9px;
    letter-spacing: 0.16em;
    margin: 0 0 2px;
  }

  .overview-shift-preview header strong,
  .work-schedule-mobile-summary header strong {
    color: var(--ink);
    display: block;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.05;
  }

  .overview-shift-preview header > span,
  .work-schedule-mobile-summary header > span {
    color: var(--admin-muted, #687082);
    font-size: 11px;
    font-weight: 850;
    line-height: 1.15;
    text-align: right;
    white-space: nowrap;
  }

  .overview-shift-preview-list,
  .work-schedule-mobile-team {
    border-top: 1px solid var(--erp-border, #e3e7ee);
    display: grid;
  }

  .overview-shift-preview-row,
  .work-schedule-mobile-row {
    -webkit-appearance: none;
    appearance: none;
    align-items: center;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--erp-border, #e3e7ee);
    border-radius: 0;
    color: inherit;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 44px;
    padding: 8px 0;
    text-align: left;
    width: 100%;
  }

  .overview-shift-preview-row:last-child,
  .work-schedule-mobile-row:last-child {
    border-bottom: 0;
  }

  .overview-shift-preview-row span,
  .work-schedule-mobile-row span {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .overview-shift-preview-row strong,
  .work-schedule-mobile-row strong {
    color: var(--ink);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-shift-preview-row small,
  .work-schedule-mobile-row small {
    color: var(--admin-muted, #687082);
    font-size: 10px;
    font-weight: 780;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-shift-preview-row b,
  .work-schedule-mobile-row b {
    color: var(--ink);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    white-space: nowrap;
  }

  .overview-shift-preview-row em,
  .work-schedule-mobile-row em {
    background: #f2f4f7;
    border-radius: 999px;
    color: var(--admin-muted, #687082);
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    padding: 5px 7px;
    white-space: nowrap;
  }

  .overview-shift-preview-row.role-admin em,
  .work-schedule-mobile-row.role-admin em {
    background: #fff0f1;
    color: var(--brand-red);
  }

  .overview-shift-preview-more,
  .overview-shift-preview-empty,
  .work-schedule-mobile-empty {
    background: transparent;
    border: 0;
    color: var(--admin-muted, #687082);
    font-size: 12px;
    font-weight: 850;
    padding: 9px 0 0;
    text-align: left;
  }

  .work-schedule-panel .work-coverage-section {
    display: none;
  }

  .work-schedule-workbench {
    gap: 10px;
  }

  .work-schedule-panel,
  .work-schedule-inspector {
    border-radius: 12px;
  }

  .work-schedule-panel-head {
    background: #fff;
    border-bottom: 1px solid var(--admin-border, #dde3ec);
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .work-schedule-panel-head .section-title {
    font-size: 20px;
    line-height: 1.05;
  }

  .work-schedule-panel-head .meta {
    font-size: 11px;
    line-height: 1.2;
  }

  .work-schedule-mobile-summary {
    background: #fff;
    border-bottom: 1px solid var(--admin-border, #dde3ec);
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .work-schedule-mobile-days {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .work-schedule-mobile-days::-webkit-scrollbar {
    display: none;
  }

  .work-schedule-mobile-days button {
    -webkit-appearance: none;
    appearance: none;
    background: #f7f8fa;
    border: 1px solid var(--erp-border, #e3e7ee);
    border-radius: 9px;
    color: var(--admin-muted, #687082);
    display: grid;
    flex: 0 0 42px;
    gap: 1px;
    min-height: 44px;
    padding: 5px 2px;
    place-items: center;
  }

  .work-schedule-mobile-days button.active {
    background: #fff7f7;
    border-color: rgba(201, 31, 38, 0.28);
    color: var(--brand-red);
  }

  .work-schedule-mobile-days span {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .work-schedule-mobile-days strong {
    color: inherit;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
  }

  .work-schedule-mobile-off {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .work-schedule-mobile-off span,
  .work-schedule-mobile-off button {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
    min-height: 28px;
    padding: 6px 9px;
  }

  .work-schedule-mobile-off span {
    color: var(--admin-muted, #687082);
    padding-left: 0;
  }

  .work-schedule-mobile-off button {
    background: #f7f8fa;
    border: 1px solid var(--erp-border, #e3e7ee);
    color: var(--ink);
  }

  .work-schedule-scroll {
    border-top: 1px solid var(--admin-border, #dde3ec);
    max-width: 100%;
    overflow: auto;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    padding-bottom: 8px;
    position: relative;
    touch-action: pan-x pan-y;
  }

  .work-schedule-grid {
    box-sizing: content-box;
    min-width: 720px;
    padding-right: max(80px, calc(100vw - 250px));
  }

  .work-schedule-head,
  .work-schedule-row {
    grid-template-columns: 128px repeat(var(--schedule-day-count, 7), minmax(84px, 1fr));
  }

  .work-schedule-month .work-schedule-head,
  .work-schedule-month .work-schedule-row {
    grid-template-columns: 128px repeat(var(--schedule-day-count, 31), 78px);
  }

  .work-schedule-head > span,
  .work-person,
  .work-shift-cell {
    min-height: 40px;
  }

  .work-schedule-head > span:first-child,
  .work-person {
    box-shadow: 1px 0 0 var(--admin-border, #dde3ec);
    left: 0;
    position: sticky;
  }

  .work-schedule-head > span:first-child {
    background: #f2f4f7;
    z-index: 4;
  }

  .work-person {
    background: #fbfcfd;
    padding: 7px 8px;
    z-index: 3;
  }

  .work-person strong {
    font-size: 13px;
  }

  .work-shift-input {
    font-size: 11px;
    line-height: 1;
    padding: 0 4px;
  }

  .work-schedule-month .work-shift-input {
    font-size: 10px;
    padding: 0 3px;
  }

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

  .work-schedule-toolbar .btn {
    border-radius: 9px;
    font-size: 12px;
    min-height: 36px;
    padding: 7px 8px;
  }

  .teachers-workbench {
    background: transparent;
    border: 0;
    border-radius: 0;
    display: grid;
    gap: 10px;
    overflow: visible;
  }

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

  .settings-metric-row > span {
    min-height: 62px;
    padding: 9px 10px;
  }

  .settings-metric-row > span + span {
    border-left: 0;
  }

  .settings-metric-row > span:nth-child(2n) {
    border-left: 1px solid var(--admin-border, #dde3ec);
  }

  .settings-metric-row > span:nth-child(n + 3) {
    border-top: 1px solid var(--admin-border, #dde3ec);
  }

  .settings-metric-row strong {
    font-size: 17px;
  }

  .settings-metric-row small {
    font-size: 11px;
    line-height: 1.15;
    white-space: normal;
  }

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

  .teacher-create-row {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .teacher-table {
    background: transparent;
    border: 0;
    display: grid;
    gap: 8px;
  }

  .teacher-table .erp-table-head {
    display: none;
  }

  .teacher-table-row {
    background: #fff;
    border: 1px solid var(--admin-border, #dde3ec);
    border-radius: 12px;
    display: grid;
    gap: 6px 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    padding: 9px 10px;
  }

  .teacher-table-row .erp-person-cell {
    grid-column: 1 / -1;
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .teacher-table-row .erp-avatar {
    height: 38px;
    width: 38px;
  }

  .teacher-table-row > span:not(.erp-person-cell):not(.erp-row-action) {
    align-items: center;
    display: grid;
    gap: 2px;
    min-width: 0;
    padding-top: 0;
  }

  .teacher-table-row > span:nth-child(2),
  .teacher-table-row > span:nth-child(3) {
    border-top: 1px solid var(--erp-border, #e3e7ee);
    padding-top: 7px;
  }

  .teacher-table-row > span:nth-child(4) {
    align-self: center;
    grid-column: 1;
  }

  .teacher-table-row > span:nth-child(2)::before,
  .teacher-table-row > span:nth-child(3)::before,
  .teacher-table-row > span:nth-child(4)::before {
    color: var(--admin-muted, #687082);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
  }

  .teacher-table-row > span:nth-child(2)::before {
    content: "Роль";
  }

  .teacher-table-row > span:nth-child(3)::before {
    content: "Сегодня";
  }

  .teacher-table-row > span:nth-child(4)::before {
    content: "Статус";
  }

  .teacher-table-row > span b,
  .teacher-table-row > span small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .teacher-table-row > span:nth-child(2) small,
  .teacher-table-row > span:nth-child(3) small,
  .teacher-table-row > span:nth-child(4) small {
    display: none;
  }

  .teacher-table-row .erp-row-action {
    align-self: center;
    background: #f7f8fa;
    border: 1px solid var(--erp-border, #e3e7ee);
    border-radius: 999px;
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
    min-height: 28px;
    padding: 6px 9px;
  }

  .teachers-workbench .overview-inspector {
    border: 1px solid var(--admin-border, #dde3ec);
    border-radius: 12px;
    order: 1;
    padding: 12px;
  }

  .teachers-workbench .teacher-list {
    order: 2;
  }

  .teachers-workbench .overview-inspector-idle {
    display: none;
  }
}

@media (max-width: 340px) {
  .overview-day-controls {
    grid-template-columns: 1fr;
  }
}

.analytics-summary-table div {
  align-content: start;
  grid-template-columns: minmax(0, 1fr);
}

.analytics-summary-table span,
.analytics-summary-table strong,
.analytics-summary-table em {
  min-width: 0;
}

.analytics-summary-table strong {
  overflow-wrap: anywhere;
}

/* Final mobile admin override: keep operational toolbar chips compact. */
@media (max-width: 640px) {
  .erp-toolbar .erp-toolbar-filters {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .erp-toolbar .erp-filter-pill {
    background: #fff;
    border: 1px solid var(--admin-border, #dde3ec);
    border-radius: 999px;
    color: var(--admin-muted, #687082);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 850;
    min-height: 28px;
    padding: 5px 8px;
    width: auto;
  }

  .erp-toolbar .erp-filter-pill + .erp-filter-pill::before {
    content: none;
    margin-right: 0;
  }

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

  .analytics-summary-table div,
  .analytics-summary-table div:nth-child(3n),
  .analytics-summary-table div:last-child {
    border-right: 1px solid var(--admin-border, #e3e7ee);
    min-height: 68px;
    padding: 9px 10px;
  }

  .analytics-summary-table div:nth-child(2n) {
    border-right: 0;
  }

  .analytics-summary-table div:nth-child(n + 3) {
    border-top: 1px solid var(--admin-border, #e3e7ee);
  }

  .teachers-workbench .teacher-table {
    order: 1;
  }

  .teachers-workbench .teacher-create-row {
    order: 2;
  }

  .teachers-workbench .overview-inspector {
    order: 1;
  }

  .teachers-workbench .teacher-list {
    order: 2;
  }
}

/* Last mobile override: must stay after legacy responsive blocks. */
@media (max-width: 760px) {
  html,
  body,
  .admin-layout,
  .workspace {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.telegram-swipe-lock .workspace {
    overflow-x: hidden;
  }

  .sidebar-open .admin-nav {
    padding-top: 58px;
  }

  .sidebar-open .mobile-menu-button {
    z-index: 91;
  }

  .clients-workbench {
    background: transparent;
    border: 0;
    display: block !important;
    min-height: 0;
    overflow: visible;
  }

  .clients-workbench > .erp-table.student-table {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: grid;
    gap: 7px;
    overflow: visible;
  }

  .clients-workbench .erp-table-head {
    display: none;
  }

  .clients-workbench .student-table-row {
    background: #fff;
    border: 1px solid var(--admin-border, #dde3ec);
    border-radius: 10px;
    box-shadow: none;
    display: grid;
    gap: 3px 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 54px;
    padding: 8px 10px;
  }

  .clients-workbench .student-table-row.selected {
    border-color: rgba(201, 31, 38, 0.32);
    box-shadow: inset 3px 0 0 var(--brand-red);
  }

  .clients-workbench .student-table-row .erp-person-cell {
    display: grid;
    gap: 8px;
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .clients-workbench .student-table-row .erp-avatar {
    font-size: 12px;
    height: 30px;
    width: 30px;
  }

  .clients-workbench .student-table-row > span:nth-child(2) {
    grid-column: 1;
    margin-left: 38px;
  }

  .clients-workbench .student-table-row > span:nth-child(3) {
    align-self: center;
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-items: end;
    max-width: 112px;
  }

  .clients-workbench .student-table-row > span:nth-child(3) small,
  .clients-workbench .student-table-row > span:nth-child(4),
  .clients-workbench .student-table-row .erp-row-action {
    display: none;
  }

  .clients-workbench .student-table-row b {
    font-size: 13px;
    line-height: 1.12;
  }

  .clients-workbench .student-table-row small {
    font-size: 11px;
    line-height: 1.12;
  }

  .clients-workbench .student-table-row .erp-status {
    border-radius: 999px;
    font-size: 10px;
    max-width: 108px;
    min-height: 26px;
    overflow: hidden;
    padding: 6px 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .clients-workbench .overview-inspector-idle.client-detail-panel {
    display: none;
  }

  .clients-workbench .client-detail-panel-active {
    border: 1px solid var(--admin-border, #dde3ec);
    border-radius: 14px;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    box-shadow: 0 24px 64px rgba(23, 30, 44, 0.24);
    left: max(8px, env(safe-area-inset-left, 0px));
    max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    overflow: auto;
    padding: 14px;
    position: fixed;
    right: max(8px, env(safe-area-inset-right, 0px));
    top: max(8px, env(safe-area-inset-top, 0px));
    z-index: 96;
  }

  .client-detail-close {
    display: flex;
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 2;
  }

  .client-card-head {
    grid-template-columns: 42px minmax(0, 1fr);
    padding-right: 44px;
  }

  .client-card-head h2 {
    font-size: 22px;
    line-height: 1.02;
  }

  .client-tags span {
    font-size: 10px;
    min-height: 24px;
    padding: 5px 7px;
  }

  .client-membership-strip strong {
    font-size: 18px;
  }

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

  .work-schedule-workbench,
  .work-schedule-panel {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .work-schedule-scroll {
    contain: inline-size;
    max-width: 100%;
    min-width: 0;
    overflow: auto;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    width: 100%;
  }

  .work-schedule-grid {
    max-width: none;
  }
}

@media (max-width: 720px) {
  input,
  textarea,
  select,
  .input,
  .textarea,
  select.input,
  .work-shift-input,
  .sale-amount-input,
  .client-profile-grid .input,
  .client-message-panel textarea,
  .planner-create-modal .input,
  .planner-create-modal .textarea,
  .planner-create-modal select.input {
    font-size: 16px !important;
  }
}

/* YCLIENTS-inspired desktop information architecture */
.admin-layout {
  grid-template-columns: 246px minmax(0, 1fr);
}

.admin-nav {
  background: #f6f8fb;
  gap: 12px;
  padding: 14px 10px;
}

.sidebar-brand-lockup {
  min-height: 38px;
  padding: 0 8px;
}

.sidebar-brand-lockup strong {
  font-size: 17px;
  letter-spacing: 0;
}

.sidebar-nav-list {
  gap: 6px;
}

.nav-tab,
.nav-section-toggle {
  min-height: 44px;
}

.nav-copy small {
  display: none;
}

.nav-section {
  background: transparent;
  border: 0;
  border-radius: 8px;
  display: grid;
  gap: 0;
  overflow: hidden;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.nav-section.open {
  background: transparent;
  box-shadow: none;
}

.nav-section-toggle {
  -webkit-appearance: none;
  appearance: none;
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--admin-muted, #687082);
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 9px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.nav-section.open > .nav-section-toggle,
.nav-section-toggle.active {
  background: var(--admin-active, rgba(201, 31, 38, 0.08));
  color: var(--brand-red);
}

.nav-section-toggle:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(201, 31, 38, 0.28);
  outline: 0;
}

.nav-section-toggle > span:nth-child(2) {
  font-size: 14px;
  font-weight: 780;
  line-height: 1.12;
}

.nav-section-toggle > i {
  font-size: 18px;
  font-style: normal;
  font-weight: 800;
}

.nav-section-content {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
  transition:
    grid-template-rows 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 140ms ease,
    visibility 0s linear 220ms;
  visibility: hidden;
}

.nav-section-content > * {
  min-height: 0;
  overflow: hidden;
}

.nav-section:not(.open) .nav-section-content > * {
  margin-bottom: 0;
  margin-top: 0;
  padding-bottom: 0;
  padding-top: 0;
}

.nav-section.open .nav-section-content {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
  transition:
    grid-template-rows 240ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease 45ms,
    visibility 0s;
  visibility: visible;
}

.nav-section-chevron {
  align-items: center;
  color: #747b87;
  display: flex;
  height: 20px;
  justify-content: center;
  transform: rotate(0deg);
  transition: transform 200ms ease;
  width: 20px;
}

.nav-section-chevron svg {
  display: block;
  height: 16px;
  width: 16px;
}

.nav-section.open .nav-section-chevron {
  color: currentColor;
  transform: rotate(180deg);
}

.nav-section-communications .nav-section-toggle {
  gap: 9px;
  grid-template-columns: 18px minmax(0, 1fr) auto 20px;
  padding-inline: 10px;
}

.nav-section-communications .nav-copy > span {
  font-size: 14px;
  font-weight: 780;
  letter-spacing: 0;
}

.nav-section-communications .nav-badge {
  grid-column: 3;
}

.nav-section-communications .nav-section-chevron {
  grid-column: 4;
}

.nav-section-communications .nav-submenu {
  margin: 0;
  padding: 5px 6px 9px;
}

.nav-employee-list,
.nav-client-list {
  display: grid;
  gap: 2px;
  padding: 7px 6px 9px;
}

.nav-employee-item {
  -webkit-appearance: none;
  appearance: none;
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #747b87;
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 9px;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  min-height: 47px;
  padding: 5px 7px;
  text-align: left;
  width: 100%;
}

.nav-employee-item:hover,
.nav-employee-item:focus-visible,
.nav-employee-item.active {
  background: #f3f5f8;
  color: #25282d;
  outline: 0;
}

.nav-employee-item.active {
  background: rgba(201, 31, 38, 0.09);
  color: var(--brand-red);
}

.nav-employee-item.active .nav-employee-avatar {
  background: rgba(201, 31, 38, 0.1);
  color: var(--brand-red);
}

.nav-employee-item.active .nav-employee-calendar {
  color: var(--brand-red);
}

.nav-employee-avatar {
  align-items: center;
  background: #efefff;
  border-radius: 999px;
  color: #9a96ff;
  display: flex;
  font-size: 13px;
  font-weight: 850;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.nav-employee-item > span:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nav-employee-item strong {
  color: inherit;
  font-size: 13px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-employee-item small {
  color: #9aa1ad;
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-employee-calendar {
  color: #737985;
  display: flex;
  height: 25px;
  width: 25px;
}

.nav-employee-calendar svg {
  height: 25px;
  width: 25px;
}

.nav-client-list button {
  -webkit-appearance: none;
  appearance: none;
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #737985;
  cursor: pointer;
  display: grid;
  font: inherit;
  font-size: 13px;
  font-weight: 780;
  gap: 9px;
  grid-template-columns: 18px minmax(0, 1fr);
  min-height: 36px;
  padding: 8px 10px 8px 38px;
  text-align: left;
  width: 100%;
}

.nav-client-list button:hover,
.nav-client-list button:focus-visible,
.nav-client-list button.active {
  background: #f3f5f8;
  color: #25282d;
  outline: 0;
}

.nav-client-list button.active {
  background: rgba(201, 31, 38, 0.09);
  color: var(--brand-red);
  font-weight: 900;
}

/* Employee weekly calendar */
.employee-schedule-page {
  animation: admin-surface-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
  background: #fff;
  display: grid;
  margin: 0 -24px -32px;
  min-height: 100%;
}

.employee-schedule-toolbar {
  align-items: center;
  background: #f5f7fa;
  border-bottom: 1px solid #dce2ea;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 68px;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.employee-schedule-period,
.employee-schedule-tools {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.employee-schedule-period > strong {
  color: #30343a;
  font-size: 16px;
  font-weight: 900;
  margin-left: 6px;
  white-space: nowrap;
}

.employee-toolbar-button,
.employee-week-stepper,
.employee-toolbar-icon {
  background: #fff;
  border: 1px solid #d7dde6;
  border-radius: 9px;
}

.employee-toolbar-button {
  color: #363a40;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  min-height: 38px;
  padding: 0 13px;
}

.employee-week-stepper {
  display: grid;
  grid-template-columns: repeat(2, 38px);
  overflow: hidden;
}

.employee-week-stepper button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #555b66;
  cursor: pointer;
  display: flex;
  height: 38px;
  justify-content: center;
  padding: 0;
}

.employee-week-stepper button svg {
  height: 18px;
  width: 18px;
}

.employee-week-stepper button + button {
  border-left: 1px solid #d7dde6;
}

.employee-filter-chip {
  align-items: center;
  background: #282828;
  border-radius: 10px;
  color: #fff;
  display: grid;
  gap: 8px;
  grid-template-columns: 30px minmax(0, auto) 22px;
  min-height: 42px;
  padding: 5px 7px;
}

.employee-schedule-period .employee-filter-chip {
  margin-left: 8px;
}

.employee-filter-chip > b {
  align-items: center;
  background: #3b347f;
  border-radius: 7px;
  color: #aaa5ff;
  display: flex;
  font-size: 12px;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.employee-filter-chip > span {
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.employee-filter-chip button {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  height: 22px;
  line-height: 1;
  padding: 0;
  width: 22px;
}

.employee-toolbar-icon {
  align-items: center;
  color: #343941;
  cursor: pointer;
  display: flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.employee-toolbar-icon svg {
  height: 19px;
  width: 19px;
}

.employee-week-planner-shell {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-width: 0;
}

.employee-week-planner-grid {
  grid-template-columns: 84px repeat(7, minmax(150px, 1fr));
  min-width: 1134px;
}

.employee-week-planner-grid .overview-planner-corner,
.employee-week-planner-grid .overview-resource-head {
  top: 0;
}

.employee-week-resource-head.today {
  background: #fffdf3;
}

/* Client database */
.client-database-page {
  align-content: start;
  animation: admin-surface-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  margin: 0 -16px -32px;
  min-height: 100%;
  min-width: 0;
}

.communications-workbench {
  animation: admin-surface-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes admin-surface-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.overview-workbench {
  grid-template-columns: minmax(0, 1fr);
}

.overview-workbench.has-inspector {
  grid-template-columns: minmax(0, 1fr) 318px;
}

.message-bubble p {
  white-space: pre-line;
}

.message-bubble.system {
  background: #f6f7f9;
  border: 1px solid #e1e5eb;
  border-radius: 8px;
  color: #626a76;
  justify-self: center;
  max-width: 88%;
  padding: 9px 12px;
}

.message-bubble.system span {
  color: #8b929d;
  font-size: 9px;
}

.message-bubble.system p {
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.client-database-head {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #dce2ea;
  display: flex;
  justify-content: space-between;
  min-height: 84px;
  padding: 14px 20px;
}

.client-database-head h1 {
  color: #30343a;
  font-size: 27px;
  font-weight: 850;
  line-height: 1;
  margin: 0;
}

.client-database-head span {
  color: #b0b6c0;
  display: block;
  font-size: 11px;
  font-weight: 760;
  margin-top: 6px;
}

.client-database-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.client-database-actions .btn {
  border-radius: 8px;
  min-height: 39px;
}

.client-database-filter-panel {
  background: #fff;
  border-bottom: 1px solid #dce2ea;
  display: grid;
  gap: 14px;
  padding: 18px 20px 16px;
}

.client-database-search {
  align-items: center;
  border: 1px solid #d8dde5;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 40px;
}

.client-database-search > span {
  align-items: center;
  color: #9299a5;
  display: flex;
  justify-content: center;
}

.client-database-search svg {
  height: 17px;
  width: 17px;
}

.client-database-search input {
  border: 0;
  color: #30343a;
  font: inherit;
  font-size: 13px;
  height: 38px;
  outline: 0;
  padding: 0 10px 0 0;
}

.client-database-segments {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.client-database-segments button {
  background: transparent;
  border: 0;
  border-bottom: 1px dashed #2994cf;
  color: #2787bd;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 780;
  padding: 0 0 2px;
}

.client-database-segments button.active {
  border-bottom-style: solid;
  color: #25282d;
  font-weight: 900;
}

.client-database-filter-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto repeat(3, minmax(150px, 220px)) 1fr;
}

.client-database-filter-row > span {
  color: #606772;
  font-size: 12px;
  font-weight: 850;
}

.client-database-filter-row > button {
  align-items: center;
  background: #fff;
  border: 1px solid #d8dde5;
  border-radius: 7px;
  color: #676e79;
  display: flex;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 11px;
}

.client-database-filter-row i {
  font-style: normal;
}

.client-result-count {
  color: #8a929e;
  font-size: 11px;
  font-weight: 800;
  justify-self: end;
}

.client-database-table {
  background: #f5f7fa;
  display: block;
  min-width: 0;
  overflow-x: auto;
  padding: 18px 20px 0;
}

.client-database-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns:
    28px
    minmax(150px, 1.2fr)
    minmax(135px, 1fr)
    minmax(140px, 1fr)
    86px
    62px
    58px
    minmax(132px, 1fr)
    minmax(132px, 1fr);
  min-width: 1110px;
}

.client-database-table-head {
  background: #fff;
  border-bottom: 1px solid #e1e5eb;
  color: #606772;
  font-size: 11px;
  font-weight: 850;
  min-height: 48px;
  padding: 0 14px;
}

.client-database-client-row {
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
  border: 0;
  color: #656c77;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  min-height: 52px;
  padding: 6px 14px;
  text-align: left;
  width: 100%;
}

.client-database-client-row:nth-child(even) {
  background: #eef0f2;
}

.client-database-client-row:hover,
.client-database-client-row:focus-visible,
.client-database-client-row.selected {
  background: #fff8d8;
  outline: 0;
}

.client-database-client-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-database-client-row > span:not(.client-row-name) {
  font-weight: 700;
}

.client-row-name {
  display: grid;
  gap: 2px;
}

.client-row-name b {
  color: #2988c0;
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-row-name small,
.client-database-client-row > span:nth-child(3) small {
  color: #969da8;
  display: block;
  font-size: 9px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-row-checkbox {
  background: #fff;
  border: 2px solid #d9dfe7;
  border-radius: 6px;
  display: block;
  height: 22px;
  width: 22px;
}

.client-database-client-row.selected .client-row-checkbox {
  background: #ffe06a;
  border-color: #e4ba17;
  box-shadow: inset 0 0 0 5px #fff;
}

.client-database-empty {
  background: #fff;
  display: grid;
  gap: 5px;
  min-width: 1110px;
  padding: 32px 14px;
}

.client-database-empty strong {
  color: #30343a;
  font-size: 14px;
  font-weight: 900;
}

.client-database-empty span {
  color: #8d95a1;
  font-size: 12px;
  font-weight: 700;
}

.client-database-footer {
  align-items: center;
  background: #fff;
  border-top: 1px solid #dce2ea;
  color: #777f8a;
  display: flex;
  font-size: 11px;
  font-weight: 750;
  justify-content: space-between;
  min-width: 1110px;
  padding: 12px 14px;
}

.client-database-footer > div {
  display: flex;
  gap: 4px;
}

.client-database-footer button,
.client-database-footer b {
  align-items: center;
  background: #fff;
  border: 1px solid #d8dde5;
  color: #68707c;
  display: flex;
  font: inherit;
  height: 30px;
  justify-content: center;
  min-width: 32px;
  padding: 0 9px;
}

.client-database-footer b {
  background: #edf1f6;
  color: #30343a;
}

.client-drawer-scrim {
  background: rgba(22, 28, 38, 0.2);
  border: 0;
  inset: 0;
  position: fixed;
  z-index: 90;
}

.client-detail-drawer {
  background: #fff;
  bottom: 0;
  box-shadow: -16px 0 40px rgba(26, 34, 46, 0.18);
  overflow-y: auto;
  padding: 16px;
  position: fixed;
  right: 0;
  top: 0;
  width: min(500px, calc(100vw - 24px));
  z-index: 91;
}

.client-detail-drawer .client-detail-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: auto;
  max-height: none;
  min-height: 100%;
  overflow: visible;
  padding: 12px;
  position: relative;
  width: 100%;
}

/* Compact working settings */
.settings-page {
  animation: admin-surface-in 180ms ease-out;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.settings-page-head {
  align-items: center;
  border-bottom: 1px solid #dfe4eb;
  display: flex;
  justify-content: space-between;
  min-height: 54px;
  padding-bottom: 12px;
}

.settings-page-head h1 {
  color: #25282d;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  margin: 0;
}

.settings-page-head p {
  color: #747b87;
  font-size: 12px;
  font-weight: 650;
  margin: 5px 0 0;
}

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

.settings-group {
  background: #fff;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px 16px;
}

.settings-group-head {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 24px minmax(0, 1fr);
}

.settings-group-head > span {
  color: #676f7c;
  display: flex;
}

.settings-group-head > span svg {
  height: 20px;
  width: 20px;
}

.settings-group-head h2,
.settings-team-head h2 {
  color: #25282d;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
}

.settings-group-head p,
.settings-team-head p {
  color: #777e89;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  margin: 3px 0 0;
}

.settings-field-list,
.settings-action-list {
  border-top: 1px solid #e5e8ed;
  display: grid;
}

.settings-field-row,
.settings-template-field {
  align-items: center;
  border-bottom: 1px solid #eceff3;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(104px, 156px);
  min-height: 50px;
  padding: 7px 0;
}

.settings-field-row:last-child,
.settings-template-field:last-child {
  border-bottom: 0;
}

.settings-field-row > span:first-child,
.settings-template-field > span:first-child {
  display: grid;
  gap: 2px;
}

.settings-field-row b,
.settings-template-field b,
.settings-action-list b {
  color: #30343a;
  font-size: 12px;
  font-weight: 850;
}

.settings-field-row small,
.settings-template-field small,
.settings-action-list small {
  color: #848b96;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
}

.settings-field-row .input,
.settings-template-field .textarea {
  background: #f8f9fb;
  border-color: #dce2ea;
  font-size: 13px;
  min-height: 36px;
}

.settings-control-value {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.settings-control-value em {
  color: #777e89;
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}

.settings-template-field {
  align-items: start;
  grid-template-columns: 150px minmax(0, 1fr);
  padding-top: 10px;
}

.settings-template-field .textarea {
  min-height: 68px;
  resize: vertical;
}

.settings-summary-list {
  border-top: 1px solid #e5e8ed;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.settings-summary-list div {
  align-items: baseline;
  border-bottom: 1px solid #eceff3;
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
}

.settings-summary-list div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.settings-summary-list div:nth-child(odd) {
  padding-right: 14px;
}

.settings-summary-list div:nth-child(even) {
  border-left: 1px solid #eceff3;
  padding-left: 14px;
}

.settings-summary-list dt {
  color: #777e89;
  font-size: 11px;
  font-weight: 700;
}

.settings-summary-list dd {
  color: #30343a;
  font-size: 12px;
  font-weight: 900;
  margin: 0;
}

.settings-text-link {
  -webkit-appearance: none;
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: #c91f26;
  cursor: pointer;
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  gap: 4px;
  justify-self: start;
  padding: 0;
  text-decoration: none;
}

.settings-text-link svg {
  height: 14px;
  width: 14px;
}

.settings-action-list button {
  -webkit-appearance: none;
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #eceff3;
  color: #30343a;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 18px;
  min-height: 50px;
  padding: 7px 0;
  text-align: left;
}

.settings-action-list button:last-child {
  border-bottom: 0;
}

.settings-action-list button > span {
  display: grid;
  gap: 2px;
}

.settings-action-list button > svg {
  color: #7b828d;
  height: 16px;
  width: 16px;
}

.settings-team-section {
  border-top: 1px solid #dfe4eb;
  display: grid;
  gap: 10px;
  padding-top: 14px;
  scroll-margin-top: 16px;
}

.settings-team-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.settings-page .teachers-workbench {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.settings-page .teachers-workbench.has-inspector {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.settings-page .teacher-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.settings-page .teacher-create-row {
  align-items: end;
  background: #fff;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.8fr) 96px auto;
  padding: 10px 12px;
}

.settings-page .teacher-create-row > div {
  align-self: center;
  display: grid;
  gap: 2px;
}

.settings-page .teacher-create-row strong {
  color: #30343a;
  font-size: 13px;
  font-weight: 900;
}

.settings-page .teacher-create-row small {
  color: #818894;
  font-size: 10px;
  font-weight: 650;
}

.settings-page .teacher-create-row .field {
  gap: 4px;
}

.settings-page .teacher-create-row .label {
  font-size: 10px;
}

.settings-page .teacher-create-row .input {
  min-height: 36px;
}

.settings-page .teacher-table {
  border: 1px solid #dce2ea;
  border-radius: 8px;
  overflow: hidden;
}

.settings-page .teacher-table-row {
  grid-template-columns: minmax(170px, 1.2fr) minmax(140px, 1fr) minmax(140px, 0.9fr) minmax(120px, 0.8fr) 62px;
  min-height: 54px;
}

.settings-page .teacher-table .teacher-card-button {
  border-left: 0;
}

.settings-page .overview-inspector {
  border: 1px solid #dce2ea;
  border-radius: 8px;
  box-shadow: none;
  height: max-content;
  position: sticky;
  top: 12px;
}

@media (max-width: 980px) {
  .settings-page-head {
    align-items: stretch;
    display: grid;
    gap: 10px;
  }

  .settings-catalog,
  .settings-page .teachers-workbench.has-inspector {
    grid-template-columns: 1fr;
  }

  .settings-page .teacher-create-row {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr) 88px;
  }

  .settings-page .teacher-create-row > div,
  .settings-page .teacher-create-row > .field:first-of-type {
    grid-column: 1 / -1;
  }

  .settings-page .teacher-table {
    overflow-x: auto;
  }

  .settings-page .teacher-table-row {
    min-width: 760px;
  }
}

@media (max-width: 980px) {
  .admin-layout {
    display: block;
  }

  .employee-schedule-page,
  .client-database-page {
    margin: 0;
  }

  .employee-schedule-toolbar {
    align-items: stretch;
    display: grid;
    gap: 8px;
    padding: 8px;
    position: static;
  }

  .employee-schedule-period,
  .employee-schedule-tools {
    overflow-x: auto;
  }

  .employee-week-planner-grid .overview-planner-corner,
  .employee-week-planner-grid .overview-resource-head {
    top: 0;
  }

  .client-database-head {
    align-items: stretch;
    display: grid;
    gap: 12px;
  }

  .client-database-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-database-filter-row {
    grid-template-columns: 1fr;
  }

  .client-result-count {
    justify-self: start;
  }
}

/* Unified broadcast workspace */
.broadcast-page {
  animation: admin-surface-in 180ms ease-out;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.broadcast-page-head {
  align-items: center;
  border-bottom: 1px solid #dfe4eb;
  display: flex;
  justify-content: space-between;
  min-height: 54px;
  padding-bottom: 12px;
}

.broadcast-page-head h1 {
  color: #25282d;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  margin: 0;
}

.broadcast-page-head p {
  color: #747b87;
  font-size: 12px;
  font-weight: 650;
  margin: 5px 0 0;
}

.broadcast-page-status {
  align-items: center;
  display: flex;
  gap: 8px;
}

.broadcast-page-status b {
  align-items: center;
  background: #c91f26;
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-size: 12px;
  height: 28px;
  justify-content: center;
  min-width: 28px;
  padding: 0 7px;
}

.broadcast-page-status small {
  color: #5f6672;
  font-size: 11px;
  font-weight: 800;
}

.broadcast-workspace {
  background: #fff;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 248px minmax(360px, 1fr) 260px;
  min-height: 540px;
  overflow: hidden;
}

.broadcast-audience-column,
.broadcast-editor-column,
.broadcast-recipients-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 14px;
}

.broadcast-audience-column,
.broadcast-editor-column {
  border-right: 1px solid #e2e6ec;
}

.broadcast-column-head,
.broadcast-editor-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 42px;
}

.broadcast-column-head {
  display: grid;
  gap: 9px;
  grid-template-columns: 22px minmax(0, 1fr);
}

.broadcast-column-head > span {
  color: #676f7c;
  display: flex;
}

.broadcast-column-head > span svg {
  height: 19px;
  width: 19px;
}

.broadcast-column-head h2,
.broadcast-editor-head h2,
.broadcast-history-panel h2 {
  color: #25282d;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
}

.broadcast-column-head p,
.broadcast-editor-head p,
.broadcast-history-panel header p {
  color: #7b828d;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
  margin: 3px 0 0;
}

.broadcast-page .broadcast-audience-grid {
  border-top: 1px solid #e5e8ed;
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
  margin-top: 10px;
}

.broadcast-page .broadcast-audience-chip {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #eceff3;
  border-radius: 0;
  box-shadow: none;
  color: #30343a;
  display: grid;
  gap: 8px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 8px 2px;
  text-align: left;
}

.broadcast-page .broadcast-audience-chip:hover,
.broadcast-page .broadcast-audience-chip:focus-visible {
  background: #f8f9fb;
  outline: 0;
}

.broadcast-page .broadcast-audience-chip.active {
  background: #fff5f5;
  border-color: #f0d2d4;
  color: #c91f26;
}

.broadcast-audience-icon {
  align-items: center;
  color: #737b87;
  display: flex;
}

.broadcast-audience-icon svg {
  height: 17px;
  width: 17px;
}

.broadcast-audience-chip.active .broadcast-audience-icon {
  color: #c91f26;
}

.broadcast-page .broadcast-audience-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.broadcast-page .broadcast-audience-copy strong {
  color: #30343a;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
}

.broadcast-page .broadcast-audience-copy em {
  color: #818894;
  font-size: 9px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.2;
}

.broadcast-page .broadcast-audience-chip > small {
  align-items: center;
  background: #eef1f5;
  border-radius: 999px;
  color: #69717d;
  display: flex;
  font-size: 9px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  min-width: 22px;
}

.broadcast-page .broadcast-audience-chip.active > small {
  background: #c91f26;
  color: #fff;
}

.broadcast-page .broadcast-rule-note {
  background: #f7f8fa;
  border: 0;
  border-radius: 6px;
  margin-top: 10px;
  padding: 9px 10px;
}

.broadcast-page .broadcast-rule-note strong {
  font-size: 9px;
}

.broadcast-page .broadcast-rule-note span {
  font-size: 10px;
  line-height: 1.3;
}

.broadcast-page .compact-field {
  margin-top: 10px;
}

.broadcast-editor-column {
  gap: 12px;
}

.broadcast-time-field {
  align-items: center;
  background: #f7f8fa;
  border: 1px solid #dce2ea;
  border-radius: 7px;
  display: grid;
  gap: 5px;
  grid-template-columns: 16px 92px;
  padding: 3px 5px 3px 8px;
}

.broadcast-time-field > span {
  color: #6f7783;
  display: flex;
}

.broadcast-time-field svg {
  height: 15px;
  width: 15px;
}

.broadcast-time-field .input {
  background: transparent;
  border: 0;
  font-size: 12px;
  min-height: 30px;
  padding: 3px;
}

.broadcast-editor-field {
  display: grid;
  gap: 6px;
}

.broadcast-editor-field > span {
  color: #5f6672;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.broadcast-editor-field .textarea {
  background: #f8f9fb;
  border-color: #dce2ea;
  font-size: 13px;
  line-height: 1.45;
  min-height: 132px;
  resize: vertical;
}

.broadcast-inline-preview {
  border: 1px solid #e0e5ec;
  border-radius: 7px;
  display: grid;
  min-height: 0;
  overflow: hidden;
}

.broadcast-inline-preview header {
  align-items: center;
  background: #f7f8fa;
  border-bottom: 1px solid #e4e8ee;
  color: #5f6672;
  display: flex;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
}

.broadcast-inline-preview header span {
  display: flex;
}

.broadcast-inline-preview header svg {
  height: 15px;
  width: 15px;
}

.broadcast-inline-preview header strong {
  font-size: 10px;
  font-weight: 850;
}

.broadcast-inline-preview pre {
  color: #454b54;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.38;
  margin: 0;
  max-height: 138px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.broadcast-page .broadcast-message-actions {
  display: grid;
  gap: 7px;
  grid-template-columns: auto minmax(170px, 1fr) auto;
  margin-top: auto;
}

.broadcast-page .broadcast-message-actions .btn {
  min-height: 36px;
  white-space: nowrap;
}

.broadcast-page .broadcast-message-actions .btn:first-child {
  grid-column: auto;
}

.broadcast-page .broadcast-message-actions .btn-primary {
  align-items: center;
  display: flex;
  gap: 7px;
  justify-content: center;
}

.broadcast-page .broadcast-message-actions .btn-primary svg {
  height: 15px;
  width: 15px;
}

.broadcast-recipients-column {
  overflow: hidden;
}

.broadcast-page .broadcast-recipient-head {
  border-bottom: 1px solid #e5e8ed;
  padding-bottom: 10px;
}

.broadcast-page .broadcast-recipient-head strong {
  font-size: 14px;
}

.broadcast-page .broadcast-recipient-list,
.broadcast-page .broadcast-custom-list {
  border: 0;
  border-radius: 0;
  flex: 1;
  margin-top: 6px;
  max-height: none;
  overflow-y: auto;
}

.broadcast-page .broadcast-recipient-list div,
.broadcast-page .broadcast-recipient-check {
  border-bottom: 1px solid #eceff3;
  border-radius: 0;
  padding: 9px 2px;
}

.broadcast-page .empty-inline {
  color: #8a919c;
  font-size: 11px;
  line-height: 1.4;
  padding: 18px 2px;
}

.broadcast-history-panel {
  background: #fff;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.broadcast-history-panel > header {
  align-items: center;
  border-bottom: 1px solid #e2e6ec;
  display: flex;
  justify-content: space-between;
  padding: 11px 14px;
}

.broadcast-history-panel > header > span {
  align-items: center;
  background: #eef1f5;
  border-radius: 999px;
  color: #69717d;
  display: flex;
  font-size: 10px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  min-width: 24px;
}

.broadcast-page .broadcast-history {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.broadcast-page .broadcast-history-item {
  border: 0;
  border-bottom: 1px solid #eceff3;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  min-width: 0;
  padding: 10px 14px;
}

.broadcast-page .broadcast-history-item:nth-child(odd) {
  border-right: 1px solid #eceff3;
}

.broadcast-page .broadcast-history-item p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .broadcast-workspace {
    grid-template-columns: 220px minmax(340px, 1fr);
  }

  .broadcast-recipients-column {
    border-top: 1px solid #e2e6ec;
    grid-column: 1 / -1;
    min-height: 220px;
  }
}

@media (max-width: 760px) {
  .broadcast-page-head {
    align-items: flex-start;
  }

  .broadcast-workspace {
    display: grid;
    grid-template-columns: 1fr;
  }

  .broadcast-audience-column,
  .broadcast-editor-column {
    border-right: 0;
    border-bottom: 1px solid #e2e6ec;
  }

  .broadcast-recipients-column {
    grid-column: auto;
  }

  .broadcast-page .broadcast-message-actions,
  .broadcast-page .broadcast-history {
    grid-template-columns: 1fr;
  }

  .broadcast-page .broadcast-history-item:nth-child(odd) {
    border-right: 0;
  }
}

/* Unified communications workspace */
.communications-page {
  background: #fff;
  height: 100dvh;
  margin: -16px -16px -32px;
  min-height: 640px;
  overflow: hidden;
}

.communications-page .communications-workbench {
  animation: admin-surface-in 180ms ease-out;
  background: #fff;
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 0;
  grid-template-columns: 160px 250px minmax(320px, 1fr) 280px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.communication-channel-nav,
.communications-page .communication-inbox,
.communications-page .communication-thread,
.communications-page .communication-contact {
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.communication-channel-nav,
.communications-page .communication-inbox,
.communications-page .communication-thread {
  border-right: 1px solid #e2e6ec;
}

.communication-channel-nav {
  display: grid;
  grid-template-rows: 84px minmax(0, 1fr);
}

.communication-channel-nav > header {
  align-content: center;
  border-bottom: 1px solid #e2e6ec;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
}

.communication-channel-nav > header strong {
  color: #202328;
  font-size: 15px;
  font-weight: 900;
}

.communication-channel-nav > header span {
  color: #747b87;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.communication-channel-nav nav {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 12px 10px;
}

.communication-channel-nav button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #6d7480;
  cursor: pointer;
  display: grid;
  font: inherit;
  font-size: 12px;
  font-weight: 820;
  gap: 8px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  min-height: 38px;
  padding: 7px 9px;
  text-align: left;
}

.communication-channel-nav button:hover,
.communication-channel-nav button:focus-visible {
  background: #f4f5f7;
  color: #25282d;
  outline: 0;
}

.communication-channel-nav button.active {
  background: #fff0f1;
  color: var(--brand-red);
}

.communication-channel-nav button i {
  display: inline-flex;
  height: 18px;
  width: 18px;
}

.communication-channel-nav button svg {
  height: 100%;
  width: 100%;
}

.communication-channel-nav button b {
  align-items: center;
  background: #eef1f5;
  border-radius: 999px;
  color: #707784;
  display: inline-flex;
  font-size: 10px;
  height: 22px;
  justify-content: center;
  min-width: 22px;
  padding: 0 6px;
}

.communication-channel-nav button.active b {
  background: var(--brand-red);
  color: #fff;
}

.communications-page .communication-inbox {
  display: grid;
  grid-template-rows: 84px minmax(0, 1fr);
  overflow: hidden;
}

.communications-page .communication-inbox-head {
  align-items: center;
  border-bottom: 1px solid #e2e6ec;
  display: flex;
  margin: 0;
  padding: 14px 12px;
}

.communication-search {
  align-items: center;
  background: #f1f3f6;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #7a828e;
  display: grid;
  gap: 8px;
  grid-template-columns: 17px minmax(0, 1fr);
  min-height: 40px;
  padding: 0 11px;
  width: 100%;
}

.communication-search:focus-within {
  background: #fff;
  border-color: #cfd5de;
}

.communication-search svg {
  height: 17px;
  width: 17px;
}

.communication-search input {
  background: transparent;
  border: 0;
  color: #24272c;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  min-width: 0;
  outline: 0;
  width: 100%;
}

.communications-page .communication-list {
  display: block;
  min-height: 0;
  overflow-y: auto;
}

.communications-page .communication-item {
  align-items: start;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #eceff3;
  border-radius: 0;
  color: inherit;
  display: grid;
  gap: 10px;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  min-height: 78px;
  padding: 12px;
  position: relative;
  text-align: left;
  width: 100%;
}

.communications-page .communication-item:hover,
.communications-page .communication-item:focus-visible,
.communications-page .communication-item.active {
  background: #f1f3f6;
  border-color: #e5e9ee;
  outline: 0;
}

.communication-item-avatar,
.communication-thread-avatar {
  align-items: center;
  background: #7b61d1;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  height: 40px;
  justify-content: center;
  line-height: 1;
  position: relative;
  width: 40px;
}

.communication-source-mark {
  align-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  bottom: -3px;
  color: #fff;
  display: inline-flex;
  font-size: 6px;
  font-style: normal;
  font-weight: 950;
  height: 17px;
  justify-content: center;
  position: absolute;
  right: -3px;
  width: 17px;
}

.communication-source-telegram {
  background: #3089e8;
}

.communication-source-vk {
  background: #1976d2;
}

.communication-source-webapp {
  background: var(--brand-red);
  font-size: 5px;
}

.communication-item-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.communications-page .communication-item-copy strong {
  color: #24272c;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.communications-page .communication-item-copy em {
  color: #737b87;
  display: block;
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.communication-item-copy small {
  align-items: center;
  display: flex;
  gap: 6px;
  min-width: 0;
}

.communication-item-copy small span {
  color: #8a919c;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.communication-item-copy small b {
  background: #ffe4e6;
  border-radius: 999px;
  color: var(--brand-red);
  font-size: 9px;
  font-weight: 900;
  padding: 2px 6px;
}

.communications-page .communication-item-time {
  color: #7d8490;
  font-size: 10px;
  font-weight: 800;
  grid-column: 3;
  grid-row: 1;
  padding-top: 1px;
}

.communications-page .communication-thread {
  display: grid;
  grid-template-rows: 84px minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 0;
}

.communications-page .communication-thread-head {
  align-items: center;
  border-bottom: 1px solid #e2e6ec;
  display: grid;
  gap: 10px;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  min-height: 84px;
  padding: 13px 16px;
}

.communication-thread-person {
  min-width: 0;
}

.communication-thread-person h2 {
  color: #202328;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
  margin: 0 0 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.communication-thread-person p {
  color: #747b87;
  font-size: 11px;
  font-weight: 700;
  margin: 0;
}

.communication-thread-person p span {
  color: #3089e8;
}

.communication-thread-action,
.client-card-edit {
  background: transparent;
  border: 0;
  color: #687080;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  padding: 6px;
}

.communication-thread-action:hover,
.communication-thread-action:focus-visible,
.client-card-edit:hover,
.client-card-edit:focus-visible {
  color: var(--brand-red);
  outline: 0;
}

.communications-page .message-thread {
  align-content: start;
  display: grid;
  gap: 10px;
  margin: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px;
}

.communications-page .message-bubble {
  border: 0;
  border-radius: 14px;
  box-shadow: none;
  max-width: min(82%, 520px);
  padding: 10px 13px;
}

.communications-page .message-bubble.incoming {
  background: #f0f2f5;
}

.communications-page .message-bubble.outgoing {
  background: #ef6b70;
  color: #fff;
}

.communications-page .message-bubble span {
  color: #858c97;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.communications-page .message-bubble p {
  color: #292c31;
  font-size: 13px;
  line-height: 1.35;
}

.communications-page .communication-media {
  display: grid;
  gap: 6px;
  margin: 7px 0 2px;
  max-width: 100%;
  overflow: hidden;
}

.communications-page .communication-media-image {
  background: rgb(255 255 255 / 48%);
  border-radius: 10px;
  cursor: zoom-in;
  min-height: 96px;
  text-decoration: none;
}

.communications-page .communication-media img,
.communications-page .communication-media video {
  border-radius: 10px;
  display: block;
  max-height: 380px;
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.communications-page .communication-media audio {
  display: block;
  max-width: 100%;
  width: 320px;
}

.communications-page .communication-media img:not([src]),
.communications-page .communication-media video:not([src]),
.communications-page .communication-media audio:not([src]) {
  display: none;
}

.communications-page .communication-media-status {
  color: #7f8792;
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
  padding: 10px 11px;
}

.communications-page .communication-media[data-media-state="ready"] .communication-media-status {
  display: none;
}

.communications-page .communication-media-file a {
  color: #2988c0;
  font-size: 12px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.communications-page .message-bubble.outgoing .communication-media-file a,
.communications-page .message-bubble.outgoing .communication-media-status {
  color: #fff;
}

.communications-page .message-bubble blockquote {
  background: rgb(255 255 255 / 52%);
  border-left: 3px solid currentColor;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1.35;
  margin: 5px 0 7px;
  opacity: 0.72;
  overflow: hidden;
  padding: 5px 7px;
  text-overflow: ellipsis;
}

.communications-page .message-bubble.deleted p {
  font-style: italic;
  opacity: 0.62;
}

.communications-page .message-bubble.outgoing span,
.communications-page .message-bubble.outgoing p {
  color: #fff;
}

.communications-page .message-bubble.system {
  background: #f7f8fa;
  border: 1px solid #e3e7ec;
  border-radius: 8px;
  color: #656d79;
  max-width: min(88%, 520px);
  padding: 8px 11px;
}

.communications-page .communication-compose {
  align-items: end;
  background: #fff;
  border-top: 1px solid #e2e6ec;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 38px;
  margin: 0;
  padding: 12px 16px;
  position: static;
}

.communication-compose textarea {
  field-sizing: content;
  background: #f3f5f7;
  border: 1px solid transparent;
  border-radius: 18px;
  color: #26292e;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  max-height: 120px;
  min-height: 38px;
  outline: 0;
  overflow-y: auto;
  padding: 9px 13px;
  resize: none;
  width: 100%;
}

.communication-compose textarea:focus {
  background: #fff;
  border-color: #cfd5de;
}

.communications-page .communication-compose button {
  align-items: center;
  background: var(--brand-red);
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 38px;
}

.communications-page .communication-compose button:hover,
.communications-page .communication-compose button:focus-visible {
  background: #af1c22;
  outline: 0;
}

.communications-page .communication-compose button svg {
  height: 17px;
  width: 17px;
}

.communication-empty-thread {
  align-content: center;
  color: #747b87;
  justify-items: center;
  text-align: center;
}

.communication-empty-thread h2 {
  color: #2b2e33;
  font-size: 18px;
  margin: 0 0 6px;
}

.communication-empty-thread p {
  font-size: 13px;
  margin: 0;
}

.communications-page .communication-contact {
  display: grid;
  grid-template-rows: 84px minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
}

.communication-client-title {
  align-items: center;
  border-bottom: 1px solid #e2e6ec;
  color: #202328;
  display: flex;
  font-size: 15px;
  font-weight: 900;
  min-height: 84px;
  padding: 0 16px;
}

.communication-client-body {
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.communications-page .client-card-head {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  margin: 0 0 14px;
}

.communications-page .client-avatar {
  border-radius: 50%;
  font-size: 14px;
  height: 44px;
  width: 44px;
}

.communications-page .client-card-head h2 {
  font-size: 16px;
  line-height: 1.15;
  margin: 0 0 6px;
}

.communications-page .client-tags {
  gap: 4px;
}

.communications-page .client-tags span {
  background: #e9faef;
  border-radius: 999px;
  color: #1b9a52;
  font-size: 9px;
  padding: 4px 7px;
}

.communications-page .client-info-list {
  border-top: 1px solid #eceff3;
}

.communications-page .client-info-list div {
  border-bottom: 0;
  gap: 8px;
  padding: 6px 0;
}

.communications-page .client-info-list dt,
.communications-page .client-info-list dd {
  font-size: 11px;
}

.communications-page .client-info-list dt {
  color: #7a818c;
}

.communications-page .client-info-list dd {
  color: #272a2f;
  max-width: 62%;
}

.communications-page .client-actions,
.communications-page .client-history {
  border-top: 1px solid #e6e9ee;
  margin-top: 14px;
  padding-top: 14px;
}

.communications-page .client-actions h3,
.communications-page .client-history h3 {
  font-size: 13px;
  margin-bottom: 10px;
}

.communications-page .client-actions > div {
  gap: 6px;
}

.communications-page .client-actions .btn {
  background: #fff;
  border: 1px solid #dfe3e9;
  border-radius: 7px;
  color: #34383e;
  font-size: 10px;
  min-height: 34px;
  padding: 6px;
}

.communications-page .client-history article {
  padding: 8px 0;
}

.communications-page .client-history strong,
.communications-page .client-history span,
.communications-page .client-history em {
  font-size: 10px;
}

.communications-page .client-profile-editor {
  border: 0;
  border-top: 1px solid #e6e9ee;
  border-radius: 0;
  box-shadow: none;
  margin: 14px 0 0;
  padding: 14px 0 0;
}

@media (max-width: 1180px) {
  .communications-page .communications-workbench {
    grid-template-columns: 150px 240px minmax(320px, 1fr);
  }

  .communications-page .communication-contact {
    display: none;
  }
}

@media (max-width: 760px) {
  .communications-page {
    height: auto;
    margin: 0;
    min-height: 0;
    overflow: visible;
  }

  .communications-page .communications-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    height: auto;
    overflow: visible;
  }

  .communication-channel-nav {
    border-bottom: 1px solid #e2e6ec;
    border-right: 0;
    grid-template-rows: auto auto;
    height: auto;
  }

  .communication-channel-nav > header {
    min-height: 60px;
  }

  .communication-channel-nav nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 10px 10px;
  }

  .communication-channel-nav button {
    flex: 0 0 auto;
    grid-template-columns: 18px auto auto;
  }

  .communications-page .communication-inbox {
    border-bottom: 1px solid #e2e6ec;
    border-right: 0;
    height: 330px;
  }

  .communications-page .communication-thread {
    border-bottom: 1px solid #e2e6ec;
    border-right: 0;
    height: max(520px, calc(100dvh - 180px));
  }

  .communications-page .communication-contact {
    display: grid;
    height: auto;
    min-height: 520px;
  }

  .communication-client-body {
    overflow: visible;
  }
}

/* Unified operations, finance and shifts */
.work-page-head {
  align-items: end;
  border-bottom: 1px solid #dde2e8;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 14px;
  min-height: 82px;
  padding: 4px 2px 14px;
}

.work-page-head h1 {
  color: #202226;
  font-size: 34px;
  line-height: 1;
  margin: 3px 0 5px;
}

.work-page-head > div > p:last-child {
  color: #707784;
  font-size: 13px;
  margin: 0;
  max-width: 760px;
}

.work-page-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.work-page-actions .btn svg,
.operations-list-toolbar .btn svg,
.finance-expense-form .btn svg {
  height: 16px;
  width: 16px;
}

.operations-list-shell {
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 7px;
  min-width: 0;
  overflow: hidden;
}

.task-suggestions {
  background: #fffaf1;
  border: 1px solid #eadfca;
  border-radius: 7px;
  margin-bottom: 10px;
  overflow: hidden;
}

.task-suggestions > header,
.task-suggestions > div {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 48px;
  padding: 9px 12px;
}

.task-suggestions > header {
  border-bottom: 1px solid #eee3cf;
}

.task-suggestions > header strong,
.task-suggestions > header span {
  font-size: 11px;
}

.task-suggestions > header span,
.task-suggestions small {
  color: #777d86;
}

.task-suggestions > div + div {
  border-top: 1px solid #f0e6d3;
}

.task-suggestions > div > span {
  display: grid;
  gap: 3px;
}

.task-suggestions b {
  color: #2b2e32;
  font-size: 12px;
}

.task-suggestions small {
  font-size: 10px;
}

.operations-list-toolbar {
  align-items: center;
  border-bottom: 1px solid #e4e8ed;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 58px;
  padding: 9px 12px;
}

.segmented-tabs {
  align-items: center;
  display: flex;
  gap: 3px;
  min-width: 0;
}

.segmented-tabs button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: #676f7c;
  display: inline-flex;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  min-height: 34px;
  padding: 7px 11px;
}

.segmented-tabs button:hover {
  background: #f1f3f6;
  color: #26292e;
}

.segmented-tabs button.active {
  background: #f8e9ea;
  color: #c91f28;
}

.segmented-tabs b {
  background: #e9edf2;
  border-radius: 999px;
  color: #626b78;
  font-size: 10px;
  min-width: 19px;
  padding: 3px 5px;
  text-align: center;
}

.segmented-tabs button.active b {
  background: #ce2029;
  color: #fff;
}

.operations-list-head {
  background: #f5f6f8;
  border-bottom: 1px solid #dfe4ea;
  color: #727a87;
  display: grid;
  font-size: 10px;
  font-weight: 900;
  gap: 12px;
  grid-template-columns: minmax(260px, 2fr) 120px minmax(140px, 1fr) 128px;
  letter-spacing: 0;
  padding: 10px 14px;
  text-transform: uppercase;
}

.task-list {
  display: block;
}

.task-row {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e7eaee;
  border-radius: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 2fr) 120px minmax(140px, 1fr) 128px;
  min-height: 66px;
  padding: 10px 14px;
}

.task-row:last-child {
  border-bottom: 0;
}

.task-row.priority-high {
  box-shadow: inset 3px 0 #ce2029;
}

.task-row h3 {
  font-size: 13px;
  margin: 1px 0 3px;
}

.task-row p:not(.kicker),
.task-row > strong {
  color: #727986;
  font-size: 11px;
  margin: 0;
}

.task-row .kicker {
  font-size: 8px;
  margin: 0;
}

.task-row-actions {
  justify-self: end;
}

.requests-workbench {
  display: block;
}

.requests-workbench.has-selection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
}

.requests-workbench > .request-table {
  border: 0;
  border-radius: 0;
  min-width: 0;
}

.requests-workbench .overview-inspector {
  border: 0;
  border-left: 1px solid #dfe4ea;
  border-radius: 0;
  box-shadow: none;
  max-height: calc(100dvh - 190px);
  min-height: 560px;
}

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

.finance-period-select {
  font-size: 12px;
  height: 36px;
  min-width: 150px;
  padding: 6px 30px 6px 10px;
}

.finance-expense-form {
  align-items: end;
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 7px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) minmax(150px, .8fr) 140px auto;
  margin-bottom: 10px;
  padding: 12px;
}

.finance-expense-form h2 {
  font-size: 17px;
  margin: 2px 0 0;
}

.finance-expense-form label {
  display: grid;
  gap: 5px;
}

.finance-expense-form label > span {
  color: #717885;
  font-size: 10px;
  font-weight: 800;
}

.finance-expense-form .input,
.finance-expense-form .select {
  font-size: 13px;
  min-height: 38px;
}

.finance-expense-form .actions {
  display: flex;
  gap: 6px;
  margin: 0;
}

.finance-metrics {
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 7px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
  overflow: hidden;
}

.finance-metrics article {
  display: grid;
  gap: 5px;
  min-height: 106px;
  padding: 16px 18px;
}

.finance-metrics article + article {
  border-left: 1px solid #e1e5ea;
}

.finance-metrics span,
.finance-metrics small {
  color: #747c88;
  font-size: 11px;
}

.finance-metrics strong {
  color: #24272b;
  font-size: 26px;
  line-height: 1;
}

.finance-metrics .positive strong {
  color: #188a56;
}

.finance-metrics .negative strong {
  color: #c82029;
}

.finance-workbench {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(360px, .9fr) minmax(440px, 1.1fr);
}

.finance-trend,
.finance-ledger {
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 7px;
  min-width: 0;
  overflow: hidden;
}

.finance-trend > header,
.finance-ledger > header {
  align-items: center;
  border-bottom: 1px solid #e4e8ed;
  display: flex;
  justify-content: space-between;
  min-height: 62px;
  padding: 11px 14px;
}

.finance-trend h2,
.finance-ledger h2 {
  font-size: 16px;
  margin: 2px 0 0;
}

.finance-ledger > header > span {
  color: #757d89;
  font-size: 12px;
  font-weight: 800;
}

.finance-legend {
  display: flex;
  gap: 12px;
}

.finance-legend span {
  color: #707885;
  font-size: 10px;
}

.finance-legend span::before {
  background: #b9c0ca;
  border-radius: 2px;
  content: "";
  display: inline-block;
  height: 8px;
  margin-right: 5px;
  width: 8px;
}

.finance-legend .income::before {
  background: #2c9a70;
}

.finance-legend .expense::before {
  background: #d56a70;
}

.finance-chart {
  align-items: end;
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  height: 250px;
  padding: 22px 16px 12px;
}

.finance-chart-month {
  align-items: center;
  display: grid;
  gap: 8px;
  height: 100%;
  grid-template-rows: minmax(0, 1fr) auto;
  text-align: center;
}

.finance-chart-bars {
  align-items: end;
  border-bottom: 1px solid #dfe4ea;
  display: flex;
  gap: 4px;
  height: 100%;
  justify-content: center;
}

.finance-chart-bars i {
  background: #2c9a70;
  border-radius: 3px 3px 0 0;
  display: block;
  height: max(2px, var(--value));
  max-width: 20px;
  width: 34%;
}

.finance-chart-bars i.expense {
  background: #d56a70;
}

.finance-chart-month > span {
  color: #777e89;
  font-size: 10px;
  text-transform: uppercase;
}

.finance-transactions article {
  align-items: center;
  border-bottom: 1px solid #e8ebef;
  display: grid;
  gap: 10px;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  min-height: 59px;
  padding: 9px 13px;
}

.finance-transactions article:last-child {
  border-bottom: 0;
}

.finance-transaction-icon {
  align-items: center;
  background: #e8f5ef;
  border-radius: 50%;
  color: #21865f;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.finance-transaction-icon.expense {
  background: #faecec;
  color: #bd3138;
}

.finance-transaction-icon svg {
  height: 14px;
  width: 14px;
}

.finance-transactions article > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.finance-transactions strong {
  color: #2b2e33;
  font-size: 12px;
}

.finance-transactions small {
  color: #777e89;
  font-size: 10px;
}

.finance-transactions b {
  color: #21865f;
  font-size: 12px;
}

.finance-transactions b.expense {
  color: #bd3138;
}

.work-schedule-workbench {
  grid-template-columns: minmax(0, 1fr);
}

.work-schedule-workbench.has-inspector {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 310px);
}

.work-schedule-panel {
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 7px;
  overflow: hidden;
  padding: 0;
}

.work-schedule-panel-head {
  border-bottom: 1px solid #e3e7ec;
  min-height: 68px;
  padding: 10px 12px;
}

.work-schedule-panel-head .section-title {
  font-size: 18px;
}

.work-schedule-toolbar .icon-btn,
.work-inspector-title-row .icon-btn {
  align-items: center;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.work-schedule-toolbar .icon-btn svg {
  height: 16px;
  width: 16px;
}

.work-inspector-title-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.work-inspector-title-row .icon-btn {
  font-size: 19px;
}

@media (max-width: 1080px) {
  .finance-expense-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-expense-form > div:first-child,
  .finance-expense-form .actions {
    grid-column: 1 / -1;
  }

  .finance-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .requests-workbench.has-selection {
    grid-template-columns: minmax(0, 1fr);
  }

  .requests-workbench .overview-inspector {
    border-left: 0;
    border-top: 1px solid #dfe4ea;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .work-page-head {
    align-items: flex-start;
    display: grid;
    min-height: 0;
    padding: 0 0 12px;
  }

  .work-page-head h1 {
    font-size: 27px;
  }

  .work-page-actions,
  .work-page-actions .btn {
    width: 100%;
  }

  .operations-list-toolbar,
  .finance-toolbar {
    align-items: stretch;
    display: grid;
  }

  .segmented-tabs {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .segmented-tabs button {
    flex: 0 0 auto;
  }

  .operations-list-head {
    display: none;
  }

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

  .task-row > strong {
    grid-column: 1;
  }

  .task-row-actions {
    grid-column: 2;
    grid-row: 2 / span 2;
  }

  .request-segments {
    margin-right: -2px;
  }

  .finance-period-select {
    width: 100%;
  }

  .finance-expense-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .finance-expense-form > div:first-child,
  .finance-expense-form .actions {
    grid-column: auto;
  }

  .finance-expense-form .actions,
  .finance-expense-form .actions .btn {
    width: 100%;
  }

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

  .finance-metrics article {
    min-height: 88px;
  }

  .finance-metrics article + article {
    border-left: 0;
    border-top: 1px solid #e1e5ea;
  }

  .finance-chart {
    height: 220px;
  }

  .work-schedule-workbench.has-inspector {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Finance, tasks and guided product tour */
.settings-page-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.settings-page-actions .btn svg {
  height: 16px;
  width: 16px;
}

.task-list::before {
  content: none !important;
  display: none !important;
}

.task-proposals {
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 7px;
  margin-bottom: 10px;
  overflow: hidden;
}

.task-proposals > header {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 9px 12px;
}

.task-proposals-icon {
  align-items: center;
  background: #f1f3f6;
  border-radius: 6px;
  color: #555d69;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.task-proposals-icon svg,
.task-proposals .btn svg {
  height: 15px;
  width: 15px;
}

.task-proposals > header > span:nth-child(2),
.task-proposals-list article > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.task-proposals > header strong {
  color: #282b30;
  font-size: 13px;
}

.task-proposals > header small,
.task-proposals-list small,
.task-proposals-list em {
  color: #747b87;
  font-size: 10px;
  font-style: normal;
}

.task-proposals > header .btn svg {
  margin-left: 3px;
  transition: transform 160ms ease;
}

.task-proposals.expanded > header .btn svg {
  transform: rotate(180deg);
}

.task-proposals-list {
  border-top: 1px solid #e5e8ed;
}

.task-proposals.expanded .task-proposals-list {
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.task-proposals-list article {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 62px;
  padding: 9px 12px;
}

.task-proposals-list article + article {
  border-top: 1px solid #eceff2;
}

.task-proposals-list b {
  color: #292c31;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-period-tabs,
.finance-chart-switch {
  align-items: center;
  background: #eef1f4;
  border: 1px solid #dce1e7;
  border-radius: 7px;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
}

.finance-period-tabs button,
.finance-chart-switch button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: #676f7b;
  display: inline-flex;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  gap: 5px;
  justify-content: center;
  min-height: 29px;
  padding: 5px 10px;
}

.finance-period-tabs button:hover,
.finance-chart-switch button:hover {
  color: #25282d;
}

.finance-period-tabs button.active,
.finance-chart-switch button.active {
  background: #fff;
  box-shadow: 0 1px 2px rgba(22, 28, 36, 0.1);
  color: #c82029;
}

.finance-workbench {
  grid-template-columns: minmax(0, 1fr);
}

.finance-chart-tools {
  align-items: center;
  display: flex;
  gap: 14px;
}

.finance-chart-switch button {
  min-width: 74px;
}

.finance-chart-switch svg {
  height: 14px;
  width: 14px;
}

.finance-chart-stage {
  height: 310px;
  min-height: 0;
  padding: 12px 16px 4px;
}

.finance-chart-stage svg {
  display: block;
  height: 100%;
  overflow: visible;
  width: 100%;
}

.finance-chart-grid-line line {
  stroke: #e4e8ed;
  stroke-width: 1;
}

.finance-chart-grid-line text,
.finance-chart-month-label {
  fill: #747c88;
  font-family: inherit;
  font-size: 11px;
  font-weight: 650;
}

.finance-chart-area {
  fill: rgba(44, 154, 112, 0.1);
}

.finance-chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.finance-chart-line.income {
  stroke: #2c9a70;
}

.finance-chart-line.expense {
  stroke: #d56a70;
}

.finance-chart-point {
  fill: #fff;
  stroke-width: 3;
}

.finance-chart-point.income {
  stroke: #2c9a70;
}

.finance-chart-point.expense {
  stroke: #d56a70;
}

.finance-chart-bar.income {
  fill: #2c9a70;
}

.finance-chart-bar.expense {
  fill: #d56a70;
}

.admin-tutorial-layer {
  inset: 0;
  position: fixed;
  z-index: 400;
}

.admin-tutorial-blocker {
  background: transparent;
  border: 0;
  inset: 0;
  padding: 0;
  position: fixed;
  width: 100%;
}

.admin-tutorial-spotlight {
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  box-shadow: 0 0 0 100vmax rgba(20, 24, 30, 0.68), 0 8px 28px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  position: fixed;
  transition: left 180ms ease, top 180ms ease, width 180ms ease, height 180ms ease;
  z-index: 401;
}

.admin-tutorial-popover {
  background: #fff;
  border: 1px solid #dce1e7;
  border-radius: 8px;
  box-shadow: 0 14px 42px rgba(15, 20, 28, 0.2);
  color: #292c31;
  max-width: calc(100vw - 24px);
  padding: 14px;
  position: fixed;
  width: 340px;
  z-index: 402;
}

.admin-tutorial-popover > header,
.admin-tutorial-popover > footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.admin-tutorial-popover > header span {
  color: #737b87;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.admin-tutorial-popover > header button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #656d78;
  display: inline-flex;
  font-size: 22px;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.admin-tutorial-progress {
  background: #edf0f3;
  border-radius: 2px;
  height: 3px;
  margin: 9px 0 14px;
  overflow: hidden;
}

.admin-tutorial-progress i {
  background: #c82029;
  display: block;
  height: 100%;
  width: var(--tutorial-progress);
}

.admin-tutorial-popover h2 {
  font-size: 20px;
  line-height: 1.15;
  margin: 0 0 8px;
}

.admin-tutorial-popover p {
  color: #686f7a;
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 16px;
}

.admin-tutorial-popover > footer {
  gap: 8px;
  justify-content: flex-end;
}

.admin-tutorial-popover > footer .btn:first-child {
  margin-right: auto;
}

@media (max-width: 760px) {
  .settings-page-head {
    align-items: stretch;
  }

  .settings-page-actions,
  .settings-page-actions .btn {
    width: 100%;
  }

  .settings-page-actions .btn {
    flex: 1 1 0;
  }

  .task-proposals > header {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .task-proposals > header .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .task-proposals-list article {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .task-proposals-list article .btn {
    width: 100%;
  }

  .finance-period-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .finance-period-tabs button {
    min-width: 0;
    padding-inline: 5px;
  }

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

  .finance-metrics article {
    min-height: 78px;
    padding: 12px;
  }

  .finance-metrics article + article {
    border-left: 1px solid #e1e5ea;
    border-top: 0;
  }

  .finance-metrics article:nth-child(3) {
    border-left: 0;
    border-top: 1px solid #e1e5ea;
    grid-column: 1 / -1;
  }

  .finance-metrics strong {
    font-size: 21px;
  }

  .finance-trend > header {
    align-items: stretch;
    display: grid;
    gap: 10px;
  }

  .finance-chart-tools {
    align-items: center;
    justify-content: space-between;
  }

  .finance-chart-switch span {
    display: none;
  }

  .finance-chart-switch button {
    min-width: 34px;
    padding-inline: 8px;
  }

  .finance-chart-stage {
    height: 225px;
    overflow-x: auto;
    padding: 8px 8px 2px;
  }

  .finance-chart-stage svg {
    min-width: 620px;
  }

  .admin-tutorial-popover {
    bottom: calc(10px + var(--tg-content-safe-area-inset-bottom, 0px));
    left: 10px !important;
    max-width: none;
    top: auto !important;
    width: calc(100vw - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-tutorial-spotlight {
    transition: none;
  }
}

/* Compact operational queues and schedule matrix */
.requests-workbench,
.requests-workbench.has-selection,
.work-schedule-workbench,
.work-schedule-workbench.has-inspector {
  display: block;
  grid-template-columns: none;
}

.request-table {
  overflow: hidden;
}

.request-table .request-table-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 32px minmax(190px, 0.9fr) minmax(150px, 0.72fr) minmax(220px, 1.35fr) 116px 24px;
  min-height: 64px;
  padding: 9px 14px;
}

.request-table .erp-table-head.request-table-row {
  min-height: 36px;
  padding-block: 7px;
}

.request-table-row:not(.erp-table-head) {
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e6e9ed;
  border-radius: 0;
  color: #292c31;
  text-align: left;
  transition: background-color 140ms ease;
}

.request-table-row:not(.erp-table-head):hover,
.request-table-row:not(.erp-table-head):focus-visible,
.request-table-row.selected {
  background: #f7f8fa;
  box-shadow: none;
  outline: 0;
}

.request-row-icon {
  align-items: center;
  background: #f0f2f5;
  border-radius: 6px;
  color: #636b77;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.request-row-icon svg,
.request-row-open svg {
  height: 16px;
  width: 16px;
}

.request-row-primary,
.request-row-person {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.request-row-primary b,
.request-row-person b {
  color: #292c31;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-row-primary small,
.request-row-person small {
  color: #7a818c;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-row-message {
  color: #606874;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-row-status {
  align-items: center;
  color: #656d78;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  gap: 7px;
  white-space: nowrap;
}

.request-row-status i {
  background: #9aa2ad;
  border-radius: 50%;
  display: block;
  height: 7px;
  width: 7px;
}

.request-row-status.status-new {
  color: #bd222a;
}

.request-row-status.status-new i {
  background: #ce2029;
}

.request-row-status.status-in_progress {
  color: #9b6508;
}

.request-row-status.status-in_progress i {
  background: #d69a2d;
}

.request-row-status.status-waiting_user {
  color: #527146;
}

.request-row-status.status-waiting_user i {
  background: #789669;
}

.request-row-open {
  color: #9198a3;
  display: inline-flex;
  justify-self: end;
}

.request-detail-scrim,
.work-detail-scrim {
  background: rgba(26, 31, 38, 0.16);
  border: 0;
  inset: 0;
  padding: 0;
  position: fixed;
  width: 100%;
  z-index: 70;
}

.request-detail-drawer,
.work-schedule-inspector {
  animation: admin-detail-drawer-in 220ms cubic-bezier(0.2, 0.75, 0.2, 1);
  background: #fff;
  border: 1px solid #dce1e7;
  border-radius: 8px;
  bottom: 12px;
  box-shadow: 0 18px 52px rgba(18, 23, 30, 0.2);
  max-height: none;
  overflow: auto;
  position: fixed;
  right: 12px;
  top: 12px;
  width: min(390px, calc(100vw - 24px));
  z-index: 71;
}

.request-detail-drawer > .overview-inspector,
.requests-workbench .request-detail-drawer > .overview-inspector {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-height: none;
  min-height: 100%;
  width: 100%;
}

.request-detail-drawer .inspector-head {
  padding-right: 48px;
}

.request-inspector-close {
  align-items: center;
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 12px;
  color: #25282d;
  cursor: pointer;
  display: inline-flex;
  font-size: 25px;
  font-weight: 500;
  height: 42px;
  justify-content: center;
  position: absolute;
  right: 12px;
  top: 12px;
  width: 42px;
  z-index: 4;
}

@keyframes admin-detail-drawer-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.work-schedule-panel {
  border-radius: 6px;
}

.work-schedule-panel-head {
  align-items: center;
  background: #fff;
  display: flex;
  min-height: 58px;
  padding: 8px 12px;
}

.work-schedule-panel-head .kicker {
  display: none;
}

.work-schedule-panel-head .section-title {
  font-size: 16px;
  line-height: 1.15;
}

.work-schedule-panel-head .meta {
  font-size: 10px;
  margin-top: 3px;
}

.work-schedule-toolbar {
  align-items: center;
  display: flex;
  gap: 5px;
}

.work-coverage-section {
  align-items: stretch;
  background: #f7f8fa;
  border: 0;
  border-bottom: 1px solid #dfe4ea;
  border-radius: 0;
  display: grid;
  gap: 0;
  grid-template-columns: 170px minmax(0, 1fr);
  padding: 0;
}

.work-coverage-head {
  align-items: center;
  border-right: 1px solid #dfe4ea;
  display: flex;
  min-width: 0;
  padding: 8px 12px;
}

.work-coverage-now {
  display: grid;
  gap: 2px;
}

.work-coverage-now .kicker,
.work-coverage-mode {
  display: none;
}

.work-coverage-now strong {
  font-size: 16px;
  line-height: 1.12;
}

.work-coverage-now span {
  font-size: 11px;
  line-height: 1.25;
}

.work-coverage-scroll {
  padding: 6px;
}

.work-coverage-grid {
  gap: 3px;
}

button.work-coverage-card {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  min-height: 42px;
  padding: 5px 7px;
  text-align: left;
}

button.work-coverage-card:hover,
button.work-coverage-card:focus-visible,
button.work-coverage-card.active {
  background: #fff;
  border-color: #d9dee5;
  outline: 0;
}

button.work-coverage-card.thin {
  background: rgba(255, 248, 248, 0.72);
  border-color: transparent;
}

button.work-coverage-card.thin.active {
  border-color: rgba(201, 31, 38, 0.18);
}

.work-coverage-card strong,
.work-coverage-card b {
  font-size: 14px;
  line-height: 1.1;
}

.work-coverage-card span,
.work-coverage-card small {
  font-size: 10px;
  line-height: 1.2;
}

.work-schedule-scroll {
  max-height: calc(100dvh - 252px);
}

.work-schedule-head {
  position: sticky;
  top: 0;
  z-index: 5;
}

.work-schedule-head,
.work-schedule-row {
  grid-template-columns: 150px repeat(var(--schedule-day-count, 7), minmax(100px, 1fr));
}

.work-schedule-head > span:first-child,
.work-person {
  box-shadow: 1px 0 0 #dfe4ea;
  left: 0;
  position: sticky;
}

.work-schedule-head > span:first-child {
  background: #f2f4f7;
  z-index: 7;
}

.work-person {
  background: #fbfcfd;
  z-index: 4;
}

.work-schedule-head > span,
.work-person,
.work-shift-cell {
  min-height: 48px;
}

.work-person strong {
  font-size: 13px;
}

.work-shift-input {
  font-size: 12px;
}

.work-shift-cell.off .work-shift-input::placeholder {
  color: #9aa2ad;
  opacity: 1;
}

.work-shift-cell.active {
  background: #fff;
}

.work-shift-cell.selected {
  background: #fff8f8;
  box-shadow: inset 0 0 0 1px rgba(201, 31, 38, 0.42);
}

.work-schedule-inspector {
  border-radius: 8px;
  padding: 0;
}

.work-inspector-head {
  padding: 12px 14px;
}

.work-inspector-head h2 {
  font-size: 21px;
}

.work-schedule-inspector .work-inspector-selected {
  min-height: 66px;
  padding-block: 10px;
}

.work-schedule-inspector .work-inspector-selected strong {
  font-size: 18px;
}

.work-schedule-inspector .work-inspector-selected > b {
  border-radius: 6px;
  padding: 6px 8px;
}

.work-shift-time-editor {
  align-items: end;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
}

.work-shift-time-control {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.work-shift-time-control > span {
  color: var(--admin-muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-shift-time-dropdown {
  min-width: 0;
  position: relative;
}

.work-shift-time-trigger {
  align-items: center;
  background: #f8f9fb;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  min-height: 42px;
  padding: 8px 10px;
  width: 100%;
}

.work-shift-time-trigger strong {
  font-size: 16px;
  font-weight: 880;
}

.work-shift-time-trigger svg {
  height: 15px;
  transition: transform 150ms ease;
  width: 15px;
}

.work-shift-time-dropdown.open .work-shift-time-trigger,
.work-shift-time-trigger:focus-visible {
  border-color: rgba(201, 31, 38, 0.48);
  box-shadow: 0 0 0 2px rgba(201, 31, 38, 0.09);
  outline: 0;
}

.work-shift-time-dropdown.open .work-shift-time-trigger svg {
  transform: rotate(180deg);
}

.work-shift-time-menu {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(24, 28, 37, 0.16);
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  left: 0;
  max-height: 204px;
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  scrollbar-width: thin;
  top: calc(100% + 6px);
  width: 226px;
  z-index: 90;
}

.work-shift-time-control:nth-child(3) .work-shift-time-menu {
  left: auto;
  right: 0;
}

.work-shift-time-menu button {
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 780;
  min-height: 32px;
  padding: 5px;
}

.work-shift-time-menu button:hover,
.work-shift-time-menu button:focus-visible {
  background: #f1f3f6;
  outline: 0;
}

.work-shift-time-menu button.active {
  background: var(--admin-red-soft);
  color: var(--admin-red);
}

.work-shift-time-separator {
  align-self: end;
  color: var(--admin-muted);
  font-size: 14px;
  font-weight: 850;
  line-height: 42px;
  text-align: center;
}

.work-shift-save {
  background: #f1f3f6;
  border: 1px solid #e0e4e9;
  border-radius: 7px;
  color: #9aa1ac;
  cursor: default;
  font-size: 12px;
  font-weight: 850;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.work-shift-save.ready {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
  cursor: pointer;
}

.work-shift-save.ready:hover,
.work-shift-save.ready:focus-visible {
  background: #ad1b21;
  outline: 0;
}

.work-inspector-presets {
  background: #fbfcfd;
}

.work-schedule-inspector .work-preset-grid button {
  min-height: 32px;
}

.work-schedule-inspector .work-preset-grid button.danger {
  grid-column: 1 / -1;
}

.work-schedule-inspector .work-day-team-list {
  max-height: 320px;
  overflow-y: auto;
}

.work-schedule-inspector .work-day-team-row {
  cursor: pointer;
  font: inherit;
  min-height: 40px;
  width: 100%;
}

.work-schedule-inspector .work-day-team-row b {
  color: var(--admin-muted);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 820;
}

.work-schedule-inspector .work-day-team-row.off b {
  color: #a3a9b2;
  font-weight: 740;
}

.work-schedule-inspector .work-day-team-row.selected {
  background: #fff5f5;
  color: var(--brand-red);
}

.work-schedule-inspector .work-day-team-row.selected b {
  color: var(--brand-red);
}

.communications-page .communication-client-status {
  align-items: baseline;
  color: #737b87;
  display: flex;
  flex-wrap: wrap;
  font-size: 10px;
  font-weight: 760;
  gap: 4px 8px;
  line-height: 1.2;
}

.communications-page .communication-client-status > span {
  align-items: center;
  color: #26894d;
  display: inline-flex;
  gap: 5px;
  white-space: nowrap;
}

.communications-page .communication-client-status i {
  background: #36a764;
  border-radius: 50%;
  height: 6px;
  width: 6px;
}

.communications-page .communication-client-status small {
  color: #737b87;
  font-size: inherit;
  font-weight: inherit;
}

.communications-page .communication-client-status small::before {
  color: #b3b8c0;
  content: "·";
  margin-right: 8px;
}

.admin-tutorial-spotlight {
  transition:
    left 280ms cubic-bezier(0.2, 0.75, 0.2, 1),
    top 280ms cubic-bezier(0.2, 0.75, 0.2, 1),
    width 280ms cubic-bezier(0.2, 0.75, 0.2, 1),
    height 280ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.admin-tutorial-popover {
  animation: admin-tutorial-popover-in 200ms ease-out;
}

@keyframes admin-tutorial-popover-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .request-table .erp-table-head {
    display: none;
  }

  .request-table .request-table-row {
    gap: 5px 9px;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    min-height: 82px;
    padding: 10px;
  }

  .request-row-icon {
    grid-row: 1 / span 2;
  }

  .request-row-primary {
    grid-column: 2;
  }

  .request-row-status {
    grid-column: 3;
    grid-row: 1;
  }

  .request-row-person {
    grid-column: 2 / span 2;
  }

  .request-row-message {
    grid-column: 2 / span 2;
  }

  .request-row-open {
    display: none;
  }

  .request-detail-drawer {
    border: 0;
    border-radius: 0;
    bottom: 0;
    right: 0;
    top: 0;
    width: 100vw;
  }

  .request-detail-drawer > .overview-inspector,
  .requests-workbench .request-detail-drawer > .overview-inspector {
    padding-top: max(68px, calc(58px + env(safe-area-inset-top, 0px)));
  }

  .request-detail-drawer .request-inspector-close {
    position: fixed;
    right: 12px;
    top: max(10px, env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
    z-index: 96;
  }

  html.telegram-fullscreen-chrome .request-detail-drawer > .overview-inspector,
  body.telegram-fullscreen-chrome .request-detail-drawer > .overview-inspector {
    padding-top: calc(var(--admin-fullscreen-control-top) + 58px);
  }

  html.telegram-fullscreen-chrome .request-detail-drawer .request-inspector-close,
  body.telegram-fullscreen-chrome .request-detail-drawer .request-inspector-close {
    top: var(--admin-fullscreen-control-top);
  }

  .work-schedule-panel-head {
    align-items: stretch;
    display: grid;
  }

  .work-coverage-section {
    display: none;
  }

  .work-schedule-scroll {
    max-height: none;
  }

  .work-schedule-inspector {
    border: 0;
    border-radius: 12px 12px 0 0;
    bottom: 0;
    height: min(72dvh, 620px);
    left: 0;
    right: 0;
    top: auto;
    width: 100vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .request-detail-drawer,
  .work-schedule-inspector,
  .admin-tutorial-popover {
    animation: none;
  }

  .admin-tutorial-spotlight {
    transition: none;
  }
}

/* One operational UI language: planner-scale controls, spacing and surfaces. */
.workspace > .page-head,
.work-page-head,
.client-database-head,
.broadcast-page-head {
  align-items: center;
  border-bottom: 1px solid var(--admin-border);
  gap: 14px;
  margin: 0 0 10px;
  min-height: 58px;
  padding: 6px 2px 10px;
}

.workspace > .page-head .title,
.work-page-head h1,
.client-database-head h1,
.broadcast-page-head h1 {
  color: #25282d;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  margin: 0;
}

.workspace > .page-head .lead,
.work-page-head > div > p:last-child,
.broadcast-page-head p {
  color: #747b87;
  font-size: 11px;
  line-height: 1.3;
  margin: 4px 0 0;
}

.workspace > .page-head .kicker,
.work-page-head .kicker {
  font-size: 8px;
  margin-bottom: 4px;
}

.client-database-page,
.communications-page {
  animation-duration: 160ms;
}

.client-database-head {
  margin: 0;
  padding-inline: 14px;
}

.client-database-head span {
  font-size: 10px;
  margin-top: 3px;
}

.client-database-actions {
  gap: 6px;
}

.client-database-actions .btn,
.client-database-filter-row > button,
.communications-page .client-actions .btn,
.sales-page-grid .btn,
.operations-list-shell .btn,
.task-proposals .btn,
.broadcast-page .btn {
  border-radius: 7px;
}

.client-database-filter-panel {
  align-items: center;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 10px 14px;
}

.client-database-search {
  background: #f6f7f9;
  border-color: transparent;
  border-radius: 7px;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-column: 1 / -1;
  min-height: 36px;
}

.client-database-search:focus-within {
  background: #fff;
  border-color: #cfd5de;
}

.client-database-search input {
  background: transparent;
  font-size: 12px;
  height: 34px;
}

.client-database-segments {
  align-items: center;
  background: #f1f3f6;
  border: 1px solid #e0e4e9;
  border-radius: 7px;
  flex-wrap: nowrap;
  gap: 2px;
  max-width: max-content;
  padding: 3px;
}

.client-database-segments button {
  border: 0;
  border-radius: 5px;
  color: #68707c;
  font-size: 11px;
  min-height: 28px;
  padding: 5px 9px;
}

.client-database-segments button.active {
  background: #fff;
  box-shadow: 0 1px 2px rgba(22, 28, 36, 0.08);
  color: var(--brand-red);
}

.client-database-filter-row {
  gap: 7px;
  grid-template-columns: auto repeat(3, minmax(110px, 1fr)) auto;
  min-width: 0;
}

.client-database-filter-row > button {
  font-size: 11px;
  min-height: 32px;
  padding-inline: 9px;
}

.client-database-table {
  padding: 10px 14px 0;
}

.client-database-table-head {
  min-height: 38px;
  padding-inline: 11px;
}

.client-database-client-row {
  min-height: 46px;
  padding: 5px 11px;
}

.client-database-client-row:nth-child(even) {
  background: #f6f7f8;
}

.client-database-client-row:hover,
.client-database-client-row:focus-visible,
.client-database-client-row.selected {
  background: #f8f1f2;
}

.client-database-footer {
  padding: 8px 11px;
}

.communications-page .communications-workbench {
  grid-template-columns:
    var(--communications-channels-width, 140px) 6px
    var(--communications-inbox-width, 250px) 6px
    minmax(300px, 1fr) 6px
    var(--communications-contact-width, 280px);
}

.communications-page .communication-channel-nav,
.communications-page .communication-inbox,
.communications-page .communication-thread {
  border-right: 0;
}

.communication-resizer {
  align-self: stretch;
  background: transparent;
  cursor: col-resize;
  min-height: 0;
  outline: 0;
  position: relative;
  touch-action: none;
  width: 6px;
  z-index: 5;
}

.communication-resizer::after {
  background: #e2e6ec;
  bottom: 0;
  content: "";
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  transition: background-color 140ms ease, width 140ms ease;
  width: 1px;
}

.communication-resizer:hover::after,
.communication-resizer:focus-visible::after,
.communication-resizer.active::after {
  background: var(--brand-red);
  width: 2px;
}

body.communication-resizing,
body.communication-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.communication-channel-nav,
.communications-page .communication-inbox,
.communications-page .communication-thread,
.communications-page .communication-contact {
  grid-template-rows: 58px minmax(0, 1fr);
}

.communications-page .communication-thread {
  grid-template-rows: 58px minmax(0, 1fr) auto;
}

.communication-channel-nav > header,
.communications-page .communication-inbox-head,
.communications-page .communication-thread-head,
.communication-client-title {
  min-height: 58px;
  padding: 9px 11px;
}

.communication-channel-nav > header {
  gap: 2px;
}

.communication-channel-nav nav {
  padding: 8px 7px;
}

.communication-channel-nav button {
  border-radius: 6px;
  font-size: 11px;
  min-height: 34px;
  padding: 6px 7px;
}

.communication-search {
  border-radius: 7px;
  min-height: 34px;
  padding-inline: 9px;
}

.communication-search input {
  font-size: 12px;
}

.communications-page .communication-inbox {
  grid-template-rows: 78px minmax(0, 1fr);
}

.communications-page .communication-inbox-head {
  align-items: stretch;
  flex-direction: column;
  gap: 5px;
  min-height: 78px;
  padding-block: 7px;
}

.communication-sync-status {
  align-items: center;
  color: #6f7782;
  display: flex;
  font-size: 10px;
  font-weight: 750;
  gap: 6px;
  line-height: 1;
  min-width: 0;
}

.communication-sync-status i {
  background: #9da4ae;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgb(157 164 174 / 14%);
  flex: 0 0 auto;
  height: 7px;
  width: 7px;
}

.communication-sync-status span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.communication-sync-status.online {
  color: #277a4c;
}

.communication-sync-status.online i {
  background: #2fa568;
  box-shadow: 0 0 0 3px rgb(47 165 104 / 14%);
}

.communication-sync-status.warning {
  color: #9b6818;
}

.communication-sync-status.warning i {
  background: #d99a2b;
  box-shadow: 0 0 0 3px rgb(217 154 43 / 14%);
}

.communication-sync-status.offline {
  color: #a33a42;
}

.communication-sync-status.offline i {
  background: #ca4b55;
  box-shadow: 0 0 0 3px rgb(202 75 85 / 14%);
}

.communications-page .communication-item {
  gap: 8px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 64px;
  padding: 9px 10px;
}

.communication-item-avatar,
.communication-thread-avatar {
  font-size: 10px;
  height: 34px;
  width: 34px;
}

.communications-page .communication-thread-head {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.communication-thread-person h2,
.communication-client-title {
  font-size: 13px;
}

.communications-page .message-thread {
  gap: 7px;
  padding: 12px 14px;
}

.communications-page .message-bubble {
  border-radius: 10px;
  max-width: min(76%, 500px);
  padding: 8px 10px;
}

.communications-page .message-bubble p {
  font-size: 12px;
  line-height: 1.32;
  margin: 3px 0 0;
}

.communications-page .message-bubble.system {
  border-radius: 7px;
  max-width: min(82%, 500px);
  padding: 7px 9px;
}

.communications-page .communication-compose {
  gap: 7px;
  grid-template-columns: minmax(0, 1fr) 36px;
  padding: 9px 12px;
}

.communication-compose textarea {
  border-radius: 8px;
  min-height: 36px;
  padding: 8px 10px;
}

.communications-page .communication-compose button {
  height: 36px;
  width: 36px;
}

.communication-client-body {
  padding: 11px;
}

.communications-page .client-card-head {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  margin-bottom: 10px;
}

.communications-page .client-avatar {
  font-size: 11px;
  height: 36px;
  width: 36px;
}

.communications-page .client-card-head h2 {
  font-size: 14px;
  margin-bottom: 4px;
}

.communications-page .client-actions,
.communications-page .client-history {
  margin-top: 10px;
  padding-top: 10px;
}

.broadcast-page {
  gap: 10px;
}

.broadcast-page-head {
  margin: 0;
  padding-inline: 2px;
}

.broadcast-page-status {
  background: transparent;
  border: 0;
  border-radius: 0;
  gap: 5px;
  padding: 0;
}

.broadcast-page-status b {
  height: 24px;
  min-width: 24px;
}

.broadcast-workspace {
  border-radius: 7px;
  grid-template-columns: 220px minmax(360px, 1fr) 236px;
}

.broadcast-audience-column,
.broadcast-editor-column,
.broadcast-recipients-column {
  padding: 10px;
}

.broadcast-column-head,
.broadcast-editor-head {
  min-height: 42px;
}

.broadcast-page .broadcast-audience-grid {
  gap: 2px;
}

.broadcast-page .broadcast-audience-chip {
  border-radius: 6px;
  min-height: 52px;
  padding: 7px;
}

.broadcast-page .broadcast-audience-chip.active {
  box-shadow: none;
}

.broadcast-editor-field .textarea {
  border-radius: 7px;
  min-height: 124px;
}

.broadcast-time-field,
.broadcast-inline-preview,
.broadcast-history-panel {
  border-radius: 7px;
}

.broadcast-inline-preview pre {
  align-self: start;
  background: #f1f3f6;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  margin: 0 10px 10px;
  max-height: 210px;
  max-width: min(82%, 520px);
  overflow: auto;
  padding: 10px 12px;
}

.broadcast-page .broadcast-message-actions {
  gap: 6px;
}

.broadcast-page .broadcast-history-item {
  padding: 8px 11px;
}

.sales-page-grid {
  gap: 10px;
}

.sales-configurator,
.sales-history-panel,
.sales-product-list,
.sales-order-list {
  border-radius: 7px;
}

.sales-configurator {
  grid-template-columns: minmax(500px, 1.15fr) minmax(360px, 0.75fr);
}

.sales-catalog-panel,
.sale-summary-panel,
.sales-history-panel {
  gap: 9px;
  padding: 10px;
}

.sale-selector-block {
  gap: 5px;
}

.sale-selector-label {
  font-size: 9px;
}

.sale-choice-grid {
  gap: 4px;
}

.sale-choice {
  border-radius: 6px;
  min-height: 34px;
  min-width: 92px;
  padding: 6px 8px;
}

.sale-choice span {
  font-size: 11px;
}

.sale-choice small {
  font-size: 9px;
}

.sale-choice.active,
.sale-client-option.selected,
.sale-product-row.active {
  background: #f8edef;
  box-shadow: none;
}

.segment-grid .sale-choice {
  flex-basis: 112px;
}

.group-grid .sale-choice,
.payment-grid .sale-choice,
.installment-grid .sale-choice,
.internal-grid .sale-choice {
  min-width: 96px;
}

.sale-product-row {
  min-height: 44px;
  padding: 7px 10px;
}

.sale-product-row strong {
  font-size: 12px;
}

.sale-product-row em,
.sale-product-row b {
  font-size: 10px;
}

.sale-summary-head {
  gap: 8px;
  padding-bottom: 9px;
}

.sale-summary-head h3 {
  font-size: 17px;
}

.sale-summary-head span,
.sale-summary-head > strong {
  font-size: 11px;
}

.sale-client,
.sale-client-results,
.sale-summary-grid,
.sale-bonus-table {
  border-radius: 6px;
}

.sale-client {
  padding: 7px 9px;
}

.sale-client-results {
  max-height: 190px;
}

.sale-client-option {
  padding: 7px 9px;
}

.sale-summary-grid div,
.sale-bonus-table div {
  padding: 7px 8px;
}

.sale-summary-grid b,
.sale-bonus-table b {
  font-size: 12px;
}

.sale-note {
  font-size: 10px;
}

.sales-order-list article {
  min-height: 44px;
  padding: 7px 9px;
}

.work-page-head {
  min-height: 58px;
}

.task-proposals,
.operations-list-shell {
  border-radius: 7px;
}

.task-proposals > header {
  min-height: 50px;
  padding: 7px 10px;
}

.task-proposals-list article {
  min-height: 52px;
  padding: 7px 10px;
}

.operations-list-toolbar {
  min-height: 50px;
  padding: 7px 10px;
}

.operations-list-head,
.task-row {
  grid-template-columns: minmax(240px, 2fr) 105px minmax(130px, 0.8fr) 116px;
}

.operations-list-head {
  padding: 8px 11px;
}

.task-row {
  min-height: 56px;
  padding: 8px 11px;
}

.task-row.priority-high {
  box-shadow: none;
}

.task-row.priority-high h3::before {
  background: var(--brand-red);
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 6px;
  margin: 0 6px 1px 0;
  width: 6px;
}

@media (max-width: 1180px) and (min-width: 761px) {
  .client-database-filter-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .client-database-search,
  .client-database-segments,
  .client-database-filter-row {
    grid-column: 1;
  }

  .communications-page .communications-workbench {
    grid-template-columns:
      var(--communications-channels-width, 132px) 6px
      var(--communications-inbox-width, 220px) 6px
      minmax(300px, 1fr);
  }

  .communication-resizer[data-communication-resizer="contact"] {
    display: none;
  }

  .sales-configurator {
    grid-template-columns: minmax(440px, 1fr) minmax(330px, 0.78fr);
  }
}

@media (max-width: 760px) {
  .workspace > .page-head,
  .work-page-head,
  .client-database-head,
  .broadcast-page-head {
    align-items: stretch;
    display: grid;
    min-height: 0;
    padding: 8px 0 10px;
  }

  .workspace > .page-head .title,
  .work-page-head h1,
  .client-database-head h1,
  .broadcast-page-head h1 {
    font-size: 22px;
  }

  .client-database-actions,
  .client-database-segments {
    overflow-x: auto;
  }

  .client-database-filter-row {
    display: flex;
    flex-wrap: wrap;
  }

  .client-database-filter-row > button {
    flex: 1 1 130px;
  }

  .communication-channel-nav,
  .communications-page .communication-inbox,
  .communications-page .communication-contact {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .communications-page .communication-thread {
    grid-template-rows: 58px minmax(0, 1fr) auto;
  }

  .communication-resizer {
    display: none;
  }

  .broadcast-workspace,
  .sales-configurator {
    grid-template-columns: minmax(0, 1fr);
  }

  .operations-list-head {
    display: none;
  }
}

/* Slot editor: one operational language for bookings, events and breaks. */
.planner-modal-backdrop {
  overflow: auto;
}

.planner-create-modal,
.planner-create-modal.planner-create-modal-lesson,
.planner-create-modal.planner-create-modal-event,
.planner-create-modal.planner-create-modal-break {
  border-radius: 10px;
  gap: 10px;
  height: min(660px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  max-width: 1240px;
  padding: 14px;
  width: min(1240px, calc(100vw - 32px));
}

.planner-create-modal.planner-create-modal-lesson {
  grid-template-rows: auto minmax(0, 1fr);
}

.planner-create-modal.planner-create-modal-event,
.planner-create-modal.planner-create-modal-break {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.planner-create-modal .planner-create-modal-head {
  align-items: center;
  gap: 18px;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 420px) 36px;
  min-height: 66px;
  padding-bottom: 12px;
}

.planner-create-modal .planner-create-modal-title {
  min-width: 0;
}

.planner-create-modal .planner-create-modal-head h2 {
  font-size: 30px;
  line-height: 1.05;
}

.planner-create-modal .planner-create-modal-head span {
  display: block;
  font-size: 13px;
  margin-top: 6px;
}

.planner-create-modal .planner-create-modal-head .planner-editor-mode-tabs {
  justify-self: end;
  width: 100%;
}

.planner-editor-mode-tabs {
  align-items: center;
  background: #f4f6f8;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 3px;
  position: relative;
  width: min(390px, 100%);
}

.planner-editor-mode-tabs::before {
  background: #fff;
  border-radius: 6px;
  bottom: 3px;
  box-shadow: 0 1px 3px rgba(22, 25, 31, 0.1);
  content: "";
  left: 3px;
  position: absolute;
  top: 3px;
  transform: translateX(0);
  transition: transform 150ms cubic-bezier(0.22, 0.8, 0.3, 1);
  width: calc((100% - 12px) / 3);
  z-index: 0;
}

.planner-editor-mode-tabs[data-active-mode="event"]::before {
  transform: translateX(calc(100% + 3px));
}

.planner-editor-mode-tabs[data-active-mode="break"]::before {
  transform: translateX(calc(200% + 6px));
}

.planner-editor-mode-tabs button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--admin-muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  min-height: 38px;
  padding: 7px 12px;
  position: relative;
  transition: color 150ms ease;
  z-index: 1;
}

.planner-editor-mode-tabs button:hover,
.planner-editor-mode-tabs button:focus-visible {
  background: #fff;
  color: var(--ink);
  outline: 0;
}

.planner-editor-mode-tabs button.active,
.planner-editor-mode-tabs button.active:disabled {
  background: transparent;
  box-shadow: none;
  color: var(--brand-red);
  cursor: default;
  opacity: 1;
}

.planner-create-modal .planner-slot-context {
  background: #f8f9fb;
  border-color: var(--admin-border);
  border-radius: 8px;
  padding: 0;
}

.planner-create-modal .planner-slot-context > div {
  border-right: 1px solid var(--admin-border);
  min-height: 46px;
  padding: 8px 11px;
}

.planner-create-modal .planner-slot-context > div:last-child {
  border-right: 0;
}

.planner-create-modal .planner-slot-context span {
  color: var(--admin-muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.planner-create-modal .planner-slot-context strong {
  font-size: 13px;
}

.planner-create-modal-body,
.planner-create-modal .planner-inspector-form,
.planner-create-modal #lessonForm {
  min-width: 0;
}

.planner-create-modal-body {
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
}

.planner-create-modal #lessonForm,
.planner-create-modal .planner-event-form,
.planner-create-modal .planner-break-form {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
}

.planner-create-modal .lesson-form-summary {
  align-items: center;
  gap: 7px;
  min-height: 34px;
}

.planner-create-modal .lesson-form-summary span,
.planner-create-modal .availability-warning-chip {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-size: 12px;
  min-height: 32px;
  padding: 7px 10px;
}

.planner-create-modal .availability-warning,
.planner-create-modal .recurring-preview {
  border-radius: 8px;
  padding: 8px 10px;
}

.lesson-editor-grid {
  align-items: stretch;
  background: #f4f6f8;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  display: grid;
  gap: 0;
  grid-template-columns: minmax(270px, 0.9fr) minmax(350px, 1.2fr) minmax(230px, 0.72fr);
  min-width: 0;
  overflow: visible;
}

.lesson-editor-column {
  align-content: start;
  border-right: 1px solid var(--admin-border);
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
}

.lesson-editor-column:last-child {
  border-right: 0;
}

.planner-create-modal .lesson-form-section,
.planner-create-modal .lesson-client-section {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: none;
  display: grid;
  gap: 10px;
  margin: 0;
  min-width: 0;
  padding: 0 10px 10px;
  position: relative;
}

.planner-editor-section {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: none;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 0 10px 10px;
  position: relative;
}

.planner-create-modal .lesson-editor-column > .lesson-form-section:last-child,
.planner-create-modal .lesson-editor-column > .lesson-client-section:last-child {
  border-bottom: 1px solid var(--admin-border);
  margin-bottom: 0;
  padding-bottom: 10px;
}

.planner-create-modal .lesson-form-section > .kicker,
.planner-create-modal .lesson-client-section > .kicker,
.planner-editor-section > .kicker {
  align-items: center;
  background: #f1f3f6;
  border: 0;
  border-bottom: 1px solid var(--admin-border);
  color: #454c59;
  display: flex;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0 -10px;
  min-height: 34px;
  padding: 8px 10px;
  text-transform: none;
}

.planner-create-modal .lesson-date-control,
.planner-create-modal .lesson-place-section .picker-grid {
  gap: 6px;
  grid-template-columns: minmax(0, 1fr);
}

.planner-create-modal .lesson-date-control {
  display: grid;
}

.planner-create-modal .lesson-time-range {
  align-items: end;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.planner-create-modal .lesson-time-control {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.planner-create-modal .lesson-time-control > span,
.planner-create-modal .lesson-time-duration > span {
  color: var(--admin-muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.planner-create-modal .lesson-time-dropdown {
  min-width: 0;
  position: relative;
}

.planner-create-modal .lesson-time-dropdown-trigger {
  align-items: center;
  background: #f8f9fb;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 10px;
  width: 100%;
}

.planner-create-modal .lesson-time-dropdown-trigger strong {
  font-size: 16px;
  font-weight: 850;
}

.planner-create-modal .lesson-time-dropdown-trigger svg {
  height: 16px;
  transition: transform 160ms ease;
  width: 16px;
}

.planner-create-modal .lesson-time-dropdown.open .lesson-time-dropdown-trigger,
.planner-create-modal .lesson-time-dropdown-trigger:focus-visible {
  border-color: rgba(201, 31, 38, 0.48);
  box-shadow: 0 0 0 2px rgba(201, 31, 38, 0.1);
  outline: 0;
}

.planner-create-modal .lesson-time-dropdown.open .lesson-time-dropdown-trigger svg {
  transform: rotate(180deg);
}

.planner-create-modal .lesson-time-dropdown-menu {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(24, 28, 37, 0.16);
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  left: 0;
  max-height: 208px;
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  scrollbar-width: thin;
  top: calc(100% + 6px);
  width: 228px;
  z-index: 80;
}

.planner-create-modal .lesson-time-control:nth-of-type(2) .lesson-time-dropdown-menu {
  left: auto;
  right: 0;
}

.planner-create-modal .lesson-time-dropdown-menu button {
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  min-height: 34px;
  padding: 6px;
}

.planner-create-modal .lesson-time-dropdown-menu button:hover,
.planner-create-modal .lesson-time-dropdown-menu button:focus-visible {
  background: #f1f3f6;
  outline: 0;
}

.planner-create-modal .lesson-time-dropdown-menu button.active {
  background: var(--admin-red-soft);
  color: var(--admin-red);
}

.planner-create-modal .lesson-time-separator {
  color: var(--admin-muted);
  font-size: 15px;
  font-weight: 800;
  padding-bottom: 12px;
}

.planner-create-modal .lesson-time-duration {
  align-items: baseline;
  display: flex;
  gap: 6px;
  grid-column: 1 / -1;
}

.planner-create-modal .lesson-time-duration strong {
  color: var(--ink);
  font-size: 11px;
}

.planner-create-modal .picker-button,
.planner-create-modal .picker-field .picker-button,
.planner-create-modal .client-picker-toggle,
.planner-create-modal .lesson-draft-statuses .lesson-visit-status,
.planner-create-modal .discipline-option,
.planner-create-modal .discipline-option.active {
  background: #f8f9fb;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  box-shadow: none;
}

.planner-create-modal .client-picker-toggle .client-picker-affordance {
  align-items: center;
  background: #eef1f4;
  border: 0;
  border-radius: 7px;
  color: var(--admin-muted);
  display: inline-flex;
  height: 32px;
  justify-content: center;
  padding: 0;
  transition: transform 160ms ease;
  width: 32px;
}

.planner-create-modal .client-picker-toggle .client-picker-affordance svg {
  height: 16px;
  width: 16px;
}

.planner-create-modal .client-picker-toggle.active .client-picker-affordance {
  background: var(--admin-red-soft);
  color: var(--admin-red);
  transform: rotate(180deg);
}

.planner-create-modal .lesson-client-section .client-picker-toggle {
  min-height: 54px;
  padding: 8px 9px 8px 11px;
}

.planner-create-modal .lesson-client-section .client-picker-toggle small {
  color: var(--admin-muted);
  font-size: 9px;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.planner-create-modal .lesson-client-section .client-picker-toggle strong {
  color: #4d5562;
  font-size: 14px;
  font-weight: 780;
}

.planner-create-modal .picker-button,
.planner-create-modal .picker-field .picker-button {
  min-height: 48px;
}

.planner-create-modal .picker-button span,
.planner-create-modal .picker-field .picker-button span,
.planner-create-modal .lesson-place-section .picker-button span {
  align-items: start;
  display: grid;
  gap: 2px;
  grid-template-columns: minmax(0, 1fr);
}

.planner-create-modal .picker-button strong,
.planner-create-modal .picker-field .picker-button strong,
.planner-create-modal .lesson-place-section .picker-button strong {
  font-size: 15px;
  line-height: 1.1;
}

.planner-create-modal .picker-button b,
.planner-create-modal .picker-field .picker-button b {
  background: transparent;
  color: var(--admin-muted);
  display: grid;
  height: 20px;
  place-items: center;
  padding: 0;
  transition: transform 160ms ease;
  width: 20px;
}

.planner-create-modal .picker-button b svg,
.planner-create-modal .picker-field .picker-button b svg {
  height: 16px;
  width: 16px;
}

.planner-create-modal .picker-button b::after,
.planner-create-modal .picker-field .picker-button b::after,
.planner-create-modal .picker-field.open .picker-button b::after {
  content: none;
}

.planner-create-modal .picker-field.open .picker-button b {
  transform: rotate(180deg);
}

.planner-create-modal .lesson-visit-create-section .lesson-draft-statuses {
  gap: 6px;
  grid-template-columns: minmax(0, 1fr);
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status,
.planner-create-modal .lesson-draft-statuses .lesson-visit-status + .lesson-visit-status {
  min-height: 58px;
  padding: 10px 58px 10px 10px;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status strong {
  font-size: 14px;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status span {
  font-size: 10px;
  line-height: 1.25;
}

.planner-create-modal .lesson-draft-statuses .lesson-visit-status::after {
  font-size: 8px;
  padding: 4px 5px;
  right: 6px;
}

.planner-create-modal .discipline-grid {
  gap: 5px;
  grid-template-columns: minmax(0, 1fr);
}

.planner-create-modal .discipline-option,
.planner-create-modal .discipline-option.active {
  min-height: 46px;
  padding: 7px 9px;
}

.planner-create-modal .discipline-option strong {
  font-size: 14px;
}

.planner-create-modal .discipline-option span {
  font-size: 10px;
}

.planner-create-modal .lesson-service-summary-section .lesson-service-selected,
.planner-create-modal .lesson-service-summary-section .lesson-service-selected.warning,
.planner-create-modal .lesson-service-summary-section .lesson-service-selected.success {
  padding: 0;
}

.planner-create-modal .lesson-service-summary-section .lesson-service-selected span strong,
.planner-create-modal .lesson-service-summary-section .lesson-service-selected.is-empty b {
  font-size: 15px;
}

.planner-create-modal .selected-client-card {
  max-height: 280px;
  overflow: auto;
}

.planner-create-modal .selected-client-details {
  grid-template-columns: minmax(0, 1fr);
}

.planner-create-modal .client-picker-panel {
  left: 6px;
  right: 6px;
}

.planner-event-editor-grid {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.planner-event-note {
  grid-column: 1 / -1;
}

.planner-custom-select-field,
.planner-custom-select {
  min-width: 0;
  position: relative;
}

.planner-custom-select {
  z-index: 1;
}

.planner-custom-select.open {
  z-index: 90;
}

.planner-custom-select-trigger {
  align-items: center;
  background: #f8f9fb;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 13px;
  justify-content: space-between;
  min-height: 40px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.planner-custom-select-trigger > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-custom-select-trigger svg {
  flex: 0 0 auto;
  height: 16px;
  transition: transform 160ms ease;
  width: 16px;
}

.planner-custom-select.open .planner-custom-select-trigger,
.planner-custom-select-trigger:focus-visible {
  border-color: rgba(201, 31, 38, 0.48);
  box-shadow: 0 0 0 2px rgba(201, 31, 38, 0.1);
  outline: 0;
}

.planner-custom-select.open .planner-custom-select-trigger svg {
  transform: rotate(180deg);
}

.planner-custom-select-menu {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(24, 28, 37, 0.16);
  display: grid;
  gap: 3px;
  left: 0;
  max-height: 220px;
  opacity: 0;
  overflow-y: auto;
  padding: 5px;
  pointer-events: none;
  position: absolute;
  right: 0;
  scrollbar-width: thin;
  top: calc(100% + 5px);
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  visibility: hidden;
  z-index: 100;
}

.planner-custom-select.open .planner-custom-select-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.planner-custom-select-menu button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  justify-content: space-between;
  min-height: 34px;
  padding: 7px 9px;
  text-align: left;
}

.planner-custom-select-menu button:hover,
.planner-custom-select-menu button:focus-visible {
  background: #f1f3f6;
  outline: 0;
}

.planner-custom-select-menu button.active {
  background: var(--admin-red-soft);
  color: var(--admin-red);
}

.planner-custom-select-menu button i {
  font-size: 12px;
  font-style: normal;
  opacity: 0;
}

.planner-custom-select-menu button.active i {
  opacity: 1;
}

.planner-custom-select-menu-time {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 220px;
}

.planner-create-modal .planner-event-note textarea {
  min-height: 78px;
}

.planner-break-form {
  margin: 0 auto;
  width: 100%;
}

.planner-break-time-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.planner-create-modal .planner-break-details-section {
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
}

.planner-create-modal .planner-break-details-section > .kicker {
  grid-column: 1 / -1;
}

.planner-break-owner-summary {
  align-content: center;
  background: #f8f9fb;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  display: grid;
  gap: 3px;
  min-height: 42px;
  padding: 8px 10px;
}

.planner-break-owner-summary strong {
  font-size: 14px;
}

.planner-create-modal .planner-break-details-section textarea {
  min-height: 42px;
}

.planner-create-modal .planner-editor-section .field {
  gap: 4px;
}

.planner-create-modal .planner-editor-section .label {
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 820;
}

.planner-create-modal .planner-editor-section .input,
.planner-create-modal .planner-editor-section .textarea,
.planner-create-modal .planner-editor-section select.input {
  background: #f8f9fb;
  border-color: var(--admin-border);
  border-radius: 7px;
  font-size: 13px;
  min-height: 40px;
  padding: 8px 10px;
}

.planner-editor-footer,
.planner-create-modal .actions.full.planner-editor-footer,
.planner-create-modal .inspector-form-actions.planner-editor-footer {
  align-items: center;
  border-top: 1px solid var(--admin-border);
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
  justify-content: flex-end;
  padding-top: 10px;
}

.planner-editor-footer .btn {
  min-height: 38px;
  min-width: 160px;
}

@media (max-width: 1040px) {
  .planner-create-modal .planner-create-modal-head {
    gap: 12px;
    grid-template-columns: minmax(220px, 1fr) minmax(300px, 360px) 36px;
  }

  .lesson-editor-grid {
    grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  }

  .lesson-editor-service {
    border-right: 0;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planner-create-modal .lesson-editor-service > .lesson-form-section {
    border-bottom: 0;
    margin: 0;
    padding: 0;
  }

  .planner-create-modal .lesson-editor-service > .lesson-form-section:first-child {
    border-right: 1px solid var(--admin-border);
    margin-right: 12px;
    padding-right: 12px;
  }

  .planner-create-modal .lesson-visit-create-section .lesson-draft-statuses {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planner-create-modal .selected-client-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .planner-modal-backdrop {
    padding: 8px;
  }

  .planner-create-modal,
  .planner-create-modal.planner-create-modal-lesson,
  .planner-create-modal.planner-create-modal-event,
  .planner-create-modal.planner-create-modal-break {
    border-radius: 10px;
    height: auto;
    max-height: calc(100dvh - 16px);
    padding: 10px;
    width: calc(100vw - 16px);
  }

  .planner-create-modal .planner-create-modal-head {
    align-items: start;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) 36px;
  }

  .planner-create-modal .planner-create-modal-title {
    grid-column: 1;
    grid-row: 1;
    padding-right: 4px;
  }

  .planner-create-modal .planner-create-modal-head .planner-editor-mode-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .planner-create-modal .planner-create-modal-head .modal-close-button {
    grid-column: 2;
    grid-row: 1;
  }

  .planner-create-modal .planner-create-modal-head h2 {
    font-size: 22px;
  }

  .planner-editor-mode-tabs {
    width: 100%;
  }

  .planner-create-modal .planner-slot-context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planner-create-modal .planner-slot-context > div:nth-child(2) {
    border-right: 0;
  }

  .planner-create-modal .planner-slot-context > div:nth-child(n + 3) {
    border-top: 1px solid var(--admin-border);
  }

  .lesson-editor-grid,
  .planner-event-editor-grid,
  .planner-break-time-grid,
  .planner-create-modal .planner-break-details-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .lesson-editor-service,
  .planner-event-note,
  .planner-create-modal .planner-break-details-section > .kicker {
    grid-column: 1;
  }

  .lesson-editor-column {
    border-bottom: 1px solid var(--admin-border);
    border-right: 0;
  }

  .lesson-editor-column:last-child {
    border-bottom: 0;
  }

  .lesson-editor-service {
    grid-template-columns: minmax(0, 1fr);
  }

  .planner-create-modal .lesson-visit-create-section .lesson-draft-statuses {
    grid-template-columns: minmax(0, 1fr);
  }

  .planner-create-modal .lesson-editor-service > .lesson-form-section:first-child {
    border-bottom: 1px solid var(--admin-border);
    border-right: 0;
    margin: 0 0 12px;
    padding: 0 0 12px;
  }

  .planner-create-modal .selected-client-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .planner-editor-footer,
  .planner-create-modal .actions.full.planner-editor-footer,
  .planner-create-modal .inspector-form-actions.planner-editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .planner-editor-footer .btn {
    width: 100%;
  }
}

/* Canonical admin type hierarchy. Keep this final so legacy screen rules cannot win by order. */
.workspace {
  --admin-type-page: 26px;
  --admin-type-section: 19px;
  --admin-type-subsection: 16px;
  --admin-type-value: 15px;
  --admin-type-label: 11px;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.workspace > .page-head .title,
.work-page-head h1,
.client-database-head h1,
.settings-page-head h1,
.broadcast-page-head h1 {
  color: #25282d;
  font-size: var(--admin-type-page);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.08;
  margin: 0;
}

.workspace > .page-head .kicker,
.work-page-head .kicker,
.settings-page-head .kicker,
.broadcast-page-head .kicker,
.finance-trend > header .kicker,
.finance-ledger > header .kicker,
.work-inspector-title-row .kicker {
  color: var(--brand-red);
  font-size: var(--admin-type-label);
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.2;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.section-title,
.work-schedule-panel-head .section-title,
.settings-group-head h2,
.settings-control-head h2,
.broadcast-column-head h2,
.broadcast-editor-head h2,
.finance-trend > header h2,
.finance-ledger > header h2,
.client-detail-panel h2,
.inspector-head h2 {
  color: #2d3138;
  font-size: var(--admin-type-section);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0;
}

.settings-group-head p,
.broadcast-column-head p,
.broadcast-editor-head p,
.work-page-head > div > p:last-child,
.settings-page-head p,
.broadcast-page-head p {
  color: var(--admin-muted);
  font-size: 11px;
  line-height: 1.35;
  margin: 3px 0 0;
}

.task-proposals > header h2,
.broadcast-inline-preview h3,
.client-actions h3,
.client-history h3,
.work-inspector-row h3,
.task-row h3,
.sale-summary-head h3 {
  color: #343941;
  font-size: var(--admin-type-subsection);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0;
}

.task-proposals > header > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.task-proposals > header h2 {
  font-size: 16px;
}

.communication-channel-nav > header h2,
.communication-thread-person h2,
.communications-page .client-card-head h2,
.communication-client-title {
  color: #2f343b;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0;
}

.communication-channel-nav > header h2 {
  font-size: 17px;
}

.communication-thread-person h2,
.communications-page .client-card-head h2,
.communication-client-title {
  font-size: 16px;
}

.broadcast-inline-preview header {
  align-items: center;
  display: flex;
  gap: 7px;
}

.broadcast-inline-preview h3 {
  font-size: 15px;
}

.work-inspector-row {
  align-items: center;
}

.work-inspector-row h3 {
  font-size: 15px;
}

.work-inspector-row > span {
  color: var(--admin-muted);
  font-size: 10px;
}

/* Booking, event and break editors share one explicit H2/H3/value hierarchy. */
.planner-create-modal .planner-create-modal-head h2 {
  color: #24272c;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

.planner-create-modal .planner-create-modal-head .planner-create-modal-title > span {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 5px;
}

.planner-create-modal .lesson-form-section > .kicker,
.planner-create-modal .lesson-client-section > .kicker,
.planner-create-modal .planner-editor-section > .kicker,
.planner-create-modal .planner-break-details-section > .kicker {
  align-items: center;
  background: #eef1f5;
  border-bottom: 1px solid var(--admin-border);
  color: #323740;
  display: flex;
  font-size: var(--admin-type-subsection);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0 -10px;
  min-height: 42px;
  padding: 10px 12px;
  text-transform: none;
}

.planner-create-modal .planner-slot-context span,
.planner-create-modal .lesson-time-control > span,
.planner-create-modal .lesson-time-duration > span,
.planner-create-modal .picker-button small,
.planner-create-modal .client-picker-toggle small,
.planner-create-modal .planner-editor-section .label,
.planner-create-modal .planner-break-owner-summary .label {
  color: #737b88;
  font-size: var(--admin-type-label);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.planner-create-modal .planner-slot-context strong,
.planner-create-modal .lesson-time-dropdown-trigger strong,
.planner-create-modal .picker-button strong,
.planner-create-modal .client-picker-toggle strong,
.planner-create-modal .planner-break-owner-summary strong,
.planner-create-modal .lesson-service-selected span strong,
.planner-create-modal .lesson-service-selected.is-empty b {
  color: #292d33;
  font-size: var(--admin-type-value);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
}

.planner-create-modal .lesson-draft-statuses .lesson-status-option strong,
.planner-create-modal .discipline-option strong,
.planner-create-modal .lesson-service-quick button strong,
.planner-create-modal .lesson-service-list button b {
  font-size: 13px;
  line-height: 1.2;
}

.planner-create-modal .lesson-draft-statuses .lesson-status-option span,
.planner-create-modal .discipline-option span,
.planner-create-modal .lesson-service-selected span small,
.planner-create-modal .lesson-service-selected em {
  font-size: 10px;
  line-height: 1.25;
}

.planner-create-modal .planner-editor-section .input,
.planner-create-modal .planner-editor-section .textarea,
.planner-create-modal .planner-editor-section select.input,
.planner-create-modal .planner-custom-select-trigger {
  font-size: 13px;
  font-weight: 650;
}

.planner-create-modal .lesson-form-section,
.planner-create-modal .lesson-client-section,
.planner-editor-section {
  gap: 12px;
}

.planner-create-modal .lesson-form-section,
.planner-create-modal .lesson-client-section,
.planner-editor-section,
.planner-create-modal .planner-slot-context {
  border-color: #d8dee7;
}

.planner-create-modal .lesson-editor-grid {
  background: #f2f4f7;
  border-color: #d8dee7;
}

.planner-create-modal .lesson-editor-column {
  gap: 12px;
}

.planner-create-modal .client-picker-toggle {
  min-height: 58px;
}

.planner-create-modal .lesson-draft-statuses {
  gap: 8px;
}

.planner-create-modal .lesson-status-option {
  min-height: 56px;
}

@media (max-width: 760px) {
  .workspace {
    --admin-type-page: 23px;
    --admin-type-section: 18px;
  }

  .planner-create-modal .planner-create-modal-head h2 {
    font-size: 24px;
  }

  .planner-create-modal .lesson-form-section > .kicker,
  .planner-create-modal .lesson-client-section > .kicker,
  .planner-create-modal .planner-editor-section > .kicker,
  .planner-create-modal .planner-break-details-section > .kicker {
    font-size: 15px;
    min-height: 40px;
  }
}

/* Keep the communication composer authoritative after the legacy compact-theme rules above. */
.communications-page .communication-compose {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  position: relative;
}

.communications-page .communication-compose > textarea {
  min-width: 0;
  width: 100%;
}

.communications-page .communication-compose .communication-compose-actions {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.communications-page .communication-compose .communication-compose-actions > button,
.communications-page .communication-compose .communication-emoji-control > button {
  flex: 0 0 36px;
  height: 36px;
  min-width: 36px;
  width: 36px;
}

.communications-page .communication-compose .communication-emoji-picker {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  height: min(500px, 70dvh);
  overflow: hidden;
  padding: 10px;
  position: absolute;
  right: 0;
  width: min(390px, calc(100vw - 28px));
}

.communications-page .communication-compose .communication-emoji-categories button,
.communications-page .communication-compose .communication-emoji-grid button {
  flex: 0 0 34px;
  height: 34px;
  min-width: 34px;
  width: 34px;
}

.communications-page .communication-compose .communication-emoji-tones button {
  flex: 0 0 25px;
  height: 25px;
  min-width: 25px;
  width: 25px;
}

@media (max-width: 760px) {
  .communications-page .communication-compose {
    gap: 7px;
    grid-template-columns: minmax(0, 1fr);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .communications-page .communication-compose > textarea,
  .communications-page .communication-compose .communication-compose-actions {
    grid-column: 1;
  }

  .communications-page .communication-compose .communication-compose-actions {
    justify-content: flex-end;
    width: 100%;
  }

  .communications-page .communication-compose .communication-send-button {
    margin-left: auto;
  }

  .communications-page .communication-compose .communication-emoji-picker,
  .communications-page .communication-compose .communication-script-suggestions {
    bottom: calc(74px + env(safe-area-inset-bottom));
    left: 12px;
    position: fixed;
    right: 12px;
    width: auto;
  }

  .communications-page .communication-compose .communication-emoji-picker {
    height: min(520px, 62dvh);
  }
}

/* CRM funnel, response SLA and conversion */
.crm-overview {
  background: #f5f7fa;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  padding: 12px 14px 2px;
}

.crm-funnel,
.crm-conversion {
  background: #fff;
  border: 1px solid #e2e6ec;
  border-radius: 12px;
  min-width: 0;
  padding: 12px;
}

.crm-funnel > header,
.crm-conversion > header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.crm-funnel > header > div,
.crm-conversion > header {
  color: #777f8b;
  font-size: 10px;
  font-weight: 800;
}

.crm-funnel > header strong,
.crm-conversion > header strong {
  color: #262a30;
  display: block;
  font-size: 15px;
  font-weight: 900;
}

.crm-funnel > header em {
  background: #fff1f2;
  border-radius: 999px;
  color: #c91f26;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  padding: 5px 8px;
}

.crm-funnel-stages {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(5, minmax(82px, 1fr));
}

.crm-stage-card {
  background: #f6f7f9;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #707783;
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 4px;
  min-height: 58px;
  padding: 8px;
  text-align: left;
}

.crm-stage-card:hover,
.crm-stage-card:focus-visible {
  border-color: rgba(201, 31, 38, 0.28);
  outline: 0;
}

.crm-stage-card span {
  font-size: 10px;
  font-weight: 800;
}

.crm-stage-card strong {
  color: #262a30;
  font-size: 20px;
  font-weight: 900;
}

.crm-stage-contacted { background: #fff8e8; }
.crm-stage-trial { background: #eef6ff; }
.crm-stage-sale { background: #edf8f1; }
.crm-stage-lost { background: #f2f3f5; }

.crm-conversion-flow {
  align-items: center;
  display: grid;
  gap: 7px;
  grid-template-columns: 1fr auto 1fr auto 1fr;
}

.crm-conversion-flow div {
  background: #f6f7f9;
  border-radius: 9px;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
}

.crm-conversion-flow b {
  color: #c91f26;
  font-size: 19px;
  font-weight: 900;
}

.crm-conversion-flow span,
.crm-conversion-flow i {
  color: #7d8490;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.crm-sla {
  border-radius: 999px;
  display: inline-flex;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 7px;
  white-space: nowrap;
}

.crm-sla.countdown { background: #fff5d9; color: #8b6300; }
.crm-sla.overdue { background: #ffe3e5; color: #c91f26; }

.client-cell-status {
  align-items: start;
  display: grid;
  gap: 4px;
}

.client-cell-status > b {
  color: #30343a;
  font-size: 10px;
}

.client-sla-card {
  align-items: center;
  background: #fff8df;
  border: 1px solid #f0d98c;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  padding: 9px 10px;
}

.client-sla-card.overdue {
  background: #fff0f1;
  border-color: #efc3c6;
}

.client-sla-card > span {
  color: #555d68;
  font-size: 11px;
  font-weight: 850;
}

.client-tags .crm-tag { background: #eef3f7; color: #53606e; }

.client-database-segments button small {
  color: inherit;
  font-size: 9px;
  margin-left: 3px;
  opacity: 0.75;
}

.communication-item-copy small .crm-sla { text-transform: none; }

@media (max-width: 760px) {
  .client-database-page {
    margin: 0;
    overflow: hidden;
    width: 100%;
  }

  .client-database-head { padding: 12px 10px 12px 58px; }

  .client-database-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    margin-left: -48px;
    margin-top: 8px;
    overflow: visible;
  }

  .client-database-actions .btn { min-width: 0; padding-inline: 8px; }

  .crm-overview {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px 8px 0;
  }

  .crm-funnel-stages {
    grid-template-columns: repeat(5, minmax(90px, 1fr));
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .crm-conversion-flow { gap: 4px; }
  .crm-conversion-flow div { padding: 7px; }
  .crm-conversion-flow b { font-size: 17px; }

  .client-database-filter-panel {
    display: grid;
    padding: 10px 8px;
  }

  .client-database-segments { max-width: 100%; width: 100%; }
  .client-database-segments button { flex: 0 0 auto; }

  .client-database-filter-row { display: block; }
  .client-database-filter-row > span,
  .client-database-filter-row > button { display: none; }

  .client-result-count {
    display: block;
    justify-self: start;
    padding: 2px 1px;
  }

  .client-database-table { overflow: visible; padding: 8px; }
  .client-database-table-head { display: none; }

  .client-database-table-body {
    display: grid;
    gap: 8px;
  }

  .client-database-client-row {
    background: #fff !important;
    border: 1px solid #e1e5eb;
    border-radius: 12px;
    box-shadow: 0 2px 7px rgba(31, 39, 51, 0.04);
    display: grid;
    gap: 10px 12px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 0;
    min-width: 0;
    padding: 12px;
    width: 100%;
  }

  .client-database-client-row.selected { border-color: rgba(201, 31, 38, 0.35); }

  .client-database-client-row > span {
    overflow: visible;
    white-space: normal;
  }

  .client-row-checkbox { display: none !important; }

  .client-cell {
    color: #4f5661;
    display: grid;
    font-size: 11px;
    gap: 3px;
    min-width: 0;
  }

  .client-cell::before {
    color: #9aa1ab;
    content: attr(data-label);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .client-cell-name,
  .client-cell-status { grid-column: 1 / -1; }
  .client-cell-name::before { display: none; }

  .client-row-name b { font-size: 15px; white-space: normal; }

  .client-row-name small,
  .client-database-client-row > span:nth-child(3) small {
    font-size: 10px;
    white-space: normal;
  }

  .client-cell-status {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
  }

  .client-cell-status::before { flex-basis: 100%; }

  .client-database-empty,
  .client-database-footer { min-width: 0; }
  .client-database-footer > div { display: none; }

  .client-detail-drawer { padding: 8px; width: 100vw; }

  .client-profile-grid { grid-template-columns: minmax(0, 1fr); }
  .client-profile-grid label.wide { grid-column: 1; }
}

/* Final 430px mobile pass: every section stays inside the Telegram viewport. */
.communication-mobile-back {
  align-items: center;
  background: #f4f5f7;
  border: 1px solid #e0e4e9;
  border-radius: 9px;
  color: #333941;
  cursor: pointer;
  display: none;
  height: 36px;
  justify-content: center;
  padding: 0;
  width: 36px;
}

.communication-mobile-back svg {
  height: 17px;
  width: 17px;
}

@media (max-width: 760px) {
  html,
  body,
  #adminApp,
  .admin-shell,
  .admin-layout,
  .workspace {
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
  }

  .crm-funnel-stages {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .crm-stage-card {
    min-width: 0;
    width: 100%;
  }

  .client-database-filter-panel,
  .client-database-filter-row,
  .client-database-search {
    min-width: 0;
    width: 100%;
  }

  .client-database-filter-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .client-database-filter-panel > *,
  .client-database-filter-row {
    grid-column: 1;
  }

  .client-database-segments {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 100%;
    overflow: visible;
    width: 100%;
  }

  .client-database-segments button {
    min-width: 0;
    padding-inline: 5px;
    white-space: normal;
    width: 100%;
  }

  .client-result-count {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .request-segments {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .request-segments button {
    min-width: 0;
    white-space: normal;
    width: 100%;
  }

  .request-segments button:last-child {
    grid-column: 1 / -1;
  }

  .settings-page,
  .settings-team-section,
  .teachers-workbench,
  .teacher-list,
  .settings-page .teacher-table {
    max-width: 100%;
    min-width: 0;
    overflow: visible;
    width: 100%;
  }

  .settings-page .teacher-create-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-page .teacher-create-row > div,
  .settings-page .teacher-create-row > .field:first-of-type {
    grid-column: 1;
  }

  .settings-page .teacher-table-row {
    grid-template-columns: minmax(0, 1fr) auto;
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .settings-page .teacher-table-row > span {
    min-width: 0;
  }

  .finance-chart-stage {
    overflow: hidden;
  }

  .finance-chart-stage svg {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    width: 100%;
  }

  .communications-page {
    height: calc(100dvh - 58px - max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px)));
    margin: 0;
    min-height: 0;
    overflow: hidden;
    width: 100%;
  }

  .communications-page .communications-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .communications-page .communication-channel-nav {
    display: grid;
    height: auto;
    min-height: 0;
  }

  .communications-page .communication-inbox {
    border-bottom: 0;
    display: grid;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  .communications-page .communication-thread,
  .communications-page .communication-contact {
    display: none;
  }

  .communications-page .communications-workbench.mobile-thread-open {
    grid-template-rows: minmax(0, 1fr);
  }

  .communications-page .communications-workbench.mobile-thread-open .communication-channel-nav,
  .communications-page .communications-workbench.mobile-thread-open .communication-inbox {
    display: none;
  }

  .communications-page .communications-workbench.mobile-thread-open .communication-thread {
    border: 0;
    display: grid;
    grid-row: 1;
    grid-template-rows: 60px minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .communications-page .communication-thread-head {
    gap: 8px;
    grid-template-columns: 36px 34px minmax(0, 1fr) auto;
    min-height: 60px;
    padding: 8px 10px 8px 58px;
  }

  .communication-mobile-back {
    display: inline-flex;
  }

  .communications-page .message-thread {
    overscroll-behavior: contain;
    padding: 10px 12px;
  }

  .communications-page .communication-compose {
    align-items: end;
    display: grid;
    gap: 7px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }

  .communications-page .communication-compose > textarea {
    grid-column: 1;
    max-height: 100px;
    min-width: 0;
  }

  .communications-page .communication-compose .communication-compose-actions {
    grid-column: 2;
    justify-content: flex-end;
    width: auto;
  }

  .communications-page .communication-compose .communication-emoji-picker,
  .communications-page .communication-compose .communication-script-suggestions {
    bottom: calc(62px + env(safe-area-inset-bottom));
  }

  .work-schedule-scroll,
  .overview-planner-shell,
  .table-scroll {
    max-width: 100%;
    overscroll-behavior-x: contain;
  }

  .work-schedule-scroll {
    display: none;
  }

  .workspace {
    padding-top: calc(58px + max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px)));
  }

  .admin-layout > .mobile-menu-button,
  .mobile-menu-button,
  .admin-nav {
    top: max(10px, env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  }

  html.telegram-fullscreen-chrome,
  body.telegram-fullscreen-chrome {
    --admin-fullscreen-safe-top: max(
      env(safe-area-inset-top, 0px),
      var(--tg-safe-area-inset-top, 0px),
      var(--tg-content-safe-area-inset-top, 0px)
    );
    --admin-fullscreen-control-top: max(104px, calc(var(--admin-fullscreen-safe-top) + 56px));
    --admin-fullscreen-content-top: max(156px, calc(var(--admin-fullscreen-safe-top) + 108px));
  }

  html.telegram-fullscreen-chrome .admin-layout > .mobile-menu-button,
  html.telegram-fullscreen-chrome .mobile-menu-button,
  html.telegram-fullscreen-chrome .admin-nav,
  body.telegram-fullscreen-chrome .admin-layout > .mobile-menu-button,
  body.telegram-fullscreen-chrome .mobile-menu-button,
  body.telegram-fullscreen-chrome .admin-nav {
    top: var(--admin-fullscreen-control-top);
  }

  html.telegram-fullscreen-chrome .workspace,
  body.telegram-fullscreen-chrome .workspace {
    padding-top: var(--admin-fullscreen-content-top);
  }

html.telegram-fullscreen-chrome .communications-page,
  body.telegram-fullscreen-chrome .communications-page {
    height: calc(100dvh - var(--admin-fullscreen-content-top));
  }
}

/* Mobile client accordion and stable communication controls. */
.client-mobile-row {
  display: none;
}

.communication-thread-actions {
  align-items: center;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  min-width: 0;
}

.communication-delete-chat,
.communication-message-delete {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: #9299a4;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 20px;
  height: 28px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 28px;
}

.communication-delete-chat:hover,
.communication-delete-chat:focus-visible,
.communication-message-delete:hover,
.communication-message-delete:focus-visible {
  color: var(--brand-red);
  outline: 0;
}

.communications-page .message-bubble {
  overflow-wrap: anywhere;
  position: relative;
  word-break: break-word;
}

.communication-message-delete {
  font-size: 16px;
  opacity: 0;
  position: absolute;
  right: 2px;
  top: 2px;
  transition: opacity 120ms ease;
}

.message-bubble:hover .communication-message-delete,
.message-bubble:focus-within .communication-message-delete {
  opacity: 1;
}

.communication-delete-chat-confirm,
.communication-message-delete-confirm {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}

.communication-delete-chat-confirm button,
.communication-message-delete-confirm button {
  appearance: none;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 7px;
  color: #626a75;
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  font-weight: 850;
  min-height: 27px;
  padding: 4px 7px;
}

.communication-delete-chat-confirm button:last-child,
.communication-message-delete-confirm button:last-child {
  background: #c91f26;
  border-color: #c91f26;
  color: #fff;
}

.communication-message-delete-confirm {
  background: inherit;
  border-radius: 7px;
  justify-content: flex-end;
  margin-bottom: 5px;
  width: 100%;
}

.communications-page .message-bubble.delete-pending {
  max-width: min(92%, 540px);
}

@media (max-width: 760px) {
  .client-database-client-row {
    display: none !important;
  }

  .client-database-table-body {
    gap: 5px;
  }

  .client-mobile-row {
    background: #fff;
    border: 1px solid #e1e5eb;
    border-radius: 10px;
    display: block;
    min-width: 0;
    overflow: hidden;
    width: 100%;
  }

  .client-mobile-row.expanded {
    border-color: rgba(201, 31, 38, 0.28);
    box-shadow: 0 4px 14px rgba(31, 39, 51, 0.07);
  }

  .client-mobile-row-summary {
    align-items: center;
    appearance: none;
    background: #fff;
    border: 0;
    color: #30353c;
    cursor: pointer;
    display: grid;
    gap: 8px;
    grid-template-columns: 34px minmax(0, 1fr) auto 16px;
    min-height: 56px;
    padding: 7px 9px;
    text-align: left;
    width: 100%;
  }

  .client-mobile-avatar {
    align-items: center;
    background: #7659d8;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-size: 10px;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    width: 34px;
  }

  .client-mobile-main,
  .client-mobile-stage {
    display: grid;
    min-width: 0;
  }

  .client-mobile-main b {
    color: #2f343b;
    font-size: 13px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .client-mobile-main small {
    color: #8b929d;
    font-size: 9px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .client-mobile-stage {
    justify-items: end;
    max-width: 94px;
  }

  .client-mobile-stage > b {
    color: #6d7480;
    font-size: 9px;
    font-weight: 850;
    white-space: nowrap;
  }

  .client-mobile-stage .crm-sla-badge {
    font-size: 8px;
    margin: 2px 0 0;
    max-width: 92px;
  }

  .client-mobile-chevron {
    color: #7a828e;
    font-size: 16px;
    transform: translateY(-2px);
    transition: transform 140ms ease;
  }

  .client-mobile-row.expanded .client-mobile-chevron {
    transform: rotate(180deg) translateY(2px);
  }

  .client-mobile-row-details {
    border-top: 1px solid #eceff3;
    display: grid;
    gap: 9px 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .client-mobile-row-details > span {
    display: grid;
    min-width: 0;
  }

  .client-mobile-row-details small {
    color: #9aa1aa;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .client-mobile-row-details b,
  .client-mobile-row-details em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .client-mobile-row-details b {
    color: #3e444d;
    font-size: 11px;
  }

  .client-mobile-row-details em {
    color: #89919c;
    font-size: 9px;
    font-style: normal;
  }

  .client-mobile-row-details > button {
    appearance: none;
    background: #c91f26;
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    font-weight: 850;
    grid-column: 1 / -1;
    min-height: 34px;
  }

  .mobile-communication-open .mobile-menu-button {
    display: none !important;
  }

  .communications-page .communication-thread-head {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    padding: 8px 10px;
  }

  .communication-mobile-back {
    display: inline-flex;
    left: 12px;
    position: fixed;
    top: max(10px, env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
    z-index: 96;
  }

  html.telegram-fullscreen-chrome .communication-mobile-back,
  body.telegram-fullscreen-chrome .communication-mobile-back {
    top: var(--admin-fullscreen-control-top);
  }

  .communication-thread-actions > .communication-thread-action {
    display: none;
  }

  .communication-delete-chat {
    opacity: 1;
  }

  .communication-delete-chat-confirm {
    background: #fff;
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 2;
  }

  .communication-message-delete {
    opacity: 0.72;
  }

  .communications-page .message-bubble {
    max-width: calc(100% - 34px);
  }

  .communications-page .message-bubble.outgoing {
    justify-self: end;
  }

  .client-detail-drawer .client-detail-close {
    margin: 0 0 -36px auto;
    position: sticky;
    right: 8px;
    top: 8px;
    z-index: 5;
  }

  .settings-page {
    padding-bottom: max(40px, calc(24px + env(safe-area-inset-bottom)));
  }

  .settings-page .overview-inspector {
    position: static;
    top: auto;
  }

  .settings-script-row,
  .settings-control-grid,
  .settings-control-status {
    max-width: 100%;
    min-width: 0;
  }

  html.telegram-fullscreen-chrome .client-detail-drawer,
  body.telegram-fullscreen-chrome .client-detail-drawer {
    top: var(--admin-fullscreen-content-top);
  }
}

.btn-danger {
  background: #fff;
  border: 1px solid rgba(183, 35, 43, 0.36);
  color: #b7232b;
}

.btn-danger:hover,
.btn-danger:focus-visible {
  background: #b7232b;
  border-color: #b7232b;
  color: #fff;
  outline: 0;
}

.client-delete-zone {
  align-items: center;
  background: #fff8f8;
  border: 1px solid rgba(183, 35, 43, 0.18);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 16px;
  padding: 12px;
}

.client-delete-zone > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.client-delete-zone strong {
  color: #3c4148;
  font-size: 12px;
  font-weight: 900;
}

.client-delete-zone span {
  color: #7f8791;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.35;
}

.client-delete-confirm {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}

.client-delete-zone.confirming {
  background: #fff1f1;
  border-color: rgba(183, 35, 43, 0.34);
}

@media (max-width: 760px) {
  .client-delete-zone {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .client-delete-zone > .btn,
  .client-delete-confirm,
  .client-delete-confirm .btn {
    width: 100%;
  }

.client-delete-confirm .btn {
    flex: 1 1 0;
    justify-content: center;
  }
}

/* Final authority after legacy compact picker rules. */
.communications-page .communication-compose > textarea {
  box-sizing: border-box;
  height: auto;
  max-height: 120px;
  min-height: 38px;
  overflow-y: hidden;
  white-space: pre-wrap;
}

.communications-page .communication-compose .communication-emoji-picker .communication-telegram-pack-tabs button {
  flex: 0 0 28px;
  font-size: 10px;
  height: 26px;
  min-width: 28px;
  padding: 0;
  width: 28px;
}

/* Stable mobile communications: avatars, filters, viewport and deletion flow. */
.communications-page .communication-thread-head {
  overflow: hidden;
  position: relative;
}

.communications-page .communication-item-shell > .communication-item {
  padding-right: 10px;
}

.communication-delete-chat {
  border: 1px solid #e1e5ea;
  border-radius: 8px;
  color: #747c87;
  font-size: 10px;
  font-weight: 850;
  height: 30px;
  min-width: 0;
  padding: 0 9px;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease,
    transform 140ms ease;
  width: auto;
}

.communication-delete-chat:hover,
.communication-delete-chat:focus-visible {
  background: #fff0f1;
  border-color: #efc6c9;
  transform: translateY(-1px);
}

@keyframes communication-delete-confirm-in {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
  }
}

@keyframes communication-delete-confirm-out {
  from {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-50%) translateX(10px) scale(0.96);
  }
}

@keyframes communication-thread-delete-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(18px);
  }
}

.communication-delete-chat-confirm {
  animation: communication-delete-confirm-in 160ms ease-out both;
  background: #fff;
  border-radius: 9px;
  box-shadow: -8px 0 14px rgba(255, 255, 255, 0.9);
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
}

.communication-delete-chat-confirm.is-cancelling {
  animation: communication-delete-confirm-out 140ms ease-in both;
}

.communications-page .communication-thread.is-deleting {
  animation: communication-thread-delete-out 180ms ease-in both;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .communication-delete-chat-confirm,
  .communication-delete-chat-confirm.is-cancelling,
  .communications-page .communication-thread.is-deleting {
    animation: none;
  }
}

@media (max-width: 760px) {
  .communications-page,
  .communications-page .communications-workbench {
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .communications-page .communications-workbench {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }

  .communications-page .communication-channel-nav {
    align-items: center;
    background: rgba(248, 249, 250, 0.97);
    border: 1px solid #e3e7ec;
    border-radius: 11px;
    display: grid !important;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) minmax(106px, 124px);
    grid-template-rows: 42px;
    height: 44px !important;
    left: 78px;
    min-height: 44px;
    padding: 3px 4px;
    position: fixed;
    right: 10px;
    top: max(10px, env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
    transition: opacity 120ms ease;
    z-index: 90;
  }

  html.telegram-fullscreen-chrome .communications-page .communication-channel-nav,
  body.telegram-fullscreen-chrome .communications-page .communication-channel-nav {
    top: var(--admin-fullscreen-control-top);
  }

  .sidebar-open .communications-page .communication-channel-nav,
  .communications-page .communications-workbench.mobile-thread-open .communication-channel-nav {
    display: none !important;
  }

  .communications-page .communication-channel-nav > header {
    display: none;
  }

  .communications-page .communication-channel-nav nav {
    align-items: center;
    display: flex;
    gap: 3px;
    min-width: 0;
    overflow: hidden;
    padding: 0;
  }

  .communications-page .communication-channel-nav button {
    align-items: center;
    display: inline-flex;
    flex: 1 1 auto;
    font-size: 9px;
    justify-content: center;
    min-height: 34px;
    min-width: 0;
    padding: 0 5px;
    text-align: center;
    white-space: nowrap;
  }

  .communications-page .communication-channel-nav button i,
  .communications-page .communication-channel-nav button b {
    display: none;
  }

  .communications-page .communication-teacher-filter {
    border: 0;
    display: block;
    margin: 0;
    min-width: 0;
    padding: 0;
  }

  .communications-page .communication-teacher-filter > span {
    display: none;
  }

  .communications-page .communication-teacher-filter select {
    background: #fff;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 780;
    height: 34px;
    min-height: 34px;
    min-width: 0;
    overflow: hidden;
    padding: 0 22px 0 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .communications-page .communication-inbox {
    grid-row: 1;
    height: 100% !important;
    min-height: 0;
  }

  .communications-page .communications-workbench.mobile-thread-open .communication-thread {
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    height: 100% !important;
    min-height: 0;
  }

  .communications-page .communication-thread-head {
    gap: 7px;
    grid-template-columns: 36px 34px minmax(0, 1fr) auto !important;
    min-height: 58px;
    padding: 8px 9px !important;
  }

  .communication-mobile-back {
    display: inline-flex;
    left: auto !important;
    position: static !important;
    top: auto !important;
    z-index: auto;
  }

  .communication-delete-chat-confirm {
    right: 8px;
  }

  .communication-delete-chat-confirm button {
    min-height: 30px;
  }

  .communications-page .communication-compose {
    padding-bottom: max(
      9px,
      env(safe-area-inset-bottom, 0px),
      var(--tg-content-safe-area-inset-bottom, 0px)
    ) !important;
  }

  .communications-page .communication-compose > textarea {
    max-height: min(120px, 24dvh);
  }

  .communications-page .communication-compose .communication-emoji-source-tabs {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .communications-page .communication-compose .communication-emoji-source-tabs button {
    font-size: 9px;
    padding-inline: 9px;
  }
}

.communication-telegram-pack-content .communication-emoji-picker-head > strong {
  font-size: 11px;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.communications-page .communication-compose .communication-telegram-asset-grid button.selected {
  background: #fff0f0;
  box-shadow: inset 0 0 0 2px var(--brand-red);
}

.communications-page .communication-compose .communication-telegram-asset-grid button.selected::after {
  align-items: center;
  background: var(--brand-red);
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  content: "✓";
  display: flex;
  font-size: 9px;
  font-weight: 900;
  height: 17px;
  justify-content: center;
  position: absolute;
  right: 2px;
  top: 2px;
  width: 17px;
  z-index: 3;
}

.communication-item-avatar > img,
.communication-thread-avatar > img {
  border-radius: inherit;
  height: 100%;
  inset: 0;
  object-fit: cover;
  opacity: 0;
  position: absolute;
  transition: opacity 120ms ease;
  width: 100%;
  z-index: 1;
}

.communication-item-avatar[data-avatar-state="ready"] > img,
.communication-thread-avatar[data-avatar-state="ready"] > img {
  opacity: 1;
}

.communication-item-avatar[data-avatar-state="ready"] > .communication-avatar-fallback,
.communication-thread-avatar[data-avatar-state="ready"] > .communication-avatar-fallback {
  visibility: hidden;
}

.communication-avatar-fallback {
  align-items: center;
  display: inline-flex;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.communication-item-avatar .communication-source-mark {
  z-index: 2;
}

.communications-page .communication-item-shell {
  border-bottom: 1px solid #eceff3;
  position: relative;
}

.communications-page .communication-item-shell > .communication-item {
  border-bottom: 0;
  padding-right: 42px;
}

.communication-item-delete {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 7px;
  bottom: 7px;
  color: #9aa1ab;
  cursor: pointer;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 7px;
  width: 28px;
  z-index: 2;
}

.communication-item-delete svg {
  fill: none;
  height: 16px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 16px;
}

.communication-item-delete:hover,
.communication-item-delete:focus-visible {
  background: #fff0f1;
  color: var(--brand-red);
  outline: 0;
}

.communication-item-delete-confirm {
  align-items: center;
  background: #fff7f7;
  border-top: 1px solid #f3d7d9;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  padding: 6px 9px;
}

.communication-item-delete-confirm button {
  appearance: none;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 7px;
  color: #626a75;
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  font-weight: 850;
  min-height: 28px;
  padding: 4px 8px;
}

.communication-item-delete-confirm button:last-child {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
}

@media (max-width: 760px) {
  .communications-page .communication-item-shell > .communication-item {
    padding-right: 42px;
  }

  .communication-item-delete {
    bottom: 6px;
    opacity: 1;
    right: 6px;
  }

  .communication-item-delete-confirm button {
    min-height: 30px;
  }
}

.communications-page .communication-compose .communication-emoji-picker .communication-emoji-source-tabs button {
  flex: 0 0 auto;
  height: 29px;
  min-width: max-content;
  padding-inline: 10px;
  width: auto;
}

.communications-page .communication-compose .communication-emoji-picker .communication-telegram-pack-tabs button {
  flex: 0 0 28px;
  font-size: 10px;
  height: 26px;
  min-width: 28px;
  padding: 0;
  width: 28px;
}

/* Keep inbox rows compact after the legacy delete-control rules above. */
.communications-page .communication-item-shell > .communication-item {
  padding-right: 10px;
}

@media (max-width: 760px) {
  .communications-page .communication-item-shell > .communication-item {
    padding-right: 10px;
  }

  /* The legacy mobile rule caps every message list at 55dvh. Inside the
     full-height communication grid that leaves a blank strip above the
     composer and clips long conversations. Let the grid row own the height. */
  .communications-page .message-thread {
    align-self: stretch;
    height: auto;
    max-height: none !important;
    min-height: 0 !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Operational pages refresh often. Keep entrance motion on their windows,
   rather than fading and translating the entire working surface in Safari. */
.client-database-page,
.communications-workbench,
.broadcast-page {
  animation: none !important;
}

/* A desktop sidebar leaves less space than the viewport breakpoint suggests. */
@media (min-width: 761px) {
  body:not(.component-admin) .client-database-filter-panel {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }
  body:not(.component-admin) .client-database-filter-panel > * { grid-column: 1; }
  body:not(.component-admin) .client-database-segments { flex-wrap: wrap; max-width: 100%; }
  body:not(.component-admin) .client-database-filter-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body:not(.component-admin) .client-database-filter-row > label { min-width: 0; }
  body:not(.component-admin) .client-database-filter-row > label .input { width: 100%; min-width: 0; }
  body:not(.component-admin) .client-database-filter-row > span,
  body:not(.component-admin) .client-database-filter-row > b { grid-column: 1 / -1; }
}

/* Replies are beside the bottom edge of the message, outside its text. */
.communications-page .communication-thread {
  grid-template-rows: auto minmax(0, 1fr) auto auto !important;
}
.communications-page .message-bubble { position:relative; overflow:visible; overflow-wrap:anywhere; }
.communications-page .message-bubble.incoming { margin-right:44px; }
.communications-page .message-bubble.outgoing { margin-left:44px; }
.communications-page .communication-message-tools { display:flex; align-items:center; gap:8px; }
.communications-page .communication-message-reply {
  align-items:center; display:inline-flex; justify-content:center;
  position:absolute; bottom:0; left:calc(100% + 6px);
  width:24px; height:24px; min-height:24px; padding:5px;
  border:0; border-radius:50%; box-shadow:none;
  background:var(--admin-message-reply,#ececec); color:var(--ink,#30343b);
  cursor:pointer; transition:background-color 120ms ease,transform 120ms ease;
}
/* The visible circle stays small; the transparent area keeps it easy to hit. */
.communications-page .communication-message-reply::before { content:""; position:absolute; inset:-8px; border-radius:50%; }
.communications-page .message-bubble.outgoing .communication-message-reply { left:auto; right:calc(100% + 6px); }
.communications-page .communication-message-reply svg { width:14px; height:14px; pointer-events:none; }
.communications-page .communication-message-reply:focus-visible { outline:2px solid var(--admin-focus,#596572); outline-offset:3px; }
.communications-page .communication-message-reply:active { transform:scale(.97); }
.communications-page [data-communication-reply-preview]:empty { display:none; }
@media(max-width:760px) {
  .communications-page .message-bubble:not(.system) { max-width:calc(100% - 46px); }
  .communications-page .communication-message-reply::before { inset:-10px; }
}
@media(prefers-reduced-motion:reduce) {
  .communications-page .communication-message-reply { transition:none; }
  .communications-page .communication-message-reply:active { transform:none; }
}
