/* ===== Tiktak Admin · база: переменные, каркас, сайдбар, топбар ===== */

:root {
  --bg: #07080d;
  --bg-soft: #0d0f17;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eef1f7;
  --muted: #8b93a7;
  --dim: #626b80;

  --violet: #7c5cff;
  --cyan: #00d4ff;
  --green: #17e39a;
  --amber: #ffbe3d;
  --red: #ff4d6d;
  --pink: #ff5ea8;

  --grad: linear-gradient(135deg, #7c5cff 0%, #00d4ff 100%);
  --grad-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(0, 212, 255, 0.14));
  --grad-green: linear-gradient(135deg, #17e39a, #00d4ff);
  --grad-red: linear-gradient(135deg, #ff4d6d, #ff5ea8);

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px rgba(124, 92, 255, 0.35), 0 12px 40px rgba(124, 92, 255, 0.22);
  --sidebar: 286px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { height: 100%; }
/* body только min-height: с height:100% и запретом бокового скролла телефон
   делает body отдельным скролл-контейнером, и закреплённая панель прыгает */
body { min-height: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* мягкие световые пятна на фоне */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 60vw at 12% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(50vw 50vw at 100% 0%, rgba(0, 212, 255, 0.12), transparent 55%),
    radial-gradient(45vw 45vw at 70% 110%, rgba(255, 94, 168, 0.10), transparent 60%);
}

a { color: inherit; text-decoration: none; }

::selection { background: rgba(124, 92, 255, 0.45); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); background-clip: content-box; }

/* ===== каркас ===== */
.shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;   /* на телефоне вычитает адресную строку, а не прячет контент под ней */
}

.main {
  flex: 1;
  min-width: 0;
  padding: 22px 28px 48px;
}

.page-enter { animation: rise 0.45s var(--ease) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ===== сайдбар ===== */
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 0; }

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--grad);
  display: grid;
  place-items: center;
  font-size: 24px;
  box-shadow: var(--shadow-glow);
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.6px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub { font-size: 11.5px; color: var(--dim); letter-spacing: 0.4px; }

/* меню: эмодзи-плашка + название + описание */
.nav { display: flex; flex-direction: column; gap: 6px; }

.nav-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--dim);
  padding: 10px 10px 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background 0.2s var(--ease), border-color 0.2s, transform 0.2s var(--ease);
}

.nav-item:hover { background: var(--panel); border-color: var(--line); transform: translateX(3px); }

.nav-item.active {
  background: var(--grad-soft);
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.nav-item.active .nav-ico { background: var(--grad); box-shadow: var(--shadow-glow); }

.nav-ico {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 19px;
  transition: background 0.25s var(--ease);
}

.nav-text { min-width: 0; }
.nav-name { font-weight: 600; font-size: 14.5px; }
.nav-desc {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.sidebar-note {
  font-size: 11.5px;
  color: var(--dim);
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  line-height: 1.45;
}

/* ===== топбар ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.topbar-title h1 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: 0.2px; }
.topbar-title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.load-strip { margin-left: auto; display: flex; align-items: stretch; gap: 10px; }

.load-card {
  min-width: 150px;
  padding: 10px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.load-card canvas { position: absolute; inset: auto 0 0 0; width: 100%; height: 26px; opacity: 0.55; }

.load-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.load-name { font-size: 11px; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; }
.load-value { font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; }
.load-sub { font-size: 11px; color: var(--dim); position: relative; z-index: 1; }

.load-bar { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.load-fill { height: 100%; width: 0; border-radius: 999px; background: var(--grad); transition: width 0.6s var(--ease); }
.load-card.warn .load-fill { background: linear-gradient(90deg, var(--amber), var(--red)); }
.load-card.hot .load-fill { background: var(--grad-red); }
.load-card.hot { border-color: rgba(255, 77, 109, 0.45); }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(23, 227, 154, 0.7);
  animation: pulse 2s infinite;
}

.live-dot.off { background: var(--red); animation: none; box-shadow: none; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(23, 227, 154, 0.6); }
  70% { box-shadow: 0 0 0 9px rgba(23, 227, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(23, 227, 154, 0); }
}

/* ===== адаптив ===== */
@media (max-width: 1500px) {
  .load-card { min-width: 128px; }
}

/* Планшет и небольшой ноутбук. Нижняя граница обязательна: без неё узкий
   сайдбар и боковой скролл полосы нагрузки доезжали до телефона. */
@media (min-width: 861px) and (max-width: 1200px) {
  :root { --sidebar: 84px; }
  .sidebar { padding: 18px 10px; }
  .brand-text, .nav-text, .sidebar-note, .nav-badge { display: none; }
  .brand { justify-content: center; }
  .nav-item { justify-content: center; padding: 8px; }
  .load-strip { width: 100%; margin-left: 0; overflow-x: auto; }
}

/* Уже 860px — телефон: сайдбар убирается, навигация переезжает в нижнюю панель.
   Всё это лежит в mobile.css, здесь правил для узких экранов больше нет. */


