/* ===========================================================================
   node_card.css — карточка ноды (модальное окно с телеметрией).
   Открытие — кнопка «Карточка ноды» в попапе ноды (node_card.js).
   =========================================================================== */

/* --- Кнопка в попапе ------------------------------------------------------- */
.popup__card-btn {
  appearance: none;
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 6px 10px;
  background: var(--accent-weak);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.popup__card-btn:hover { border-color: var(--accent); }

/* --- Оверлей и модальное окно ----------------------------------------------- */
.nc-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000; /* поверх topbar (1000) и leaflet-контролов */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  background: color-mix(in srgb, #0b0f14 55%, transparent);
  overflow-y: auto;
}
.nc-overlay[hidden] { display: none; }

.nc-modal {
  position: relative;
  width: min(780px, 100%);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
}
.nc-close {
  appearance: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  font-size: 14px;
  cursor: pointer;
}
.nc-close:hover { background: var(--bg-elev-2); color: var(--text); }

/* --- Шапка + текущая информация --------------------------------------------- */
.nc-head { padding-right: 36px; margin-bottom: 10px; }
.nc-name { font-weight: 600; font-size: 17px; }
.nc-sub { color: var(--text-muted); font-size: 13px; margin-top: 1px; }

.nc-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 24px;
  padding: 10px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13px;
}
.nc-info__row { display: flex; justify-content: space-between; gap: 12px; }
.nc-info__k { color: var(--text-muted); }
.nc-info__v { font-variant-numeric: tabular-nums; text-align: right; }
.nc-tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text-muted);
  margin-top: 4px;
  align-self: start;
}
@media (max-width: 560px) {
  .nc-info { grid-template-columns: 1fr; }
}

/* --- Селектор периода --------------------------------------------------------- */
.nc-period { margin-bottom: 14px; }
.nc-period__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.nc-period__label {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 4px;
}
.nc-btn {
  appearance: none;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.nc-btn:hover { color: var(--text); border-color: var(--border-strong); }
.nc-btn--active, .nc-btn--active:hover {
  color: var(--accent);
  background: var(--accent-weak);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}

.nc-period__custom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.nc-period__custom[hidden] { display: none; }
.nc-date {
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  color-scheme: light dark;
}

/* --- Графики ------------------------------------------------------------------ */
.nc-status {
  padding: 28px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}
.nc-status--err { color: var(--danger); }

.nc-chart { margin-bottom: 16px; }
.nc-chart__title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.nc-chart__box {
  position: relative; /* Chart.js responsive sizing */
  height: 200px;
}
