/* Admin polish (07.11.2026, owner: «везде одинаково, как в Пользователях, только на 5% больше отступа»; «все косяки
   исправить, сделать максимально удобным для всей команды»). Loaded last, so it wins over the older files. */

/* ---------- one width everywhere: no 2200px column centred on wide screens, the same edges in every section ---------- */
.workspace,
.workspace:has(.users-layout),
.workspace:has(.cb-root) { max-width: none; margin-inline: 0; padding-inline: clamp(18px, 3.3vw, 53px) }
@media (min-width: 2300px) { .workspace { max-width: none } }

/* the dashboard on a wide screen: more in a row instead of stretched cards */
@media (min-width: 2300px) {
  .dash-middle { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) }
}
/* forms stay readable on a wide screen - aligned to the same left edge, not centred */
.crm-settings-form, .prune-panel .form-row { max-width: 1100px }

/* ---------- statuses: plain muted text, colour only where something needs attention (owner, 06.11.2026) ---------- */
.chip { padding: 0; background: none !important; border-radius: 0; color: var(--muted); text-transform: none; letter-spacing: 0; font: 500 13px/1.3 var(--f-body) }
.chip::before { display: none }
.chip-ok { color: var(--muted) }
.chip-off { color: var(--faint) }
.chip-warn { color: var(--warn) }
.chip-warn::before { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor }
body.crm-shell .chip { border-radius: 0 !important }

/* ---------- an empty chart: just the words in the middle of its panel, without empty axes ---------- */
.chart-panel:has(.chart-blank) { display: flex; flex-direction: column }
.chart-blank { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 120px; padding: 16px; color: var(--muted); font: 500 13px var(--f-body) }

/* ---------- «Сегодня» ---------- */
.today-root { display: flex; flex-direction: column; gap: 18px }
.today-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 18px }
.today-head p { margin: 0; color: var(--muted) }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; align-items: start }
.today-list { display: flex; flex-direction: column }
.today-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; width: 100%; padding: 11px 4px;
  border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer }
.today-row:first-child { border-top: 0 }
.today-row:hover { background: var(--surface-2) }
.today-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.today-row small { grid-column: 1; color: var(--muted); font-size: 13px }
.today-row .today-when { grid-row: 1 / span 2; grid-column: 2; color: var(--muted); font: 500 12px var(--f-mono); white-space: nowrap }
.today-row .today-when.is-late { color: var(--warn) }
.today-more { margin-top: 8px; align-self: flex-start }
.today-calm { padding: 28px 4px; color: var(--muted) }
.today-count { color: var(--faint); font: 500 13px var(--f-mono) }

/* ---------- search (Ctrl+K) ---------- */
.nav-search { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--sunken); color: var(--muted); font: 500 13px var(--f-body); cursor: pointer }
.nav-search:hover { color: var(--ink); border-color: var(--line-strong) }
.nav-search svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8 }
.nav-search kbd { margin-left: auto; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; font: 500 11px var(--f-mono); color: var(--faint) }
[data-side-collapsed="true"] .nav-search span, [data-side-collapsed="true"] .nav-search kbd { display: none }
.palette { width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 120px)); margin: 12vh auto auto; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); overflow: hidden }
.palette::backdrop { background: rgba(0, 0, 0, .45) }
.palette input { width: 100%; margin: 0; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; font: 500 16px var(--f-body) }
.palette input:focus { outline: none }
.palette-list { max-height: min(460px, calc(100vh - 200px)); overflow-y: auto; padding: 6px }
.palette-group { padding: 10px 12px 4px; color: var(--faint); font: 500 11px var(--f-body) }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink);
  font: 500 14px var(--f-body); text-align: left; cursor: pointer }
.palette-item small { margin-left: auto; color: var(--muted); font: 500 12px var(--f-mono); white-space: nowrap }
.palette-item.is-on { background: var(--surface-2) }
.palette-empty { padding: 22px 14px; color: var(--muted) }
@media (max-width: 860px) { .nav-search kbd { display: none } }
.today-grid > .panel { margin: 0 }

/* ---------- no glows (07.11.2026, owner: «градиент иишный, полоска норм»): the blue line on top of the numbers stays;
   the chosen card and tariff - the blue border on a flat surface, no gradient ---------- */
.kpi-filter.selected { border-color: var(--accent); background: var(--surface) }
.plan-card.selected { border-color: var(--accent); background: var(--sunken) }
.login-screen::before { display: none }

/* «Сегодня»: «Ответили» next to a support row */
.today-item { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line) }
.today-item:first-child { border-top: 0 }
.today-item .today-row { flex: 1; min-width: 0; border-top: 0 }
.today-item .table-action { flex: none }

/* ---------- 15.11.2026: the admin tidied (screens on a computer and a phone) ---------- */
/* «Сегодня»: what does not work at the clients - across the whole width */
/* the top blocks share the width among themselves (two - halves, three - thirds); «Не работает у клиентов» is below, apart -
   in one grid with it three columns stayed and two blocks left an empty third (15.11.2026) */
.today-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)) }
.today-wide { margin-top: 18px }
.today-wide > .panel { margin: 0 }
/* «Настройщики»: wider cards - «32 мин» and «6 + 1 соцсети» on one line */
.setter-cards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) }
.setter-card-stats dd { white-space: nowrap }
/* «Тарифы»: the old plans folded under the subscriptions */
.plan-old { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px }
.plan-old > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0 12px; list-style-position: inside }
.plan-old[open] > summary { color: var(--ink) }
@media (max-width: 760px) {
  /* the number squares of «Настройщики» two in a row, as in «Пользователи» */
  .setters-root .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .setters-root .kpi-card strong { font-size: 30px; white-space: nowrap }
  /* the card's tabs fit the screen: «История» was cut off */
  .client-card-tabs { gap: 14px; overflow-x: auto; scrollbar-width: none }
  .client-card-tabs button { white-space: nowrap; font-size: 13px }
  /* the exit button's corner as the others' (a 10 px corner on a small square looked cut) */
  .logout-button { --notch: 7px }
}
@media (max-width: 520px) {
  /* a product: its name over the whole row, then days | Продлить | Закрыть in one row (Закрыть was alone below) */
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px }
  .product-row-name { grid-column: 1 / -1; margin-top: 6px }
  .product-row > :last-child { grid-column: auto }
}

/* 15.11.2026: the five improvements */
/* the log: a client's name is a link to his card */
.log-client { border: 0; background: none; padding: 0; color: var(--accent-text); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px }
/* the card → «Доступ»: the folded networks (the rows are display: contents - [hidden] alone would not hide them) */
.product-row[hidden] { display: none }
/* «Пользователи»: the search and «Фильтры» in one line, the filters under them when open */
.clients-tools { flex-wrap: nowrap; align-items: center }
.clients-tools .clients-search { flex: 1 1 260px; min-width: 0 }
.clients-filter-toggle { flex: none }
.clients-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 12px }
.clients-filters[hidden] { display: none }
.clients-filters .clients-filter { flex: 1 1 180px; min-width: 0 }
/* Дашборд: the four numbers next to the ring - in the middle of their squares, not at the top with empty space under them */
.kpi-grid .kpi-card { display: flex; flex-direction: column; justify-content: center }
/* 23.11.2026 (the screens' check): on a phone the search takes its own line, «Фильтры» and «Воронки AI-сейлза» go under it */
@media (max-width: 600px) {
  .clients-tools { flex-wrap: wrap }
  .clients-tools .clients-search { flex: 1 1 100% }
}

