/* ==========================================================================
   Компоненты и каркас приложения
   ========================================================================== */

/* ---------- каркас ---------- */

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  padding: var(--s-5) var(--s-3) var(--s-4);
  background: linear-gradient(180deg, oklch(0.13 0.018 262 / 0.92), oklch(0.11 0.02 262 / 0.96));
  border-right: 1px solid var(--line-soft);
  backdrop-filter: blur(18px) saturate(1.2);
  z-index: 40;
}

:root[data-theme='light'] .sidebar {
  background: linear-gradient(180deg, oklch(0.98 0.006 250 / 0.95), oklch(0.955 0.008 250 / 0.97));
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-1) var(--s-3) var(--s-3);
}

.brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(150deg, oklch(0.83 0.125 198 / 0.22), oklch(0.83 0.125 198 / 0.05));
  border: 1px solid oklch(0.83 0.125 198 / 0.26);
  color: var(--accent);
  box-shadow: var(--glow-accent);
}

.brand__mark svg {
  width: 22px;
  height: 22px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.brand__name {
  font-size: var(--fs-14);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand__sub {
  font-size: var(--fs-11);
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav__label {
  padding: var(--s-2) var(--s-3);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  height: 40px;
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-13);
  font-weight: 520;
  text-decoration: none;
  transition:
    background-color var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out);
}

.nav__item svg {
  width: 18px;
  height: 18px;
  flex: none;
  opacity: 0.8;
}

.nav__item:hover {
  background: var(--neutral-soft);
  color: var(--text);
  text-decoration: none;
}

.nav__item.is-active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

.nav__item.is-active::before {
  content: '';
  position: absolute;
  left: -var(--s-3);
  left: -12px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 12px oklch(0.83 0.125 198 / 0.55);
}

.nav__item.is-active svg {
  color: var(--accent);
  opacity: 1;
}

.nav__badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 650;
  background: var(--danger-soft);
  color: var(--danger-bright);
  font-variant-numeric: tabular-nums;
}

.sidebar__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.host-chip {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  min-width: 0;
}

.host-chip__icon {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-2);
}

.host-chip__icon svg {
  width: 17px;
  height: 17px;
}

.host-chip__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.host-chip__name {
  font-size: var(--fs-12);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-chip__detail {
  font-size: var(--fs-11);
  color: var(--text-3);
  font-family: var(--font-mono);
}

/* ---------- основная область ---------- */

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  height: var(--topbar-h);
  padding: 0 var(--s-6);
  background: var(--surface-glass);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(18px) saturate(1.15);
}

.topbar__heading {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.topbar__title {
  font-size: var(--fs-15);
  font-size: 15px;
  font-weight: 640;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__sub {
  font-size: var(--fs-11);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  height: 34px;
  min-width: 190px;
  padding: 0 var(--s-2) 0 var(--s-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--text-3);
  font-size: var(--fs-12);
  transition:
    border-color var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out),
    background-color var(--dur-2) var(--ease-out);
}

.search-trigger svg {
  width: 15px;
  height: 15px;
}

.search-trigger kbd {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  color: var(--text-3);
  font-family: var(--font-mono);
}

.search-trigger:hover {
  border-color: var(--line-strong);
  color: var(--text-2);
}

.scan-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 34px;
  padding: 0 var(--s-4) 0 var(--s-3);
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--fs-12);
  font-weight: 650;
  overflow: hidden;
  transition:
    transform var(--dur-1) var(--ease-out),
    background-color var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.25) inset, 0 6px 18px -8px oklch(0.83 0.125 198 / 0.7);
}

.scan-btn svg {
  width: 15px;
  height: 15px;
}

.scan-btn:hover {
  background: var(--accent-strong);
}

.scan-btn:active {
  transform: scale(0.96);
}

.scan-btn:disabled {
  cursor: default;
  background: var(--surface-2);
  color: var(--text-2);
  box-shadow: none;
}

.scan-btn__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: calc(var(--progress, 0) * 1%);
  background: var(--accent-ink);
  opacity: 0.5;
  transition: width var(--dur-3) var(--ease-out);
}

.scan-btn .spin {
  animation: spin 1s linear infinite;
}

.scan-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  background: transparent;
  overflow: hidden;
}

.scan-progress__fill {
  height: 100%;
  width: calc(var(--progress, 0) * 1%);
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-strong));
  transition: width var(--dur-3) var(--ease-out);
  box-shadow: 0 0 12px oklch(0.83 0.125 198 / 0.8);
}

.icon-btn {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  color: var(--text-3);
  transition:
    background-color var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn:hover {
  background: var(--neutral-soft);
  color: var(--text);
}

.icon-btn--bordered {
  border-color: var(--line-soft);
  background: var(--surface);
}

.icon-btn--danger:hover {
  background: var(--danger-soft);
  color: var(--danger-bright);
}

.menu-btn {
  display: none;
}

/* ---------- страница ---------- */

.page {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--s-6) var(--s-6) var(--s-10);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.page__head {
  display: flex;
  align-items: flex-end;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.page__head-main {
  min-width: 0;
}

.page__title {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--fs-28);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.page__desc {
  margin-top: 3px;
  font-size: var(--fs-13);
  color: var(--text-3);
  max-width: 72ch;
}

.page__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* ---------- карточки ---------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, oklch(1 1 1 / 0.022), transparent 42%), var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

:root[data-theme='light'] .card {
  background: var(--surface);
}

.card--flush {
  padding: 0;
}

.card--interactive {
  transition:
    border-color var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
}

@media (hover: hover) {
  .card--interactive:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-3);
  }
}

.card__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5) var(--s-3);
}

.card__head--tight {
  padding-bottom: var(--s-2);
}

.card__title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-13);
  font-weight: 640;
  letter-spacing: -0.005em;
}

.card__title svg {
  width: 15px;
  height: 15px;
  color: var(--text-3);
}

.card__hint {
  margin-left: auto;
  font-size: var(--fs-11);
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.card__body {
  padding: 0 var(--s-5) var(--s-5);
  min-width: 0;
}

.card__body--tight {
  padding: 0 var(--s-2) var(--s-2);
}

.card__foot {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-12);
  color: var(--text-3);
}

.card__link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--accent);
}

.card__link svg {
  width: 13px;
  height: 13px;
  transition: transform var(--dur-2) var(--ease-out);
}

.card__link:hover {
  text-decoration: none;
}

@media (hover: hover) {
  .card__link:hover svg {
    transform: translateX(2px);
  }
}

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 36px;
  padding: 0 var(--s-4);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: var(--fs-13);
  font-weight: 600;
  white-space: nowrap;
  transition:
    transform var(--dur-1) var(--ease-out),
    background-color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn:active:not(:disabled) {
  transform: scale(0.96);
}

.btn:disabled {
  opacity: 0.55;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.24) inset;
}

.btn--primary:hover {
  background: var(--accent-strong);
}

.btn--secondary {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text);
}

.btn--secondary:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
}

.btn--ghost {
  color: var(--text-2);
}

.btn--ghost:hover {
  background: var(--neutral-soft);
  color: var(--text);
}

.btn--danger {
  background: var(--danger-soft);
  color: var(--danger-bright);
  border-color: oklch(0.72 0.19 22 / 0.35);
}

.btn--danger:hover {
  background: oklch(0.72 0.19 22 / 0.22);
}

.btn--sm {
  height: 30px;
  padding: 0 var(--s-3);
  font-size: var(--fs-12);
  border-radius: var(--r-xs);
}

.btn--sm svg {
  width: 14px;
  height: 14px;
}

.btn--block {
  width: 100%;
}

.btn--loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn--loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  color: var(--text);
}

/* ---------- статусы ---------- */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
  background: var(--text-faint);
  position: relative;
}

.status-dot.is-up {
  background: var(--success);
  box-shadow: 0 0 0 3px oklch(0.82 0.155 158 / 0.14);
}

.status-dot.is-down {
  background: var(--danger-bright);
  box-shadow: 0 0 0 3px oklch(0.72 0.19 22 / 0.16);
}

.status-dot.is-degraded {
  background: var(--warning);
  box-shadow: 0 0 0 3px oklch(0.85 0.145 82 / 0.14);
}

.status-dot.is-unknown {
  background: var(--text-faint);
}

.status-dot.is-live::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid currentColor;
  color: var(--accent);
  animation: pulse-ring 2.4s var(--ease-out) infinite;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-full);
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--text-2);
  background: var(--neutral-soft);
}

.status-pill.is-up {
  color: var(--success);
  background: var(--success-soft);
}

.status-pill.is-down {
  color: var(--danger-bright);
  background: var(--danger-soft);
}

.status-pill.is-degraded {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-pill.is-unknown {
  color: var(--text-3);
  background: var(--neutral-soft);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: var(--fs-11);
  font-weight: 560;
  color: var(--text-2);
  background: var(--neutral-soft);
  white-space: nowrap;
}

.pill--accent {
  color: var(--accent);
  background: var(--accent-soft);
}

.pill--warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.pill--danger {
  color: var(--danger-bright);
  background: var(--danger-soft);
}

.pill--success {
  color: var(--success);
  background: var(--success-soft);
}

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

.pill svg {
  width: 12px;
  height: 12px;
}

.badge-demo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ---------- сегменты, вкладки ---------- */

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}

.segmented__item {
  height: 28px;
  padding: 0 var(--s-3);
  border-radius: 6px;
  font-size: var(--fs-12);
  font-weight: 550;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background-color var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out);
}

.segmented__item:hover {
  color: var(--text);
}

.segmented__item.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-1);
}

.segmented__count {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}

.segmented__item.is-active .segmented__count {
  color: var(--accent);
}

.tabs {
  display: flex;
  gap: var(--s-1);
  border-bottom: 1px solid var(--line-soft);
}

.tab {
  position: relative;
  height: 40px;
  padding: 0 var(--s-3);
  font-size: var(--fs-13);
  font-weight: 550;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--dur-2) var(--ease-out);
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: var(--text);
  font-weight: 620;
}

.tab.is-active::after {
  content: '';
  position: absolute;
  left: var(--s-2);
  right: var(--s-2);
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}

/* ---------- поля ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field__label {
  font-size: var(--fs-12);
  font-weight: 560;
  color: var(--text-2);
}

.field__hint {
  font-size: var(--fs-11);
  color: var(--text-3);
}

.input,
.textarea,
.select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
  font-size: var(--fs-13);
  transition:
    border-color var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-faint);
}

.input:hover,
.textarea:hover {
  border-color: var(--line-strong);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-softer);
}

.textarea {
  height: auto;
  min-height: 84px;
  padding: var(--s-2) var(--s-3);
  resize: vertical;
  line-height: 1.5;
}

.input[type='time'] {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-3);
}

/* переключатель */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch__track {
  width: 38px;
  height: 22px;
  flex: none;
  border-radius: var(--r-full);
  background: var(--surface-3);
  border: 1px solid var(--line);
  position: relative;
  transition:
    background-color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out);
}

.switch__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-2);
  transition:
    transform var(--dur-3) var(--ease-spring),
    background-color var(--dur-2) var(--ease-out);
}

.switch input:checked + .switch__track {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked + .switch__track::after {
  transform: translateX(16px);
  background: var(--accent-ink);
}

.switch input:focus-visible + .switch__track {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.switch__label {
  font-size: var(--fs-13);
  color: var(--text);
}

.switch__sub {
  font-size: var(--fs-11);
  color: var(--text-3);
}

/* ---------- таблица ---------- */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: var(--surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-13);
}

.table th {
  text-align: left;
  font-size: var(--fs-11);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
  white-space: nowrap;
}

.table td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-2);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background-color var(--dur-2) var(--ease-out);
}

.table tbody tr:hover {
  background: var(--neutral-soft);
}

.table tbody tr.is-clickable {
  cursor: pointer;
}

.table__name {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 180px;
}

.table__name strong {
  font-weight: 600;
  color: var(--text);
}

.table__sub {
  display: block;
  font-size: var(--fs-11);
  color: var(--text-3);
  font-family: var(--font-mono);
}

/* ---------- список статусов ---------- */

.site-list {
  display: flex;
  flex-direction: column;
}

.site-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  min-height: 54px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  width: 100%;
  color: var(--text);
  transition: background-color var(--dur-2) var(--ease-out);
}

.site-row:last-child {
  border-bottom: none;
}

.site-row:hover {
  background: var(--neutral-soft);
}

.site-row__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.site-row__name {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-13);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-row__meta {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-11);
  color: var(--text-3);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
}

.site-row__metric {
  font-size: var(--fs-12);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 54px;
}

.site-row__bars {
  width: 84px;
  flex: none;
}

/* ---------- полоски аптайма ---------- */

.bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
}

.bars__item {
  flex: 1;
  min-width: 2px;
  border-radius: 2px;
  background: var(--line);
  height: 55%;
  transition:
    height var(--dur-2) var(--ease-out),
    opacity var(--dur-2) var(--ease-out);
}

.bars__item.is-up {
  background: oklch(0.82 0.155 158 / 0.75);
  height: 100%;
}

.bars__item.is-degraded {
  background: var(--warning);
  height: 82%;
}

.bars__item.is-down {
  background: var(--danger-bright);
  height: 100%;
}

.bars__item.is-none {
  background: var(--line-soft);
  height: 30%;
}

.bars__item:hover {
  opacity: 0.75;
}

.bars--lg {
  height: 34px;
  gap: 3px;
}

.bars--lg .bars__item {
  border-radius: 3px;
}

/* ---------- кольцевые индикаторы ---------- */

.rings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
}

.ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
}

.ring__chart {
  position: relative;
  width: 86px;
  height: 86px;
}

.ring__chart svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring__track {
  stroke: var(--line-soft);
}

.ring__value {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 900ms var(--ease-out);
}

.ring--cpu .ring__value {
  stroke: var(--accent);
}

.ring--mem .ring__value {
  stroke: var(--info);
}

.ring--disk .ring__value {
  stroke: var(--warning);
}

.ring--disk.is-danger .ring__value {
  stroke: var(--danger-bright);
}

.ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.ring__pct {
  font-size: var(--fs-16);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.ring__unit {
  font-size: 9px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ring__label {
  font-size: var(--fs-11);
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
}

.ring__label svg {
  width: 13px;
  height: 13px;
}

/* ---------- метрики ---------- */

.metric {
  position: relative;
  padding: var(--s-4) var(--s-5) var(--s-3);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.metric__top {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
}

.metric__label {
  font-size: var(--fs-12);
  color: var(--text-3);
  font-weight: 520;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric__icon {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  background: var(--neutral-soft);
  flex: none;
}

.metric__icon svg {
  width: 14px;
  height: 14px;
}

.metric__value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: var(--fs-34);
  font-weight: 620;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.metric__value small {
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
}

.metric__value .unit {
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--text-3);
}

.metric__meta {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-11);
  color: var(--text-3);
  min-width: 0;
}

.metric__delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 650;
  background: var(--success-soft);
  color: var(--success);
  white-space: nowrap;
}

.metric__delta.is-bad {
  background: var(--danger-soft);
  color: var(--danger-bright);
}

.metric__delta.is-warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.metric__delta.is-flat {
  background: var(--neutral-soft);
  color: var(--text-3);
}

.metric__spark {
  margin-top: auto;
  height: 34px;
  width: 100%;
}

.metric__spark svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ---------- лента событий ---------- */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline__item {
  position: relative;
  display: flex;
  gap: var(--s-3);
  padding: 0 0 var(--s-4) 0;
  min-height: 44px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: 0;
  width: 1px;
  background: var(--line-soft);
}

.timeline__item:last-child::before {
  display: none;
}

.timeline__node {
  width: 27px;
  height: 27px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--line-soft);
  z-index: 1;
}

.timeline__node svg {
  width: 13px;
  height: 13px;
}

.timeline__node.is-critical {
  background: var(--danger-soft);
  color: var(--danger-bright);
  border-color: oklch(0.72 0.19 22 / 0.28);
}

.timeline__node.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: oklch(0.85 0.145 82 / 0.26);
}

.timeline__node.is-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: oklch(0.82 0.155 158 / 0.26);
}

.timeline__body {
  min-width: 0;
  padding-top: 2px;
}

.timeline__title {
  font-size: var(--fs-12);
  font-weight: 560;
  color: var(--text);
  overflow-wrap: anywhere;
}

.timeline__meta {
  font-size: var(--fs-11);
  color: var(--text-3);
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.timeline__detail {
  font-size: var(--fs-11);
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-top: 1px;
  overflow-wrap: anywhere;
}

/* ---------- предупреждение сверху ---------- */

.alert-banner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid oklch(0.72 0.19 22 / 0.32);
  background: linear-gradient(90deg, oklch(0.72 0.19 22 / 0.14), oklch(0.72 0.19 22 / 0.04));
  color: var(--text);
  font-size: var(--fs-12);
}

.alert-banner--warning {
  border-color: oklch(0.85 0.145 82 / 0.3);
  background: linear-gradient(90deg, oklch(0.85 0.145 82 / 0.12), oklch(0.85 0.145 82 / 0.03));
}

.alert-banner__icon {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--danger-soft);
  color: var(--danger-bright);
}

.alert-banner--warning .alert-banner__icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.alert-banner__icon svg {
  width: 16px;
  height: 16px;
}

.alert-banner__text {
  min-width: 0;
}

.alert-banner__title {
  font-weight: 620;
}

.alert-banner__detail {
  font-size: var(--fs-11);
  color: var(--text-3);
}

.alert-banner__actions {
  margin-left: auto;
  display: flex;
  gap: var(--s-2);
  flex: none;
}

/* ---------- пустые состояния ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--s-2);
  padding: var(--s-9) var(--s-5);
  color: var(--text-3);
}

.empty__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  color: var(--text-3);
  margin-bottom: var(--s-2);
}

.empty__icon svg {
  width: 24px;
  height: 24px;
}

.empty__title {
  font-size: var(--fs-15);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.empty__text {
  font-size: var(--fs-12);
  max-width: 44ch;
}

.empty__actions {
  margin-top: var(--s-3);
  display: flex;
  gap: var(--s-2);
}

/* ---------- тосты ---------- */

.toasts {
  position: fixed;
  right: var(--s-5);
  bottom: var(--s-5);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  max-width: min(380px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  animation: rise var(--dur-3) var(--ease-out) both;
  font-size: var(--fs-12);
}

.toast__icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--accent);
  margin-top: 1px;
}

.toast--success .toast__icon {
  color: var(--success);
}

.toast--error .toast__icon {
  color: var(--danger-bright);
}

.toast__text {
  min-width: 0;
}

.toast__title {
  font-weight: 620;
  color: var(--text);
}

.toast__desc {
  color: var(--text-3);
  font-size: var(--fs-11);
  margin-top: 1px;
}

.toast__close {
  margin-left: auto;
  color: var(--text-3);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 5px;
}

.toast__close:hover {
  background: var(--neutral-soft);
  color: var(--text);
}

.toast__close svg {
  width: 13px;
  height: 13px;
}

/* ---------- модальные окна / drawer ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: oklch(0.05 0.01 262 / 0.6);
  backdrop-filter: blur(3px);
  animation: fade var(--dur-2) var(--ease-out) both;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 72;
  width: min(580px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  animation: drawer-in var(--dur-3) var(--ease-out) both;
}

@keyframes drawer-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.drawer__head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-5) var(--s-4);
  border-bottom: 1px solid var(--line-soft);
}

.drawer__title-block {
  min-width: 0;
  flex: 1;
}

.drawer__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-11);
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-bottom: 2px;
}

.drawer__title {
  font-size: var(--fs-22);
  font-weight: 650;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.drawer__actions {
  display: flex;
  gap: var(--s-1);
  flex: none;
}

.drawer__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s-4) var(--s-5) var(--s-8);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.drawer__foot {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}

.modal {
  position: fixed;
  z-index: 74;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  animation: modal-in var(--dur-3) var(--ease-out) both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 10px)) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line-soft);
}

.modal__title {
  font-size: var(--fs-15);
  font-size: 15px;
  font-weight: 640;
}

.modal__body {
  padding: var(--s-4) var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5) var(--s-4);
}

/* ---------- командная палитра ---------- */

.palette {
  position: fixed;
  z-index: 76;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 24px));
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: modal-in var(--dur-3) var(--ease-out) both;
  animation-name: palette-in;
}

@keyframes palette-in {
  from {
    opacity: 0;
    transform: translate(-50%, -6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.palette__search {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-4);
  border-bottom: 1px solid var(--line-soft);
}

.palette__search svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  flex: none;
}

.palette__input {
  flex: 1;
  height: 52px;
  border: none;
  background: none;
  font-size: var(--fs-15);
  font-size: 15px;
  color: var(--text);
  outline: none;
}

.palette__results {
  max-height: 54vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s-2);
}

.palette__item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  text-align: left;
  color: var(--text-2);
  transition: background-color var(--dur-1) var(--ease-out);
}

.palette__item.is-selected {
  background: var(--accent-soft);
  color: var(--text);
}

.palette__item-main {
  min-width: 0;
  flex: 1;
}

.palette__item-name {
  font-size: var(--fs-13);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.palette__item-meta {
  font-size: var(--fs-11);
  color: var(--text-3);
  font-family: var(--font-mono);
}

.palette__empty {
  padding: var(--s-6);
  text-align: center;
  color: var(--text-3);
  font-size: var(--fs-12);
}

.palette__foot {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-2) var(--s-4);
  border-top: 1px solid var(--line-soft);
  font-size: 10.5px;
  color: var(--text-3);
}

.palette__foot kbd {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-family: var(--font-mono);
}

/* ---------- прочее ---------- */

.divider {
  height: 1px;
  background: var(--line-soft);
  border: none;
  margin: 0;
}

.kv {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: var(--s-2) var(--s-3);
  font-size: var(--fs-12);
  align-items: baseline;
}

.kv dt {
  color: var(--text-3);
}

.kv dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
}

.copy-row code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--text-2);
}

.copy-btn {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition:
    background-color var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out);
}

.copy-btn svg {
  width: 13px;
  height: 13px;
}

.copy-btn:hover {
  background: var(--neutral-soft);
  color: var(--text);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 200px;
  flex: 1;
  max-width: 340px;
}

.search-field > svg {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--text-3);
  pointer-events: none;
}

.search-field .input {
  height: 34px;
  padding-left: 34px;
}

.result-note {
  font-size: var(--fs-11);
  color: var(--text-3);
  white-space: nowrap;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}

::-webkit-details-marker {
  display: none;
}