/* Партнерський кабінет HelperCRM — в стиле CRM: светло-серый фон, белые скруглённые
   блоки, синие «таблетки», цветные плашки статусов, даты 25.11.26, суммы в грн.
   Адаптивно: меню слева от 1024 px, ниже — верхняя панель и выезжающее меню;
   таблицы на телефоне превращаются в карточки. */

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #2b2d33;
  --muted: #666b75;        /* серый CRM, затемнён до контраста 4.5:1 */
  --link: #1366e0;
  --line: #eceef2;
  --head: #eef0f4;
  --blue: #176ef0;
  --blue-hover: #0f5fd6;
  --blue-soft: #e8f0fe;
  --active: #cdeefd;
  --pill: #eceef1;
  --ok: #6fcf72;
  --ok-text: #1f7a32;
  --ok-soft: #e5f6e6;
  --wait: #f6c935;
  --wait-text: #8a6100;
  --wait-soft: #fdf4d6;
  --info: #56c4f1;
  --info-text: #0b6d99;
  --info-soft: #e2f5fd;
  --bad: #f2776a;
  --bad-text: #b3322a;
  --bad-soft: #fde9e7;
  --violet: #c26cf0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(23, 33, 54, .04);
  --sidebar: 272px;
  --font: Roboto, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(23, 110, 240, .35); outline-offset: 2px; }

.icon { width: 22px; height: 22px; flex: none; }
.logo { width: 40px; height: 40px; flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* --- Кнопки ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 500; font-size: 16px; line-height: 1.2; text-align: center;
  cursor: pointer; text-decoration: none !important;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn .icon { width: 20px; height: 20px; }
.btn--pill { border-radius: 999px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-hover); }
.btn--outline { background: #fff; color: var(--link); border-color: #dfe3ea; }
.btn--outline:hover { border-color: #cfd9ea; background: #fbfcff; }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--pill); color: #a3a8b1; border-color: transparent; cursor: not-allowed;
}
.btn--google { background: #fff; color: var(--text); border-color: #dadce0; }
.btn--google:hover { background: #f8f9fb; }
.btn--apple { background: #000; color: #fff; }
.btn--apple:hover { background: #222; }
.btn__mark {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid #dadce0; font-weight: 700; font-size: 14px; color: var(--blue);
}
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--link); cursor: pointer;
}
.icon-btn:hover { background: var(--blue-soft); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 500; }
.link-arrow .icon { width: 18px; height: 18px; }

/* --- Каркас ------------------------------------------------------------ */
.shell { min-height: 100vh; }
.main { padding: 16px 16px 40px; max-width: 1240px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 8px 0 16px;
  background: rgba(245, 246, 248, .92); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; color: var(--text); }
.topbar__brand .logo { width: 32px; height: 32px; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: min(86vw, var(--sidebar)); padding: 12px;
  display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
  background: var(--bg);
  transform: translateX(-100%); transition: transform .22s ease;
}
.drawer-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .18); }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(20, 24, 33, .38); }
.drawer-open { overflow: hidden; }

.side-block { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 12px; }
.side-brand__logo { display: block; }
.side-brand__btn { flex: 1; min-height: 46px; padding: 0 12px; font-size: 16px; }
.side-row { display: flex; gap: 6px; }
.side-id { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 60px; padding: 8px 16px; min-width: 0; }
.side-id__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-id__code { font-size: 14px; color: var(--muted); }
.side-id__copy { width: 52px; border: 0; color: #a3a8b1; cursor: pointer; display: grid; place-items: center; }
.side-id__copy:hover { color: var(--blue); }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-nav__item {
  display: flex; align-items: center; gap: 14px; min-height: 50px; padding: 0 14px;
  color: var(--text); text-decoration: none !important;
}
.side-nav__item .icon { color: var(--blue); }
.side-nav__item:hover { background: #f0f7fe; }
.side-nav__item.is-active { background: var(--active); }

@media (min-width: 1024px) {
  .topbar, .scrim, .side-brand__close { display: none !important; }
  .sidebar { transform: none; width: var(--sidebar); padding: 16px 12px 16px 16px; box-shadow: none !important; }
  .main { margin-left: var(--sidebar); padding: 24px 32px 48px 24px; }
}
@media (max-width: 1023.98px) {
  .side-brand__btn { display: none; }
  .side-brand { justify-content: space-between; }
}

/* --- Заголовок страницы ----------------------------------------------- */
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 4px 0 20px;
}
.page-head h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.page-head__action { display: none; }
@media (min-width: 720px) {
  .page-head h1 { font-size: 34px; }
  .page-head__action { display: inline-flex; }
}

/* --- Карточки --------------------------------------------------------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px;
}
.card__title { font-size: 20px; font-weight: 700; margin-bottom: 14px; }
@media (min-width: 720px) {
  .card { padding: 24px; }
  .card__title { font-size: 22px; }
}

.notice {
  margin-bottom: 16px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--wait-soft); color: var(--wait-text); font-size: 15px;
}
.notice--error { background: var(--bad-soft); color: var(--bad-text); }

/* Шапка с условиями */
.hero { display: grid; gap: 18px; }
.hero h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.hero p { color: var(--muted); }
.rates { display: grid; gap: 10px; }
.rate {
  display: grid; grid-template-columns: 40px 1fr auto; grid-template-areas: "icon label value" "icon note value";
  align-items: center; column-gap: 12px; padding: 12px 14px;
  background: var(--bg); border-radius: var(--radius-sm);
}
.rate__icon { grid-area: icon; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); }
.rate__icon .icon { width: 20px; height: 20px; }
.rate__label { grid-area: label; font-weight: 500; }
.rate__note { grid-area: note; font-size: 14px; color: var(--muted); }
.rate__value { grid-area: value; font-size: 22px; font-weight: 700; color: var(--link); white-space: nowrap; }
@media (min-width: 720px) {
  .hero h2 { font-size: 24px; }
  .rates { grid-template-columns: repeat(3, 1fr); }
  .rate { grid-template-columns: 1fr; grid-template-areas: "icon" "label" "value" "note"; row-gap: 4px; padding: 16px; }
  .rate__icon { margin-bottom: 6px; }
  .rate__value { font-size: 30px; }
}

/* Ссылка */
.link-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.link-row__buttons { display: flex; gap: 10px; }
.link-row__buttons .btn { flex: 1; }
.link-field {
  flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0;
  min-height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.link-field__icon { color: var(--muted); display: grid; }
.link-field input {
  flex: 1; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent;
  font: 500 17px/1.2 var(--font); color: var(--text); text-overflow: ellipsis;
}
@media (min-width: 720px) {
  .link-row { flex-direction: row; }
  .link-row__buttons .btn { flex: none; }
}

/* Деньги */
.money { display: grid; gap: 12px; margin-bottom: 16px; }
.money .card { margin: 0; }
.money-card { display: flex; flex-direction: column; gap: 4px; }
.money-card__title { color: var(--muted); font-size: 15px; }
.money-card__amount { font-size: 28px; line-height: 1.2; font-weight: 700; white-space: nowrap; }
.money-card__note { font-size: 14px; color: var(--muted); }
.money-card--accent .money-card__amount { color: var(--link); }
.money-card--bonus .money-card__amount { color: #9b3fd4; }
.money-card--pending .money-card__amount { color: var(--wait-text); }
@media (max-width: 559.98px) {
  .money { grid-template-columns: 1fr 1fr; gap: 10px; }
  .money-card { padding: 14px; }
  .money-card__title { font-size: 14px; }
  .money-card__amount { font-size: clamp(18px, 5.2vw, 22px); overflow-wrap: anywhere; }
  .money-card__note { font-size: 13px; line-height: 1.35; }
}
@media (min-width: 560px) { .money { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) {
  .money { grid-template-columns: repeat(4, 1fr); }
  .money-card__amount { font-size: 26px; }
}

/* Вывод и тариф */
.actions { display: grid; gap: 14px; }
.actions__buttons { display: flex; flex-direction: column; gap: 10px; }
.actions__text { display: grid; gap: 4px; }
.hint { font-weight: 500; color: var(--wait-text); }
@media (min-width: 720px) {
  .actions { grid-template-columns: auto 1fr; align-items: center; gap: 24px; }
  .actions__buttons { flex-direction: row; }
}

/* Статистика */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 12px;
  background: var(--bg); border-radius: var(--radius-sm); min-width: 0;
}
.stat__value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat__label { font-size: 13px; color: var(--muted); }
@media (min-width: 720px) {
  .stat { padding: 18px 20px; }
  .stat__value { font-size: 32px; }
  .stat__label { font-size: 15px; }
}

/* Вкладки — как «Головна / Звіт по послугах…» в «Аналітиці» */
.tabs {
  display: flex; gap: 10px; margin: 24px 0 14px; padding-bottom: 14px;
  border-bottom: 1px solid #e3e6eb; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px;
  border-radius: 999px; background: var(--pill); color: var(--text);
  font-weight: 500; text-decoration: none !important; white-space: nowrap;
}
.tab:hover { background: #e2e5ea; }
.tab.is-active { background: var(--blue); color: #fff; }
@media (min-width: 720px) { .tab { min-height: 52px; padding: 0 26px; font-size: 18px; } }
.js .panel:not(.is-active) { display: none; }
.panel { margin-bottom: 16px; scroll-margin-top: 150px; }
#link { scroll-margin-top: 76px; }
@media (min-width: 1024px) { .panel { scroll-margin-top: 100px; } #link { scroll-margin-top: 16px; } }

/* Таблицы — как «Клієнти» в CRM */
.table-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 16px 18px; background: var(--head); color: var(--muted);
  font-size: 15px; font-weight: 400; text-align: left;
}
.table td { padding: 16px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: #f7f9fc; }
.table .num { text-align: right; }
.table__main { font-weight: 500; }
.op__title { display: block; }
.op__sub { display: block; font-size: 14px; color: var(--muted); font-weight: 400; }
.amount { display: block; white-space: nowrap; font-weight: 500; }
.amount + .amount { font-size: 14px; font-weight: 400; }
.amount--plus { color: var(--ok-text); }
.amount--minus { color: var(--text); }
.amount--bonus { color: #9b3fd4; }
.amount--pending { color: var(--wait-text); }
.amount--cancelled { color: var(--muted); text-decoration: line-through; }
.amount--zero { color: var(--muted); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-size: 14px; line-height: 1.4; white-space: nowrap;
}
.badge--ok { background: var(--ok-soft); color: var(--ok-text); }
.badge--wait { background: var(--wait-soft); color: var(--wait-text); }
.badge--info { background: var(--info-soft); color: var(--info-text); }
.badge--muted { background: var(--pill); color: #646a74; }
.badge--bad { background: var(--bad-soft); color: var(--bad-text); }

@media (max-width: 719.98px) {
  .table-card { background: transparent; box-shadow: none; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody { display: block; }
  .table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 6px 12px;
    padding: 14px 16px; margin-bottom: 10px;
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .table td { display: block; padding: 0; border: 0; }
  .table td[data-label="Дата"], .table td[data-label="Дата реєстрації"] { grid-column: 2; grid-row: 1; font-size: 14px; color: var(--muted); text-align: right; }
  .table .table__main { grid-column: 1; grid-row: 1; }
  .table td[data-label="Статус"] { grid-column: 1; grid-row: 2; align-self: center; }
  .table td.num { grid-column: 2; grid-row: 2; text-align: right; }
  .table .badge { white-space: normal; }
  .table .amount { white-space: normal; }
  .table tbody tr:hover { background: var(--card); }
}

/* Пустое состояние */
.empty { display: grid; justify-items: center; gap: 8px; padding: 32px 20px; text-align: center; }
.empty__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); }
.empty__title { font-size: 18px; font-weight: 700; }
.empty .btn { margin-top: 8px; }

.page-foot { margin-top: 8px; }

/* --- Вход, телефон, правила для гостя -------------------------------- */
.plain { min-height: 100vh; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth__card { width: 100%; max-width: 440px; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 28px 22px; }
.auth__card--wide { max-width: 760px; }
.auth__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none !important; }
.auth__title { font-size: 26px; line-height: 1.2; font-weight: 700; }
.auth__rates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.auth__rates li { display: grid; gap: 2px; padding: 12px 10px; border-radius: var(--radius-sm); background: var(--bg); }
.auth__rates strong { font-size: 20px; color: var(--link); white-space: nowrap; }
.auth__rates span { font-size: 13px; color: var(--muted); line-height: 1.3; }
.auth__buttons { display: grid; gap: 10px; }
@media (max-width: 359.98px) {
  .auth__rates { grid-template-columns: minmax(0, 1fr); }
  .auth__rates li { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; column-gap: 10px; }
}
.sso { display: flex; justify-content: center; min-height: 44px; }
.sso > div { margin: 0 auto; }
.step { font-size: 14px; font-weight: 500; color: var(--link); }
@media (min-width: 560px) { .auth__card { padding: 36px 36px 32px; } }

.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: 15px; }
.field__control {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 14px;
  border: 1px solid #dfe2e7; border-radius: 6px; background: #fff;
}
.field__control:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23, 110, 240, .15); }
.field__control.is-invalid { border-color: var(--bad); }
.field__icon { color: var(--muted); }
.field__control input {
  flex: 1; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent;
  font: 400 18px/1.2 var(--font); color: var(--text);
}
.field__control input::placeholder { color: #b5bac3; }
.field__error { color: var(--bad-text); font-size: 14px; margin-top: -6px; }

.rules { display: grid; gap: 20px; margin-bottom: 8px; }
.rules__section h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.rules__section ul { display: grid; gap: 6px; }
.rules__section li { position: relative; padding-left: 18px; }
.rules__section li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }

/* Всплывающее «Скопійовано» */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translateX(-50%); padding: 12px 20px; border-radius: 999px;
  background: #2b2d33; color: #fff; font-size: 15px; box-shadow: 0 6px 24px rgba(0, 0, 0, .2);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
/* Суперадмінка — дополнение к partner.css: графики и плашки как в «Аналітиці» CRM,
   фильтры, формы действий, таблицы, которые на телефоне становятся списком «поле: значение». */

.admin .main { max-width: 1400px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 500; }
.lead { margin: -8px 0 16px; }
.back { margin: 0 0 8px; }
.back .icon { width: 18px; height: 18px; }
.page-head--wrap { flex-wrap: wrap; align-items: flex-end; }
.page-sub { display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 17px; }
.card__title small { font-size: 14px; font-weight: 400; margin-left: 6px; }
.card__title .icon { vertical-align: -4px; color: var(--blue); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 8px 0 12px; }
.more { text-align: center; margin: 16px 0; }
.side-brand__label { cursor: default; }
.side-brand__label:hover { background: var(--blue); }
.nav-badge {
  margin-left: auto; min-width: 24px; padding: 1px 8px; border-radius: 999px;
  background: #d0453a; color: #fff; font-size: 13px; text-align: center;
}
.notice--ok { background: var(--ok-soft); color: var(--ok-text); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-2 > * { min-width: 0; }
.grid-2 > .card { margin: 0; }
@media (min-width: 1100px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Период — вкладки-«таблетки» и поле дат как «26.10.26 - 25.11.26» */
.period { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.period__presets { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.period__presets::-webkit-scrollbar { display: none; }
.tab--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
@media (min-width: 720px) { .tab--sm { min-height: 44px; font-size: 16px; padding: 0 20px; } }
.period__range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.period__dash { color: var(--muted); }
.date-box { display: inline-flex; align-items: center; background: #fff; border: 1px solid #e3e6eb; border-radius: 6px; padding: 0 10px; min-height: 44px; }
.date-box input { width: 100%; border: 0; outline: 0; background: transparent; font: 16px var(--font); color: var(--text); min-width: 0; }
.btn--sm { min-height: 44px; padding: 0 18px; font-size: 15px; }

/* Плашки-цифры как «1 032», «750 810 грн» в «Аналітиці» */
.num-badge {
  display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 16px; line-height: 1.5;
  color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums;
}
/* Заливки как в CRM; на светлых — тёмные цифры, чтобы читались (контраст ≥ 4.5:1). */
.num-badge--violet { background: #9b3fd0; }
.num-badge--yellow { background: #f6c935; color: #4d3a00; }
.num-badge--green { background: #77d07a; color: #0f3d17; }
.num-badge--sky { background: #5ec8f2; color: #083a52; }
.num-badge--red { background: #d0453a; }
.num-badge--pale { background: #e8eef6; color: #0f5fd6; }
.stat-rows { display: grid; gap: 12px; }
.stat-rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-rows__label { color: var(--link); }
.stat-rows__label small { display: block; color: var(--muted); font-size: 13px; }
@media (min-width: 720px) {
  .stat-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .stat-rows li { justify-content: flex-start; }
  .stat-rows__label { flex: 0 1 220px; }
}

/* Графики */
.chart { margin: 0; }
.chart__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.chart__total { font-size: 22px; font-weight: 700; }
.chart__svg { display: block; width: 100%; height: auto; margin-top: 4px; }
.chart__grid { stroke: #e9ecf1; stroke-width: 1; }
.chart__ylabel, .chart__xlabel { fill: #666b75; font-size: 16px; font-family: var(--font); }
.chart__scroll { overflow-x: auto; scrollbar-width: thin; }
@media (max-width: 559.98px) { .chart__svg { min-width: 520px; } }
.chart__line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.chart__dot { stroke: #fff; stroke-width: 1.5; }
.chart--green .chart__line { stroke: #7fcf7a; }
.chart--green .chart__area { fill: rgba(127, 207, 122, .14); }
.chart--green .chart__dot { fill: #7fcf7a; }
.chart--green .chart__total { color: #3f9a3a; }
.chart--blue .chart__line { stroke: var(--blue); }
.chart--blue .chart__area { fill: rgba(23, 110, 240, .1); }
.chart--blue .chart__dot { fill: var(--blue); }
.chart--blue .chart__total { color: var(--blue); }

/* Воронка */
.funnel { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.funnel__step { display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "label value conv" "bar bar bar"; gap: 6px 12px; align-items: center; }
.funnel__label { grid-area: label; }
.funnel__value { grid-area: value; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel__conv { grid-area: conv; color: var(--muted); font-size: 14px; min-width: 48px; text-align: right; }
.funnel__bar { grid-area: bar; height: 12px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.funnel__bar span { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
@media (min-width: 720px) {
  .funnel__step { grid-template-columns: 160px 1fr 90px 60px; grid-template-areas: "label bar value conv"; }
}

/* Фильтры */
.filters {
  display: grid; gap: 12px; align-items: end; margin-bottom: 16px;
  grid-template-columns: minmax(0, 1fr);
}
.filters__field { display: grid; gap: 6px; }
.filters__check { min-height: 48px; }
@media (min-width: 720px) {
  .filters { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto auto; }
}
.input-box { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; background: #fff; border: 1px solid #e3e6eb; border-radius: 6px; }
.input-box .icon { color: #b5bac3; width: 20px; height: 20px; }
.input-box input { flex: 1; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font: 16px var(--font); color: var(--text); }
.input-box:focus-within, .input:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23, 110, 240, .15); outline: 0; }
.input, .select {
  width: 100%; min-height: 48px; padding: 0 12px; background: #fff;
  border: 1px solid #e3e6eb; border-radius: 6px; font: 16px var(--font); color: var(--text);
}
.select { appearance: none; padding-right: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a3a8b1' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); flex: none; }

/* Таблицы: на телефоне — «поле: значение» */
.table a:where(:not(.btn, .icon-btn)) { font-weight: 500; display: inline-block; padding: 11px 0; margin: -11px 0; }  /* зона нажатия ≥ 44 px; кнопки — своими размерами (TABLE-BTN-20261127) */
.table .num-badge { font-size: 13px; margin-left: 4px; }
@media (min-width: 720px) {
  .table--stack th, .table--stack td { padding: 14px 14px; }
}
@media (max-width: 719.98px) {
  .table.table--stack tr { display: block; padding: 12px 16px; }
  .table.table--stack td {
    display: grid; grid-template-columns: minmax(96px, 42%) minmax(0, 1fr); column-gap: 12px; padding: 4px 0;
    grid-column: auto !important; grid-row: auto !important; text-align: right !important;
    font-size: 15px; color: var(--text) !important; overflow-wrap: anywhere;
  }
  .table.table--stack td::before {
    content: attr(data-l); grid-column: 1; grid-row: 1 / span 6; color: var(--muted); text-align: left;
  }
  .table.table--stack td > * { grid-column: 2; justify-self: end; }
  .table.table--stack td:empty { display: none; }
  .table.table--stack td:first-child { font-size: 17px; }
  .table.table--stack .amount { white-space: normal; }
  .table.table--stack .amount + .amount { font-size: 14px; }
}

/* Карточка партнёра */
.facts { display: grid; gap: 12px 24px; margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
@media (min-width: 900px) { .facts { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 559.98px) {
  .facts { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .facts > div { display: flex; justify-content: space-between; gap: 16px; }
  .facts dd { margin: 0; text-align: right; }
}
.card--alert { border: 1px solid #f7c9c3; }
.signals { display: grid; gap: 14px; }
.signal { padding-top: 14px; border-top: 1px solid var(--line); }
.signal:first-child { padding-top: 0; border-top: 0; }
.signal__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-inline { display: grid; gap: 8px; margin-top: 10px; }
@media (min-width: 720px) { .form-inline { grid-template-columns: 220px minmax(0, 1fr) auto; align-items: start; } .form-inline .field__error { grid-column: 2; } }

.payout-active { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--wait-soft); margin-bottom: 16px; display: grid; gap: 4px; }
.payout-active .badge { margin-left: 6px; }
.steps { display: grid; gap: 20px; }
@media (min-width: 1000px) { .steps { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.form-grid { display: grid; gap: 12px; align-content: start; }
.form-grid .btn { justify-self: start; }
@media (max-width: 559.98px) { .form-grid .btn { justify-self: stretch; } }
.form-grid--side { padding-top: 20px; border-top: 1px solid var(--line); }
@media (min-width: 1000px) { .form-grid--side { padding: 0 0 0 20px; border-top: 0; border-left: 1px solid var(--line); } }
.form-grid--row .step, .form-grid--row p { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .form-grid--row { grid-template-columns: 220px minmax(0, 1fr) auto; align-items: end; }
  .form-grid--row .btn { align-self: end; }
}
.form-row { display: grid; gap: 12px; }
@media (min-width: 560px) { .form-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.step--muted { color: var(--muted); }
.status-help { margin: -4px 0 14px; }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--pill); border-radius: 999px; justify-self: start; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 500; }
.seg input:checked + span { background: #fff; color: var(--link); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.seg input:focus-visible + span { outline: 3px solid rgba(23, 110, 240, .35); }
.field .field__error { margin-top: 0; }
form .field__error { display: block; }

/* Настройки */
.settings__group { border: 0; display: grid; gap: 4px; }
.settings__group legend { float: left; width: 100%; padding: 0; }
.settings__row { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.settings__group legend + .settings__row { border-top: 0; }
.check.settings__row { display: flex; align-items: center; min-height: 52px; }
.settings__label small { display: block; color: var(--muted); font-size: 13px; }
.settings__control { display: flex; align-items: center; gap: 10px; }
.settings__control .input { max-width: 140px; }
.settings__control--wide .input { max-width: 360px; }
.settings__suffix { color: var(--muted); }
@media (min-width: 720px) {
  .settings__row { grid-template-columns: minmax(0, 1fr) 380px; align-items: center; }
  .settings__row .field__error { grid-column: 2; }
}
.settings__save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.settings fieldset:disabled { opacity: .7; }
.versions { margin: 0 0 24px; padding: 0; list-style: none; display: grid; gap: 10px; }
.version { margin: 0; padding: 16px 20px; }
.version__head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 6px; }
.version ul { display: grid; gap: 2px; font-size: 15px; color: #4a4f58; }
