/* ============ Кнопки, инпуты, бейджи ============ */
.btn-primary {
  background: var(--grad); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 9px 16px; font-weight: 600; font-size: 13px; white-space: nowrap;
  box-shadow: var(--grad-shadow);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: .55; cursor: default; box-shadow: none; }
.btn-ghost {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 13px; color: var(--muted); font-size: 13px; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-text); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.btn-link { background: none; border: none; color: var(--accent-text); padding: 2px 4px; font-size: 12.5px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--red); }

.set-input {
  background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; min-height: 38px; outline: none; min-width: 0; transition: border-color .15s;
}
.set-input:focus { border-color: var(--accent); }
.set-input::placeholder { color: var(--faint); }
select.set-input { cursor: pointer; }
textarea.set-input { resize: vertical; min-height: 80px; }

/* чекбоксы: квадрат макета, отмеченный — градиент с галкой (галка картинкой, а не
   псевдоэлементом: у replaced-элементов псевдоэлементы работают ненадёжно) */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex-shrink: 0; margin: 0; vertical-align: middle;
  border: 1px solid var(--border); border-radius: 6px; background: var(--input-bg);
  cursor: pointer; transition: border-color .15s;
}
input[type="checkbox"]:hover { border-color: var(--accent); }
input[type="checkbox"]:checked {
  border-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"), var(--grad);
  background-size: 68% 68%, auto;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

.badge {
  display: inline-block; padding: 3px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge.gray { background: var(--card2); color: var(--muted); }
.badge.blue { background: var(--accent-soft); color: var(--accent-text); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--card2);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; font-size: 12.5px;
}
.chip button { background: none; border: none; color: var(--faint); padding: 0; font-size: 14px; }
.chip button:hover { color: var(--red); }

/* Сегментированный переключатель */
.seg {
  display: inline-flex; gap: 2px; padding: 4px;
  background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.seg button {
  background: none; border: none; border-radius: 9px; padding: 6px 13px;
  color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
/* компактный вариант — когда сегмент живёт в шапке карточки, а не в тулбаре */
.seg-sm { padding: 3px; }
.seg-sm button { padding: 5px 9px; font-size: 12px; }
.seg button.active { background: var(--grad); color: #fff; box-shadow: 0 4px 14px -4px rgba(99, 102, 241, .5); }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

/* ============ Модалки ============ */
.modal-wrap {
  position: fixed; inset: 0; background: rgba(6, 8, 14, .6); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px;
  overflow-y: auto;
}
/* форма (редактирование/платёж/задача) открывается ПОВЕРХ карточки клиента */
#fModal { z-index: 60; }
.modal-card {
  background: var(--card-solid); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; width: min(560px, 96vw);
  max-height: 92vh; overflow-y: auto;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.modal-head h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.modal-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.modal-close {
  background: none; border: none; font-size: 22px; color: var(--muted);
  line-height: 1; padding: 2px 6px; border-radius: 8px;
}
.modal-close:hover { color: var(--text); background: var(--hover); }
/* мелкие действия в шапке карточки: «Поделиться» стоит вплотную к крестику и весит столько же.
   Обе кнопки — в одинаковой квадратной коробке с центрированием: крестик это текстовый глиф со
   своей базовой линией, а «Поделиться» — inline-SVG, и без общей коробки они стоят вразнобой. */
.modal-head-acts { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.modal-head-acts > button {
  width: 30px; height: 30px; padding: 0; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-head-acts .modal-close { color: var(--muted); }
.head-act { background: none; border: none; color: var(--muted); line-height: 1; }
.head-act:hover { color: var(--text); background: var(--hover); }
.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.f-status { color: var(--red); font-size: 13px; }
.f-status.ok { color: var(--green); }

/* Конструктор форм */
.f-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* min-width:0 обязателен: у grid-элементов минимум по умолчанию — ширина содержимого,
   а у input[type=datetime-local] она большая, и колонка переставала сжиматься —
   форма вылезала за модалку и уезжала вправо */
.f-row { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f-row .set-input { width: 100%; max-width: 100%; }
.f-row.wide { grid-column: 1 / -1; }
.f-row label { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.f-row.checkbox { flex-direction: row; align-items: center; gap: 9px; grid-column: 1 / -1; }
.f-row.checkbox label { font-size: 13.5px; color: var(--text); font-weight: 400; }
.f-hint { font-size: 11.5px; color: var(--faint); margin-top: 3px; line-height: 1.4; }
@media (max-width: 560px) { .f-form { grid-template-columns: 1fr; } }

/* спойлер-группа в формах («Сайт и продления») */
.f-group { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 10px; }
.f-group summary {
  cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 600;
  user-select: none; -webkit-user-select: none;
}
.f-group summary:hover { color: var(--accent-text); }
.f-group .f-form { margin-top: 12px; }

/* ============ Карточка клиента — панель, выезжающая справа ============ */
#clientModal {
  align-items: stretch; justify-content: flex-end; padding: 0; overflow: hidden;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.client-card-modal {
  /* 760, а не 600: семи вкладкам карточки в 600 тесно — полоса вкладок уезжала
     в горизонтальную прокрутку, и часть разделов была не видна */
  width: min(760px, 100vw); max-width: none;
  height: 100vh; height: 100dvh; max-height: none;
  border: none; border-left: 1px solid var(--border); border-radius: 0;
  padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
  animation: drawerIn .25s ease;
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.client-card-modal .modal-head { flex-shrink: 0; padding: 18px 22px 0; margin-bottom: 12px; }
.client-card-modal .card-tabs { flex-shrink: 0; padding: 0 22px 12px; margin-bottom: 0; border-bottom: 1px solid var(--border); }
.client-card-modal .card-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 22px 24px; }

.client-head { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 14px; }
.client-head .ch-main { flex: 1; min-width: 0; }
.ch-avatar {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 800;
}
.client-head .ch-name { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.client-head .ch-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.card-tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 12px; }
.card-tabs button {
  background: none; border: none; border-radius: 9px;
  padding: 6px 11px; color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap;
}
.card-tabs button:hover { color: var(--text); }
.card-tabs button.active {
  background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-ring);
}
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 18px; }
.info-item .ii-label { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.info-item .ii-val { font-size: 13.5px; margin-top: 3px; word-break: break-word; }
.note-item { border-bottom: 1px solid var(--border); padding: 10px 2px; }
.note-item:last-child { border-bottom: none; }
.note-meta { color: var(--faint); font-size: 11.5px; display: flex; gap: 8px; align-items: center; }
.note-item.pinned { background: var(--amber-soft); border-radius: 10px; padding: 10px 12px; }
/* быстрые действия в строке списка (задачи и правки): удаление приглушено, краснеет при наведении */
.row-acts { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.row-acts .row-del { color: var(--faint); font-size: 17px; line-height: 1; padding: 0 6px; }
.row-acts .row-del:hover { color: var(--red); text-decoration: none; }
.quick-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.quick-row .set-input { flex: 1; min-width: 120px; }
/* Строка добавления платежа в ДДС — девять полей: разрешаем им сжиматься, иначе кнопка «＋»
   съезжает на следующую строку. Правило намеренно узкое: .quick-row живёт ещё в карточке
   клиента и настройках, там полей мало и сжимать их незачем. */
.quick-row.dds-add { gap: 6px; }
.quick-row.dds-add .set-input { flex: 1 1 84px; min-width: 0; }
.quick-row.dds-add #pqDate { flex: 0 0 142px; }
.quick-row.dds-add #pqNote { flex: 2 1 100px; }
.quick-row.dds-add .btn-primary { flex: 0 0 auto; white-space: nowrap; }

.cred-secret { font-family: ui-monospace, monospace; letter-spacing: .1em; }
.copy-btn { background: none; border: none; color: var(--faint); font-size: 13px; padding: 1px 4px; }
.copy-btn:hover { color: var(--accent-text); }

/* загрузка файлов: зона перетаскивания, выбранное к отправке, группы по пачкам */
.drop-zone {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  background: var(--input-bg); padding: 22px 16px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop-zone:hover { border-color: var(--accent); }
.drop-zone.over { border-color: var(--accent); background: var(--accent-soft); }
.dz-title { font-size: 13.5px; font-weight: 600; }
.dz-sub { font-size: 12px; color: var(--faint); margin-top: 5px; }

.file-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.fc-title { font-size: 12px; color: var(--muted); font-weight: 600; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px;
  max-width: 100%; overflow: hidden;
}
.file-chip b { color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.file-chip button { background: none; border: none; color: var(--faint); padding: 0 2px; font-size: 14px; line-height: 1; }
.file-chip button:hover { color: var(--red); }

.file-group { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 10px; overflow: hidden; }
.fg-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--card2); }
.fg-note { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; word-break: break-word; }
.fg-meta { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.fg-item {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 8px 12px; border-top: 1px solid var(--border);
}
/* у пачки без описания шапки нет — верхняя линия первой строки удвоила бы рамку */
.file-group .fg-item:first-child { border-top: none; }
.fg-item a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-size { color: var(--faint); font-size: 11.5px; }

/* переписка с Авито (только чтение) */
.chat-log {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 52vh; overflow-y: auto; padding: 4px 2px;
}
.chat-msg {
  max-width: 80%; align-self: flex-start;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 12px 12px 12px 4px; padding: 8px 11px;
}
.chat-msg.mine {
  align-self: flex-end; border-radius: 12px 12px 4px 12px;
  background: var(--accent-soft); border-color: var(--accent-ring);
}
.chat-text { font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.chat-time { font-size: 10.5px; color: var(--faint); margin-top: 4px; text-align: right; }

/* чек-лист */
.checklist { margin: 6px 0 0; padding: 0; list-style: none; }
.checklist li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.checklist li.done span { text-decoration: line-through; color: var(--faint); }

@media (max-width: 700px) {
  .modal-wrap { padding: 0; }
  .modal-card { border-radius: 0; width: 100vw; max-height: 100vh; border: none; }
}

/* ============ Тултипы и тосты ============ */
.info-i {
  display: inline-flex; width: 15px; height: 15px; border-radius: 50%;
  background: var(--card2); color: var(--faint); font-size: 10px; font-weight: 700;
  align-items: center; justify-content: center; cursor: help; border: 1px solid var(--border);
}
.info-i:hover { color: var(--accent-text); border-color: var(--accent); }
.tip-box {
  position: fixed; z-index: 90; max-width: 280px; background: var(--text); color: var(--bg);
  font-size: 12.5px; padding: 9px 11px; border-radius: 10px; pointer-events: none;
  box-shadow: var(--shadow);
  /* переносы строк в data-tip показываем как есть: подсказки к столбикам читаются в столбик */
  white-space: pre-line; line-height: 1.45;
}
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13px; z-index: 95; box-shadow: var(--shadow);
}
#toast.err { background: var(--red); color: #fff; }

/* инлайн-редактирование ячеек ДДС */
.cell-edit { cursor: pointer; border-bottom: 1px dashed transparent; }
tr:hover .cell-edit { border-bottom-color: var(--faint); }
.cell-input { width: 110px; min-height: 30px; padding: 4px 8px; } /* не разгоняем высоту строки таблицы */

/* ── визуализации: бары оплат, донат, горизонтальные бары, месяцы ── */
.pay-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 90px; }
.pay-pct { font-size: 11px; font-weight: 700; color: var(--faint); }
.pay-bar { width: 90px; height: 6px; background: var(--track); border-radius: 4px; overflow: hidden; }
.pay-bar i { display: block; height: 100%; background: var(--grad); border-radius: 4px; transition: width .3s ease; }
.pay-bar.full i { background: var(--green); }
.pay-bar.mini { width: 64px; display: inline-block; vertical-align: middle; }

.donut-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.donut { width: 156px; height: 156px; border-radius: 50%; position: relative; flex-shrink: 0; }
/* дырка доната: только непрозрачный цвет — полупрозрачный --card дал бы двойное наложение */
.donut::before { content: ""; position: absolute; inset: 24%; background: var(--card-solid); border-radius: 50%; }
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.donut-center b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.donut-center span { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.donut-legend { flex: 1; min-width: 190px; }
.dl-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.dl-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dl-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.dl-pct { color: var(--faint); font-size: 11.5px; width: 34px; text-align: right; }

.hbar-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.hbar-label { width: 110px; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { flex: 1; height: 10px; background: var(--track); border-radius: 5px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; background: var(--grad); border-radius: 5px; transition: width .3s ease; }
.hbar-val { width: 92px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }

.month-bars { display: flex; gap: 8px; align-items: stretch; padding-top: 6px; }
.mb-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.mb-pair { display: flex; gap: 3px; align-items: flex-end; height: 110px; width: 100%; justify-content: center; }
.mb-pair i { display: block; width: min(20px, 42%); border-radius: 4px 4px 0 0; }
.mb-in { background: var(--green); }
.mb-out { background: var(--red); }
.mb-label { font-size: 11px; color: var(--faint); }
/* число прибыли/суммы над столбиками месяца */
.mb-profit { font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums; min-height: 14px; color: var(--faint); }
.mb-profit.pos { color: var(--green); }
.mb-profit.neg { color: var(--red); }

/* Столбики по дням. За каждым днём дорожка во всю высоту: без неё пустой день читался как
   дыра в графике, а соседние дни сливались. Отдельно от .month-bars — там пара столбиков на
   6–14 колонок, тут одиночные на 30, и зазор нужен вчетверо меньше. */
.day-bars { display: flex; gap: 2px; align-items: flex-end; }
.db-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.db-rail {
  display: flex; flex-direction: column-reverse; height: 92px; width: min(16px, 88%);
  background: var(--track); border-radius: 4px; overflow: hidden;
}
.db-rail i { display: block; width: 100%; border-radius: 4px 4px 0 0; }
.db-col:hover .db-rail { filter: brightness(1.12); }
.db-pro { background: var(--green); }
.db-loss { background: var(--red); }
.db-label { font-size: 10px; color: var(--faint); height: 12px; font-variant-numeric: tabular-nums; }
.db-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: auto; padding-top: 10px; font-size: 12px; color: var(--muted); }
.db-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.db-legend .db-sum { margin-left: auto; }
/* на узком экране 30 колонок уже не помещаются — только там включаем прокрутку */
@media (max-width: 900px) {
  .day-bars { overflow-x: auto; }
  .db-col { flex: 0 0 12px; }
}

/* счета */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.acc-card { background: var(--card2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 15px; }
.acc-name { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.acc-owner { color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.acc-balance { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 8px; letter-spacing: -.01em; }
.acc-balance.neg { color: var(--red); }

/* предупреждение о кассовом разрыве */
.cash-warning {
  background: var(--red-soft); border: 1px solid var(--red); color: var(--red);
  border-radius: var(--radius-sm); padding: 11px 15px; margin-bottom: 16px; font-weight: 600; font-size: 13px;
}

/* воронка в «Аналитике»: сужающийся силуэт из трапеций (clip-path), метки слева */
.funnel {
  display: grid; grid-template-columns: minmax(130px, 32%) 1fr;
  align-items: stretch; margin-top: 4px;
}
.fn-label {
  display: flex; flex-direction: column; justify-content: center;
  text-align: right; padding: 0 14px 0 0; gap: 2px;
}
.fn-name { font-weight: 700; font-size: 13px; }
.fn-sub { color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.fn-lost { color: var(--red); }
.fn-band {
  position: relative; height: 46px;
  display: flex; align-items: center; justify-content: center;
}
.fn-band > i {
  position: absolute; inset: 0; background: var(--grad);
  transition: clip-path .3s ease, opacity .3s ease;
}
.fn-band > i.done { background: var(--green); opacity: 1 !important; }
.fn-cnt {
  position: relative; z-index: 1; color: #fff; font-weight: 800; font-size: 15px;
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
@media (prefers-reduced-motion: reduce) { .fn-band > i { transition: none; } }
@media (max-width: 560px) {
  .funnel { grid-template-columns: minmax(96px, 40%) 1fr; }
  .fn-name { font-size: 12.5px; }
}

/* ── интерактивный тур ── */
.tour-wrap { position: fixed; inset: 0; z-index: 100; }
.tour-spot {
  position: fixed; border-radius: var(--radius-sm); pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(6, 8, 14, .62), 0 0 0 1px var(--accent-ring) inset;
  transition: all .25s ease;
}
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }
.tour-card {
  position: fixed; width: 340px; max-width: calc(100vw - 24px);
  background: var(--card-solid); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 16px 48px -12px rgba(0, 0, 0, .5); padding: 16px 18px;
}
.tour-x {
  position: absolute; top: 8px; right: 10px; background: none; border: none;
  color: var(--muted); font-size: 18px; cursor: pointer; padding: 2px 6px;
}
.tour-title { font-weight: 800; font-size: 14.5px; margin-bottom: 6px; padding-right: 20px; }
.tour-text { font-size: 13px; line-height: 1.5; color: var(--muted); }
.tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tour-foot .spacer { flex: 1; }
.tour-dots { display: flex; gap: 4px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.tour-dots i.on { background: var(--accent); }
@media (max-width: 700px) {
  .tour-card { left: 12px !important; right: 12px; bottom: 12px; top: auto !important; width: auto; }
}

/* «Итого по клиентам»: строка флагов и разделитель секций аналитики */
.attn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.attn-t { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.an-section {
  font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase;
  letter-spacing: .06em; margin: 6px 2px 8px;
}
/* выбор отрезка по месяцам рядом с переключателем периодов Аналитики */
.an-range { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.an-month {
  background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 5px 8px; font-size: 12px; cursor: pointer; outline: none;
}
.an-month:focus { border-color: var(--accent); }
/* На телефоне переключатель периодов Аналитики (шесть кнопок) шире экрана, а «Аналитика» —
   единственная широкая вкладка, которая видна в приложении. Даём сегменту прокрутку внутри
   себя, иначе вбок уезжала бы вся страница. */
@media (max-width: 620px) {
  .toolbar .seg { max-width: 100%; overflow-x: auto; }
}
