@import url('https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap');

:root {
  --navy: #071748;
  --ink: #0a1538;
  --muted: #5d6b8f;
  --blue: #0655ff;
  --blue-soft: #eaf0fe;
  --green: #07a93a;
  --green-soft: #e6fce6;
  --violet: #682df2;
  --orange-soft: #fff2df;
  --orange: #c46a18;
  --border: #dfe6f3;
  --line: #edf1f7;
  --panel: #ffffff;
  --page: #fbfcff;
  --danger: #ff3030;
  --shadow: 0 16px 40px rgba(7, 23, 72, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: "Google Sans", Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px 14px 18px 18px;
  color: #fff;
  background: linear-gradient(150deg, #09245b, #020b28);
  font-size: 33px;
  line-height: 1;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 23px;
}

.app-logo {
  position: relative;
  display: inline-flex;
  width: 100%;
  height: 64px;
  align-items: center;
  justify-content: center;
}

.app-logo img {
  position: absolute;
  display: block;
  height: auto;
  transition: opacity 0.16s ease;
}

.app-logo-short {
  width: 56px;
  opacity: 1;
}

.app-logo-full {
  width: 150px;
  opacity: 0;
}

.mobile-app-header,
.mobile-menu-overlay,
.mobile-menu-close {
  display: none;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.sidebar {
  position: sticky;
  z-index: 60;
  top: 0;
  display: flex;
  width: 88px;
  height: 100vh;
  flex-direction: column;
  gap: 42px;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: #fff;
  padding: 32px 14px;
  box-shadow: none;
  transition: width 0.2s ease, box-shadow 0.2s ease;
}

.sidebar:hover,
.sidebar:focus-within {
  width: 270px;
  box-shadow: 16px 0 40px rgba(7, 23, 72, 0.12);
}

.sidebar:hover .app-logo-short,
.sidebar:focus-within .app-logo-short {
  opacity: 0;
}

.sidebar:hover .app-logo-full,
.sidebar:focus-within .app-logo-full {
  opacity: 1;
}

.side-nav {
  display: grid;
  gap: 18px;
}

.side-link,
.logout-link {
  display: flex;
  min-height: 52px;
  align-items: center;
  border-radius: 12px;
  color: var(--navy);
  font-size: 16px;
  font-weight: 650;
  padding: 0 15px;
  white-space: nowrap;
}

.sidebar:hover .side-link, .sidebar:focus-within .side-link,
.sidebar:hover .logout-link, .sidebar:focus-within .logout-link {
  gap: 16px;
}

.side-link.is-active {
  color: var(--blue);
  background: var(--blue-soft);
}

.side-link.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.side-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 30px;
}

.side-icon img {
  display: block;
  width: 28px;
  height: 28px;
}

.side-label {
  width: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.sidebar:hover .side-label,
.sidebar:focus-within .side-label {
  width: auto;
  opacity: 1;
  transition-delay: 0.06s;
}

.logout-link {
  margin-top: auto;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding-top: 28px;
}

.main-area {
  min-width: 0;
}

.topbar {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: flex-end;
  gap: 34px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 8px 42px;
}

.top-balance {
  display: flex;
  min-width: 320px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
}

.top-balance span,
.stat-card span,
.page-heading p,
.field label,
.field-help {
  color: var(--muted);
}

.top-balance strong {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font-size: 28px;
}

.top-balance-icon {
  display: inline-grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  border-radius: 12px;
  background: var(--green-soft);
}

.top-balance-icon img {
  display: block;
  width: 32px;
  height: 32px;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-link {
  border-radius: 12px;
  padding: 6px 8px;
  transition: background 0.15s ease;
}

.profile-link:hover,
.profile-link:focus-visible {
  background: var(--blue-soft);
}

.profile-chip span:last-child {
  display: grid;
  gap: 3px;
}

.profile-chip small {
  color: var(--muted);
}

.avatar {
  display: inline-grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
  color: var(--navy);
  background: #e8edf6;
  font-weight: 800;
}

.avatar.compact,
.person-cell.compact .avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 12px;
}

.content {
  padding: 36px 42px 56px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.telegram-dialog-page-heading.is-staff-dialog-heading {
  margin-bottom: 16px;
}

.telegram-dialog-page-heading.is-staff-dialog-heading .back-link {
  margin-bottom: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.14;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel + .panel,
.split-grid {
  margin-top: 22px;
}

.panel-header,
.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 30px;
}

.panel-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.leads-table-wrap {
  min-height: 390px;
}

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

.links-table {
  min-width: 1180px;
}

.data-table th {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.lead-status-filter {
  position: relative;
  display: inline-block;
}

.lead-status-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.lead-status-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #eaf0ff;
  color: var(--primary);
  font-size: 12px;
}

.lead-status-filter-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  width: 300px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(18, 45, 95, 0.16);
  color: var(--ink);
}

.lead-status-filter-menu[hidden] {
  display: none;
}

.lead-status-filter-toolbar,
.lead-status-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lead-status-filter-toolbar {
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.lead-status-filter-toolbar button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
}

.lead-status-filter-toolbar span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.lead-status-filter-search {
  width: 100%;
  min-height: 38px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
}

.lead-status-filter-options {
  display: grid;
  gap: 4px;
  max-height: 230px;
  overflow-y: auto;
}

.lead-status-filter-options label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 4px;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.lead-status-filter-options input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.lead-status-filter-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.data-table th,
.data-table td {
  border-top: 1px solid var(--line);
  padding: 18px 30px;
  vertical-align: middle;
}

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

.person-cell {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
}

.lead-created-at {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.money-positive {
  color: var(--green);
  font-weight: 750;
}

.row-arrow {
  color: var(--muted);
  font-size: 34px;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 26px;
}

.dashboard-stats {
  grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.planned-profit-row {
  display: grid;
  grid-template-columns: minmax(280px, 420px);
  margin-bottom: 26px;
}

.dashboard-heading {
  align-items: flex-start;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 118px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 24px;
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  color: var(--blue);
  font-size: 32px;
}

.stat-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong.green {
  color: var(--green);
}

.stat-card strong.violet {
  color: var(--violet);
}

.stat-icon {
  display: inline-grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  font-size: 32px;
}

.stat-icon.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.stat-icon.gray {
  color: var(--blue);
  background: var(--blue-soft);
}

.stat-icon.green {
  color: var(--green);
  background: var(--green-soft);
}

.stat-icon.violet {
  color: var(--violet);
  background: #f4effd;
}

.stat-icon.orange {
  color: #c86612;
  background: #fff1df;
}

.stat-icon img {
  display: block;
  width: 42px;
  height: 42px;
}

.dashboard-stat-card {
  align-items: flex-start;
  gap: 16px;
  min-height: 132px;
  border-radius: 8px;
  padding: 22px 20px;
  box-shadow: 0 10px 30px rgba(9, 28, 63, 0.05);
}

.dashboard-stat-card .stat-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
}

.dashboard-stat-card .stat-icon img {
  width: 24px;
  height: 24px;
}

.dashboard-stat-card .stat-content {
  display: grid;
  min-width: 0;
  gap: 10px;
  width: 100%;
}

.dashboard-stat-card .stat-title {
  min-height: 34px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dashboard-stat-card strong {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.1;
}

.dashboard-stat-card .stat-change {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 0;
  color: var(--green);
  font-weight: 800;
  line-height: 1.25;
}

.dashboard-stat-card .stat-change.blue {
  color: var(--blue);
}

.dashboard-stat-card .stat-change.violet {
  color: var(--violet);
}

.dashboard-stat-card .stat-change span {
  color: var(--muted);
  font-weight: 700;
}

.stat-periods {
  display: grid;
  grid-template-columns: repeat(2, minmax(68px, 1fr));
  align-items: end;
  gap: 10px 14px;
  max-width: 100%;
}

.stat-periods span {
  display: grid;
  gap: 8px;
}

.stat-periods small {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.stat-periods strong {
  color: var(--ink);
  font-size: 20px;
}

.stat-periods em {
  grid-column: 1 / -1;
  align-self: end;
  color: #ff8b1a;
  font-style: normal;
  font-weight: 850;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
  padding: 0 22px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 22px rgba(7, 92, 248, 0.22);
}

.btn img {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.panel-header .btn-primary img, .page-heading .btn-primary img {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.btn-secondary {
  color: var(--blue);
  border-color: var(--blue);
  background: #fff;
}

.btn-success {
  color: #fff;
  background: #12b354;
}

.btn-danger {
  color: #fff;
  background: var(--danger);
}

.btn-full {
  width: 100%;
}

.btn-compact {
  min-height: 34px;
  border-radius: 7px;
  padding: 0 12px;
}

.btn-icon-only {
  width: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 26px;
}

.actions,
.heading-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dashboard-filters {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard-filters label {
  display: flex;
  align-items: center;
  min-width: 230px;
  gap: 10px;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0 14px;
  color: var(--muted);
}

.dashboard-filter-control img {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.dashboard-filters .form-control {
  min-height: 46px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  font-weight: 750;
}

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

.analytics-panel {
  margin-bottom: 22px;
  overflow: hidden;
}

.analytics-panel .panel-header {
  align-items: flex-start;
}

.analytics-panel .panel-header p {
  margin: 8px 0 0;
}

.analytics-table {
  min-width: 860px;
}

.summary-row td {
  background: #fbfdff;
  font-weight: 700;
}

.link-button,
.icon-link,
.icon-danger {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-weight: 700;
}

.link-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  padding: 0;
}

.link-button img {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.icon-link,
.icon-danger {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  font-size: 22px;
}

.icon-danger {
  color: var(--danger);
}

.icon-link img,
.icon-danger img {
  display: block;
  width: 18px;
  height: 18px;
}

.form-grid {
  display: grid;
  gap: 22px 28px;
}

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

.form-grid.four {
  grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(160px, 1fr));
}

.payment-form,
.entity-form {
  padding: 28px 30px;
}

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

.form-grid .field {
  margin-bottom: 0;
}

.form-grid + .field {
  margin-top: 20px;
}

.form-control {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfd9ec;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 14px;
  outline: none;
}

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

select[multiple].form-control {
  min-height: 110px;
}

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(7, 92, 248, 0.12);
}

.field-error {
  color: var(--danger);
  font-size: 13px;
}

.field-help {
  font-size: 13px;
}

.avatar-upload-row {
  display: grid;
  grid-template-columns: 94px 82px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 28px;
}

.avatar-upload-label {
  align-self: start;
  color: var(--muted);
  font-size: 14px;
  padding-top: 4px;
}

.avatar-upload-preview {
  position: relative;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #f0f3f8;
}

.avatar-upload-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-placeholder,
.avatar-upload-placeholder::before,
.avatar-upload-placeholder::after {
  display: block;
}

.avatar-upload-placeholder {
  position: relative;
  width: 46px;
  height: 50px;
}

.avatar-upload-placeholder::before,
.avatar-upload-placeholder::after {
  position: absolute;
  left: 50%;
  content: "";
  transform: translateX(-50%);
}

.avatar-upload-placeholder::before {
  top: -5px;
  width: 22px;
  height: 22px;
  border: 3px solid #99a0ad;
  border-radius: 50%;
}

.avatar-upload-placeholder::after {
  bottom: 2px;
  width: 40px;
  height: 22px;
  border: 3px solid #99a0ad;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-bottom: 0;
}

.avatar-upload-body {
  display: grid;
  justify-items: start;
  gap: 7px;
}

.avatar-upload-body strong {
  color: var(--navy);
  font-size: 15px;
}

.avatar-upload-body > span {
  color: var(--muted);
  font-size: 12px;
}

.avatar-upload-row input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.upload-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 0 14px;
}

.upload-button-icon {
  position: relative;
  width: 16px;
  height: 16px;
}

.upload-button-icon::before,
.upload-button-icon::after {
  position: absolute;
  left: 50%;
  content: "";
  transform: translateX(-50%);
}

.upload-button-icon::before {
  top: 3px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}

.upload-button-icon::after {
  top: 5px;
  width: 2px;
  height: 9px;
  background: currentColor;
}

.avatar-upload-file {
  min-height: 15px;
}

.password-input {
  position: relative;
}

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

.password-toggle {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #69789f;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle::before,
.password-toggle::after {
  position: absolute;
  content: "";
}

.password-toggle::before {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.password-toggle::after {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.password-toggle.is-visible {
  color: var(--blue);
}

.chips-select {
  position: relative;
}

.chips-select-control {
  display: none;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #cfd9ec;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 7px 14px;
  text-align: left;
}

.chips-select.is-ready .chips-select-control {
  display: flex;
}

.chips-select.is-ready select {
  display: none;
}

.chips-select-values {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  gap: 7px;
}

.chips-select-placeholder {
  color: var(--muted);
  padding: 6px 0;
}

.chips-select-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  background: #f1f4fb;
  color: #52608a;
  font-size: 14px;
  line-height: 1.1;
  padding: 0 9px 0 11px;
}

.chips-select-remove {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #7582a2;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.chips-select-arrow {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-right: 2px solid #69789f;
  border-bottom: 2px solid #69789f;
  transform: rotate(45deg);
}

.chips-select.is-open .chips-select-arrow {
  transform: rotate(225deg);
}

.chips-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  display: none;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 8px;
}

.chips-select.is-ready.is-open .chips-select-menu {
  display: grid;
  gap: 4px;
}

.chips-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  padding: 10px;
}

.chips-select-option:hover {
  background: #f5f7fc;
}

.chips-select-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.form-actions {
  display: flex;
  gap: 16px;
  margin-top: 22px;
}

.form-section-title {
  margin: 26px 0 18px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.mode-switch label {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--navy);
  cursor: pointer;
  font-weight: 700;
  padding: 0 16px;
}

.mode-switch label.is-active {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-soft);
}

.mode-switch input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.info-note {
  border: 1px solid #d9e3ff;
  border-radius: 8px;
  color: var(--muted);
  background: #f5f8ff;
  padding: 12px 14px;
}

.result-panel {
  padding: 26px 30px;
}

.result-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.success-icon,
.fail-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 2px solid var(--green);
  border-radius: 50%;
  color: var(--green);
  font-size: 24px;
  font-weight: 800;
}

.fail-icon {
  border-color: var(--danger);
  color: var(--danger);
}

.centered {
  margin: 0 auto 16px;
}

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

.success-note {
  margin: 16px 0 0;
  color: var(--green);
}

.status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
}

.status-paid {
  color: var(--green);
  background: var(--green-soft);
}

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

.status-telegram {
  color: #ffffff;
  background: #FF7D32;
}

.status-trial_visited {
  color: #ffffff;
  background: #650c76;
}

.status-agreed {
  color: #ffffff;
  background: #87e417;
}

.status-created {
  color: var(--orange);
  background: var(--orange-soft);
}

.status-cancelled {
  color: var(--muted);
  background: #eef1f6;
}

.status-refused {
  color: #c2414b;
  background: #ffe8eb;
}

.status-expired, .status-no_show {
  color: #a33d00;
  background: #fff0df;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-link,
.page-gap {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--navy);
  background: #fff;
}

.page-link.is-current {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-soft);
}

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

.split-grid > .panel {
  margin-top: 0;
}

.mini-list {
  display: grid;
  padding: 0 30px 26px;
}

.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.message {
  border-radius: 8px;
  padding: 12px 14px;
}

.message.success {
  color: var(--green);
  background: var(--green-soft);
}

.message.error {
  color: var(--danger);
  background: #fff0f0;
}

.message.info {
  color: var(--blue);
  background: var(--blue-soft);
}

.telegram-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  margin-bottom: 18px;
}

.telegram-dialog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.telegram-dialog-toolbar .telegram-filter {
  margin-bottom: 0;
}

.telegram-dialog-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.telegram-page-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.telegram-hub-link {
  position: relative;
}

.telegram-hub-badge {
  position: absolute;
  top: -9px;
  right: -8px;
  min-width: 22px;
  padding: 3px 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--danger);
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
}

.telegram-filter label {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.is-telegram-new-dialog-open {
  overflow: hidden;
}

.telegram-new-dialog-modal[hidden] {
  display: none;
}

.telegram-new-dialog-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.telegram-new-dialog-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(5, 17, 44, .42);
  cursor: pointer;
}

.telegram-new-dialog-dialog {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(5, 17, 44, .24);
}

.telegram-hub-settings-dialog {
  width: min(920px, 100%);
}

.telegram-hub-settings-table-wrap {
  max-height: min(62vh, 580px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.telegram-hub-settings-table {
  width: 100%;
  border-collapse: collapse;
}

.telegram-hub-settings-table th,
.telegram-hub-settings-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.telegram-hub-settings-table th:nth-child(3),
.telegram-hub-settings-table th:nth-child(4),
.telegram-hub-settings-table td:nth-child(3),
.telegram-hub-settings-table td:nth-child(4) {
  width: 150px;
  text-align: center;
}

.telegram-hub-settings-table input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
}

.telegram-new-dialog-dialog h2 {
  margin: 0 42px 8px 0;
}

.telegram-new-dialog-dialog p {
  margin-bottom: 20px;
  color: var(--muted);
}

.telegram-new-dialog-dialog label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.telegram-new-dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.telegram-new-dialog-close::before,
.telegram-new-dialog-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 9px;
  right: 9px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

.telegram-new-dialog-close::before {
  transform: rotate(45deg);
}

.telegram-new-dialog-close::after {
  transform: rotate(-45deg);
}

.telegram-new-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.telegram-dialogs-panel {
  overflow: hidden;
}

.telegram-dialog-list {
  display: grid;
}

.telegram-dialog-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  transition: background .16s ease;
}

.telegram-dialog-row:hover,
.telegram-dialog-row.has-unread {
  background: #f5f8ff;
}

.telegram-dialog-avatar {
  display: inline-grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-weight: 700;
}

.telegram-dialog-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.telegram-dialog-main {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.telegram-dialog-title {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.telegram-dialog-title small,
.telegram-dialog-tutor,
.muted-text {
  color: var(--muted);
}

.telegram-dialog-preview {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-dialog-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.unread-badge {
  min-width: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--danger);
  text-align: center;
}

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

.telegram-chat-panel {
  overflow: hidden;
}

.telegram-messages {
  display: grid;
  gap: 10px;
  min-height: 380px;
  max-height: 68vh;
  align-content: flex-start;
  padding: 20px;
  overflow: auto;
  background: #f7f9fd;
}

.telegram-message {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.telegram-message.is-outgoing {
  justify-content: flex-end;
}

.telegram-message-bubble {
  min-width: 0;
  max-width: min(720px, 82%);
  padding: 11px 14px;
  border-radius: 16px 16px 16px 4px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 15px rgba(7, 23, 72, .06);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.45;
}

.telegram-message.is-outgoing .telegram-message-bubble {
  border-radius: 16px 16px 4px 16px;
  color: #fff;
  background: var(--blue);
}

.telegram-message-bubble strong,
.telegram-message-bubble time {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
}

.telegram-live-text {
  white-space: pre-wrap;
}

.telegram-message-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 7px;
}

.telegram-message-bubble time {
  margin: 0;
  opacity: .65;
  text-align: right;
}

.telegram-message-edited {
  font-size: 11px;
  opacity: .65;
}

.telegram-message-status {
  display: inline-block;
  color: currentColor;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  opacity: .7;
}

.telegram-message-status[hidden] {
  display: none;
}

.telegram-message-status[data-delivery-status="error"],
.telegram-message-status[data-delivery-status="undelivered"] {
  color: #ffb4b4;
  opacity: 1;
}

.telegram-message-reaction-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  margin-top: 5px;
}

.telegram-message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.telegram-reaction-chip,
.telegram-reaction-picker button {
  border: 1px solid rgba(95, 119, 171, .28);
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.telegram-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  padding: 3px 7px;
  font-size: 14px;
}

.telegram-reaction-count {
  font-size: 11px;
  font-weight: 700;
}

.telegram-reaction-chip.is-selected {
  border-color: var(--blue);
  background: #e9f0ff;
}

.telegram-reaction-picker {
  position: absolute;
  z-index: 3;
  bottom: 29px;
  left: 0;
  display: flex;
  box-sizing: border-box;
  width: max-content;
  max-width: min(224px, calc(100vw - 32px));
  flex-wrap: wrap;
  gap: 3px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(7, 23, 72, .16);
}

.telegram-reaction-picker[hidden] {
  display: none;
}

.telegram-reaction-picker button {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 17px;
}

@media (max-width: 820px) {
  .telegram-message.is-outgoing .telegram-reaction-picker {
    right: 0;
    left: auto;
  }
}

.telegram-reaction-chip:hover,
.telegram-reaction-picker button:hover {
  border-color: var(--blue);
  background: #f0f5ff;
}

.telegram-message.is-outgoing .telegram-reaction-chip,
.telegram-message.is-outgoing .telegram-reaction-chip {
  border-color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .92);
}

.telegram-media-link {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
}

.telegram-media-audio,
.telegram-media-video {
  display: block;
  width: min(100%, 520px);
  max-width: 100%;
  margin: 4px 0 8px;
}

.telegram-media-video {
  max-height: 420px;
  border-radius: 10px;
  background: #101827;
}

.telegram-media-image-link {
  display: block;
  max-width: 100%;
  margin-bottom: 8px;
}

.telegram-media-image {
  display: block;
  width: auto;
  max-width: min(100%, 520px);
  max-height: 520px;
  border-radius: 10px;
  object-fit: contain;
}

.telegram-media-fallback {
  display: block;
  margin-bottom: 7px;
  color: inherit;
  font-size: 12px;
  opacity: .75;
}

.telegram-contact-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  max-width: 100%;
  margin: 2px 0 4px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f3f6fb;
  color: var(--ink);
}

.telegram-contact-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 21px;
}

.telegram-contact-info {
  min-width: 0;
}

.telegram-contact-info strong,
.telegram-contact-info a {
  display: block;
  overflow-wrap: anywhere;
}

.telegram-contact-info strong {
  margin: 0 0 2px;
  font-size: 14px;
}

.telegram-contact-info a {
  color: inherit;
  font-size: 13px;
  text-decoration: none;
}

.telegram-contact-info a:hover {
  text-decoration: underline;
}

.telegram-contact-masked {
  font-weight: 600;
}

.telegram-message.is-outgoing .telegram-media-link {
  color: #fff;
}

.telegram-send-form {
  display: block;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.telegram-send-form[hidden] {
  display: none;
}

.telegram-hub-claim-panel {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.telegram-hub-claim-panel small {
  color: var(--muted);
}

.telegram-compose-row {
  display: grid;
  grid-template-columns: 44px 44px minmax(0, 1fr) 44px;
  align-items: end;
  gap: 10px;
}

.telegram-compose-textarea,
textarea.form-control.telegram-compose-textarea {
  height: 44px;
  min-height: 44px;
  max-height: 140px;
  padding: 9px 12px;
  overflow-y: hidden;
  resize: none;
  line-height: 1.4;
}

.telegram-compose-textarea:disabled {
  opacity: .7;
}

.telegram-icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  padding: 0;
  line-height: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: background .16s ease, border-color .16s ease;
}

.telegram-icon-button:hover {
  border-color: var(--blue);
  background: #f5f8ff;
}

.telegram-icon-button img {
  display: block;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  object-fit: contain;
}

.telegram-record-button img,
.telegram-send-button img {
  width: 24px;
  height: 24px;
}

.telegram-record-button.is-recording {
  border-color: #d93f4b;
  background: #fff0f1;
  animation: telegram-record-pulse 1.2s ease-in-out infinite;
}

.telegram-record-button.is-recording img {
  filter: sepia(1) saturate(7) hue-rotate(315deg);
}

@keyframes telegram-record-pulse {
  50% { box-shadow: 0 0 0 5px rgba(217, 63, 75, .12); }
}

.telegram-send-button {
  border-color: var(--blue);
  background: var(--blue);
}

.telegram-send-button:hover {
  background: var(--blue-dark, #102d76);
}

.telegram-send-button img {
  filter: brightness(0) invert(1);
}

.file-picker {
  position: relative;
  overflow: hidden;
}

.file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.telegram-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.telegram-send-status {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 13px;
}

.telegram-send-status.is-error {
  color: var(--danger);
}

.telegram-attachment-item {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--ink);
  background: #f7f9fd;
  font-size: 13px;
}

.telegram-attachment-name {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-attachment-size {
  color: var(--muted);
  white-space: nowrap;
}

.telegram-attachment-item.has-preview {
  flex-direction: column;
  align-items: flex-start;
}

.telegram-attachment-preview {
  display: block;
  width: min(320px, 100%);
  max-width: 100%;
}

.telegram-attachment-remove {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.telegram-attachment-remove:hover {
  color: var(--danger);
  background: #fff0f0;
}

.telegram-dialog-sidebar {
  display: grid;
  gap: 8px;
  padding: 20px;
}

.telegram-dialog-sidebar h2 {
  margin: 0 0 8px;
}

.telegram-dialog-sidebar p {
  margin: 0 0 10px;
}

.telegram-dialog-sidebar form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.telegram-dialog-title-form {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.telegram-dialog-title-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: stretch;
}

.telegram-dialog-title-control .telegram-icon-button {
  width: 44px;
  height: 44px;
}

.telegram-dialog-title-control .telegram-icon-button img {
  width: 20px;
  height: 20px;
}

.telegram-dialog-title-status {
  font-size: 12px;
}

.telegram-dialog-title-status.is-success {
  color: var(--green);
}

.telegram-dialog-title-status.is-error {
  color: var(--danger);
}

.telegram-parent-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 2px 0 0;
  cursor: pointer;
  color: var(--text);
}

.telegram-parent-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.telegram-empty-panel,
.telegram-qr-panel {
  text-align: center;
}

.telegram-qr-panel {
  max-width: 520px;
  margin: 0 auto;
  padding: 30px;
}

.telegram-qr-image {
  display: block;
  width: min(360px, 100%);
  margin: 24px auto;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--blue);
  font-size: 14px;
}

.schedule-panel {
  overflow: hidden;
}

.schedule-panel.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.schedule-toolbar {
  justify-content: flex-start;
}

.schedule-wrap,
.availability-wrap {
  overflow-x: auto;
}

.schedule-table,
.availability-table {
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
  table-layout: fixed;
}

.schedule-table th,
.schedule-table td,
.availability-table th,
.availability-table td {
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: top;
}

.schedule-table th:last-child,
.schedule-table td:last-child,
.availability-table th:last-child,
.availability-table td:last-child {
  border-right: 0;
}

.schedule-table thead th,
.availability-table thead th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 14px 10px;
  text-align: center;
}

.schedule-table thead strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.schedule-time-head,
.schedule-time,
.availability-table tbody th {
  width: 78px;
}

.schedule-time,
.availability-table tbody th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  text-align: center;
}

.schedule-table tbody tr {
  height: 30px;
}

.schedule-table td {
  height: 30px;
  padding: 2px;
  background: #fff;
}

.schedule-table td.has-schedule-items {
  background: #fbfdff;
}

.schedule-slot {
  display: grid;
  gap: 3px;
  min-height: calc((var(--schedule-slot-span, 2) * 30px) - 5px);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.25;
}

.schedule-slot-button {
  width: 100%;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
}

.schedule-slot-button:hover {
  filter: brightness(0.98);
}

.schedule-slot-button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.schedule-slot + .schedule-slot {
  margin-top: 6px;
}

.schedule-slot strong,
.schedule-slot span,
.schedule-slot small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.schedule-slot strong {
  font-size: 12px;
}

.schedule-slot small {
  color: inherit;
  opacity: 0.8;
}

.schedule-slot-available {
  color: #067b35;
  background: #dff8e7;
}

.schedule-slot-trial {
  color: #fff;
  background: #FF7D32;
}

.schedule-slot-regular {
  color: #fff;
  background: #8E24AC;
}

.schedule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 16px 30px;
}

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

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-dot.available {
  background: #4cc978;
}

.legend-dot.trial {
  background: #ff9f43;
}

.legend-dot.regular {
  background: #8e24ac;
}

.availability-table th,
.availability-table td {
  padding: 5px 10px;
  text-align: center;
}

.availability-checkbox {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  cursor: pointer;
}

.availability-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.availability-checkbox span {
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid #d8e1f2;
  border-radius: 5px;
  background: #fff;
}

.availability-checkbox input:checked + span {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px #fff;
}

.availability-checkbox.is-disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

.availability-checkbox.is-disabled span {
  background: #f2f5fa;
}

.muted-text {
  color: var(--muted);
}

.schedule-picker-panel {
  overflow: hidden;
}

.schedule-picker-table thead th span,
.schedule-picker-table thead th strong {
  display: block;
}

.schedule-form-message {
  margin: 0 30px 16px;
}

.schedule-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 18px 30px;
}

.schedule-picker-footer span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.schedule-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.schedule-section-heading h2 {
  margin: 0;
}

.compact-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-weight: 700;
}

.trial-info-modal[hidden] {
  display: none;
}

.trial-info-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.trial-info-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(5, 17, 44, 0.42);
}

.trial-info-dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(5, 17, 44, 0.24);
  padding: 28px;
}

.trial-info-dialog h2 {
  margin: 0 42px 22px 0;
  color: var(--ink);
  font-size: 26px;
}

.trial-info-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
}

.trial-info-close::before,
.trial-info-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 9px;
  right: 9px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

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

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

.trial-info-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.trial-info-list div {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.trial-info-list dt {
  color: var(--muted);
  font-weight: 700;
}

.trial-info-list dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.trial-info-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.trial-note {
  margin-top: 18px;
}

.lesson-result-panel {
  width: min(760px, 100%);
  padding: 30px;
}

.lesson-summary dl {
  display: grid;
  margin: 0;
}

.lesson-summary div {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(0, 1fr);
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.lesson-summary div:first-child {
  padding-top: 0;
}

.lesson-summary dt {
  color: var(--muted);
}

.lesson-summary dd {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
}

.lesson-result-form {
  margin-top: 26px;
}

.lesson-duration-field {
  max-width: 260px;
  margin-bottom: 18px;
}

.lesson-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

.schedule-assignment-panel {
  padding: 0;
  overflow: hidden;
}

.student-schedule-layout {
  display: grid;
  grid-template-columns: minmax(240px, 330px) minmax(0, 1fr);
  gap: 44px;
  padding: 30px;
}

.student-schedule-sidebar {
  display: grid;
  align-content: start;
  gap: 22px;
}

.student-schedule-card {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 96px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.student-schedule-card strong,
.student-schedule-selected strong,
.student-schedule-grid h2 {
  color: var(--ink);
}

.student-schedule-hint {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: #eef4ff;
  color: var(--muted);
}

.student-schedule-hint strong {
  color: var(--blue);
}

.student-schedule-selected {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

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

.selected-slot-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-weight: 700;
}

.selected-slot-row strong {
  color: var(--ink);
}

.selected-slots-empty {
  color: var(--muted);
}

.student-schedule-total {
  margin-top: -22px;
  padding: 18px 22px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: #eaf9ee;
  color: var(--green);
  font-weight: 800;
}

.student-schedule-grid {
  min-width: 0;
}

.student-schedule-grid h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.schedule-assignment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding: 22px 30px;
  border-top: 1px solid var(--line);
}

.payment-lesson-note {
  margin-bottom: 22px;
}

.is-confirm-open {
  overflow: hidden;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal {
  position: fixed;
  z-index: 140;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(7, 23, 72, 0.42);
  cursor: pointer;
}

.confirm-dialog {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(7, 23, 72, 0.18);
  padding: 26px;
}

.confirm-dialog h2 {
  margin-bottom: 10px;
}

.confirm-dialog p {
  color: var(--muted);
  line-height: 1.45;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.auth-page {
  background: #fff;
}

.auth-layout {
  display: grid;
  min-height: 68.6vh;
  grid-template-columns: 46.35% 53.65%;
}

.auth-promo {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #e5f0fd;
  padding: 26px 32px 40px;
}

.auth-logo {
  display: inline-flex;
  align-self: flex-start;
}

.auth-logo img {
  display: block;
  width: 208px;
  max-width: 100%;
  height: auto;
}

.promo-content {
  width: min(100%, 560px);
  margin: 25px auto 0;
}

.promo-content h1 {
  max-width: 430px;
  margin-bottom: 14px;
  color: var(--navy);
  font-size: 30px;
  line-height: 1.18;
}

.promo-content p {
  max-width: 430px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.42;
}

.auth-illustration {
  display: block;
  width: min(80%, 550px);
  height: auto;
  margin: 8px auto 0;
}

.promo-list {
  display: grid;
  max-width: 430px;
  gap: 16px;
  margin: 4px 0 0 16px;
  padding: 0;
  color: var(--navy);
  list-style: none;
}

.promo-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  color: var(--navy);
  line-height: 1.35;
}

.promo-list-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 10px;
}

.promo-list-icon img {
  width: 100%;
  height: 100%;
}

.auth-form-panel {
  display: grid;
  place-items: center;
  background: #fff;
  padding: 44px;
}

.login-form {
  width: min(408px, 100%);
  margin-top: -48px;
}

.login-form h2 {
  margin-bottom: 14px;
  color: #050505;
  font-size: 30px;
  line-height: 1.15;
}

.login-form p {
  margin-bottom: 46px;
  color: var(--muted);
  font-size: 16px;
}

.auth-field {
  margin-bottom: 26px;
}

.auth-field label {
  color: #050505;
  font-size: 14px;
}

.input-with-icon {
  position: relative;
}

.input-with-icon img {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-with-icon .form-control {
  height: 48px;
  padding-left: 48px;
}

.login-form .btn-success {
  min-height: 50px;
  margin-top: 10px;
  background: #11b85d;
}

.auth-footer {
  display: block;
  min-height: 320px;
  color: #c7d5ef;
  background: #061b3c;
  padding: 40px 6.6vw 28px;
}

.auth-footer h3,
.footer-brand {
  color: #fff;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.2fr 1.1fr;
  gap: 52px;
}

.footer-main > div {
  display: grid;
  align-content: start;
  gap: 12px;
}

.auth-footer p,
.auth-footer a:not(.footer-brand) {
  margin: 0;
  color: #c7d5ef;
  line-height: 1.45;
}

.auth-footer a:not(.footer-brand):hover {
  color: #fff;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
}

.footer-brand img {
  display: block;
  width: 166px;
  height: auto;
}

.footer-bottom {
  margin-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #aebcda;
  padding-top: 24px;
}

.public-page {
  background: #f7faff;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 24px 9vw;
}

.public-logo {
  display: inline-flex;
  width: 250px;
  max-width: 70vw;
  align-items: center;
}

.public-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.public-main {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.public-hero {
  margin-bottom: 28px;
}

.public-kicker {
  margin-bottom: 10px;
  color: var(--blue);
  font-weight: 800;
  text-transform: uppercase;
}

.public-hero h1 {
  max-width: 760px;
  margin-bottom: 14px;
}

.public-hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.public-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 34px;
}

.doc-section + .doc-section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.doc-intro {
  display: grid;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.doc-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.doc-section h2 {
  margin-bottom: 16px;
}

.doc-section p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.doc-section a,
.doc-intro a,
.requisites-list a {
  color: var(--ink);
  font-weight: 700;
}

.doc-section ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.6;
}

.requisites-list {
  display: grid;
  margin: 0;
}

.requisites-list div {
  display: grid;
  grid-template-columns: minmax(180px, 0.4fr) minmax(0, 1fr);
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.requisites-list div:first-child {
  padding-top: 0;
}

.requisites-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.requisites-list dt {
  color: var(--muted);
}

.requisites-list dd {
  margin: 0;
  font-weight: 750;
}

.payment-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  padding: 28px;
}

.payment-card {
  width: min(520px, 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 28px;
}

.payment-brand {
  display: inline-flex;
  width: 230px;
  max-width: 100%;
  align-items: center;
}

.payment-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.payment-summary {
  margin: 30px 0 22px;
  text-align: center;
}

.payment-summary h1 {
  margin: 12px 0;
}

.payment-summary p {
  color: var(--muted);
}

.payment-details {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
}

.payment-details div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.payment-details dt {
  color: var(--muted);
}

.payment-details dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .brand {
    font-size: 24px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

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

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .telegram-compose-row.is-text-focused {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .telegram-compose-row.is-text-focused .telegram-record-button {
    display: none;
  }

  .telegram-chat-layout {
    grid-template-columns: 1fr;
  }

  .telegram-dialog-sidebar {
    order: -1;
  }

  .telegram-message-bubble {
    max-width: 92%;
  }

  .mobile-app-header {
    position: sticky;
    z-index: 70;
    top: 0;
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    padding: 14px 18px;
  }

  .mobile-app-logo {
    display: inline-flex;
    width: min(150px, calc(100vw - 96px));
    align-items: center;
  }

  .mobile-app-logo img {
    display: block;
    width: 100%;
    height: auto;
  }

  .mobile-menu-toggle {
    display: inline-grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    padding: 0;
    line-height: 0;
    appearance: none;
    -webkit-appearance: none;
  }

  .mobile-menu-toggle img {
    display: block;
    width: 24px;
    height: 24px;
  }

  .sidebar {
    position: fixed;
    z-index: 90;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(420px, calc(100vw - 48px));
    height: 100dvh;
    gap: 34px;
    overflow-y: auto;
    padding: 26px 16px 28px;
    box-shadow: 16px 0 40px rgba(7, 23, 72, 0.12);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar:hover,
  .sidebar:focus-within {
    width: min(420px, calc(100vw - 48px));
    box-shadow: 16px 0 40px rgba(7, 23, 72, 0.12);
  }

  .is-menu-open .sidebar {
    transform: translateX(0);
  }

  .is-menu-open {
    overflow: hidden;
  }

  .mobile-menu-overlay {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(7, 23, 72, 0.36);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .is-menu-open .mobile-menu-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar .app-logo {
    width: min(150px, calc(100% - 62px));
    height: auto;
    justify-content: flex-start;
  }

  .sidebar .app-logo-short {
    display: none;
  }

  .sidebar .app-logo-full {
    position: static;
    width: 100%;
    opacity: 1;
  }

  .mobile-menu-close {
    position: relative;
    display: inline-grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
  }

  .mobile-menu-close::before,
  .mobile-menu-close::after {
    position: absolute;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--navy);
    content: "";
  }

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

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

  .side-nav {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .side-link,
  .logout-link {
    min-height: 64px;
    padding: 0 18px;
    font-size: 18px;
  }

  .side-label,
  .sidebar:hover .side-label,
  .sidebar:focus-within .side-label {
    width: auto;
    opacity: 1;
  }

  .logout-link {
    margin-top: auto;
    padding-top: 22px;
  }

  .topbar {
    justify-content: space-between;
    padding: 14px 18px;
  }

  .top-balance {
    min-width: 0;
  }

  .profile-chip span:last-child {
    display: none;
  }

  .content {
    padding: 24px 18px 40px;
  }

  .page-heading,
  .panel-header,
  .panel-footer,
  .copy-row,
  .form-actions,
  .heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-filters label {
    min-width: 0;
  }

  .copy-row,
  .form-grid.two,
  .form-grid.four,
  .split-grid,
  .auth-layout,
  .footer-main {
    grid-template-columns: 1fr;
  }

  .avatar-upload-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .avatar-upload-label {
    padding-top: 0;
  }

  .auth-layout {
    min-height: auto;
  }

  .auth-promo,
  .auth-form-panel {
    padding: 28px 20px;
  }

  .login-form {
    margin-top: 0;
  }

  .public-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

  .public-main {
    width: calc(100% - 32px);
    padding: 34px 0 48px;
  }

  .public-card {
    padding: 24px 20px;
  }

  .lesson-summary div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .lesson-result-panel {
    padding: 20px;
  }

  .lesson-result-actions .btn {
    width: 100%;
  }

  .student-schedule-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 20px;
  }

  .student-schedule-total {
    margin-top: -22px;
  }

  .schedule-assignment-actions {
    align-items: stretch;
    flex-direction: column;
    padding: 18px 20px;
  }

  .schedule-assignment-actions .btn {
    width: 100%;
  }

  .schedule-picker-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 18px 20px;
  }

  .schedule-picker-footer .btn {
    width: 100%;
  }

  .schedule-section-heading,
  .compact-toolbar,
  .telegram-dialog-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .telegram-dialog-toolbar-actions {
    justify-content: stretch;
  }

  .telegram-dialog-toolbar-actions .btn {
    flex: 1 1 auto;
  }

  .telegram-hub-settings-table {
    min-width: 680px;
  }

  .schedule-form-message {
    margin: 0 20px 14px;
  }

  .requisites-list div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .promo-content {
    margin-top: 44px;
  }

  .auth-illustration {
    width: min(100%, 480px);
  }

  .sidebar .side-link, .sidebar .logout-link {
    gap: 16px;
  }
}

@media (max-width: 520px) {
  .brand {
    font-size: 21px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    font-size: 28px;
  }

  h1 {
    font-size: 28px;
  }

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

  .side-nav {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .panel-footer,
  .payment-form,
  .entity-form,
  .result-panel {
    padding: 20px;
  }

  .auth-footer {
    padding: 34px 20px;
  }

  .auth-logo img {
    width: 220px;
  }

  .promo-list {
    margin-left: 0;
  }
}
