:root {
  --bg: linear-gradient(180deg, rgba(24,24,31,.92), rgba(18,18,24,.92));
  --panel: linear-gradient(180deg, rgba(24,24,31,.92), rgba(18,18,24,.92)); /* #2b2a31; */
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.7);
  --border: rgba(255, 255, 255, 0.10);
  --sidebar-width: 280px; /* стартовая ширина */
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -ms-overflow-style: none;    /* старый Edge/IE */
  scrollbar-width: none;       /* Firefox */
}

.layout {
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  min-width: 180px;
  max-width: 40vw; /* <= 40% */
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  overflow: hidden;
}

.sidebar .title {
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px 0;
}

.nav {
  display: grid;
  gap: 6px;
  margin-right: 10px;
}

.nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
}

.nav a:hover {
  border-color: var(--border);
}

.nav a.active {
  background: rgba(255,255,255,0.08);
  border-color: var(--border);
}

.resizer {
  width: 6px;
  cursor: col-resize;
  background: rgba(255,255,255,0.04);
}

.resizer:hover {
  background: rgba(255,255,255,0.10);
}

.content {
  flex: 1;
  padding: 24px;
  overflow: auto;
  -ms-overflow-style: none;    /* старый Edge/IE */
  scrollbar-width: none;       /* Firefox */
}

.content h1 { margin-top: 0; }

/* Loader overlay */
body.is-loading {
  overflow: hidden;
}

#app {
  opacity: 1;
  transition: opacity 160ms ease;
}

body.is-loading #app {
  opacity: 0;
  pointer-events: none;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg);
  z-index: 9999;
  transition: opacity 180ms ease;
}

.loading-overlay.is-hidden {
  opacity: 0;
}

.loading-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.loading-title {
  font-weight: 700;
  font-size: 16px;
}

.loading-subtitle {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.loading-noscript {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: rgba(255,255,255,0.85);
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* For Uptime Kuma */
.kuma-center {
  height: calc(100vh - 48px);
  /* height: 100%; */
  display: flex;
  align-items: center;
  justify-content: center;
}

.kuma-frame {
  width: min(1200px, 100%);
  height: min(850px, 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

.content { height: 100%; }

/* Убираем лишние поля у контента для страницы со статусом */
.content--full {
  padding: 0;        /* если хочешь прям в край */
  overflow: hidden;  /* чтобы не было скролла вокруг iframe */
}

.content::-webkit-scrollbar {  /* Chrome/Yandex/Safari */
  width: 0;
  height: 0;
}
/* iframe занимает всю доступную область справа от sidebar */
.kuma-frame--full {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;         /* без рамки */
  border-radius: 0;  /* если хочешь без скруглений */
  background: transparent;
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.sidebar-footer {
  margin-top: auto;            /* магия: уводит футер вниз */
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.sidebar-footer__title {
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.sidebar-footer__sub {
  margin-top: 4px;
  opacity: 0.8;
}
/* Ссылки */
/* Зелёные ссылки только там, где ты явно поставишь class="link" */
a.link {
  color: #42f59e;
  text-decoration: none;
  border-bottom: 1px solid rgba(66, 245, 158, 0.35);
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

a.link:hover {
  color: #7bffbf;
  border-bottom-color: rgba(123, 255, 191, 0.75);
}

a.link:active {
  color: #2fe08a;
}

a.link:visited {
  color: #42f59e; /* без фиолетового */
}

a.link:focus-visible {
  outline: 2px solid rgba(66, 245, 158, 0.55);
  outline-offset: 3px;
  border-radius: 6px;
  background: rgba(66, 245, 158, 0.08);
}

/* Таблицы */
.table-card {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  overflow: hidden;
}

.table-scroll {
  overflow: auto;
}

.svc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px; /* чтобы колонки не слипались */
}

.svc-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(0,0,0,0.30);
  border-bottom: 1px solid var(--border);
  padding: 14px 14px;
}

.svc-table tbody td {
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: top;
}

.svc-table tbody tr:nth-child(odd) td {
  background: rgba(255,255,255,0.015);
}

.svc-table tbody tr:hover td {
  background: rgba(66,245,158,0.06);
}

.svc-name {
  font-weight: 700;
  font-size: 14px;
}

.svc-meta {
  margin-top: 6px;
}

.tag {
  display: inline-block;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--muted);
  background: rgba(255,255,255,0.03);
}

.tag-ok {
  border-color: rgba(66,245,158,0.35);
  color: rgba(123,255,191,0.95);
  background: rgba(66,245,158,0.08);
  margin-bottom: 4px;
}

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Рыжее предупреждение (на всю ширину) */
.alert-warn {
  width: 100%;
  display: block;

  padding: 14px 16px;
  margin: 14px 0;

  border-radius: 14px;
  border: 1px solid rgba(255, 165, 0, 0.35);
  background: rgba(255, 165, 0, 0.10);

  color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px rgba(0,0,0,0.20);

  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  cursor: default;
}

.alert-warn:hover {
  background: rgba(255, 165, 0, 0.14);
  border-color: rgba(255, 165, 0, 0.50);
  transform: translateY(-1px);
  box-shadow: 0 14px 38px rgba(0,0,0,0.28);
}

.alert-warn:active {
  transform: translateY(0px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.20);
}

.alert-warn strong {
  display: inline-block;
  margin-bottom: 6px;
  color: rgba(255, 210, 140, 1);
}

/* Если внутри алерта есть ссылки — они тоже в рыжем стиле */
.alert-warn a {
  color: rgba(255, 210, 140, 1);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 210, 140, 0.35);
}

.alert-warn a:hover {
  border-bottom-color: rgba(255, 210, 140, 0.75);
}

/* iframe-страницы: чтобы контент занимал всю высоту окна */
.content--embed{
  padding: 16px;
  height: 100vh;
  overflow: hidden; /* убираем внешний скролл у страницы */
}

.embed-frame-wrap{
  height: 100%;
  min-height: 0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.18);
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
  overflow: hidden; /* режем края, чтобы iframe не торчал */
}

.embed-frame{
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
/* ===========================
   Embed pages (iframe full)
   =========================== */
html, body {
  height: 100%;
}

body.page-embed {
  height: 100vh;
  overflow: hidden; /* ✅ убираем внешний скролл страницы */
  -ms-overflow-style: none;    /* старый Edge/IE */
  scrollbar-width: none;       /* Firefox */
}

/* зажимаем весь layout в высоту окна */
body.page-embed #app,
body.page-embed .layout {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

/* убираем "центровку/макс-ширину/паддинги" у контента */
body.page-embed .content {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;

  height: 100%;
  min-height: 0;
  overflow: hidden; /* ✅ чтобы скролл не вылезал у main */
}

/* если у sidebar/резайзера высота не дотягивает */
body.page-embed .sidebar,
body.page-embed .resizer {
  height: 100vh;
}

/* обёртка и сам iframe — строго 100% */
body.page-embed .embed-frame-wrap {
  width: 100%;
  height: 100%;
  min-height: 0;

  border: 0;
  border-radius: 0;  /* ✅ убираем визуальные "отступы" */
  box-shadow: none;
  background: transparent;
  overflow: hidden;
}

body.page-embed .embed-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Делает нативные контролы (select/scrollbar и т.п.) тёмными там, где браузер это умеет */
/* Общий вид select под твой стиль */
select {
  appearance: none;
  -webkit-appearance: none;

  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);

  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;

  padding: 10px 38px 10px 14px;
  line-height: 1.2;

  /* стрелка */
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.55) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.55) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

select:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

select:focus {
  outline: none;
  border-color: rgba(80, 200, 140, 0.45);
  box-shadow: 0 0 0 4px rgba(80, 200, 140, 0.14);
}

/* Выпадающее меню (работает в большинстве браузеров; в Firefox это особенно важно) */
select option,
select optgroup {
  background-color: #0f1418;
  color: rgba(255, 255, 255, 0.92);
}

/* Чтобы disabled-опции не были "ядрёно белыми" */
select option:disabled {
  color: rgba(255, 255, 255, 0.35);
}
/* прячем нативный select, но оставляем его в DOM для форм */
.ui-select-native {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
}

/* контейнер кастом-селекта */
.ui-select {
  position: relative;
  display: inline-block;
  min-width: 180px;
}

/* кнопка, которая выглядит как твой инпут */
.ui-select__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 10px 12px;
  border-radius: 12px;

  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.92);

  cursor: pointer;
  user-select: none;
}

.ui-select__btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}

.ui-select__btn:focus {
  outline: none;
  border-color: rgba(80, 200, 140, 0.45);
  box-shadow: 0 0 0 4px rgba(80, 200, 140, 0.14);
}

/* стрелка */
.ui-select__chev {
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255,255,255,0.55);
  border-bottom: 2px solid rgba(255,255,255,0.55);
  transform: rotate(45deg);
  margin-left: 10px;
  flex: 0 0 auto;
}

/* выпадашка */
.ui-select__list {
  position: absolute;
  z-index: 9999;
  top: calc(100% + 8px);
  left: 0;
  right: 0;

  background: #0f1418;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  overflow: hidden;

  box-shadow: 0 18px 60px rgba(0,0,0,0.45);

  max-height: 280px;
  overflow-y: auto;

  display: none;
}

.ui-select.is-open .ui-select__list {
  display: block;
}

.ui-select__item {
  padding: 10px 12px;
  color: rgba(255,255,255,0.88);
  cursor: pointer;
  white-space: nowrap;
}

.ui-select__item:hover {
  background: rgba(80, 200, 140, 0.12);
}

.ui-select__item.is-selected {
  background: rgba(80, 200, 140, 0.18);
  color: rgba(255,255,255,0.95);
}

/* 3 колонки 33/33/3 + разделитель 2px */
.kuma-split {
  display: grid;
  grid-template-columns: 1fr 2px 1fr 2px 1fr;
  gap: 0;
  padding: 0;
  height: 100%;
  min-height: calc(100vh - 24px); /* можно убрать/подстроить под твой layout */
}

.kuma-divider {
  background: #414046;
  height: 100%;
}

.kuma-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* чтобы содержимое в main не раздувало ширину и не появлялся горизонтальный скролл */
.kuma-split > iframe {
  min-width: 0;
}

/* ===== Sidebar (menu) refresh: nicer items + hidden scroll ===== */

.sidebar {
  /* перебиваем старые padding/overflow из ранних блоков */
  padding: 0 !important;
  overflow: hidden !important;

  display: flex;
  flex-direction: column;
  height: 100vh;
}

.sidebar-top {
  padding: 18px 16px 10px;
}

.sidebar-top .title {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.85;
}

.sidebar-scroll {
  flex: 1 1 auto;
  overflow: auto;
  padding: 6px 12px 12px;

  /* Firefox */
  scrollbar-width: none;
  /* old Edge/IE */
  -ms-overflow-style: none;
}

/* Chrome/Safari */
.sidebar-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

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

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);

  color: #e9e9e9;
  text-decoration: none;

  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav a.active {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(64, 206, 152, 0.35);
  box-shadow: inset 3px 0 0 rgba(64, 206, 152, 0.9);
}

.nav-ico {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);

  font-size: 16px;
  line-height: 1;
}

.nav a.active .nav-ico {
  background: rgba(64, 206, 152, 0.18);
}

.sidebar-bottom {
  flex: 0 0 auto;

  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);

  /* лёгкий “туман” внизу, чтобы футер читался */
  background: linear-gradient(180deg, rgba(24,24,31,.92), rgba(18,18,24,.92));
  /* background: linear-gradient(
    to bottom,
    rgba(35, 34, 40, 0),
    rgba(35, 34, 40, 0.65) 35%,
    rgba(35, 34, 40, 1)
  ); */
}

/* футеры внутри sidebar-bottom — без "случайных" внешних отступов */
.sidebar-bottom .sidebar-footer {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.sidebar-bottom .sidebar-footer + .sidebar-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer__title {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.95;
}

.sidebar-footer__sub {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 6px;
}

/* Quick links */
.quick-links {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-links a {
  font-size: 11px;
  text-decoration: none;

  padding: 4px 8px;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);

  color: #bdbebd;
}

.quick-links a:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.10);
}

/* Quick links: visited не меняет цвет, зелёный только на hover */
.sidebar .quick-links a,
.sidebar .quick-links a:visited {
  color: #bdbebd;
}

.sidebar .quick-links a:hover,
.sidebar .quick-links a:visited:hover {
  color: #2ee68b; /* зелёный только при наведении */
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.10);
}

code {
  color: #2ee68b;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
}
