*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #0055ff;
  --blue-light: #e8f0ff;
  --text: #0e1016;
  --muted: #5c6e92;
  --border: #e4eaf4;
  --bg: #f4f7fb;
  --font: 'Manrope', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.admin {
  display: grid;
  grid-template-columns: 200px 1fr 320px;
  min-height: 100vh;
}

.admin.admin--form {
  grid-template-columns: 200px 200px 1fr 320px;
}

/* Main nav — закреплено при прокрутке */
.admin-nav {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  z-index: 3;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
}

.admin-nav__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  color: inherit;
  padding: 8px;
  margin-bottom: 24px;
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--blue);
  color: white;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.admin-nav__menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.admin-nav__item {
  text-align: left;
  padding: 12px 14px;
  border: none;
  background: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.3;
}

.admin-nav__item:hover {
  background: #f4f7fb;
  color: var(--blue);
}

.admin-nav__item.active {
  background: var(--blue-light);
  color: var(--blue);
}

.admin-nav__logout {
  padding: 12px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

/* Sub nav — закреплено при прокрутке */
.admin-subnav {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  background: #fafbfd;
  border-right: 1px solid var(--border);
  padding: 24px 12px;
  z-index: 2;
}

.admin-subnav.hidden {
  display: none;
}

.admin-subnav__title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0 12px 12px;
}

.admin-subnav__menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-subnav__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.admin-subnav__item:hover {
  background: rgba(255, 255, 255, 0.8);
}

.admin-subnav__item.active {
  background: white;
  color: var(--blue);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.form-section {
  scroll-margin-top: 24px;
}

/* Main */
.admin-main {
  padding: 28px 32px;
  overflow-y: auto;
  max-width: 900px;
}

.admin-main--wide {
  max-width: none;
}

/* Dashboard */
.dash-board {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
}

.dash-board__tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.dash-board__tab {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0 4px;
}

.dash-board__tab.active {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--blue);
}

.dash-board__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.dash-card {
  padding: 20px;
  border-radius: 14px;
  color: white;
}

.dash-card--blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.dash-card--green { background: linear-gradient(135deg, #34d399, #059669); }

.dash-card__label {
  font-size: 12px;
  opacity: 0.9;
  display: block;
  margin-bottom: 6px;
}

.dash-card__value {
  font-size: 36px;
  font-weight: 600;
  display: block;
  line-height: 1;
  letter-spacing: -1px;
}

.dash-card__sub {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 4px;
  display: block;
}

.dash-board__chart {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.chart__title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--muted);
}

.chart__bars {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  height: 120px;
  padding-bottom: 28px;
}

.chart__bar {
  flex: 1;
  height: var(--h);
  min-height: 12px;
  background: linear-gradient(180deg, #60a5fa, var(--blue));
  border-radius: 8px 8px 4px 4px;
  position: relative;
}

.chart__bar span {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.dash-board__list-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.dash-board__empty {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 0;
}

.msg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fafbfd;
  transition: border-color 0.15s, background 0.15s;
}

.msg-row--current {
  border-color: rgba(0, 85, 255, 0.25);
  background: var(--blue-light);
}

.msg-row--clickable {
  cursor: pointer;
}

.msg-row--clickable:hover,
.msg-row--clickable:focus-visible {
  border-color: var(--blue);
  background: var(--blue-light);
  outline: none;
}

.msg-row__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.msg-row__meta {
  font-size: 12px;
  color: var(--muted);
}

.msg-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
}

.msg-status--draft {
  background: #f1f5f9;
  color: var(--muted);
}

.msg-status--pending {
  background: #fef3c7;
  color: #b45309;
}

.msg-status--published {
  background: #d1fae5;
  color: #047857;
}

.admin-header__status--published {
  background: #d1fae5;
  color: #047857;
}

.form-sheet {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px 0;
}

.form-progress {
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  border-radius: 16px 16px 0 0;
}

.form-progress__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.form-progress__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.form-progress__pct {
  font-size: 18px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -0.5px;
}

.form-progress__pct--done {
  color: #047857;
}

.form-progress__bar {
  height: 8px;
  background: #e8eef8;
  border-radius: 999px;
  overflow: hidden;
}

.form-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #60a5fa, var(--blue));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.form-progress--done .form-progress__fill {
  background: linear-gradient(90deg, #34d399, #059669);
}

.form-progress__hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.form-progress__hint--done {
  color: #047857;
  font-weight: 500;
}

.form-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  position: relative;
}

.form-section--done .section-check {
  border-color: #059669;
  background: #d1fae5;
}

.form-section--done .section-check::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #047857;
}

.field-grid label span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-grid label span::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #dce4f2;
  flex-shrink: 0;
  margin-left: auto;
}

.field-grid label.field--done span::after {
  content: '✓';
  border-color: #059669;
  background: #d1fae5;
  color: #047857;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.field-grid label.field--done input,
.field-grid label.field--done textarea {
  border-color: rgba(5, 150, 105, 0.35);
}

.field--readonly.field--done input {
  background: #f0fdf4;
}

.admin-subnav__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subnav-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #dce4f2;
  flex-shrink: 0;
}

.admin-subnav__item--done .subnav-check {
  border-color: #059669;
  background: #d1fae5;
  position: relative;
}

.admin-subnav__item--done .subnav-check::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: #047857;
}

.form-section {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.form-sheet__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 24px 28px;
  background: #fafbfd;
  border-radius: 0 0 16px 16px;
}

.form-sheet__actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.form-authority-hint {
  flex: none;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: left;
}

@keyframes btn-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 85, 255, 0.5);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(0, 85, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 85, 255, 0);
  }
}

.btn--pulse {
  animation: btn-pulse 1.5s ease-out infinite;
}

.pay-page {
  max-width: 720px;
}

.pay-page__hero {
  margin-bottom: 28px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #f4f8ff 0%, #fff 55%);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.pay-page__status {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0f7a45;
  background: #e8f8ef;
  border-radius: 999px;
}

.pay-page__title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.35px;
  color: var(--text);
  max-width: 540px;
}

.pay-page__subtitle {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 520px;
}

.pay-page__amount {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  font-size: 17px;
  font-weight: 700;
  color: var(--blue);
  background: #fff;
  border: 1px solid #d4e2ff;
  border-radius: 10px;
}

.pay-page__block-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.pay-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-queue__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font: inherit;
}

.pay-queue__item strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.pay-queue__item span {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.pay-queue__item:hover {
  border-color: #c7d7ff;
}

.pay-queue__item.is-active {
  border-color: var(--blue);
  background: #e8f0ff;
}

.pay-queue__empty {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.pay-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.pay-row {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.pay-row:hover {
  border-color: #b8c9e8;
  background: #fafcff;
}

.pay-row.is-active {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: inset 3px 0 0 var(--blue);
}

.pay-row__num {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-top: 2px;
}

.pay-row.is-active .pay-row__num {
  color: var(--blue);
}

.pay-row__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pay-row__body strong {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}

.pay-row__body span {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.pay-details {
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 4px 0 20px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
}

.pay-details__header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #f8faff 0%, #fff 100%);
  border-bottom: 1px solid var(--border);
}

.pay-details__badge {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-light);
  border-radius: 10px;
}

.pay-details__head-text {
  flex: 1;
  min-width: 0;
}

.pay-details__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text);
}

.pay-details__method {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.pay-details__sum {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
  background: #fff;
  border: 1px solid #d4e2ff;
  border-radius: 8px;
  white-space: nowrap;
}

.pay-details__body {
  padding: 18px 20px;
}

.pay-details__lead {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary, #3a4f78);
}

.pay-details__foot {
  margin: 0;
  padding: 14px 20px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  background: #f8fafc;
  border-top: 1px solid var(--border);
}

.pay-details__grid {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #eef2f8;
  border-radius: 10px;
  overflow: hidden;
}

.pay-details__grid-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #eef2f8;
  font-size: 13px;
}

.pay-details__grid-row:last-child {
  border-bottom: none;
}

.pay-details__grid-row dt {
  margin: 0;
  font-weight: 500;
  color: var(--muted);
}

.pay-details__grid-row dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.pay-details__notice {
  padding: 20px;
  text-align: center;
  background: #f8fafc;
  border: 1px dashed #d4deef;
  border-radius: 12px;
}

.pay-details__notice--pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.pay-details__notice--info {
  text-align: left;
}

.pay-details__notice p {
  margin: 0;
}

.pay-details__pending-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: var(--blue);
  background: var(--blue-light);
  border-radius: 14px;
}

.pay-details__mailto {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  background: #fff;
  border: 1px solid #c7d7ff;
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s;
}

.pay-details__mailto:hover {
  background: var(--blue-light);
  border-color: var(--blue);
}

.pay-details__link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  margin-bottom: 10px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: var(--blue);
  border-radius: 10px;
  transition: background 0.15s;
}

.pay-details__link-btn:hover {
  background: #0044cc;
}

.pay-details__link-url {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  word-break: break-all;
}

.pay-details__qr-wrap {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: #fff;
  border: 1px solid #eef2f8;
  border-radius: 12px;
}

.pay-details__qr-wrap img {
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 8px;
}

.pay-page__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 4px;
}

/* legacy selectors kept for safety */
.pay-details h3 {
  font-size: 15px;
  margin: 0 0 10px;
  color: var(--text);
}

.pay-details p,
.pay-details li {
  font-size: 13px;
  color: #3a4f78;
  line-height: 1.5;
}

.pay-details__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #eef2f8;
  font-size: 13px;
}

.pay-details__qr {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.pay-details__qr img {
  width: 180px;
  height: 180px;
}

.pay-details a {
  color: var(--blue);
}

.admin-header__status--pending {
  background: #fef3c7;
  color: #b45309;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}

.admin-header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.admin-header__org {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.admin-header__status {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 999px;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

.admin-nav__item--alert:not(.active)::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  margin-left: auto;
}

.admin-nav__item--done:not(.active) {
  color: #047857;
}

.setup {
  max-width: 760px;
}

.setup-progress {
  padding: 20px 22px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 20px;
}

.ob-checklist {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ob-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.ob-check__mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.ob-check--done {
  color: #047857;
}

.ob-check--done .ob-check__mark {
  background: #d1fae5;
  border-color: #a7f3d0;
  color: #047857;
}

.ob-ready {
  margin-top: 14px;
  padding: 12px 14px;
  background: #ecfdf5;
  color: #047857;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}

.setup-block {
  padding: 22px 24px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
}

.setup-block h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.setup-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  padding: 8px 0 24px;
}

.ob-check-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text);
  margin: 10px 0;
  cursor: pointer;
}

.ob-check-label input {
  margin-top: 3px;
}

.ob-inline-link {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.ob-inline-link:hover {
  color: #0040cc;
}

.ob-rep {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: #f0f7ff;
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
}

.ob-rep strong {
  color: var(--text);
  font-size: 14px;
}

.ob-howto {
  margin: 0 0 16px;
  padding: 16px 18px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.ob-howto h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.ob-howto ol {
  margin: 0;
  padding-left: 18px;
}

.ob-howto li {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.ob-howto a {
  color: var(--blue);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ob-howto code {
  font-size: 12px;
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 4px;
}

.ob-howto__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 14px 0 0;
  font-size: 13px;
}

.ob-role {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ob-role__card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.ob-role__card input {
  margin-top: 3px;
}

.ob-role__card strong {
  color: var(--text);
}

.docs-flow {
  margin-bottom: 16px;
}

.docs-flow--accent {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 20px;
  margin: 12px 0 22px;
  background: linear-gradient(135deg, #e8f0ff 0%, #dce8ff 100%);
  border: 2px solid var(--blue);
  border-radius: 14px;
}

.docs-flow__hint {
  margin: 0;
  font-size: 13px;
  color: #2a4578;
  text-align: center;
}

.btn--accent {
  background: var(--blue);
  color: #fff;
  border: none;
  font-weight: 700;
  letter-spacing: -0.2px;
  box-shadow: 0 8px 24px rgba(0, 85, 255, 0.28);
}

.btn--accent:hover {
  background: #0046d9;
  color: #fff;
}

.btn--xl {
  padding: 18px 28px;
  font-size: 16px;
  border-radius: 12px;
  width: 100%;
}

.setup-subhead {
  font-size: 14px;
  font-weight: 600;
  margin: 22px 0 10px;
  color: var(--text);
}

.setup-subhead:first-of-type {
  margin-top: 8px;
}

@media (max-width: 640px) {
  .ob-role {
    grid-template-columns: 1fr;
  }
}

.form-lock {
  padding: 28px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: center;
  margin-bottom: 16px;
}

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

.form-sheet--locked {
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

.panel-desc {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

.guide-steps {
  list-style: none;
  counter-reset: guide;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
}

.guide-steps li {
  counter-increment: guide;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 4px 14px;
  padding: 16px 18px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.guide-steps li::before {
  content: counter(guide);
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--blue-light, #dbeafe);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.guide-steps strong {
  font-size: 14px;
  font-weight: 600;
}

.guide-steps span {
  grid-column: 2;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.guide-box {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f0f7ff;
  margin-bottom: 14px;
}

.guide-box--muted {
  background: #f8fafc;
}

.guide-box h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.guide-box ul {
  margin: 0;
  padding-left: 18px;
}

.guide-box li {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 6px;
}

.guide .btn {
  margin-top: 8px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.field-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-grid label span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field-grid input,
.field-grid textarea,
.field-grid select {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  background: white;
}

.field-grid input:focus,
.field-grid textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.field-grid input[readonly] {
  background: #f8fafc;
  color: var(--muted);
}

.inn-lookup {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.inn-lookup input {
  flex: 1;
}

.inn-lookup .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

#inn-lookup-error {
  color: #dc2626;
  font-size: 13px;
  margin-top: 10px;
  font-weight: 500;
}

/* Type picker (категория + подтипы) */
.type-picker {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 12px;
  min-height: 220px;
}

.type-picker__cats,
.type-picker__subs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 320px;
  overflow-y: auto;
}

.type-picker__cat,
.type-picker__sub {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.type-picker__cat:hover,
.type-picker__sub:hover {
  background: #fff;
}

.type-picker__cat.is-active,
.type-picker__sub.is-active {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}

.type-picker__selected {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}

@media (max-width: 700px) {
  .type-picker {
    grid-template-columns: 1fr;
  }
}

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

.type-card {
  display: block;
  cursor: pointer;
}

.type-card input {
  display: none;
}

.type-card span {
  display: block;
  padding: 14px 16px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.type-card input:checked + span {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}

.preview-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  min-height: 180px;
}

.preview-box__title {
  font-weight: 600;
  margin-bottom: 12px;
}

.upload-zone {
  background: white;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 12px;
  text-align: center;
}

.upload-zone p {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
}

.upload-status {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

.upload-status--ok { color: #047857; }
.upload-status--err { color: #dc2626; }

.docs-list {
  margin-top: 20px;
}

.docs-list__title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.doc-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  overflow: hidden;
}

.doc-row__open {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 12px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.doc-row__open:hover {
  background: var(--blue-light);
}

.doc-row__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-row__date {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
}

.doc-row__delete {
  flex-shrink: 0;
  width: 44px;
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.doc-row__delete:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.history-list {
  background: white;
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
}

/* AI panel */
.admin-ai {
  background: white;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.admin-ai__header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.admin-ai__header h2 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
}

.admin-ai__badge {
  display: inline-block;
  padding: 2px 8px;
  background: linear-gradient(135deg, #7c3aed, var(--blue));
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
}

.admin-ai__chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-msg {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 95%;
}

.ai-msg--bot {
  background: #f4f7fb;
  align-self: flex-start;
  white-space: pre-wrap;
}

.ai-msg--user {
  background: var(--blue-light);
  align-self: flex-end;
}

.ai-msg--hint {
  background: #fef3c7;
  font-size: 12px;
}

.admin-ai__actions {
  padding: 0 16px 12px;
}

.admin-ai__input {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.admin-ai__input input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  background: var(--blue);
  color: white;
}

.btn--outline {
  background: white;
  color: var(--blue);
  border: 1.5px solid var(--blue);
}

.btn--sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn--lg {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 1100px) {
  .admin {
    grid-template-columns: 64px 1fr;
  }
  .admin.admin--form {
    grid-template-columns: 64px 160px 1fr;
  }
  .admin-ai { display: none; }
  .admin-nav__logo span { display: none; }
  .admin-main { max-width: none; }
}

@media (max-width: 768px) {
  .admin,
  .admin.admin--form {
    grid-template-columns: 1fr;
  }
  .admin-nav { display: none; }
  .admin-subnav {
    position: relative;
    height: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .admin-subnav.hidden { display: none; }
  .admin-subnav__title { display: none; }
  .admin-subnav__menu {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
  .admin-subnav__item {
    width: auto;
    padding: 8px 12px;
    font-size: 12px;
  }
  .form-sheet__actions-row {
    flex-direction: column;
  }
  .form-sheet__actions-row .btn {
    width: 100%;
  }
  .type-grid {
    grid-template-columns: 1fr;
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  .dash-board__cards {
    grid-template-columns: 1fr;
  }
  .dash-board__tabs {
    gap: 12px;
    flex-wrap: wrap;
  }
}
