@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-soft: #f8fbff;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --text: #0b1324;
  --muted: #5c6885;
  --line: #d9e6fb;
  --line-strong: #b9cdf1;
  --primary: #0b1324;
  --primary-hover: #202c45;
  --blue: #3b82f6;
  --success: #16a34a;
  --success-soft: #ecfdf3;
  --danger: #dc2626;
  --danger-soft: #fff1f2;
  --shadow: 0 18px 42px rgba(11, 19, 36, 0.08);
  --shadow-soft: 0 10px 28px rgba(34, 48, 79, 0.08);
  --radius: 20px;
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }

.initial-loader {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 600;
}

/* Авторизация использует дизайн-код текущего приложения WowLife. */
.auth-screen {
  min-height: 100vh;
  width: 100%;
}

.auth-screen-wakesurf {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(520px, 1fr);
  background: #f6f7fb;
}

.auth-brand-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px;
  background:
    radial-gradient(700px 460px at 20% 10%, rgba(34, 197, 94, 0.16), transparent 55%),
    radial-gradient(600px 420px at 90% 90%, rgba(59, 130, 246, 0.15), transparent 58%),
    #f8fbff;
  border-right: 1px solid var(--line);
}

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

.auth-brand-content > img {
  width: min(72%, 320px);
  height: auto;
  margin-bottom: 72px;
}

.brand-caption {
  display: grid;
  gap: 14px;
}

.step-kicker,
.eyebrow,
.card-kicker {
  color: var(--blue);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-caption strong {
  max-width: 430px;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.brand-caption p {
  max-width: 460px;
  margin: 0;
  color: #44506a;
  font-size: 17px;
  line-height: 1.65;
}

.auth-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px 28px;
  overflow-y: auto;
}

.auth-panel-inner {
  width: min(100%, 560px);
}

.auth-mobile-logo {
  display: none;
  width: 170px;
  height: auto;
  margin: 0 0 34px;
}

.auth-heading { margin-bottom: 28px; }
.auth-heading h1 {
  margin: 12px 0 0;
  color: var(--text);
  font-size: clamp(30px, 3.5vw, 40px);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.035em;
}
.auth-heading p {
  margin: 9px 0 0;
  color: #44506a;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
}

.step-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.step-label span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
}

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

.registration-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eefb;
}
.registration-progress-value {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #3b82f6);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.name-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.form-field {
  display: grid;
  gap: 7px;
  color: #44506a;
  font-weight: 500;
  font-size: 13px;
}
.field-label { font-weight: 650; }
.form-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  font-size: 15px;
  font-weight: 500;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.form-field input::placeholder { color: #94a3b8; }
.form-field input:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}
.form-field.has-error input {
  border-color: #f87171;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}
.field-helper {
  color: #7b879f;
  font-size: 11px;
  line-height: 1.4;
}
.field-error {
  min-height: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.35;
}
.field-error:empty { display: none; }

.password-control {
  position: relative;
  display: block;
}
.password-control input { padding-right: 48px; }
.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}
.password-toggle:hover,
.password-toggle:focus-visible { background: #eef4ff; color: var(--text); }
.password-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.consent-control {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 11px;
  align-items: start;
  color: #44506a;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}
.consent-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.custom-checkbox {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  display: grid;
  place-items: center;
  transition: .16s ease;
}
.consent-control input:checked + .custom-checkbox {
  background: var(--primary);
  border-color: var(--primary);
}
.consent-control input:checked + .custom-checkbox::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}
.consent-control input:focus-visible + .custom-checkbox { box-shadow: 0 0 0 3px rgba(59, 130, 246, .22); }
.consent-control.has-error .custom-checkbox { border-color: #f87171; }
.consent-error { margin-top: -12px; }

.primary-button,
.secondary-button {
  min-height: 46px;
  border-radius: 13px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 750;
  transition: background-color .16s ease, transform .16s ease, opacity .16s ease;
}
.primary-button {
  position: relative;
  width: 100%;
  border: 0;
  color: #fff;
  background: var(--primary);
}
.primary-button:hover:not(:disabled) { background: var(--primary-hover); }
.primary-button:active:not(:disabled) { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: .72; }
.button-loader {
  display: none;
  width: 18px;
  height: 18px;
  margin: auto;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
.primary-button.is-loading .button-label { display: none; }
.primary-button.is-loading .button-loader { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-switch {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.auth-switch a { color: var(--text); font-weight: 750; text-underline-offset: 3px; }
.notice {
  border-radius: 13px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
}
.notice.error { color: #991b1b; background: var(--danger-soft); border: 1px solid #fecdd3; }

/* Экран завершённого шага использует карточки и навигацию текущего приложения. */
.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: rgba(255,255,255,.9);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display: block; padding: 8px 10px; margin-bottom: 40px; }
.brand img { width: 144px; height: auto; }
.onboarding-nav { display: grid; gap: 8px; }
.onboarding-nav a { text-decoration: none; }
.nav-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  color: #6c7892;
}
.nav-step > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf2fa;
  font-size: 13px;
  font-weight: 800;
}
.nav-step div { display: grid; gap: 2px; }
.nav-step strong { font-size: 13px; }
.nav-step small { font-size: 11px; }
.nav-step.active { color: var(--text); background: #eef4ff; }
.nav-step.active > span { color: #fff; background: var(--success); }
.nav-step.locked { opacity: .68; }
.workspace { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 30px;
  background: rgba(255,255,255,.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.topbar-logo { display: none; width: 116px; }
.mobile-navigation-toggle,
.mobile-navigation-close,
.mobile-navigation-overlay { display: none; }
.mobile-navigation-toggle,
.mobile-navigation-close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
}
.mobile-navigation-toggle:hover,
.mobile-navigation-close:hover { background: #f8fbff; }
.mobile-navigation-toggle:focus-visible,
.mobile-navigation-close:focus-visible {
  outline: 3px solid rgba(59, 130, 246, .22);
  outline-offset: 2px;
}
.mobile-navigation-toggle img { width: 24px; height: 24px; }
.mobile-navigation-close {
  position: absolute;
  top: 20px;
  right: 18px;
  z-index: 1;
}
.mobile-navigation-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.topbar-title { display: grid; gap: 1px; }
.topbar-title strong { font-size: 15px; }
.topbar-title span { color: var(--muted); font-size: 12px; }
.logout-button {
  margin-left: auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.logout-button:hover { background: #f8fbff; }
.logout-button img { width: 18px; height: 18px; }
.content {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 38px 30px 70px;
}
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.page-heading h1 {
  margin: 7px 0 8px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}
.page-heading p { margin: 0; max-width: 690px; color: var(--muted); line-height: 1.55; }
.status-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}
.status-badge.success { color: #166534; background: var(--success-soft); }
.status-badge span { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.success-card,
.info-card,
.security-note {
  border: 1px solid rgba(217,230,251,.9);
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.success-card {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
  align-items: center;
  padding: 24px;
  border-radius: 20px;
  margin-bottom: 22px;
}
.success-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: var(--success);
}
.success-icon svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.success-card h2, .info-card h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.success-card p, .info-card > p { margin: 6px 0 0; color: var(--muted); line-height: 1.55; }
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 22px;
}
.info-card { padding: 25px; border-radius: 20px; }
.card-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.card-heading > div { display: grid; gap: 7px; }
.step-number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--muted);
  background: #eef4ff;
  font-weight: 800;
}
.details-list { margin: 0; display: grid; }
.details-list > div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 14px 0;
  border-top: 1px solid #e8eef8;
}
.details-list dt { color: var(--muted); font-size: 13px; }
.details-list dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 650; }
.inline-status { color: #166534; }
.next-step-card { display: flex; flex-direction: column; }
.next-step-card .secondary-button { margin-top: auto; }
.secondary-button {
  width: 100%;
  margin-top: 24px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #f8fbff;
  cursor: not-allowed;
}
.security-note {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  margin-top: 22px;
}
.security-note svg { width: 26px; height: 26px; fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.security-note strong { font-size: 14px; }
.security-note p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

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

@media (max-width: 980px) {
  .auth-screen-wakesurf { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-mobile-logo { display: block; }
  .auth-panel { padding: 48px 22px; align-items: flex-start; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: block;
    width: min(86vw, 320px);
    height: 100dvh;
    overflow-y: auto;
    padding-top: 24px;
    box-shadow: 18px 0 46px rgba(11, 19, 36, .16);
    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, visibility 0s linear .22s;
  }
  .admin-sidebar { display: flex; }
  .mobile-navigation-open { overflow: hidden; }
  .mobile-navigation-open .sidebar {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform .22s ease;
  }
  .mobile-navigation-toggle,
  .mobile-navigation-close { display: grid; }
  .mobile-navigation-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(11, 19, 36, .42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility 0s linear .22s;
  }
  .mobile-navigation-open .mobile-navigation-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .22s ease;
  }
  .sidebar .brand {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding-right: 58px;
  }
  .topbar-logo { display: block; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .auth-panel { padding: 34px 18px 46px; }
  .auth-mobile-logo { width: 144px; margin-bottom: 30px; }
  .auth-heading h1 { font-size: 30px; }
  .auth-heading p { font-size: 14px; }
  .form-grid, .name-grid { grid-template-columns: 1fr; gap: 18px; }
  .form-field input { min-height: 48px; font-size: 16px; }
  .primary-button { min-height: 48px; }
  .topbar { padding: 0 17px; }
  .topbar-title { display: none; }
  .logout-button { width: 42px; padding: 0; justify-content: center; }
  .logout-button span { display: none; }
  .content { padding: 28px 17px 50px; }
  .page-heading { display: grid; }
  .status-badge { justify-self: start; }
  .success-card { grid-template-columns: 44px 1fr; padding: 20px; }
  .success-icon { width: 44px; height: 44px; border-radius: 14px; }
  .info-card { padding: 21px; }
  .details-list > div { grid-template-columns: 1fr; gap: 5px; }
}


/* Шаг 2: сведения о компании. */
.required-mark {
  margin-left: 3px;
  color: var(--danger);
}

.status-badge.neutral {
  color: #475569;
  background: #eef2f7;
}

.mobile-step-progress {
  display: none;
  margin-bottom: 24px;
}
.mobile-step-progress > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}
.mobile-step-progress > div strong { color: var(--text); }
.mobile-step-progress-track {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eefb;
}
.mobile-step-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #3b82f6);
}

.card-action {
  width: 100%;
  margin-top: auto;
}

.company-form {
  display: grid;
  gap: 22px;
}
.company-form > .notice {
  position: sticky;
  top: 82px;
  z-index: 4;
  box-shadow: var(--shadow-soft);
}
.notice.success {
  color: #166534;
  background: var(--success-soft);
  border: 1px solid #bbf7d0;
}
.notice.warning {
  color: #854d0e;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.company-form-card {
  padding: 28px;
}
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e8eef8;
}
.section-heading > div { display: grid; gap: 7px; }
.section-heading h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.025em;
}
.section-heading > p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.company-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.company-fields .full-width { grid-column: 1 / -1; }
.business-form-slot { min-width: 0; }
.form-field textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.form-field textarea::placeholder { color: #94a3b8; }
.form-field textarea:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}
.form-field.has-error textarea,
.business-form-field.has-error .business-form-options {
  border-color: #f87171;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.logo-field {
  display: grid;
  gap: 8px;
}
.logo-upload-panel {
  min-height: 142px;
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface-soft);
}
.logo-field.has-error .logo-upload-panel {
  border-color: #f87171;
  background: #fffafa;
}
.logo-preview {
  width: 116px;
  height: 104px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #94a3b8;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}
.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.logo-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}
.logo-upload-actions p {
  flex-basis: 100%;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.selected-file-name {
  flex-basis: 100%;
  color: #44506a;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.outline-button,
.text-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}
.outline-button {
  padding: 0 16px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: #fff;
}
.outline-button:hover { background: #f8fbff; }
.text-button {
  padding: 0 8px;
  color: var(--danger);
  border: 0;
  background: transparent;
}
.text-button:hover { background: var(--danger-soft); }

.business-form-field {
  min-width: 0;
  height: 100%;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.business-form-field legend {
  padding: 0;
  color: #44506a;
  font-size: 13px;
  font-weight: 650;
}
.business-form-options {
  min-height: 78px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.business-form-options label {
  position: relative;
  min-width: 0;
  display: block;
  cursor: pointer;
}
.business-form-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.business-form-options span {
  height: 100%;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.business-form-options strong { color: var(--text); font-size: 13px; }
.business-form-options small { font-size: 10px; line-height: 1.35; }
.business-form-options input:checked + span {
  color: #1e40af;
  background: #eef4ff;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.business-form-options input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .22);
}

.company-form-actions {
  display: grid;
  grid-template-columns: auto minmax(280px, 420px);
  justify-content: end;
  gap: 12px;
  align-items: center;
}
.company-form-actions .back-button { min-width: 110px; }
.company-form-actions .save-company-button { width: 100%; }

.company-legal-footnote {
  margin-top: 20px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.company-legal-footnote > span {
  color: var(--text);
  font-weight: 700;
}

.form-skeleton { display: grid; gap: 18px; }
.form-skeleton span {
  height: 54px;
  border-radius: 13px;
  background: linear-gradient(90deg, #edf2f8 25%, #f8fbff 45%, #edf2f8 65%);
  background-size: 220% 100%;
  animation: skeleton 1.2s linear infinite;
}
.form-skeleton span:first-child { width: 60%; }
.form-skeleton span:nth-child(3) { width: 75%; }
@keyframes skeleton { to { background-position: -220% 0; } }

.requisites-placeholder {
  min-height: 280px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 22px;
  align-items: start;
  padding: 32px;
}
.placeholder-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--blue);
  background: #eef4ff;
}
.placeholder-icon svg {
  width: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.requisites-placeholder h2 { margin: 8px 0 6px; font-size: 24px; }
.requisites-placeholder p { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.6; }
.inline-button { margin-top: 22px; }

@media (max-width: 980px) {
  .mobile-step-progress { display: block; }
  .company-form > .notice { top: 78px; }
}

@media (max-width: 760px) {
  .section-heading { display: grid; gap: 10px; }
  .company-fields { grid-template-columns: 1fr; }
  .company-fields .full-width { grid-column: auto; }
  .company-form-actions {
    grid-template-columns: 1fr;
  }
  .company-form-actions .save-company-button { grid-row: 1; }
  .company-form-actions .back-button { grid-row: 2; }
}

@media (max-width: 620px) {
  .company-form-card { padding: 20px; }
  .logo-upload-panel { grid-template-columns: 1fr; }
  .logo-preview { width: 100%; height: 150px; }
  .business-form-options { grid-template-columns: 1fr; }
  .requisites-placeholder { grid-template-columns: 1fr; padding: 22px; }
}

.nav-step.active:not(.completed) > span {
  background: var(--blue);
}

/* Повторяемые контакты и расширенная информация о компании. */
.repeatable-field {
  display: grid;
  gap: 10px;
}
.repeatable-field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.repeatable-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.repeatable-rows {
  display: grid;
  gap: 10px;
}
.repeatable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px) 44px;
  gap: 10px;
  align-items: start;
}
.social-repeatable-row {
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr) 44px;
}
.city-repeatable-row {
  grid-template-columns: minmax(0, 1fr) 44px;
}
.repeatable-control {
  min-width: 0;
  display: block;
}
.repeatable-control input,
.repeatable-control select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.repeatable-control select {
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 20px,
    calc(100% - 12px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.repeatable-control input::placeholder { color: #94a3b8; }
.repeatable-control input:focus,
.repeatable-control select:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}
.repeatable-field.has-error .repeatable-control input,
.repeatable-field.has-error .repeatable-control select {
  border-color: #f87171;
  background-color: #fffafa;
}
.remove-row-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #64748b;
  background: transparent;
}
.remove-row-button:hover,
.remove-row-button:focus-visible {
  color: var(--danger);
  border-color: #fecdd3;
  background: var(--danger-soft);
}
.remove-row-button svg,
.add-row-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.add-row-button {
  width: fit-content;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  color: #1d4ed8;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}
.add-row-button:hover,
.add-row-button:focus-visible { background: #eef4ff; }
.add-row-button:disabled { color: #94a3b8; cursor: not-allowed; background: transparent; }
.social-other-control {
  grid-column: 1 / -2;
}
.form-field textarea.large-textarea { min-height: 170px; }
.form-field textarea.service-textarea { min-height: 220px; }

@media (max-width: 760px) {
  .repeatable-row,
  .social-repeatable-row,
  .city-repeatable-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }
  .repeatable-row .repeatable-value-control,
  .repeatable-row .repeatable-type-control,
  .repeatable-row .social-type-control,
  .repeatable-row .social-other-control {
    grid-column: 1;
  }
  .repeatable-row .remove-row-button {
    grid-column: 2;
    grid-row: 1 / span 3;
  }
}

@media (max-width: 620px) {
  .repeatable-control input,
  .repeatable-control select { min-height: 48px; font-size: 16px; }
  .add-row-button { width: 100%; justify-content: center; border: 1px dashed var(--line-strong); }
}

/* Реквизиты партнёра и банковские счета. */
.form-field select {
  width: 100%;
  min-height: 46px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 42px 0 14px;
  color: var(--text);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 20px,
    calc(100% - 12px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.form-field select:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}
.form-field.has-error select {
  border-color: #f87171;
  background-color: #fffafa;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}
.form-field input[readonly] {
  color: #475569;
  background: #f3f6fb;
  cursor: default;
}
.requisites-section-heading {
  align-items: center;
}
.business-form-summary {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #1e3a8a;
  background: #eef4ff;
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.requisites-fields {
  align-items: start;
}
.requisites-fields > .form-field {
  align-self: start;
}
.requisites-fields .form-field input[type="date"] {
  color-scheme: light;
}
.bank-accounts-list {
  display: grid;
  gap: 22px;
}
.bank-account-card {
  padding: 28px;
}
.bank-account-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e8eef8;
}
.bank-account-heading > div {
  display: grid;
  gap: 7px;
}
.bank-account-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
.bank-account-fields textarea {
  min-height: 104px;
}
.add-bank-account-button {
  margin-top: 14px;
}
.bank-accounts-error {
  display: block;
  margin-top: 8px;
}
.placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.placeholder-actions .inline-button {
  margin-top: 0;
}

@media (max-width: 760px) {
  .requisites-section-heading,
  .bank-account-heading {
    display: grid;
  }
  .business-form-summary {
    width: fit-content;
  }
}

@media (max-width: 620px) {
  .bank-account-card { padding: 20px; }
  .form-field select { min-height: 48px; font-size: 16px; }
  .placeholder-actions { display: grid; }
  .placeholder-actions .inline-button { width: 100%; }
}
.bank-lookup-field {
  display: grid;
  gap: 7px;
  color: #44506a;
  font-size: 13px;
  font-weight: 500;
}
.bank-lookup-control {
  position: relative;
}
.bank-lookup-control input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 52px 0 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  font-size: 15px;
  font-weight: 500;
}
.bank-lookup-control input:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}
.bank-lookup-control button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}
.bank-lookup-control button:hover,
.bank-lookup-control button:focus-visible {
  color: var(--text);
  background: #eef4ff;
}
.bank-lookup-control svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Подтверждённая компания: пользовательские данные доступны только для просмотра. */
.primary-button:is(a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.company-form.is-readonly input[readonly],
.company-form.is-readonly textarea[readonly],
.company-form.is-readonly select:disabled,
.company-form.is-readonly .repeatable-control input[readonly],
.company-form.is-readonly .repeatable-control select:disabled,
.company-form.is-readonly .bank-lookup-control input[readonly] {
  color: #334155;
  background-color: #f3f6fb;
  border-color: #d7e0ec;
  box-shadow: none;
  cursor: default;
  opacity: 1;
  -webkit-text-fill-color: #334155;
}
.company-form.is-readonly textarea[readonly] { resize: none; }
.company-form.is-readonly .business-form-options { background: #f3f6fb; }
.company-form.is-readonly .business-form-options label { cursor: default; }
.company-form.is-readonly .business-form-options input:disabled + span { opacity: 1; }
.company-form.is-readonly .add-row-button,
.company-form.is-readonly .remove-row-button,
.company-form.is-readonly .remove-bank-account,
.company-form.is-readonly .add-bank-account-button,
.company-form.is-readonly .bank-lookup-field { display: none !important; }
.company-form.is-readonly .repeatable-row {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
}
.company-form.is-readonly .social-repeatable-row {
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
}
.company-form.is-readonly .city-repeatable-row {
  grid-template-columns: minmax(0, 1fr);
}
.company-form.is-readonly .social-other-control { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .company-form.is-readonly .repeatable-row,
  .company-form.is-readonly .social-repeatable-row { grid-template-columns: 1fr; }
}

/* Панель администратора — тот же дизайн-код, отдельный административный контур. */
.is-admin-auth-page .brand-caption strong { max-width: 470px; }
.admin-auth-form { max-width: 520px; }
.admin-auth-back {
  margin: -4px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.admin-auth-back a { text-underline-offset: 3px; }

.admin-sidebar {
  display: flex;
  flex-direction: column;
}
.admin-navigation {
  display: grid;
  gap: 8px;
  margin-top: 44px;
}
.admin-navigation-link {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 13px;
  color: #526079;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: color .16s ease, background-color .16s ease;
}
.admin-navigation-link svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.admin-navigation-link:hover,
.admin-navigation-link:focus-visible,
.admin-navigation-link.active {
  color: #1e3a8a;
  background: #eef4ff;
}
.admin-sidebar-user {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}
.admin-sidebar-user span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.admin-sidebar-user strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.admin-content { width: min(100%, 1500px); }
.admin-page-heading { align-items: flex-end; }
.admin-record-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.admin-stat-card {
  min-height: 124px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.admin-stat-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.admin-stat-card strong {
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.admin-stat-card small {
  color: #7b879f;
  font-size: 11px;
}
.admin-list-card { padding: 0; overflow: hidden; }
.admin-company-filters {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(190px, 260px) auto;
  gap: 12px;
  align-items: end;
  padding: 24px;
  border-bottom: 1px solid #e8eef8;
  background: #fbfdff;
}
.admin-filter-actions {
  display: flex;
  gap: 8px;
}
.admin-company-filters .primary-button,
.admin-company-filters .outline-button {
  min-height: 46px;
  width: auto;
  padding-inline: 18px;
}
.admin-list-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 24px 18px;
}
.admin-list-heading h2 { margin: 5px 0 0; font-size: 22px; }
.admin-list-heading > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.admin-table-wrapper { width: 100%; overflow-x: auto; }
.admin-companies-table-wrapper { overflow-x: hidden; }
.admin-companies-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
}
.admin-companies-table th,
.admin-companies-table td {
  padding: 14px 10px;
  border-top: 1px solid #e8eef8;
  vertical-align: middle;
}
.admin-companies-table th {
  color: var(--muted);
  background: #fbfdff;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.admin-companies-table td {
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.admin-companies-table tbody tr:hover { background: #fbfdff; }
.admin-companies-table th:nth-child(1) { width: 18%; }
.admin-companies-table th:nth-child(2) { width: 9%; }
.admin-companies-table th:nth-child(3) { width: 7%; }
.admin-companies-table th:nth-child(4) { width: 10%; }
.admin-companies-table th:nth-child(5) { width: 10%; }
.admin-companies-table th:nth-child(6) { width: 7%; }
.admin-companies-table th:nth-child(7) { width: 6%; }
.admin-companies-table th:nth-child(8) { width: 11%; }
.admin-companies-table th:nth-child(9) { width: 10%; }
.admin-companies-table th:nth-child(10) { width: 12%; }
.admin-companies-table td:first-child { min-width: 0; }
.admin-companies-table td:first-child small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.admin-company-link {
  color: #1d4ed8;
  font-weight: 750;
  text-decoration: none;
}
.admin-company-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.tabular-value { font-variant-numeric: tabular-nums; }
.admin-table-action {
  width: auto;
  min-height: 38px;
  padding: 0 10px;
  font-size: 11px;
}
.admin-company-mobile-list { display: none; }
.admin-empty-state {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 58px 24px;
  color: var(--muted);
  text-align: center;
}
.admin-empty-state strong { color: var(--text); }
.admin-empty-state p { margin: 0; font-size: 13px; }
.admin-empty-state.compact { padding: 24px; border: 1px dashed var(--line); border-radius: 14px; }
.admin-loading-card { padding: 28px; }
.admin-route-error { margin-top: 24px; }

.admin-back-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  color: #475569;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.admin-back-link:hover { color: #1d4ed8; }
.admin-back-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.admin-detail-page-heading { align-items: flex-end; }
.admin-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-detail-actions .primary-button { width: auto; min-width: 150px; }
.admin-flash-notice { margin-bottom: 18px; }
.admin-detail-layout { display: grid; gap: 18px; }
.admin-detail-section { padding: 28px; }
.admin-detail-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid #e8eef8;
}
.admin-detail-section-heading h2 { margin: 5px 0 0; font-size: 22px; }
.admin-details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 24px;
  margin: 0;
}
.admin-details-grid > div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
}
.admin-details-grid > .full-width { grid-column: 1 / -1; }
.admin-details-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.admin-details-grid dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.admin-empty-value { color: #94a3b8; font-weight: 500; }
.admin-company-overview {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.admin-company-logo,
.admin-logo-placeholder {
  width: 180px;
  min-height: 150px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #f8fbff;
}
.admin-company-logo img {
  width: 100%;
  height: 150px;
  display: block;
  object-fit: contain;
  background: #fff;
}
.admin-company-logo figcaption {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  overflow-wrap: anywhere;
}
.admin-logo-placeholder {
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.admin-contact-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.admin-contact-columns > div {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}
.admin-contact-columns h3 { margin: 0 0 12px; font-size: 14px; }
.admin-contact-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.admin-contact-list li { display: grid; gap: 3px; }
.admin-contact-list span { color: var(--muted); font-size: 10px; }
.admin-contact-list strong { font-size: 12px; overflow-wrap: anywhere; }
.admin-bank-list { display: grid; gap: 14px; }
.admin-bank-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
}
.admin-bank-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.admin-bank-card-heading span {
  padding: 5px 9px;
  border-radius: 999px;
  color: #1e3a8a;
  background: #eef4ff;
  font-size: 10px;
  font-weight: 750;
}
.admin-bank-card-heading strong { font-size: 14px; }
.admin-status-history {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.admin-status-history li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid #eef2f8;
}
.admin-status-history li:last-child { border-bottom: 0; }
.admin-status-history li > div { display: grid; gap: 3px; }
.admin-status-history strong { font-size: 12px; }
.admin-status-history small { color: var(--muted); font-size: 10px; }

@media (max-width: 1180px) {
  .admin-company-filters { grid-template-columns: minmax(240px, 1fr) minmax(180px, 220px); }
  .admin-filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .admin-details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .admin-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-sidebar-user { display: none; }
}

@media (max-width: 760px) {
  .admin-page-heading,
  .admin-detail-page-heading { display: grid; gap: 16px; }
  .admin-record-count { justify-self: start; }
  .admin-stat-grid { grid-template-columns: 1fr; }
  .admin-stat-card { min-height: 98px; }
  .admin-company-filters { grid-template-columns: 1fr; padding: 20px; }
  .admin-filter-actions { grid-column: auto; display: grid; grid-template-columns: 1fr 1fr; }
  .admin-company-filters .primary-button,
  .admin-company-filters .outline-button { width: 100%; }
  .admin-table-wrapper { display: none; }
  .admin-company-mobile-list { display: grid; gap: 12px; padding: 0 18px 20px; }
  .admin-company-mobile-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
  }
  .admin-company-mobile-heading { display: grid; gap: 12px; }
  .admin-company-mobile-heading > div { display: grid; gap: 3px; }
  .admin-company-mobile-heading strong { font-size: 15px; }
  .admin-company-mobile-heading > div > span { color: var(--muted); font-size: 11px; }
  .admin-company-mobile-heading .status-badge { width: fit-content; }
  .admin-company-mobile-card dl { display: grid; gap: 9px; margin: 0; }
  .admin-company-mobile-card dl > div { display: flex; justify-content: space-between; gap: 18px; }
  .admin-company-mobile-card dt { color: var(--muted); font-size: 10px; }
  .admin-company-mobile-card dd { margin: 0; text-align: right; font-size: 11px; font-weight: 650; }
  .admin-detail-actions { justify-content: flex-start; }
  .admin-details-grid { grid-template-columns: 1fr; }
  .admin-details-grid > .full-width { grid-column: auto; }
  .admin-company-overview { grid-template-columns: 1fr; }
  .admin-company-logo,
  .admin-logo-placeholder { width: 100%; }
  .admin-contact-columns { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .admin-list-heading { padding: 20px 18px 16px; }
  .admin-detail-section { padding: 20px; }
  .admin-detail-actions { display: grid; width: 100%; }
  .admin-detail-actions .primary-button { width: 100%; }
  .admin-filter-actions { grid-template-columns: 1fr; }
}

/* Application confirmation modal */
body.is-modal-open { overflow: hidden; }
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 180ms ease;
}
.app-modal-backdrop.is-visible { opacity: 1; }
.app-confirmation-modal {
  width: min(100%, 680px);
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  transform: translateY(14px) scale(0.985);
  transition: transform 180ms ease;
}
.app-modal-backdrop.is-visible .app-confirmation-modal { transform: translateY(0) scale(1); }
.app-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px 24px;
  border-bottom: 1px solid #dce7f6;
  background: linear-gradient(135deg, #f2fbf8 0%, #edf5ff 100%);
}
.app-modal-header h2 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
}
.app-modal-close {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid #cbdcf5;
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.app-modal-close:hover { border-color: #9db8e6; background: #fff; }
.app-modal-close:active { transform: translateY(1px); }
.app-modal-close:disabled { cursor: wait; opacity: 0.55; }
.app-modal-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.app-modal-body {
  overflow-y: auto;
  padding: 30px;
}
.app-modal-body > p { margin: 0; }
.app-modal-body #confirmCompanyDescription {
  color: var(--text);
  font-size: 20px;
  line-height: 1.55;
}
.app-modal-body #confirmCompanyDescription strong { font-weight: 800; }
.app-modal-supporting-text {
  margin-top: 12px !important;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.app-modal-body .notice { margin-top: 22px; }
.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 22px 30px 28px;
  border-top: 1px solid #e8eef8;
  background: #fff;
}
.app-modal-actions .outline-button,
.app-modal-actions .primary-button {
  width: auto;
  min-width: 148px;
}
.app-modal-actions button:focus-visible,
.app-modal-close:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .app-modal-backdrop,
  .app-confirmation-modal { transition: none; }
}

@media (max-width: 620px) {
  .app-modal-backdrop {
    align-items: end;
    padding: 12px;
  }
  .app-confirmation-modal {
    width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 24px;
  }
  .app-modal-header { padding: 22px 20px 18px; }
  .app-modal-close {
    width: 48px;
    min-width: 48px;
    padding: 0;
  }
  .app-modal-close span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .app-modal-body { padding: 24px 20px; }
  .app-modal-body #confirmCompanyDescription { font-size: 18px; }
  .app-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 18px 20px 20px;
  }
  .app-modal-actions .outline-button,
  .app-modal-actions .primary-button {
    width: 100%;
    min-width: 0;
  }
}

/* Admin contracts and event journal */
.admin-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-contract-download {
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #1d4ed8;
  background: #f8fbff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.admin-contract-download:hover,
.admin-contract-download:focus-visible {
  border-color: #93b4ed;
  color: #173ea5;
  background: #eef4ff;
  outline: none;
}
.admin-contract-download svg,
.admin-event-contract-link svg,
.admin-event-marker svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.admin-no-contract { color: #94a3b8; }
.admin-mobile-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-mobile-card-actions .outline-button { flex: 1; }
.admin-detail-status-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.admin-detail-status-group .admin-contract-download {
  width: 44px;
  padding: 0;
  border-radius: 14px;
}
.admin-generate-contract { width: auto; min-height: 46px; padding-inline: 18px; }
.admin-event-marker {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #64748b;
  background: #f1f5f9;
}
.admin-event-marker > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}
.admin-event-marker.contract_generated { color: #1d4ed8; background: #eef4ff; }
.admin-event-marker.company_confirmed { color: #15803d; background: #ecfdf3; }
.admin-event-type-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  color: #475569;
  background: #f1f5f9;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.admin-event-type-badge.contract_generated { color: #1d4ed8; background: #eef4ff; }
.admin-event-type-badge.company_confirmed { color: #15803d; background: #ecfdf3; }
.admin-event-contract-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}
.admin-event-contract-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.admin-events-table { min-width: 1120px; }
.admin-events-table td:first-child { min-width: 180px; }
.admin-events-table td:nth-child(2) { min-width: 230px; }
.admin-events-table td:nth-child(2) small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 1180px) {
  .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .admin-stat-grid { grid-template-columns: 1fr; }
  .admin-mobile-card-actions { align-items: stretch; }
  .admin-event-mobile-card .admin-event-contract-link {
    min-height: 44px;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fbff;
  }
}

@media (max-width: 620px) {
  .admin-detail-status-group { justify-content: space-between; width: 100%; }
  .admin-generate-contract { width: 100%; }
  .admin-mobile-card-actions { display: grid; grid-template-columns: 1fr; }
}

/* SMS contract signing */
.status-badge.signed {
  box-shadow: 0 0 0 3px rgba(35, 153, 103, 0.08);
}

.review-status-card {
  margin-bottom: 24px;
}

.review-signature-card {
  padding: 0;
  overflow: hidden;
}

.review-signature-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 30px;
}

.review-signature-panel h3 {
  margin: 6px 0 8px;
  font-size: 22px;
  color: var(--text);
}

.review-signature-panel p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.55;
}

.review-signature-panel.is-waiting {
  background: rgba(247, 249, 252, 0.72);
}

.review-signature-panel.is-signed {
  justify-content: flex-start;
  background: rgba(231, 249, 240, 0.6);
}

.review-signature-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 18px;
  color: #177b52;
  background: #dff5ea;
}

.review-signature-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.review-signature-error {
  margin: 20px 24px 0;
}

.signature-code-modal {
  max-width: 640px;
}

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

.signature-code-form > p strong {
  white-space: nowrap;
}

.signature-code-field input {
  min-height: 72px;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: 0.32em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.signature-expiry {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.signature-expiry.is-expired {
  color: var(--danger, #d92d20);
  font-weight: 700;
}

.signature-modal-actions {
  justify-content: space-between;
}

@media (max-width: 720px) {
  .review-signature-panel {
    align-items: stretch;
    flex-direction: column;
    padding: 22px;
  }

  .review-signature-panel .primary-button {
    width: 100%;
  }

  .review-signature-panel.is-signed {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .signature-code-field input {
    min-height: 64px;
    font-size: 26px;
  }

  .signature-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Partner contract on review */
.review-contract-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.review-contract-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  color: #2458b8;
  background: #edf4ff;
}

.review-contract-icon svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.review-contract-content h2 {
  margin: 5px 0 6px;
  font-size: 21px;
  color: var(--text);
}

.review-contract-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.review-contract-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 760px) {
  .review-contract-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .review-contract-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  .review-contract-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .review-contract-actions {
    grid-template-columns: 1fr;
  }
}

/* Bitrix24 company synchronization */
.admin-bitrix-sync-control {
  display: grid;
  gap: 6px;
  min-width: 144px;
}
.admin-bitrix-sync-button {
  width: auto;
  min-height: 42px;
  padding: 0 14px;
  white-space: nowrap;
  font-size: 12px;
}
.admin-bitrix-sync-button:disabled {
  cursor: not-allowed;
  opacity: .58;
}
.admin-bitrix-sync-state {
  display: grid;
  gap: 2px;
  min-width: 132px;
}
.admin-bitrix-sync-state strong {
  color: #15803d;
  font-size: 11px;
  font-weight: 800;
}
.admin-bitrix-sync-state small {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.admin-bitrix-sync-error {
  display: block;
  max-width: 190px;
  color: #b42318;
  font-size: 10px;
  line-height: 1.35;
}
.admin-event-type-badge.bitrix_company_synced { color: #15803d; background: #ecfdf3; }
.admin-event-type-badge.bitrix_sync_failed { color: #b42318; background: #fff1f0; }
.admin-event-marker.bitrix_company_synced { color: #15803d; background: #ecfdf3; }
.admin-event-marker.bitrix_sync_failed { color: #b42318; background: #fff1f0; }

@media (max-width: 760px) {
  .admin-mobile-card-actions .admin-bitrix-sync-control { width: 100%; }
  .admin-mobile-card-actions .admin-bitrix-sync-button { width: 100%; }
  .admin-mobile-card-actions .admin-bitrix-sync-state {
    min-height: 44px;
    align-content: center;
    padding: 8px 12px;
    border: 1px solid #b7e4c7;
    border-radius: 12px;
    background: #f3fbf6;
  }
  .admin-bitrix-sync-error { max-width: none; }
}

/* Company rejection and revision flow */
.status-badge.warning {
  color: #92400e;
  background: #fff7ed;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.admin-companies-table .admin-row-actions {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 7px;
  white-space: normal;
}
.admin-companies-table .admin-row-actions .admin-table-action {
  width: 100%;
  min-width: 0;
}
.admin-companies-table .admin-bitrix-sync-control,
.admin-companies-table .admin-bitrix-sync-button,
.admin-companies-table .admin-bitrix-sync-state {
  min-width: 0;
  max-width: 100%;
}
.admin-companies-table .admin-bitrix-sync-button {
  width: 100%;
  padding-inline: 8px;
  font-size: 10px;
}
.admin-companies-table .admin-bitrix-sync-state strong,
.admin-companies-table .admin-bitrix-sync-state small {
  overflow-wrap: anywhere;
}

.admin-reject-button {
  width: auto;
  color: #b42318;
  border-color: #f1b8b2;
  background: #fff;
}
.admin-reject-button:hover:not(:disabled) {
  color: #991b1b;
  border-color: #e38a80;
  background: #fff7f6;
}
.admin-reject-button:focus-visible,
.admin-reject-submit:focus-visible {
  outline: 3px solid rgba(220, 38, 38, 0.18);
  outline-offset: 3px;
}
.admin-reject-submit {
  background: #b42318;
}
.admin-reject-submit:hover:not(:disabled) {
  background: #8f1d15;
}

.admin-rejection-reason-field {
  margin-top: 22px;
}
.admin-rejection-reason-field textarea {
  min-height: 132px;
}
.admin-rejection-reason-field textarea.invalid {
  border-color: #f87171;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.app-modal-body #rejectCompanyDescription {
  color: var(--text);
  font-size: 20px;
  line-height: 1.55;
}
.app-modal-body #rejectCompanyDescription strong { font-weight: 800; }

.review-status-card.is-rejected {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fffdfa 0%, #fff 100%);
}
.review-status-card.is-rejected .placeholder-icon {
  color: #b45309;
  background: #fff7ed;
}
.review-rejection-reason {
  max-width: 760px;
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  background: #fff7ed;
}
.review-rejection-reason > span {
  color: #92400e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.review-rejection-reason p {
  max-width: none;
  color: #7c2d12;
  white-space: pre-wrap;
}
.review-rejection-reason small {
  color: #9a5b2d;
  font-size: 11px;
}
.review-rejection-actions .primary-button {
  width: auto;
}
.review-flash-notice {
  margin-bottom: 20px;
}
.admin-event-detail-text {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 620px) {
  .app-modal-body #rejectCompanyDescription { font-size: 18px; }
  .admin-row-actions { display: grid; gap: 8px; }
  .review-rejection-actions .primary-button { width: 100%; }
}

/* Admin commission and revision history */
.admin-commission-field {
  margin-top: 22px;
}
.admin-percent-input {
  position: relative;
  display: block;
}
.admin-percent-input input {
  width: 100%;
  padding-right: 52px;
  font-variant-numeric: tabular-nums;
}
.admin-percent-input > strong {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}
.admin-commission-field input.invalid {
  border-color: #f87171;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}
.admin-confirm-button.admin-table-action {
  min-width: 112px;
}
.admin-revision-history {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #dbe7f7;
  border-radius: 14px;
  background: #f8fbff;
}
.admin-revision-history > span {
  color: #34506f;
  font-size: 11px;
  font-weight: 800;
}
.admin-revision-history ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.admin-revision-history li {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid #e4edf8;
}
.admin-revision-history li:first-child {
  padding-top: 0;
  border-top: 0;
}
.admin-revision-history li > strong {
  color: var(--text);
  font-size: 11px;
  line-height: 1.4;
}
.admin-revision-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.admin-revision-values > span {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.admin-revision-values small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
@media (max-width: 620px) {
  .admin-revision-values { grid-template-columns: 1fr; }
  .admin-confirm-button { width: 100%; }
}

/* Mobile admin tables — variant B: stacked table rows */
@media (max-width: 1100px) {
  .admin-list-card .admin-company-mobile-list { display: none; }
  .admin-list-card .admin-table-wrapper {
    display: block;
    width: 100%;
    overflow: visible;
    padding: 0 18px 20px;
  }
  .admin-list-card .admin-companies-table,
  .admin-list-card .admin-events-table {
    width: 100%;
    min-width: 0;
    display: block;
  }
  .admin-list-card .admin-companies-table thead { display: none; }
  .admin-list-card .admin-companies-table tbody {
    display: grid;
    gap: 12px;
  }
  .admin-list-card .admin-companies-table tr {
    min-width: 0;
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
  }
  .admin-list-card .admin-companies-table tbody tr:hover { background: #fff; }
  .admin-list-card .admin-companies-table td,
  .admin-list-card .admin-events-table td,
  .admin-list-card .admin-companies-table td:first-child,
  .admin-list-card .admin-events-table td:first-child,
  .admin-list-card .admin-events-table td:nth-child(2) {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(96px, 0.8fr) minmax(0, 1.2fr);
    gap: 14px;
    align-items: center;
    padding: 11px 14px;
    border-top: 1px solid #eef2f8;
    font-size: 12px;
    overflow-wrap: anywhere;
  }
  .admin-list-card .admin-companies-table td:first-child { border-top: 0; }
  .admin-list-card .admin-companies-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
  }
  .admin-list-card .admin-companies-table td[data-label="Действия"] {
    grid-template-columns: minmax(96px, 0.8fr) minmax(0, 1.2fr);
    padding: 14px;
    background: #fbfdff;
  }
  .admin-list-card .admin-companies-table td > * { min-width: 0; }
  .admin-list-card .admin-companies-table td > :not(.admin-row-actions) { justify-self: end; text-align: right; }
  .admin-list-card .admin-companies-table td:first-child > :not(.admin-row-actions) { justify-self: stretch; text-align: left; }
  .admin-list-card .admin-companies-table td:first-child small { margin-top: 3px; }
  .admin-list-card .admin-row-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .admin-list-card .admin-row-actions > * { min-width: 0; width: 100%; }
  .admin-list-card .admin-bitrix-sync-control,
  .admin-list-card .admin-bitrix-sync-button { min-width: 0; max-width: 100%; }
}

@media (max-width: 520px) {
  .admin-list-card .admin-companies-table td,
  .admin-list-card .admin-events-table td,
  .admin-list-card .admin-companies-table td:first-child,
  .admin-list-card .admin-events-table td:first-child,
  .admin-list-card .admin-events-table td:nth-child(2) {
    grid-template-columns: minmax(82px, 0.7fr) minmax(0, 1.3fr);
    gap: 10px;
    padding-inline: 12px;
  }
  .admin-list-card .admin-row-actions { grid-template-columns: 1fr; }
}


/* Единое согласие на регистрационном экране и публичные страницы документов. */
.consent-copy a {
  color: #2563eb;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.consent-copy a:hover { color: #1d4ed8; }
.consent-copy a:focus-visible {
  border-radius: 4px;
  outline: 3px solid rgba(59, 130, 246, .22);
  outline-offset: 2px;
}

.is-legal-page {
  background:
    radial-gradient(780px 420px at 0% 0%, rgba(34, 197, 94, .09), transparent 60%),
    radial-gradient(720px 460px at 100% 0%, rgba(59, 130, 246, .10), transparent 62%),
    var(--bg);
}
.legal-screen { min-height: 100vh; }
.legal-header {
  width: calc(100% - 48px);
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.legal-brand-link {
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
}
.legal-brand-link img {
  display: block;
  width: 142px;
  height: auto;
}
.legal-brand-link:focus-visible,
.legal-back-link:focus-visible {
  outline: 3px solid rgba(59, 130, 246, .22);
  outline-offset: 3px;
}
.legal-back-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 12px;
  color: #44506a;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}
.legal-back-link:hover { background: rgba(255, 255, 255, .72); color: var(--text); }
.legal-back-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.legal-page-shell {
  width: calc(100% - 48px);
  margin: 0 auto;
  padding: 8px 0 72px;
}
.legal-document {
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}
.legal-document h1 {
  max-width: none;
  margin: 0 0 34px;
  color: var(--text);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -.035em;
}
.legal-document-body {
  color: #26324a;
  font-size: 15px;
  line-height: 1.72;
}
.legal-document-body h2 {
  margin: 32px 0 10px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: -.012em;
}
.legal-document-body p {
  margin: 0 0 14px;
  white-space: pre-wrap;
}
.legal-document-list-item {
  margin-bottom: 7px !important;
  padding-left: 2px;
}

@media (max-width: 640px) {
  .legal-header {
    width: calc(100% - 28px);
    min-height: 72px;
  }
  .legal-brand-link img { width: 118px; }
  .legal-back-link span { display: none; }
  .legal-back-link { width: 44px; justify-content: center; padding: 0; }
  .legal-page-shell {
    width: calc(100% - 28px);
    padding: 2px 0 36px;
  }
  .legal-document {
    padding: 24px 20px 30px;
    border-radius: 18px;
  }
  .legal-document h1 { margin-bottom: 26px; font-size: 28px; }
  .legal-document-body { font-size: 14px; line-height: 1.68; }
  .legal-document-body h2 { margin-top: 26px; font-size: 16px; }
}

/* Справочник городов России. */
.city-list-field {
  position: relative;
}
.city-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.city-selected:empty {
  display: none;
}
.city-selected-readonly:empty {
  display: flex;
}
.city-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 6px 4px 12px;
  border: 1px solid #cbd9ee;
  border-radius: 999px;
  color: #1e3a5f;
  background: #f6f9ff;
  font-size: 13px;
  font-weight: 700;
}
.city-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.city-chip-remove {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #64748b;
  background: transparent;
  cursor: pointer;
}
.city-chip-remove:hover,
.city-chip-remove:focus-visible {
  color: #1e293b;
  background: #e8eef8;
  outline: none;
}
.city-chip-remove svg {
  width: 17px;
  height: 17px;
}
.city-empty-value {
  color: var(--muted);
  font-size: 14px;
}
.city-picker {
  position: relative;
}
.city-picker-control {
  position: relative;
}
.city-picker-control input {
  width: 100%;
  min-height: 48px;
  padding: 0 46px 0 44px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: #fff;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.city-picker-control input::placeholder {
  color: #94a3b8;
}
.city-picker-control input:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}
.city-picker-control input:disabled {
  color: #64748b;
  background: #f5f7fb;
  cursor: not-allowed;
}
.city-picker-search-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  z-index: 1;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
  fill: none;
  stroke: #64748b;
  stroke-width: 2;
  stroke-linecap: round;
}
.city-picker-loader {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid #d9e3f2;
  border-top-color: #315f9e;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.city-picker-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 7px;
  border: 1px solid #d8e2f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(31, 50, 78, .16);
}
.city-picker-option {
  width: 100%;
  min-height: 48px;
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.city-picker-option:hover,
.city-picker-option:focus-visible,
.city-picker-option.is-active {
  background: #eef4ff;
  outline: none;
}
.city-picker-option-name {
  font-size: 14px;
  font-weight: 750;
}
.city-picker-option-region {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.city-picker-empty {
  padding: 13px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.city-directory-helper {
  display: block;
}
.company-form.is-readonly .city-selected {
  gap: 7px;
}
.company-form.is-readonly .city-chip {
  padding-right: 12px;
  color: #334155;
  background: #f3f6fb;
  border-color: #d7e0ec;
}

@media (max-width: 620px) {
  .city-picker-control input {
    min-height: 50px;
    font-size: 16px;
  }
  .city-picker-options {
    max-height: 280px;
  }
  .city-chip {
    max-width: 100%;
  }
}


.admin-application-edit {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}
.admin-application-edit.hidden { display: none; }
.admin-edit-intro { margin: 0; }
.admin-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
.admin-edit-grid.nested { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-edit-grid > .full-width,
.admin-edit-grid.nested > .full-width { grid-column: 1 / -1; }
.admin-application-edit .repeatable-field,
.admin-application-edit .city-list-field { grid-column: 1 / -1; }
.admin-application-edit .form-field select { min-height: 48px; }
.admin-edit-actions {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
  backdrop-filter: blur(12px);
}
.admin-edit-actions .primary-button,
.admin-edit-actions .outline-button { width: auto; min-width: 180px; }

@media (max-width: 760px) {
  .admin-edit-grid,
  .admin-edit-grid.nested { grid-template-columns: 1fr; }
  .admin-edit-actions { position: static; display: grid; }
  .admin-edit-actions .primary-button,
  .admin-edit-actions .outline-button { width: 100%; min-width: 0; }
}

/* Регистрация: отдельные согласия и отсутствие отчества. */
.patronymic-field-group {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 9px;
}
.patronymic-field-group .form-field input[readonly] {
  color: #64748b;
  background: #f3f6fb;
  border-color: #d7e0ec;
  cursor: not-allowed;
  opacity: 1;
}
.compact-checkbox {
  position: relative;
  min-height: 28px;
  display: inline-grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: fit-content;
  color: #5f6d88;
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
}
.compact-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.compact-checkbox input:checked + .custom-checkbox {
  background: var(--primary);
  border-color: var(--primary);
}
.compact-checkbox input:checked + .custom-checkbox::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}
.compact-checkbox input:focus-visible + .custom-checkbox {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .22);
}
.registration-consent-list {
  display: grid;
  gap: 12px;
}
.registration-consent-list .consent-error {
  margin: -8px 0 0 33px;
}

/* Банковские реквизиты: каждая пара полей живёт в собственной строке. */
.bank-fields-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}
.bank-fields-row-single > .form-field {
  max-width: calc(50% - 10px);
}
.bank-lookup-field .field-helper.is-success { color: #15803d; }
.bank-lookup-field .field-helper.is-error { color: var(--danger); }
.bank-lookup-control button:disabled {
  opacity: .55;
  cursor: wait;
}
.admin-patronymic-warning {
  margin-bottom: 18px;
}

@media (max-width: 760px) {
  .bank-fields-row { grid-template-columns: 1fr; gap: 16px; }
  .bank-fields-row-single > .form-field { max-width: none; }
}
