/* ─────────────────────────────────────────────
   Радомир · Дебиторка — токены
   Бренд-цвет взят из логотипа (#4E8A7D)
───────────────────────────────────────────── */
:root {
  --brand: #4E8A7D;
  --brand-deep: #2F5C53;
  --brand-ink: #1B3A33;
  --mint: #E4EFEB;
  --mint-2: #CFE1DB;

  --paper: #F1F4F2;
  --card: #FFFFFF;
  --ink: #16211E;
  --ink-2: #4B5955;
  --ink-3: #8C9793;
  --line: #DDE4E1;
  --line-2: #EDF1EF;

  --debt: #C13A2B;
  --debt-soft: #FBE8E5;
  --debt-line: #F1C3BC;
  --ok: #1E9A5F;
  --ok-soft: #DFF3E8;
  --warn: #B97C11;
  --warn-soft: #FBF0D8;

  --font: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --r: 10px;
  --r-s: 6px;
  --shadow: 0 1px 2px rgba(22,33,30,.05), 0 6px 20px -8px rgba(22,33,30,.12);
  --shadow-lg: 0 24px 60px -20px rgba(22,33,30,.35);
  --side-w: 248px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.45 var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--brand-deep); }
svg { display: block; }
.muted { color: var(--ink-3); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* иконки внутри кнопок и навигации */
.nav__item svg, .btn svg, .iconbtn svg, .search svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; flex: none;
}

/* ─────────────── Кнопки ─────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--card); color: var(--ink);
  font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s var(--ease), box-shadow .15s;
}
.btn:hover { background: #FAFBFA; border-color: #C9D3CF; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.btn--primary:hover { background: #26504A; border-color: #26504A; }
.btn--danger { background: var(--debt); border-color: var(--debt); color: #fff; }
.btn--danger:hover { background: #A93224; border-color: #A93224; }
.btn--ghost { background: transparent; border-color: var(--mint-2); color: var(--brand-deep); }
.btn--ghost:hover { background: var(--mint); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn--lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn--block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; pointer-events: none; }
.iconbtn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; background: transparent; border-radius: var(--r-s); cursor: pointer; color: var(--ink-2);
}
.iconbtn:hover { background: var(--line-2); color: var(--ink); }

/* ─────────────── Поля ─────────────── */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: #fff; font: inherit; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(78,138,125,.18);
}
.field__error { color: var(--debt); font-size: 13px; margin: -6px 0 12px; }

/* ─────────────── Вход ─────────────── */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff;
}
.login__side {
  background: var(--brand-ink);
  color: #fff; padding: 40px; display: flex; flex-direction: column; gap: 32px;
  position: relative; overflow: hidden;
}
.login__logo { width: 190px; background: #fff; padding: 12px 14px; border-radius: var(--r); align-self: flex-start; }
.login__facade { flex: 1; display: grid; place-items: center; }
.login__facade svg { width: min(100%, 560px); height: auto; }
.login__note { color: rgba(255,255,255,.65); font-size: 13px; }
.login__form { align-self: center; justify-self: center; width: min(360px, 100%); padding: 40px 24px; }
.login__form h1 { font-size: 26px; margin-bottom: 6px; }
.login__form .muted { margin-bottom: 26px; }
.login__form .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login__foot { margin-top: 28px; font-size: 12px; color: var(--ink-3); }
.login.is-shake .login__form { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

/* ─────────────── Каркас ─────────────── */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }

.side {
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side__brand { padding: 18px 18px 14px; border-bottom: 1px solid var(--line-2); }
.side__brand img { width: 150px; display: block; }
.side__module {
  display: inline-block; margin-top: 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand-deep); background: var(--mint); padding: 3px 8px; border-radius: 4px;
}
.nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; background: transparent; border-radius: var(--r-s);
  text-align: left; cursor: pointer; color: var(--ink-2); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav__item:hover { background: var(--line-2); color: var(--ink); }
.nav__item.is-active { background: var(--mint); color: var(--brand-ink); }
.nav__item.is-active svg { stroke: var(--brand); }
.nav__count {
  margin-left: auto; font-family: var(--mono); font-size: 11px; font-weight: 600;
  background: var(--debt-soft); color: var(--debt); padding: 2px 7px; border-radius: 999px;
}
.nav__count:empty { display: none; }

.side__erc { margin: auto 10px 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); }
.side__erc-title { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.side__erc-status { display: flex; align-items: center; gap: 8px; margin: 8px 0 10px; font-size: 13px; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot--busy { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

.side__user { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; }
.side__user-name { font-weight: 600; font-size: 13px; }
.side__user-role { font-size: 12px; color: var(--ink-3); }
.side__user .iconbtn { margin-left: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 22px 28px 16px; border-bottom: 1px solid var(--line); background: var(--paper);
  position: sticky; top: 0; z-index: 5;
}
.top__crumb { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.top__tools { display: flex; gap: 10px; align-items: center; }
.search {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; width: 320px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-s); color: var(--ink-3);
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(78,138,125,.18); }
.search input { border: 0; outline: 0; background: transparent; font: inherit; width: 100%; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }

.view { padding: 24px 28px 48px; flex: 1; animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ─────────────── Карточки и сетка ─────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card__body { padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid--kpi { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: 1.4fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.kpi { padding: 16px 18px; }
.kpi__label { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.kpi__value { font-family: var(--mono); font-size: 26px; font-weight: 600; margin-top: 6px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 14px; color: var(--ink-3); font-weight: 500; }
.kpi__delta { margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.kpi__delta.is-down { color: var(--ok); }
.kpi__delta.is-up { color: var(--debt); }
.kpi--debt .kpi__value { color: var(--debt); }

/* ─────────────── Фасад (подпись системы) ─────────────── */
.facade { padding: 22px 18px 12px; overflow-x: auto; }
.facade__row { display: flex; gap: 28px; align-items: flex-end; min-width: max-content; }
.house { text-align: center; }
.house svg { display: block; overflow: visible; }
.house__addr { margin-top: 10px; font-weight: 600; font-size: 13px; }
.house__meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.win { fill: #D5DEDA; transition: fill .3s, filter .3s; }
.win--dim { fill: #E9EEEC; }
.win--ok { fill: #34C77E; filter: drop-shadow(0 0 6px rgba(52,199,126,.7)); cursor: pointer; }
.win--debt { fill: #F05A48; filter: drop-shadow(0 0 7px rgba(240,90,72,.75)); cursor: pointer; animation: glow 2.4s infinite; }
.win--ok:hover { filter: drop-shadow(0 0 11px rgba(52,199,126,1)) brightness(1.08); }
.win--debt:hover { filter: drop-shadow(0 0 11px rgba(240,90,72,1)) brightness(1.08); animation: none; }
.win--busy { fill: #F2B544; filter: drop-shadow(0 0 7px rgba(242,181,68,.75)); }
@keyframes glow { 50% { filter: drop-shadow(0 0 2px rgba(240,90,72,.4)); } }
.facade__legend { display: flex; gap: 18px; font-size: 12px; color: var(--ink-2); margin-top: 16px; }
.facade__legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

/* график начислено/собрано */
.chart { display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: 160px; gap: 14px; padding-top: 10px; }
.chart__col { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 160px; gap: 4px; align-items: end; height: 160px; position: relative; }
.chart__bar { border-radius: 3px 3px 0 0; transform-origin: bottom; animation: grow .6s var(--ease) both; }
.chart__bar--acc { background: var(--mint-2); }
.chart__bar--col { background: var(--brand); }
.chart__month { position: absolute; left: 0; right: 0; bottom: -20px; text-align: center; font-size: 11px; color: var(--ink-3); }
@keyframes grow { from { transform: scaleY(0); } }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); margin-top: 30px; }
.chart-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

/* лента событий */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.feed li:last-child { border-bottom: 0; }
.feed time { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding-top: 1px; }
.feed b { font-weight: 600; }

/* ─────────────── Таблица ─────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: var(--r-s); padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.seg button.is-active { background: var(--brand-ink); color: #fff; }
.seg button .cnt { font-family: var(--mono); font-size: 11px; opacity: .7; margin-left: 5px; }
.toolbar__right { margin-left: auto; display: flex; gap: 8px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 10px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
th { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: #FAFBFA; }
th:first-child, td:first-child { padding-left: 16px; width: 36px; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: #F7FAF9; }
tbody tr.is-debt { background: #FFF8F7; }
tbody tr.is-debt:hover { background: #FFF1EF; }
tbody tr.is-debt td:nth-child(2) { box-shadow: inset 3px 0 0 var(--debt); }
tbody tr.is-selected { background: #EEF6F3 !important; }
td.amt { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
th.amt { text-align: right; }
td.amt.is-zero { color: var(--ink-3); font-weight: 400; }
td.amt.is-debt { color: var(--debt); }
td.mono { font-family: var(--mono); font-size: 13px; }
td .sub { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; font-family: var(--font); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand-deep); cursor: pointer; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--ok { background: var(--ok-soft); color: #147A4A; }
.pill--debt { background: var(--debt-soft); color: #A32E22; }
.pill--warn { background: var(--warn-soft); color: #8A5C08; }
.pill--neutral { background: var(--line-2); color: var(--ink-2); }

/* панель массовых действий */
.bulk {
  position: sticky; bottom: 20px; margin-top: 16px; display: flex; align-items: center; gap: 12px;
  background: var(--brand-ink); color: #fff; padding: 12px 12px 12px 18px; border-radius: var(--r);
  box-shadow: var(--shadow-lg); animation: rise .25s var(--ease); z-index: 4;
}
.bulk__text b { font-family: var(--mono); }
.bulk .btn { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; }
.bulk .btn:hover { background: rgba(255,255,255,.16); }
.bulk .btn--primary { background: #fff; color: var(--brand-ink); border-color: #fff; }
.bulk .btn--primary:hover { background: var(--mint); }
.bulk__spacer { flex: 1; }

.empty { padding: 48px 18px; text-align: center; color: var(--ink-3); }

/* ─────────────── Взыскание (стадии) ─────────────── */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.stage { background: #F7F9F8; border: 1px solid var(--line); border-radius: var(--r); min-height: 300px; }
.stage__head { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.stage__line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 2px; }
.stage__title { font-weight: 600; font-size: 13px; }
.stage__rule { font-size: 11px; color: var(--ink-3); }
.stage__sum { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.stage__list { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.dcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; box-shadow: var(--shadow); animation: rise .3s var(--ease); }
.dcard__name { font-weight: 600; font-size: 13px; }
.dcard__addr { font-size: 12px; color: var(--ink-3); }
.dcard__row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.dcard__amt { font-family: var(--mono); color: var(--debt); font-weight: 600; }
.dcard__days { font-size: 11px; color: var(--ink-3); }
.dcard__actions { display: flex; gap: 6px; margin-top: 10px; }
.dcard__actions .btn { flex: 1; justify-content: center; }
.stage--final .dcard__actions { display: none; }

/* ─────────────── Рассылки ─────────────── */
.grid--comms { grid-template-columns: 1fr 380px; }
.phone { background: #F7F9F8; border: 1px solid var(--line); border-radius: 22px; padding: 18px 14px; }
.phone__bar { font-size: 11px; color: var(--ink-3); display: flex; justify-content: space-between; margin-bottom: 14px; }
.bubble { background: #fff; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 10px 12px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; max-width: 92%; box-shadow: var(--shadow); }
.bubble__meta { margin-top: 6px; font-size: 11px; color: var(--ink-3); }
.tmpl-vars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -6px; margin-bottom: 14px; }
.tmpl-vars button { border: 1px dashed var(--mint-2); background: var(--mint); color: var(--brand-deep); font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 4px; cursor: pointer; }
.progress { height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .4s var(--ease); }
.progress.is-ok i { background: var(--ok); }

/* ─────────────── Документы ─────────────── */
.drop {
  border: 1.5px dashed var(--mint-2); border-radius: var(--r); padding: 36px 20px; text-align: center;
  background: #FAFCFB; cursor: pointer; transition: background .15s, border-color .15s;
}
.drop:hover, .drop.is-over { background: var(--mint); border-color: var(--brand); }
.drop__icon { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 12px; background: var(--mint); color: var(--brand-deep); display: grid; place-items: center; }
.drop__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.drop b { display: block; margin-bottom: 4px; }
.drop small { color: var(--ink-3); }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); animation: rise .3s var(--ease); }
.files li:last-child { border-bottom: 0; }
.ftype { width: 36px; height: 40px; border-radius: 4px; display: grid; place-items: center; font-family: var(--mono); font-size: 10px; font-weight: 600; color: #fff; background: var(--brand); }
.ftype--pdf { background: var(--debt); }
.ftype--xlsx { background: var(--ok); }
.ftype--docx { background: #3B6FB0; }
.fname { font-weight: 500; font-size: 13px; }
.fmeta { font-size: 12px; color: var(--ink-3); }
.files .progress { width: 140px; }

/* ─────────────── Панель лицевого счёта ─────────────── */
.drawer { position: fixed; inset: 0; z-index: 30; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(22,33,30,.35); animation: fade .2s; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--paper);
  box-shadow: var(--shadow-lg); overflow-y: auto; animation: slide .3s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.dp__head { background: #fff; padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; position: sticky; top: 0; }
.dp__head h2 { font-size: 18px; }
.dp__head .iconbtn { margin-left: auto; }
.dp__body { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.dp__hero { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.dp__hero.is-debt { border-color: var(--debt-line); background: linear-gradient(0deg, #fff, #FFF6F5); }
.dp__amt { font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.dp__hero.is-debt .dp__amt { color: var(--debt); }
.dp__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.fact { font-size: 13px; }
.fact span { display: block; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.fact.mono { font-family: var(--mono); }
.dp__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dp__actions .btn { justify-content: center; }
.ledger { width: 100%; }
.ledger td, .ledger th { padding: 8px 0; font-size: 13px; white-space: normal; }
.ledger th { background: transparent; padding-left: 0; }
.ledger td:first-child, .ledger th:first-child { padding-left: 0; width: auto; }
.ledger td.amt { padding-right: 0; }
.ledger .is-pay { color: var(--ok); }

/* ─────────────── Модальные окна ─────────────── */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; }
.modal__scrim { position: absolute; inset: 0; background: rgba(22,33,30,.45); animation: fade .2s; }
.modal__box { position: relative; width: min(600px, 100%); background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop .3s var(--ease); overflow: hidden; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.m__head { padding: 18px 22px 0; display: flex; align-items: flex-start; gap: 12px; }
.m__head h2 { font-size: 18px; }
.m__head p { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.m__head .iconbtn { margin-left: auto; }
.m__body { padding: 18px 22px; }
.m__foot { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; background: #FAFBFA; }
.m__foot .note { margin-right: auto; font-size: 12px; color: var(--ink-3); align-self: center; }

/* очередь рассылки / прозвона */
.queue { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.queue li { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; background: #fff; transition: background .3s; }
.queue li:last-child { border-bottom: 0; }
.queue li.is-active { background: #FBFDFC; }
.queue__name { font-weight: 500; }
.queue__phone { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.queue__state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); min-width: 150px; justify-content: flex-end; }
.spin { width: 12px; height: 12px; border: 2px solid var(--mint-2); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.queue__state.is-done { color: var(--ok); font-weight: 500; }
.queue__state.is-fail { color: var(--warn); font-weight: 500; }
.queue__state .ok::before { content: "✓ "; }
.wave { display: inline-flex; gap: 2px; align-items: center; height: 14px; }
.wave i { width: 3px; height: 4px; background: var(--brand); border-radius: 2px; animation: wave .8s infinite var(--ease); }
.wave i:nth-child(2) { animation-delay: .1s; } .wave i:nth-child(3) { animation-delay: .2s; } .wave i:nth-child(4) { animation-delay: .3s; }
@keyframes wave { 50% { height: 14px; } }
.summary { display: flex; gap: 22px; margin-top: 14px; }
.summary div { font-size: 12px; color: var(--ink-3); }
.summary b { display: block; font-family: var(--mono); font-size: 20px; color: var(--ink); }

/* шаги синхронизации ЕРЦ */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-s); color: var(--ink-3); font-size: 13px; }
.steps li .ic { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; font-size: 11px; }
.steps li.is-run { color: var(--ink); background: #F7FAF9; }
.steps li.is-run .ic { border-color: transparent; }
.steps li.is-done { color: var(--ink-2); }
.steps li.is-done .ic { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li .val { margin-left: auto; font-family: var(--mono); font-size: 12px; }
.checkdone { animation: pop .3s var(--ease); }

/* ─────────────── Тосты ─────────────── */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--brand-ink); color: #fff; padding: 12px 16px; border-radius: var(--r); box-shadow: var(--shadow-lg); font-size: 13px; display: flex; align-items: center; gap: 10px; animation: rise .3s var(--ease); max-width: 380px; }
.toast .dot { flex: none; }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: .3s; }

/* ─────────────── Адаптив ─────────────── */
@media (max-width: 1200px) { .grid--kpi { grid-template-columns: repeat(2, 1fr); } .stages { grid-template-columns: repeat(2, 1fr); } .grid--2, .grid--comms { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side__erc { margin-top: 10px; }
  .login { grid-template-columns: 1fr; }
  .login__side { padding: 24px; }
  .top { flex-direction: column; align-items: stretch; }
  .search { width: 100%; }
  .view { padding: 18px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
