
/* =============================================================================
   Design pass — окт. 2026 (только CSS, разметка и JS не тронуты).
   1. Списки не жмутся в узкую колонку на широком экране
   2. Кнопка поиска страницы встаёт в строку с вкладками, а не занимает свою
   3. Шапка: заголовок обычным регистром; «данные» остаются моноширинными,
      но подписи в карточках — рабочим Inter
   4. Настройки: сворачиваемые разделы выглядят как кликабельные строки
   5. Переключатели и «опасные» текстовые кнопки читаются в покое
   ============================================================================= */

/* --- 1. Ширина и сетка списков ------------------------------------------- */
@media (min-width: 1200px) {
  .content:has(#requests-body),
  .content:has(#clients-body) { max-width: 1120px; }
  #requests-body .list,
  #clients-body .list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
    gap: 10px;
    align-items: start;
  }
}

/* --- 2. Поиск страницы в одной строке с вкладками ------------------------- */
#requests-toolbar,
#clients-toolbar,
#leads-toolbar { position: relative; }
#requests-toolbar > div:first-child:not(.search-bar):not(.chip-row),
#clients-toolbar > div:first-child:not(.search-bar):not(.chip-row),
#leads-toolbar > div:first-child:not(.search-bar):not(.chip-row) {
  position: absolute;
  top: 8px;
  right: 16px;
  padding: 0 !important;
  z-index: 1;
}
#requests-toolbar .chip-row--tabs,
#clients-toolbar .chip-row--tabs,
#leads-toolbar .chip-row--tabs { padding-top: 14px; padding-right: 64px; }
@media (max-width: 859px) {
  #requests-toolbar .chip-row--tabs,
  #clients-toolbar .chip-row--tabs,
  #leads-toolbar .chip-row--tabs { padding-right: 60px; padding-top: 12px; }
  #requests-toolbar > div:first-child:not(.search-bar):not(.chip-row),
  #clients-toolbar > div:first-child:not(.search-bar):not(.chip-row),
  #leads-toolbar > div:first-child:not(.search-bar):not(.chip-row) { top: 6px; }
}
#requests-toolbar .icon-btn.on-light,
#clients-toolbar .icon-btn.on-light,
#leads-toolbar .icon-btn.on-light {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-dim);
}
#requests-toolbar .icon-btn.on-light:hover,
#clients-toolbar .icon-btn.on-light:hover,
#leads-toolbar .icon-btn.on-light:hover { color: var(--ink); border-color: var(--border-strong); }

/* --- 3. Типографика ------------------------------------------------------ */
.topbar-title {
  font-size: 20px;
  text-transform: none;
  letter-spacing: -0.02em;
}
.row-title { font-weight: 600; }
/* Моно — только для действительно «данных»; подписи вроде «Создал: Олег» — Inter */
.row-sub {
  font-family: var(--font-body);
  font-size: 12.5px;
  letter-spacing: 0;
  color: var(--ink-dim);
  margin-top: 4px;
}
.lead-f .lead-k { font-size: 11px; color: color-mix(in srgb, var(--ink-dim) 85%, var(--ink)); }

/* --- 4. Сворачиваемые разделы (Настройки) --------------------------------- */
.collapsible-head {
  margin: 12px 16px 0;
  min-height: 44px;
  padding: 0 8px 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  transition: border-color 0.13s ease, background 0.13s ease;
}
.collapsible-head:hover { border-color: var(--border-strong); background: var(--surface-2); }
.collapsible-head .section-label::before { display: none; }
.collapsible-head .section-label { font-size: 12px; letter-spacing: 0.05em; color: var(--ink); }
.collapsible-head .collapsible-chevron { order: -1; color: var(--ink-dim); }
.collapsible-head .btn { height: 30px; }
.collapsible.expanded .collapsible-head {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* --- 5. Контролы ---------------------------------------------------------- */
.switch .track { background: color-mix(in srgb, var(--ink-dim) 40%, var(--surface)); }
.switch input:checked + .track { background: var(--signal); }
.btn-danger-text {
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: var(--radius-s);
}

/* --- 6. Лицензии (оповещения об окончании r_keeper) ----------------------- */
.notif-type-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; }
.notif-type-icon svg { width: 100%; height: 100%; }

/* --- 7. Лицензии: список и блок в карточке объекта ------------------------ */
/* Мобильная нижняя лента: 10 пунктов не помещаются, «Лицензии» там скрыты —
   на них ведут колокольчик со сводкой и кнопка «Все лицензии» в карточке объекта. */
@media (max-width: 859px) {
  .app-nav .nav-item[data-path="/licenses"] { display: none; }
}

.lic-head { margin: 16px 16px 0; }
.lic-head-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lic-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
#licenses-body { padding: 16px; }
.lic-group { margin-bottom: 16px; }
.lic-group-label { margin: 0 0 8px; padding: 0; }
#licenses-body .list { gap: 8px; }
@media (min-width: 1200px) {
  .content:has(#licenses-body) { max-width: 1120px; }
  #licenses-body .list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
    gap: 10px;
    align-items: start;
  }
}

/* Срочность: бейдж «через N дн.» (без полоски слева — убрана по просьбе). */
.lic-row .row-top { align-items: center; }
.lic-main { flex: 1; min-width: 0; }
.lic-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; text-align: right; }
.lic-days { font-family: var(--font-mono); font-size: 13px; font-weight: 700; white-space: nowrap; }
.lic-days--danger { color: var(--danger); }
.lic-days--warn { color: var(--warning); }
.lic-days--calm { color: var(--ink); }
.lic-date { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-dim); }
.lic-chev { color: var(--ink-dim); display: inline-flex; flex-shrink: 0; }
.lic-chev svg { width: 18px; height: 18px; }

/* Плановое продление облака — спокойный чип, модули — заметный янтарный */
.lic-chip { margin-top: 2px; }
.lic-chip--main { background: var(--surface-2); color: var(--ink-dim); border: 1px solid var(--border-strong); }
.lic-chip--modules {
  background: color-mix(in srgb, var(--warning) 18%, var(--surface));
  color: color-mix(in srgb, var(--warning) 60%, var(--ink));
  border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent);
}

/* Блок в карточке объекта */
.lic-section-head { display: flex; align-items: center; margin: 16px 16px 0; }
.lic-section-head .section-label { margin: 0; padding: 0; flex: 1; font-weight: 700; }
.lic-card { padding-top: 4px; padding-bottom: 4px; }
.lic-stale { margin: 8px 0 0; }
.lic-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.lic-line:last-child { border-bottom: none; }
.lic-line-main { flex: 1; min-width: 0; }
.lic-line-title { font-size: 14px; font-weight: 600; }
