/* ============================================================================
   SeriesUpdater — design system
   Единая система: одинаковые радиусы, высоты, состояния hover/focus/disabled
   для всех компонентов. Никаких точечных hardcoded значений по страницам.
   ========================================================================= */

:root {
  /* Поверхности */
  --bg:              #f5f7fa;
  --surface:         #ffffff;
  --surface-muted:   #f8fafc;
  --surface-hover:   #f1f5f9;
  --surface-accent:  #eff4ff;

  /* Акцент */
  --primary:         #2563eb;
  --primary-hover:   #1d4ed8;
  --primary-active:  #1e40af;
  --primary-soft:    #eff4ff;
  --primary-border:  #c7d9fe;

  /* Текст */
  --text:            #0f172a;
  --text-secondary:  #334155;
  --text-muted:      #64748b;
  --text-subtle:     #94a3b8;
  --text-inverse:    #ffffff;

  /* Границы */
  --border:          #e5e9f0;
  --border-strong:   #d5dbe5;
  --border-focus:    #93b4fd;

  /* Статусы */
  --success:         #16a34a;
  --success-soft:    #e8f8ef;
  --success-border:  #b7e8cb;
  --warning:         #d97706;
  --warning-soft:    #fef4e6;
  --warning-border:  #f7dcaf;
  --danger:          #dc2626;
  --danger-soft:     #fdecec;
  --danger-border:   #f6c6c6;
  --info:            #2563eb;
  --info-soft:       #eff4ff;
  --neutral-soft:    #f1f5f9;

  /* Радиусы */
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-pill: 999px;

  /* Тени */
  --shadow-sm:  0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md:  0 4px 14px rgba(15, 23, 42, .07);
  --shadow-lg:  0 16px 48px rgba(15, 23, 42, .14);

  /* Размеры */
  --control-h:   38px;
  --control-h-sm: 30px;
  --control-h-lg: 44px;
  --sidebar-w:  236px;
  --header-h:   64px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --t-fast: 150ms cubic-bezier(.4, 0, .2, 1);
  --t-base: 200ms cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

/* Атрибут hidden должен побеждать любой display из классов компонентов —
   иначе .alert{display:flex} и подобные «показывают» скрытые блоки. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

svg { flex-shrink: 0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d7dee8; border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #c2ccda; }

/* Общий видимый фокус для клавиатурной навигации */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── Каркас ──────────────────────────────────────────────────────────────── */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
}

.sidebar__brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Знак бренда: растровый логотип с прозрачным фоном, поэтому без подложки
   и без тени — они бы обвели картинку квадратом. */
.brand-logo {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-logo--lg { width: 40px; height: 40px; }

.sidebar__name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }

.sidebar__nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  width: 100%;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font: 500 14px var(--font);
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-item svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: var(--surface-hover); color: var(--text-secondary); }
.nav-item.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item.is-active svg { stroke: var(--primary); }
.nav-item--danger.is-active { background: var(--danger-soft); color: var(--danger); }
.nav-item--danger.is-active svg { stroke: var(--danger); }

.sidebar__footer { padding: 12px; border-top: 1px solid var(--border); }

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header__title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.header__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Гамбургер появляется только на узких экранах (правило в медиазапросе ниже).
   Специфичность .icon-btn.burger нужна, чтобы перебить display:grid у .icon-btn. */
.icon-btn.burger { display: none; }

/* Профиль */
.profile {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 4px 4px;
  border: 0; background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--t-fast);
}
.profile:hover { background: var(--surface-hover); }
.profile__avatar {
  width: 34px; height: 34px; border-radius: var(--radius-pill);
  background: linear-gradient(140deg, #3b82f6, #2563eb);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.profile__meta { text-align: left; line-height: 1.25; }
.profile__name { font-size: 13px; font-weight: 600; color: var(--text); }
.profile__role { font-size: 11.5px; color: var(--text-muted); }

.page { padding: 24px; flex: 1; }
.page[hidden] { display: none; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head__text { min-width: 0; }
.page-head__title { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.page-head__sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.page-head__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 4px; }
.breadcrumbs b { color: var(--text-secondary); font-weight: 600; }

/* ── Кнопки ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--control-h);
  padding: 0 15px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font: 600 13.5px var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn--primary:active:not(:disabled) { background: var(--primary-active); }

.btn--secondary { background: var(--surface); color: var(--text-secondary); border-color: var(--border-strong); }
.btn--secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--text-subtle); }

.btn--ghost { background: transparent; color: var(--text-muted); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text-secondary); }

.btn--soft { background: var(--primary-soft); color: var(--primary); }
.btn--soft:hover:not(:disabled) { background: #e0eaff; }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #b91c1c; }

.btn--danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn--danger-soft:hover:not(:disabled) { background: #fbdcdc; }

.btn--sm { height: var(--control-h-sm); padding: 0 11px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn--sm svg { width: 14px; height: 14px; }
.btn--lg { height: var(--control-h-lg); padding: 0 20px; font-size: 14px; }
.btn--block { width: 100%; }

.icon-btn {
  width: var(--control-h); height: var(--control-h);
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.icon-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn--plain { border-color: transparent; background: transparent; }
.icon-btn--sm { width: var(--control-h-sm); height: var(--control-h-sm); }
.icon-btn--sm svg { width: 15px; height: 15px; }
.icon-btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn.has-dot::after {
  content: ""; position: absolute; top: 7px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface);
}

/* Спиннер загрузки внутри кнопок */
.spinner {
  width: 15px; height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Поля ────────────────────────────────────────────────────────────────── */

.field { display: block; margin-bottom: 14px; }
.field__label {
  display: block;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field__label .req { color: var(--danger); }
.field__hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.field__error { font-size: 12px; color: var(--danger); margin-top: 5px; display: none; }
.field.has-error .field__error { display: block; }

.input, .select, .textarea {
  width: 100%;
  height: var(--control-h);
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  font: 400 13.5px var(--font);
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; }
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-subtle); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--surface-muted); color: var(--text-muted); cursor: not-allowed;
}
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }

.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px;
  cursor: pointer;
}

.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 36px; }
.input-group__icon {
  position: absolute; left: 12px;
  width: 16px; height: 16px;
  stroke: var(--text-subtle); fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}
.input-group__btn {
  position: absolute; right: 6px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0; background: transparent; border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer;
}
.input-group__btn:hover { background: var(--surface-hover); color: var(--text); }
.input-group__btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.input-group:has(.input-group__btn) .input { padding-right: 40px; }

.search { position: relative; width: 260px; }
.search .input { padding-left: 34px; height: var(--control-h); background: var(--surface-muted); border-color: var(--border); }
.search .input:focus { background: var(--surface); }
.search__icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--text-subtle); fill: none; stroke-width: 2; stroke-linecap: round; }
.search__kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font: 500 11px var(--font); color: var(--text-subtle);
  border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 5px;
  background: var(--surface); pointer-events: none;
}

/* Переключатель */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 38px; height: 22px; border-radius: var(--radius-pill);
  background: #cbd5e1; position: relative; flex-shrink: 0;
  transition: background var(--t-fast);
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast);
}
.switch input:checked + .switch__track { background: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: .5; cursor: not-allowed; }
.switch__label { font-size: 13.5px; color: var(--text-secondary); }

/* Чекбокс */
.checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--text-secondary); }
.checkbox input {
  appearance: none; width: 17px; height: 17px; flex-shrink: 0;
  border: 1.5px solid var(--border-strong); border-radius: 5px;
  background: var(--surface); cursor: pointer; position: relative;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.checkbox input:checked { background: var(--primary); border-color: var(--primary); }
.checkbox input:checked::after {
  content: ""; position: absolute; left: 5px; top: 1.5px;
  width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}
.checkbox input:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

/* ── Карточки ────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card__title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.card__sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.card__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card__body { padding: 20px; }
.card__body--tight { padding: 8px 12px; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }

/* Плитка показателя */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat__label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.stat__value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 8px; line-height: 1.1; }
.stat__delta { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; margin-top: 10px; }
.stat__delta svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.stat__delta--up { color: var(--success); }
.stat__delta--down { color: var(--danger); }
.stat__delta--flat { color: var(--text-muted); }
.stat__delta--warn { color: var(--warning); }

/* ── Бейджи ──────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge--success { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.badge--danger  { background: var(--danger-soft);  color: var(--danger);  border-color: var(--danger-border); }
.badge--warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-border); }
.badge--info    { background: var(--info-soft);    color: var(--info);    border-color: var(--primary-border); }
.badge--neutral { background: var(--neutral-soft); color: var(--text-muted); border-color: var(--border); }

.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.dot-status { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-status--online { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot-status--offline { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot-status--idle { background: var(--text-subtle); box-shadow: 0 0 0 3px var(--neutral-soft); }

/* ── Таблицы ─────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
  white-space: nowrap;
}
.table th:first-child { border-top-left-radius: var(--radius-lg); }
.table th:last-child  { border-top-right-radius: var(--radius-lg); }
.table td {
  padding: 13px 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-muted); }
.table tbody tr:last-child td { border-bottom: 0; }
.table__primary { font-weight: 600; color: var(--text); }
.table__num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.is-sortable { cursor: pointer; user-select: none; }
.table th.is-sortable:hover { color: var(--text-secondary); }
.table th .sort-icon { display: inline-block; width: 12px; margin-left: 4px; opacity: .45; }
.table th.is-sorted .sort-icon { opacity: 1; color: var(--primary); }
.table__actions { display: flex; gap: 4px; justify-content: flex-end; }

.mono { font-family: var(--mono); font-size: 12.5px; }

/* Кликабельное значение с копированием */
.copyable { display: inline-flex; align-items: center; gap: 6px; }
.copyable__btn {
  border: 0; background: transparent; padding: 2px; cursor: pointer;
  color: var(--text-subtle); border-radius: 4px; display: grid; place-items: center;
  opacity: 0; transition: opacity var(--t-fast), color var(--t-fast);
}
.copyable__btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.copyable:hover .copyable__btn, .copyable__btn:focus-visible { opacity: 1; }
.copyable__btn:hover { color: var(--primary); background: var(--surface-hover); }

/* Пагинация */
.pagination { display: flex; align-items: center; gap: 6px; }
.pagination__info { font-size: 12.5px; color: var(--text-muted); margin-right: auto; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 9px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-sm);
  font: 500 13px var(--font); color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.page-btn:hover:not(:disabled):not(.is-active) { background: var(--surface-hover); }
.page-btn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }
.page-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.page-ellipsis { color: var(--text-subtle); padding: 0 2px; }

/* ── Фильтры ─────────────────────────────────────────────────────────────── */

.filter-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .search { width: 280px; }
.filter-bar .select { width: auto; min-width: 140px; }
.filter-bar__spacer { margin-left: auto; }

/* ── Табы ────────────────────────────────────────────────────────────────── */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
  border: 0; background: transparent;
  padding: 10px 14px;
  font: 500 13.5px var(--font); color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tab:hover { color: var(--text-secondary); }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Пилюли-фильтры (страница пресетов) */
.pills { display: flex; gap: 7px; flex-wrap: wrap; }
.pill {
  height: 32px; padding: 0 14px;
  border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: var(--radius-md);
  font: 500 13px var(--font); color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.pill:hover { background: var(--surface-hover); }
.pill.is-active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ── Степпер ─────────────────────────────────────────────────────────────── */

.stepper { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: var(--radius-md); }
.step__num {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  background: var(--neutral-soft); color: var(--text-muted);
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.step__num svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.step__label { font-size: 13.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.step.is-active { background: var(--primary-soft); }
.step.is-active .step__num { background: var(--primary); color: #fff; }
.step.is-active .step__label { color: var(--primary); font-weight: 600; }
.step.is-done .step__num { background: var(--success-soft); color: var(--success); }
.step.is-done .step__label { color: var(--text-secondary); }
.step__sep { width: 18px; height: 1px; background: var(--border-strong); flex-shrink: 0; }

/* Прогресс по шагам (реальные этапы деплоя) */
.checklist { display: flex; flex-direction: column; gap: 2px; }
.checklist__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-muted);
}
.checklist__mark {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  border: 1.5px solid var(--border-strong);
}
.checklist__mark svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.checklist__item--done { color: var(--text-secondary); }
.checklist__item--done .checklist__mark { background: var(--success); border-color: var(--success); color: #fff; }
.checklist__item--active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.checklist__item--active .checklist__mark { border-color: var(--primary); color: var(--primary); }
.checklist__item--active .checklist__mark::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  animation: pulse 1.4s ease-in-out infinite;
}
.checklist__item--error { color: var(--danger); }
.checklist__item--error .checklist__mark { background: var(--danger); border-color: var(--danger); color: #fff; }
.checklist__note { margin-left: auto; font-size: 12px; color: var(--text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Массовый выбор: колонка-чекбокс, панель действий, список выбора ─────── */

/* Колонка выбора узкая намеренно: она не должна выталкивать «Действия»
   за пределы карточки на обычном мониторе. */
.table__pick { width: 18px; padding-left: 14px !important; padding-right: 0 !important; }
.table th:last-child, .table td:last-child { padding-right: 10px; }
.table__pick input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
.table tbody tr.is-selected { background: var(--primary-soft); }
.table tbody tr.is-selected:hover { background: #e5edff; }

/* Панель массовых действий появляется только когда что-то выбрано */
.bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-lg);
  background: var(--primary-soft);
}
.bulk-bar__count { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--primary); }
.bulk-bar__count svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* Список выбора доменов в мастере удаления */
.pick-list {
  max-height: 340px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface-muted);
}
.pick-list__empty { padding: 24px; text-align: center; font-size: 13px; color: var(--text-muted); }
.pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background var(--t-fast);
}
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: var(--surface-muted); }
.pick-row.is-checked { background: var(--danger-soft); }
.pick-row input { width: 15px; height: 15px; accent-color: var(--danger); cursor: pointer; flex-shrink: 0; }
.pick-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30%; }

/* На телефоне важно видеть домен целиком — им подтверждают удаление,
   поэтому проект и лишние отступы уступают место имени. */
@media (max-width: 620px) {
  .pick-row { padding: 9px 10px; gap: 8px; }
  .pick-row__meta { display: none; }
  .pick-row__name { font-size: 12px; }
  .pick-row .badge { font-size: 10.5px; padding: 1px 6px; }
}

/* Перечень доменов на шаге подтверждения — читаемый, но не бесконечный */
.delete-list {
  max-height: 190px; overflow-y: auto;
  margin: 12px auto 0; max-width: 420px;
  padding: 10px 14px; text-align: left;
  font-size: 12.5px; line-height: 1.7;
  border: 1px solid var(--danger-border); border-radius: var(--radius-md);
  background: var(--danger-soft); color: var(--danger);
}

/* Полоса прогресса */
.progress { height: 6px; background: var(--neutral-soft); border-radius: var(--radius-pill); overflow: hidden; }
.progress__bar { height: 100%; background: var(--primary); border-radius: var(--radius-pill); transition: width var(--t-base); }
.progress__bar--danger { background: var(--danger); }
.progress__bar--success { background: var(--success); }
.progress--indeterminate .progress__bar { width: 35% !important; animation: indeterminate 1.5s ease-in-out infinite; }
@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(330%); } }

/* Мини-метр для CPU/RAM/диска */
.meter { display: flex; align-items: center; gap: 9px; }
.meter__track { flex: 1; height: 5px; min-width: 54px; background: var(--neutral-soft); border-radius: var(--radius-pill); overflow: hidden; }
.meter__fill { height: 100%; border-radius: var(--radius-pill); background: var(--primary); transition: width var(--t-base); }
.meter__fill--warn { background: var(--warning); }
.meter__fill--danger { background: var(--danger); }
.meter__value { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-secondary); min-width: 34px; text-align: right; }

/* ── Состояния ───────────────────────────────────────────────────────────── */

.empty-state { text-align: center; padding: 48px 24px; }
.empty-state__icon {
  width: 52px; height: 52px; border-radius: var(--radius-lg);
  background: var(--surface-muted); border: 1px solid var(--border);
  display: grid; place-items: center; margin: 0 auto 16px;
  color: var(--text-subtle);
}
.empty-state__icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty-state__title { font-size: 15px; font-weight: 650; color: var(--text); }
.empty-state__text { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; max-width: 400px; margin-inline: auto; }
.empty-state__actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; }
.empty-state--error .empty-state__icon { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }

.skeleton {
  background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 50%, #eef1f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--radius-sm);
  height: 14px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton--row { height: 44px; border-radius: var(--radius-md); margin-bottom: 8px; }
.skeleton--card { height: 104px; border-radius: var(--radius-lg); }

.alert {
  display: flex; gap: 12px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: 13.5px;
  line-height: 1.55;
}
.alert svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.alert__title { font-weight: 650; margin-bottom: 3px; }
.alert--info    { background: var(--info-soft);    border-color: var(--primary-border);  color: #1e40af; }
.alert--success { background: var(--success-soft); border-color: var(--success-border);  color: #15803d; }
.alert--warning { background: var(--warning-soft); border-color: var(--warning-border);  color: #b45309; }
.alert--danger  { background: var(--danger-soft);  border-color: var(--danger-border);   color: #b91c1c; }

/* ── Модальные окна ──────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade var(--t-base);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  animation: rise var(--t-base);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.modal--md { max-width: 560px; }
.modal--lg { max-width: 720px; }
.modal--xl { max-width: 900px; }

.modal__head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px 0;
}
.modal__title { font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.modal__close {
  margin-left: auto; width: 30px; height: 30px;
  border: 0; background: transparent; border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer;
  display: grid; place-items: center;
}
.modal__close svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.modal__close:hover { background: var(--surface-hover); color: var(--text); }
.modal__body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal__foot {
  padding: 16px 22px;
  display: flex; gap: 10px;
  border-top: 1px solid var(--border);
}
.modal__foot .btn { flex: 1; }
.modal__foot--end { justify-content: flex-end; }
.modal__foot--end .btn { flex: none; min-width: 118px; }

/* Иконка-«герой» для подтверждений */
.modal__hero { text-align: center; padding: 26px 22px 0; }
.modal__hero-icon {
  width: 58px; height: 58px; border-radius: var(--radius-lg);
  display: grid; place-items: center; margin: 0 auto 16px;
}
.modal__hero-icon svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.modal__hero-icon--danger { background: var(--danger-soft); color: var(--danger); }
.modal__hero-icon--warning { background: var(--warning-soft); color: var(--warning); }
.modal__hero-icon--success { background: var(--success-soft); color: var(--success); }
.modal__hero-icon--info { background: var(--info-soft); color: var(--info); }
.modal__hero-title { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.modal__hero-text { font-size: 13.5px; color: var(--text-muted); margin-top: 8px; line-height: 1.6; }
.modal__hero-text strong { color: var(--text); }
.modal__hero-text .danger-domain { color: var(--danger); font-weight: 650; }

/* ── Тосты ───────────────────────────────────────────────────────────────── */

#toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column-reverse; gap: 10px;
  max-width: calc(100vw - 40px);
}
.toast {
  display: flex; gap: 12px; align-items: flex-start;
  width: 360px; max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 14px 15px;
  animation: toast-in var(--t-base);
}
.toast.is-leaving { animation: toast-out var(--t-base) forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
.toast__icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; }
.toast__icon svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.toast__icon--success { background: var(--success-soft); color: var(--success); }
.toast__icon--error   { background: var(--danger-soft);  color: var(--danger); }
.toast__icon--warning { background: var(--warning-soft); color: var(--warning); }
.toast__icon--info    { background: var(--info-soft);    color: var(--info); }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-size: 13.5px; font-weight: 650; color: var(--text); }
.toast__text { font-size: 13px; color: var(--text-muted); margin-top: 2px; word-break: break-word; }
.toast__action { margin-top: 8px; }
.toast__close { border: 0; background: transparent; color: var(--text-subtle); cursor: pointer; padding: 2px; border-radius: 4px; display: grid; place-items: center; }
.toast__close svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.toast__close:hover { background: var(--surface-hover); color: var(--text); }

/* ── Выпадающие меню ─────────────────────────────────────────────────────── */

.dropdown { position: relative; display: inline-flex; }
.dropdown__menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 5px;
  animation: rise var(--t-fast);
}
.dropdown__menu--left { right: auto; left: 0; }
.dropdown__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  border: 0; background: transparent; border-radius: var(--radius-sm);
  font: 500 13.5px var(--font); color: var(--text-secondary);
  cursor: pointer; text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
}
.dropdown__item svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dropdown__item:hover { background: var(--surface-hover); color: var(--text); }
.dropdown__item--danger { color: var(--danger); }
.dropdown__item--danger:hover { background: var(--danger-soft); }
.dropdown__sep { height: 1px; background: var(--border); margin: 5px 0; }
.dropdown__label { padding: 7px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .04em; }

/* Подсказки */
.tooltip { position: relative; }
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff;
  font: 500 12px var(--font); white-space: nowrap;
  padding: 5px 9px; border-radius: var(--radius-sm);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-fast);
  z-index: 70;
}
.tooltip:hover::after, .tooltip:focus-visible::after { opacity: 1; }

/* ── Просмотр логов ──────────────────────────────────────────────────────── */

.log-layout { display: grid; grid-template-columns: 236px 1fr; gap: 16px; align-items: start; }
.log-files { display: flex; flex-direction: column; gap: 2px; padding: 8px; max-height: 560px; overflow-y: auto; }
.log-files__group { font-size: 11.5px; font-weight: 600; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .04em; padding: 10px 10px 5px; }
.log-file {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px;
  border: 0; background: transparent; border-radius: var(--radius-sm);
  font: 500 13px var(--font); color: var(--text-secondary);
  cursor: pointer; text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
}
.log-file svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.log-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-file:hover { background: var(--surface-hover); }
.log-file.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.log-view {
  background: #0f172a;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  height: 500px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.85;
}
.log-line { display: flex; gap: 10px; white-space: pre-wrap; word-break: break-word; }
.log-line__ts { color: #64748b; flex-shrink: 0; }
.log-line__lvl { flex-shrink: 0; width: 62px; font-weight: 600; }
.log-line__text { color: #cbd5e1; flex: 1; min-width: 0; }
.log-line--INFO     .log-line__lvl { color: #7dabf8; }
.log-line--DEBUG    .log-line__lvl { color: #8b96a8; }
.log-line--WARNING  .log-line__lvl { color: #e3a008; }
.log-line--WARNING  .log-line__text { color: #f0cb8b; }
.log-line--ERROR    .log-line__lvl { color: #f27979; }
.log-line--ERROR    .log-line__text { color: #f2b2b2; }
.log-line--CRITICAL .log-line__lvl { color: #ff8a8a; }
.log-line--CRITICAL .log-line__text { color: #ffc2c2; }
.log-empty { color: #64748b; }

.code-block {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  font-family: var(--mono); font-size: 12px; line-height: 1.7;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Карточки пресетов ───────────────────────────────────────────────────── */

.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.preset-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: box-shadow var(--t-fast), border-color var(--t-fast);
}
.preset-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.preset-card__preview {
  height: 120px;
  background: linear-gradient(135deg, #eef4ff, #f8fafc);
  display: grid; place-items: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
/* В превью лежит логотип пресета, а не скриншот страницы — показываем его
   целиком, а не обрезаем по краям. */
.preset-card__preview img { width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.preset-card__preview-placeholder { display: grid; place-items: center; gap: 8px; color: var(--text-subtle); }
.preset-card__preview-placeholder svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.preset-card__type {
  position: absolute; top: 10px; right: 10px;
}
.preset-card__body { padding: 14px 16px; display: flex; align-items: center; gap: 11px; }
.preset-card__logo {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  background: var(--surface-muted); border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
}
.preset-card__logo img { width: 100%; height: 100%; object-fit: cover; }
.preset-card__name { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-card__meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-card__foot { padding: 0 16px 16px; display: flex; gap: 8px; margin-top: auto; }
.preset-card__foot .btn { flex: 1; }

.preset-card--add {
  border-style: dashed;
  border-color: var(--border-strong);
  background: var(--surface-muted);
  display: grid; place-items: center;
  min-height: 232px;
  cursor: pointer;
  color: var(--text-muted);
  box-shadow: none;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.preset-card--add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.preset-card--add__inner { display: grid; place-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; }
.preset-card--add__inner svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; }

/* Выбор пресета в форме деплоя */
.preset-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.preset-option {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.preset-option:hover { border-color: var(--primary-border); background: var(--surface-muted); }
.preset-option.is-selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.preset-option__logo { width: 32px; height: 32px; border-radius: var(--radius-sm); margin: 0 auto 8px; background: var(--surface-muted); display: grid; place-items: center; overflow: hidden; }
.preset-option__logo img { width: 100%; height: 100%; object-fit: cover; }
.preset-option__name,
.preset-option__meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-option__name { font-size: 12.5px; font-weight: 600; }
.preset-option__meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* Пресетов может быть много — ограничиваем высоту, чтобы форма деплоя
   помещалась на экран без бесконечной прокрутки. */
.preset-picker--scroll { max-height: 260px; overflow-y: auto; padding: 2px; }

/* ── График активности ───────────────────────────────────────────────────── */

.chart { width: 100%; height: 210px; display: block; }
.chart__legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.chart__legend-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.chart__legend-swatch { width: 9px; height: 9px; border-radius: 3px; }

/* ── Список серверов ─────────────────────────────────────────────────────── */

.server-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
}
.server-row:last-child { border-bottom: 0; }
.server-row__name { font-size: 13.5px; font-weight: 600; min-width: 68px; }
.server-row__metrics { display: flex; gap: 16px; margin-left: auto; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.server-metric { display: flex; align-items: center; gap: 7px; min-width: 118px; }
.server-metric__label { font-size: 12px; color: var(--text-muted); width: 34px; }

/* ── Служебные утилиты ───────────────────────────────────────────────────── */

.row { display: grid; gap: 14px; }
.row--2 { grid-template-columns: 1fr 1fr; }
.row--3 { grid-template-columns: repeat(3, 1fr); }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.grid-main--wide { grid-template-columns: minmax(0, 1fr) 420px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--sm { gap: 10px; }
.inline { display: flex; align-items: center; gap: 10px; }
.inline--wrap { flex-wrap: wrap; }
.spacer { margin-left: auto; }
.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* Список «ключ — значение» */
.kv { display: flex; flex-direction: column; gap: 1px; }
.kv__row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.kv__row:last-child { border-bottom: 0; }
.kv__key { color: var(--text-muted); min-width: 168px; flex-shrink: 0; }
.kv__val { color: var(--text-secondary); word-break: break-word; }

/* Строка настроек с переключателем */
.setting-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: 0; }
.setting-row__text { min-width: 0; }
.setting-row__title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.setting-row__desc { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.setting-row__control { margin-left: auto; flex-shrink: 0; }

/* Зона загрузки файла */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  min-height: 92px;
  display: grid; place-items: center; gap: 6px;
  color: var(--text-muted);
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.dropzone:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.dropzone svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dropzone img { max-width: 46px; max-height: 46px; object-fit: contain; border-radius: var(--radius-sm); }
.dropzone__hint { font-size: 12px; }

/* ── Адаптивность ────────────────────────────────────────────────────────── */

@media (max-width: 1400px) {
  .grid-main, .grid-main--wide { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 1180px) {
  .grid-main, .grid-main--wide { grid-template-columns: 1fr; }
  .search { width: 200px; }
  .log-layout { grid-template-columns: 200px 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--t-base);
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after {
    content: ""; position: fixed; inset: 0; z-index: 39;
    background: rgba(15, 23, 42, .4);
  }
  .main { margin-left: 0; }
  .icon-btn.burger { display: grid; }
  .header { padding: 0 16px; gap: 10px; }
  .header__title { font-size: 17px; }
  .search { width: 150px; }
  .search__kbd { display: none; }
  .profile__meta { display: none; }
  .page { padding: 16px; }
  .row--2, .row--3 { grid-template-columns: 1fr; }
  .log-layout { grid-template-columns: 1fr; }
  .log-files { max-height: 190px; flex-direction: row; overflow-x: auto; }
  .log-files__group { display: none; }
  .log-file { white-space: nowrap; width: auto; }
  .modal__foot { flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
  .kv__key { min-width: 120px; }

  /* Заголовок карточки и её управляющие элементы на узком экране —
     в две строки, иначе кнопки/пилюли сжимаются в столбик. */
  .card__head { flex-wrap: wrap; }
  .card__actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .card__actions .select { flex: 1; }
  .pills { width: 100%; }
  .pills .pill { flex: 1; }
}

@media (max-width: 620px) {
  /* Прячем ТОЛЬКО глобальный поиск в шапке — поиск внутри страниц
     (домены, история, пресеты, логи) на мобильном нужен не меньше. */
  .header__search { display: none; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat__value { font-size: 24px; }
  .filter-bar > * { flex: 1 1 auto; }
  .filter-bar .search, .filter-bar .select { width: 100%; }
  .stepper { gap: 2px; }
  .step { padding: 6px 8px; }
  .step__label { display: none; }
  .step.is-active .step__label { display: block; }
  .server-row { flex-wrap: wrap; }
  .server-row__metrics { width: 100%; margin-left: 0; justify-content: flex-start; }
}

@media print { .sidebar, .header__actions, .page-head__actions { display: none; } }
