/* Target Hisobot — стили панели по утверждённому дизайну (target-hisobot-design/README.md) */

:root {
  --blue: #2F5BFF;
  --blue-dark: #1E3FBF;
  --blue-bg: #EAF0FF;
  --ink: #0E1726;
  --muted: #556070;
  --page: #F4F6FA;
  --card: #FFFFFF;
  --line: #E3E7EF;
  --ok: #11795A;
  --ok-bg: #E6F5EF;
  --bad: #B4232C;
  --bad-bg: #FCEBEC;
  --warn: #8A5300;
  --warn-bg: #FFF3DC;
  --radius-card: 16px;
  --radius: 10px;
  --tap: 44px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
h1 { margin: 0 0 4px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h2 { margin: 28px 0 12px; font-size: 18px; font-weight: 700; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--muted); font-size: 14px; }
.icon { flex: 0 0 auto; }

/* ---------- каркас: боковое меню + содержимое ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  flex: 0 0 248px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 24px 16px; background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 28px;
}
.sidebar .brand { display: flex; align-items: center; padding: 0 8px; line-height: 0; }
.sidebar .brand img { height: 34px; width: auto; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a, .nav .soon {
  display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 0 14px;
  border-radius: var(--radius); font-size: 15px; color: var(--ink);
}
.nav a:hover { background: var(--page); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--blue-bg); color: var(--blue); font-weight: 600; }
.nav .soon { color: #9AA3B2; cursor: default; }
.nav .soon small { margin-left: auto; font-size: 12px; }
.profile { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--page); }
.profile-row { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 18px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
.profile-name { display: flex; flex-direction: column; min-width: 0; }
.profile-name b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-name span { font-size: 13px; color: var(--muted); }
.profile .logout { width: 100%; justify-content: center; }
.legal { font-size: 12px; color: var(--muted); padding: 0 8px; }
.legal a { color: var(--muted); }

.content { flex: 1 1 auto; min-width: 0; padding: 32px 40px 48px; }
.content-inner { max-width: 1120px; }
.sidebar .menu-toggle { display: none; }  /* видна только на телефоне */

/* Телефон: меню складывается наверх */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: sticky; top: 0; z-index: 20; height: auto; flex: 0 0 auto; flex-direction: row; flex-wrap: wrap;
    align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .sidebar .brand img { height: 28px; }
  .sidebar .menu-toggle { display: inline-flex; }
  .nav, .sidebar .profile, .sidebar .legal { display: none; flex-basis: 100%; }
  .sidebar.open .nav, .sidebar.open .profile, .sidebar.open .legal { display: flex; }
  .sidebar.open .legal { display: block; }
  .content { padding: 20px 16px 40px; }
  h1 { font-size: 24px; }
}

/* Страницы без входа (вход, главная сайта, сообщения) */
.public { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
.public-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.public-top img { height: 34px; width: auto; }
.login-logo img { height: 56px; width: auto; max-width: 100%; }
.login-logo { margin: 0 0 24px; }
.public footer { margin-top: 40px; font-size: 13px; color: var(--muted); }
.public footer a { color: var(--muted); text-decoration: underline; }

/* ---------- переключатель языка ---------- */
.langs { display: inline-flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.langs button {
  border: 0; background: none; color: var(--blue); font: inherit; font-size: 13px; cursor: pointer;
  padding: 4px 6px; border-radius: 6px; min-height: 32px;
}
.langs button:hover { background: var(--blue-bg); }
.langs button.on { color: var(--ink); font-weight: 600; cursor: default; background: none; }

/* ---------- элементы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap);
  padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: #C9D0DD; color: var(--ink); }
.btn-primary, .btn-primary:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }

.card, .notice {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px 24px;
  margin-bottom: 16px;
}
.notice { padding: 14px 18px; }
.ok-box { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.bad-box { background: var(--bad-bg); border-color: transparent; color: var(--bad); }

.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* Статусы — «пилюли»: цветная точка + текст */
.status-ok, .status-bad, .status-warn, .pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 13px;
  font-size: 13px; font-weight: 600; white-space: nowrap; line-height: 1.3;
}
.status-ok::before, .status-bad::before, .status-warn::before, .pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 3px; background: currentColor; flex: 0 0 6px;
}
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-bad { background: var(--bad-bg); color: var(--bad); }
.status-warn { background: var(--warn-bg); color: var(--warn); }
.pill { background: var(--page); color: var(--muted); }
p.status-ok, p.status-bad, p.status-warn { display: flex; width: fit-content; max-width: 100%; white-space: normal; padding: 6px 12px; border-radius: 12px; }
/* Сумма к оплате красным — это текст, не пилюля */
td span.status-bad.amount { background: none; padding: 0; min-height: 0; font-size: inherit; }
td span.status-bad.amount::before { display: none; }

/* Таблицы */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: #FAFBFD; }
tr.off td { color: var(--muted); }

/* Поля ввода */
.search, select, input.num, input[type="text"], input[type="search"] {
  min-height: var(--tap); padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit;
}
.search { flex: 1 1 260px; }
input.num { width: 80px; }
.search:focus, select:focus, input:focus { outline: 2px solid var(--blue-bg); border-color: var(--blue); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); vertical-align: middle; }

/* Кнопки-фильтры */
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  min-height: var(--tap); padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer;
}
.seg button.on { background: var(--blue-bg); border-color: var(--blue-bg); color: var(--blue); font-weight: 600; }

/* Переключатель «включено» */
.switch {
  width: 44px; height: 26px; border-radius: 13px; border: 0; background: #CBD2DE; position: relative;
  cursor: pointer; flex: 0 0 auto;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(14, 23, 38, .2);
}
.switch.on { background: var(--blue); }
.switch.on::after { left: 21px; }
.switch:disabled { opacity: .4; cursor: default; }

code.copy {
  display: inline-block; margin: 6px 0; padding: 8px 12px; border-radius: 8px; background: var(--page);
  border: 1px solid var(--line); cursor: pointer; font-size: 15px;
}
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 10px 0; }
.checks label { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; }
details summary { cursor: pointer; margin: 8px 0; min-height: 32px; display: flex; align-items: center; }
pre.err { white-space: pre-wrap; font-size: 12px; max-height: 300px; overflow: auto; background: var(--page); padding: 10px; border-radius: 8px; }
ol { padding-left: 20px; }

/* ---------- страница «Кабинеты» (макет 02-accounts) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.subtitle { margin: 0; font-size: 15px; color: var(--muted); }
.org-settings { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.org-settings select { margin-left: 6px; }
.warn-box { background: var(--warn-bg); border-color: transparent; color: var(--warn); }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 8px; }
.search-box {
  flex: 1 1 320px; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--muted);
}
.search-box:focus-within { border-color: var(--blue); outline: 2px solid var(--blue-bg); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; color: var(--ink); background: transparent; min-height: 44px; }
.seg-group { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.seg-group button {
  min-height: 38px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.seg-group button.danger { color: var(--bad); }
.seg-group button.on { background: var(--ink); color: #fff; font-weight: 600; }

.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split-main { flex: 999 1 560px; min-width: 0; margin-bottom: 0; }
table.accounts { min-width: 840px; }
table.accounts tbody tr { cursor: pointer; }
table.accounts tbody tr:hover td { background: #F8FAFD; }
table.accounts tbody tr.selected td { background: var(--blue-bg); }
.acc-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acc-text { display: flex; flex-direction: column; min-width: 0; }
.acc-text a { color: var(--ink); }
.acc-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; display: block; }
.initials {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; color: #fff; display: flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.nowrap { white-space: nowrap; }
.muted-cell { color: var(--muted); font-size: 14px; }
.amount-cell { font-weight: 600; }
td .icon { vertical-align: -3px; }

/* Боковая панель кабинета. Широкий экран — рядом с таблицей (как в макете);
   обычный ноутбук — выезжает справа поверх таблицы; телефон — снизу */
.side-panel { display: none; }
.side-panel.open {
  display: block; position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(440px, 100%);
  overflow-y: auto; background: var(--card); border-left: 1px solid var(--line); padding: 24px;
  box-shadow: -8px 0 30px rgba(14, 23, 38, .14);
}
@media (min-width: 1500px) {
  .side-panel.open {
    position: sticky; top: 16px; bottom: auto; right: auto; z-index: auto; flex: 1 1 380px; max-width: 440px;
    max-height: calc(100vh - 32px); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: none;
  }
}
.panel-inner { display: flex; flex-direction: column; gap: 16px; }
.panel-head { display: flex; align-items: flex-start; gap: 12px; }
.panel-title { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.panel-title b { font-size: 18px; font-weight: 700; }
.icon-btn {
  width: 44px; height: 44px; flex: 0 0 44px; border: 0; border-radius: var(--radius); background: var(--page);
  color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--page); border-radius: 12px; }
.tabs button {
  flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 14px;
  font-weight: 500; color: var(--muted); cursor: pointer;
}
.tabs button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(14, 23, 38, .06); }
.side-panel h3 { margin: 4px 0 0; font-size: 15px; font-weight: 700; }

.recipient { border: 1px solid var(--line); border-radius: 12px; }
.recipient[open] { border-color: #C9D0DD; }
.recipient > summary {
  list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px; margin: 0; cursor: pointer; min-height: 44px;
}
.recipient > summary::-webkit-details-marker { display: none; }
.recipient.off { opacity: .6; }
.round-icon {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 20px; background: var(--blue-bg); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.rec-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rec-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.rec-meta { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.pill-blue {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 13px;
  background: var(--blue-bg); color: var(--blue); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.pill-blue::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: currentColor; }
.rec-edit { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.row-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.add-box > summary.dashed {
  list-style: none; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin: 0;
  border: 1.5px dashed #B8C2D3; border-radius: 12px; font-weight: 600; color: var(--blue); cursor: pointer;
}
.add-box > summary::-webkit-details-marker { display: none; }
.add-box[open] > summary { margin-bottom: 12px; }
.lang-row select { display: block; margin-top: 6px; width: 100%; }
.preview { display: flex; flex-direction: column; gap: 10px; }
.tg-chat { background: #DDE6F1; border-radius: 14px; padding: 16px; }
.tg-bubble {
  background: #fff; border-radius: 12px 12px 12px 4px; padding: 12px 14px; font-size: 14px; line-height: 1.55;
  white-space: pre-line; overflow-wrap: anywhere;
}
.alert-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.alert-line > span:first-of-type { flex: 1 1 auto; min-width: 0; }

@media (max-width: 900px) {
  .side-panel.open {
    left: 0; top: auto; width: 100%; max-height: 85vh; border-left: 0;
    border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(14, 23, 38, .18); padding: 20px 16px 28px;
  }
}


/* ---------- «Главная» (макет 01-dashboard) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 24px; }
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; font-size: 14px; color: var(--muted); }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-icon.blue { background: var(--blue-bg); color: var(--blue); }
.stat-icon.green { background: var(--ok-bg); color: var(--ok); }
.stat-icon.amber { background: var(--warn-bg); color: var(--warn); }
.stat-icon.red { background: var(--bad-bg); color: var(--bad); }
.stat-value { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; line-height: 1.2; }
.stat-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.two-col .card { margin-bottom: 0; padding: 24px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.list-icon { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.list-icon.bad { background: var(--bad-bg); color: var(--bad); }
.list-icon.warn { background: var(--warn-bg); color: var(--warn); }
.list-icon.ok { background: var(--ok-bg); color: var(--ok); }
.list-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-text a { color: var(--ink); }
.list-text b { font-weight: 600; }
.list-time { font-size: 14px; font-weight: 600; width: 44px; flex: 0 0 44px; color: var(--muted); }
.list-link { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); font-size: 14px; font-weight: 600; white-space: nowrap; }
.with-icon { display: inline-flex; align-items: center; gap: 6px; }
.status-strip { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; padding: 12px 24px; margin-top: 16px; }
.status-strip .with-icon { gap: 10px; font-size: 15px; }
.status-strip .ok .icon { color: var(--ok); }
.status-strip .bad .icon { color: var(--bad); }
.push-right { margin-left: auto; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } .push-right { margin-left: 0; } }

/* Мастер «Подключить клиента» (макет 03-connect-client) */
.wiz-steps { display: flex; align-items: center; gap: 16px; padding: 20px 24px; overflow-x: auto; }
.wiz-step { display: flex; align-items: center; gap: 10px; }
.wiz-num {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 16px; background: var(--line); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.wiz-step.now .wiz-num { background: var(--blue); color: #fff; }
.wiz-step.done .wiz-num { background: var(--ok); color: #fff; }
.wiz-label { font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.wiz-step.now .wiz-label, .wiz-step.done .wiz-label { color: var(--ink); }
.wiz-line { flex: 1 1 24px; min-width: 24px; height: 2px; background: var(--line); }
.wiz-line.done { background: var(--ok); }
.wiz-card { padding: 28px; display: flex; flex-direction: column; gap: 28px; }
.wiz-block { display: flex; flex-direction: column; gap: 12px; }
.wiz-block > p { margin: 0; }
.wiz-q { margin: 0; font-size: 16px; font-weight: 700; }
.wiz-q.small { font-size: 15px; color: var(--muted); font-weight: 600; }
.wiz-chosen { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--page); border-radius: 12px; }
.wiz-chosen .initials { border-radius: 12px; }
.wiz-change { font-size: 14px; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.wiz-end { margin-left: auto; }
.wiz-list { display: flex; flex-direction: column; gap: 8px; }
.wiz-option {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; border: 1px solid var(--line);
  border-radius: 12px; color: var(--ink); background: var(--card);
}
.wiz-option:hover { border-color: var(--blue); background: var(--blue-bg); color: var(--ink); }
.wiz-option > .icon:last-child { color: var(--muted); flex: 0 0 auto; }
.wiz-option[hidden] { display: none; }
.wiz-option .acc-text { min-width: 0; }
.wiz-new { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1.5px dashed #B8C2D3; border-radius: 14px; }
.wiz-new .acc-text { display: flex; flex-direction: column; gap: 2px; }
.wiz-new .with-icon { gap: 12px; }
.wiz-howto { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.wiz-wait { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--blue); font-weight: 600; }
.spinner {
  width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%; border: 2.5px solid var(--blue-bg);
  border-top-color: var(--blue); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.wiz-actions { display: flex; justify-content: space-between; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.wiz-split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.wiz-main { flex: 999 1 520px; min-width: 0; margin-bottom: 0; }
.wiz-preview {
  flex: 1 1 340px; max-width: 420px; display: flex; flex-direction: column; gap: 14px; padding: 24px;
  position: sticky; top: 24px; margin-bottom: 0;
}
.wiz-preview > span.muted { font-size: 13px; line-height: 1.5; }
.wiz-preview .tg-bubble[hidden] { display: none; }
#wiz-form { display: flex; flex-direction: column; gap: 28px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  min-height: var(--tap); padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.choice:hover { border-color: #C9D0DD; }
.choice.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.choice-row select { min-height: var(--tap); }
.type-cards { display: flex; flex-wrap: wrap; gap: 12px; }
.type-card {
  flex: 1 1 220px; display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 18px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); font: inherit; color: var(--ink); cursor: pointer;
}
.type-card .acc-text { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.type-card b { font-size: 16px; }
.type-card .muted { font-size: 14px; line-height: 1.45; }
.type-card.on { border: 2px solid var(--blue); padding: 17px; background: var(--blue-bg); }
.type-card .radio {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 11px; border: 2px solid #B8C2D3;
  display: flex; align-items: center; justify-content: center;
}
.type-card.on .radio { border-color: var(--blue); }
.type-card.on .radio span { width: 10px; height: 10px; border-radius: 5px; background: var(--blue); }
.type-card .status-warn { white-space: normal; }
.wiz-done { align-items: center; text-align: center; gap: 12px; padding: 40px 28px; }
.wiz-done h2 { margin: 4px 0 0; font-size: 22px; }
.wiz-done p { margin: 0; max-width: 560px; }
.wiz-done-icon {
  width: 56px; height: 56px; border-radius: 28px; background: var(--ok-bg); color: var(--ok);
  display: flex; align-items: center; justify-content: center;
}
.wiz-done-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
@media (max-width: 900px) {
  .wiz-card { padding: 20px; gap: 22px; }
  .wiz-steps { gap: 8px; padding: 14px 16px; scrollbar-width: none; }
  .wiz-line { min-width: 12px; }
  .wiz-step:not(.now) .wiz-label { display: none; }
  .wiz-preview { position: static; max-width: none; }
  .wiz-actions .btn { flex: 1 1 auto; }
}
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.wiz-block .search-box { flex: 0 0 auto; }

/* Вход и «Настройки» */
.login-box { max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 4px; }
.login-box h1 { margin-bottom: 16px; }
.login-form, .set-form { display: flex; flex-direction: column; gap: 14px; }
.login-form h2 { margin: 0; font-size: 17px; }
.login-form label, .set-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.login-form input[type="email"], .login-form input[type="password"], .login-form input[type="text"],
.set-form input[type="email"], .set-form input[type="password"] {
  min-height: var(--tap); padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-weight: 400; color: var(--ink); background: var(--card);
}
.login-form input:focus, .set-form input:focus { border-color: var(--blue); outline: 2px solid var(--blue-bg); }
.login-form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; min-height: var(--tap); }
.login-form label.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.login-form .btn { width: 100%; }
.forgot { align-self: center; font-size: 14px; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 8px 0 16px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-wide { width: 100%; }
.settings { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.set-card { margin: 0; padding: 24px; display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 16px; }
.set-head { display: flex; gap: 14px; align-items: flex-start; }
.set-head h2 { margin: 0 0 2px; font-size: 17px; }
.set-head p { margin: 0; }
.set-row { display: flex; flex-direction: column; gap: 10px; }
.set-label { font-weight: 700; }
.set-line { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.set-form { max-width: 440px; }
.set-form p { margin: 0; }
.choice-row select.on { border-color: var(--blue); background: var(--blue); color: #fff; }

/* «Клиенты и группы» */
.chat-list { display: flex; flex-direction: column; gap: 10px; }
.chat-card { margin: 0; padding: 0; }
.chat-card[hidden] { display: none; }
.chat-card.off { opacity: .65; }
.chat-card > summary {
  list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; min-height: 64px;
}
.chat-card > summary::-webkit-details-marker { display: none; }
.chat-card[open] > summary { border-bottom: 1px solid var(--line); }
.chat-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-left: auto; }
.chat-body { padding: 6px 18px 16px; display: flex; flex-direction: column; }
.chat-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.chat-line .rec-text { flex: 1 1 200px; }
.chat-line .rec-text a { color: var(--ink); }
.chat-saved { flex-basis: 100%; }
.chat-saved:empty { display: none; }
.initials.small { width: 32px; height: 32px; flex: 0 0 32px; font-size: 12px; background: var(--blue-bg); color: var(--blue); }
.chat-actions { padding-top: 12px; }
.removed-box { margin-top: 16px; }
.removed-box > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 600; }
.removed-box .chat-list { margin-top: 8px; }
.team-card { margin-top: 24px; padding: 24px; }
.team-sub { margin: 20px 0 4px; font-size: 15px; color: var(--muted); }
@media (max-width: 900px) {
  .chat-card > summary { flex-wrap: wrap; }
  .chat-meta { margin-left: 52px; justify-content: flex-start; }
}

/* «Алерты» */
.alerts-card { padding: 24px; max-width: 980px; }
.alerts-card .card-head { margin-bottom: 4px; }
.list-time.wide { width: auto; flex: 0 0 auto; white-space: nowrap; }
.list-row[hidden] { display: none; }
.al-filter { margin: 8px 0 12px; align-self: flex-start; display: inline-flex; }
.thresholds { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 8px; }
.thresholds label { display: flex; flex-direction: column; gap: 8px; }
.thresholds .muted { font-size: 14px; }
.num-row { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.num-row input { width: 110px; min-height: var(--tap); }
.al-rules { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.al-rules h3 { margin: 0 0 8px; font-size: 15px; }
.al-rules ul { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 900px) {
  .alerts-card .list-row { flex-wrap: wrap; }
  .alerts-card .list-text { flex: 1 1 calc(100% - 60px); }
  .alerts-card .list-row .list-link, .alerts-card .list-row .pill, .alerts-card .list-time { margin-left: 54px; }
  .al-filter { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .al-filter button { white-space: nowrap; }
}

/* «Права доступа» и «Состояние» */
.perm-intro { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); max-width: 980px; }
.perm-intro .icon { color: var(--blue); flex: 0 0 auto; margin-top: 2px; }
.perm-section { margin: 24px 0; max-width: 980px; }
.perm-section > .card-head { margin-bottom: 12px; }
.perm-section .search-box { margin-bottom: 12px; display: flex; }
.perm-list { display: flex; flex-direction: column; gap: 12px; }
.perm-card { margin: 0; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 16px; }
.perm-card[hidden] { display: none; }
.perm-card.focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.perm-head { display: flex; align-items: center; gap: 12px; }
.perm-head .pill-blue { margin-left: auto; }
.perm-templates { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 28px; }
.perm-group { display: flex; flex-direction: column; }
.perm-group .set-label { margin-bottom: 4px; font-size: 14px; }
.tgl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); border-bottom: 1px solid var(--line); cursor: pointer; }
.tgl-row.strong span { font-weight: 600; }
.tgl {
  appearance: none; -webkit-appearance: none; flex: 0 0 44px; width: 44px; height: 26px; margin: 0; border-radius: 13px;
  background: #CBD2DE; position: relative; cursor: pointer; transition: background .15s;
}
.tgl::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 10px; background: #fff;
  box-shadow: 0 1px 2px rgba(14, 23, 38, .2); transition: transform .15s;
}
.tgl:checked { background: var(--blue); }
.tgl:checked::after { transform: translateX(18px); }
.tgl:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.perm-accounts > summary { font-weight: 600; gap: 8px; }
.danger-btn { color: var(--bad); }
.table-wrap.plain { border: 0; margin: 0; }
.status-banner { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.err-row { border-top: 1px solid var(--line); }
.err-row > summary { display: flex; align-items: center; gap: 12px; min-height: 52px; margin: 0; flex-wrap: wrap; }
.err-first { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
@media (max-width: 900px) { .perm-head { flex-wrap: wrap; } .perm-head .pill-blue { margin-left: 52px; } .perm-card { padding: 18px; } }
.legal { max-width: 720px; } .legal ol { display: flex; flex-direction: column; gap: 8px; }
.onboarding { padding: 24px; border-color: var(--blue); }
.onboarding h2 { margin: 0 0 4px; }
.ob-steps { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; }
.ob-steps li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ob-steps li .list-text { flex: 1 1 240px; }
.ob-steps li .wiz-num { background: var(--blue); color: #fff; }
.ob-steps li.done .wiz-num { background: var(--ok); }
.set-form input[type="text"] {
  min-height: var(--tap); padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-weight: 400; color: var(--ink); background: var(--card);
}

/* Админка платформы */
.nav-admin { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.impersonation { margin-bottom: 16px; }
.adm-search { display: flex; margin-bottom: 8px; }
.adm-table tr.clickable { cursor: pointer; }
.adm-table tr.clickable:hover td { background: var(--page); }
.adm-table tr[hidden] { display: none; }
.adm-table td a { color: var(--ink); }

/* Тарифы */
.plan-name { font-size: 17px; margin-right: 8px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.plan-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.plan-card.current { border: 2px solid var(--blue); padding: 15px; background: var(--blue-bg); }
.plan-price { font-size: 20px; font-weight: 700; }
.plan-price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.muted.small { font-size: 13px; line-height: 1.45; }
.adm-plan { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; max-width: 980px; }
.adm-plan h2 { margin: 0; }
.adm-plan .push { margin-left: auto; }
.adm-plan-fields, .adm-plan-form { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.adm-plan-fields label, .adm-plan-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.adm-plan-fields input[type="text"], .adm-plan-form input[type="date"] {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; color: var(--ink); width: 150px;
}
.check-inline { flex-direction: row !important; align-items: center; gap: 8px !important; min-height: 40px; color: var(--ink) !important; }
.adm-plan-form { margin-bottom: 12px; }
.pay-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; align-items: baseline;
  padding: 16px; background: var(--page); border-radius: 12px; }
.pay-summary > div:first-child { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.pay-total { font-size: 24px; }
.choice small { font-weight: 600; opacity: .8; }
.type-card:disabled { opacity: .55; cursor: not-allowed; }
.autopay { flex: 1; border-bottom: 0; }
.load-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.load-grid > div { display: flex; flex-direction: column; gap: 2px; }
.load-grid b { font-size: 20px; }

/* Публичные страницы: оферта и тарифы */
.doc { max-width: 760px; }
.doc h2 { font-size: 17px; margin: 24px 0 8px; }
.doc p { margin: 0 0 8px; line-height: 1.6; }
.requisites { padding: 18px 20px; }
.requisites p { margin: 0 0 10px; }
.requisites dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.requisites dt { color: var(--muted); }
.requisites dd { margin: 0; overflow-wrap: anywhere; }
.pricing h1 { margin-bottom: 4px; }
.pricing .subtitle { margin: 0 0 16px; }
.pr-period { display: inline-flex; margin: 8px 0 16px; }
.pr-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pr-card { gap: 8px; }
.pr-card .btn { width: 100%; margin-top: auto; }
.pr-name { font-size: 18px; }
.pr-price { display: flex; flex-direction: column; gap: 2px; }
.pr-price[hidden] { display: none; }
.pr-features { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.pr-features li { display: flex; gap: 6px; align-items: center; }
.pr-features .icon { color: var(--ok); flex: 0 0 auto; }
.pr-faq { padding: 4px 18px; margin-bottom: 8px; }
.pr-faq p { margin: 0 0 12px; }
.lg-fields label.wide input { width: 420px; max-width: 100%; }
.lg-fields input[type="text"] { width: 200px; }
.public { max-width: 980px; }
.wrap { white-space: normal; }
