*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Guardians / Groot + Rocket theme tokens */
  --bg-0: #04050c;          /* deep space */
  --bg-1: #070a18;          /* space haze */
  --ink: #eef2ff;           /* main text */
  --muted: rgba(238, 242, 255, 0.68);
  --muted-2: rgba(226, 232, 240, 0.82);

  --panel: rgba(10, 14, 28, 0.78);
  --panel-2: rgba(12, 18, 36, 0.88);
  --border: rgba(170, 180, 210, 0.22);
  --border-2: rgba(170, 180, 210, 0.34);

  --neon-cyan: #22d3ee;     /* “space tech” */
  --neon-violet: #a78bfa;   /* cosmic */
  --neon-magenta: #ff3ea6;  /* guardians vibe */
  --neon-lime: #a3ff12;     /* Rocket highlights */
  --amber: #fbbf24;

  --danger: #fb7185;
  --success: #4ade80;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;

  --shadow-xl: 0 22px 60px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.45);
  --glow-cyan: 0 0 0 1px rgba(34, 211, 238, 0.28), 0 0 28px rgba(34, 211, 238, 0.12);
  --glow-magenta: 0 0 0 1px rgba(255, 62, 166, 0.22), 0 0 28px rgba(255, 62, 166, 0.12);
  --glow-lime: 0 0 0 1px rgba(163, 255, 18, 0.18), 0 0 26px rgba(163, 255, 18, 0.10);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.5;
  background:
    radial-gradient(900px 520px at 15% 10%, rgba(167, 139, 250, 0.16), transparent 60%),
    radial-gradient(780px 460px at 85% 18%, rgba(34, 211, 238, 0.12), transparent 55%),
    radial-gradient(880px 520px at 70% 90%, rgba(255, 62, 166, 0.11), transparent 58%),
    radial-gradient(circle at 22% 64%, rgba(163, 255, 18, 0.06), transparent 56%),
    /* starfield (no images) */
    radial-gradient(1px 1px at 12% 22%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1px 1px at 36% 18%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(1px 1px at 58% 34%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(1px 1px at 74% 16%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 86% 54%, rgba(255, 255, 255, 0.3), transparent 60%),
    radial-gradient(1px 1px at 18% 78%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(1px 1px at 64% 72%, rgba(255, 255, 255, 0.45), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
}

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

.sidebar {
  width: 260px;
  /* Groot-ish wood + space mix */
  background:
    radial-gradient(1200px 520px at 0% 0%, rgba(163, 255, 18, 0.07), transparent 60%),
    radial-gradient(860px 520px at 100% 20%, rgba(34, 211, 238, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(20, 12, 18, 0.85), rgba(8, 10, 18, 0.88)),
    repeating-linear-gradient(
      90deg,
      rgba(120, 72, 42, 0.18) 0px,
      rgba(120, 72, 42, 0.18) 6px,
      rgba(92, 55, 32, 0.12) 6px,
      rgba(92, 55, 32, 0.12) 12px
    );
  border-right: 1px solid rgba(170, 180, 210, 0.14);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.logo {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.logo-main {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--neon-lime), var(--neon-cyan), var(--neon-magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.18);
}

.logo-sub {
  font-size: 12px;
  color: var(--muted);
}

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

.nav-item {
  border: none;
  background: transparent;
  color: rgba(238, 242, 255, 0.72);
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}

.nav-item.active {
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(255, 62, 166, 0.20)),
    linear-gradient(135deg, rgba(163, 255, 18, 0.10), rgba(167, 139, 250, 0.12));
  color: var(--ink);
  box-shadow: var(--glow-magenta);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 11px;
  color: rgba(238, 242, 255, 0.52);
}

.main {
  flex: 1;
  padding: 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(680px 240px at 30% 0%, rgba(34, 211, 238, 0.10), transparent 60%),
    radial-gradient(520px 240px at 85% 20%, rgba(255, 62, 166, 0.10), transparent 58%),
    rgba(10, 14, 28, 0.55);
  border: 1px solid rgba(170, 180, 210, 0.18);
  box-shadow: var(--shadow-lg);
}

.topbar-title {
  font-size: 18px;
  font-weight: 600;
}

.topbar-user {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(170, 180, 210, 0.16);
}

.section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.section-header h2 {
  font-size: 16px;
}

.section-desc {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.70);
}

.card {
  background:
    radial-gradient(640px 280px at 12% 0%, rgba(167, 139, 250, 0.14), transparent 60%),
    radial-gradient(560px 320px at 100% 20%, rgba(34, 211, 238, 0.10), transparent 62%),
    radial-gradient(640px 360px at 0% 100%, rgba(255, 62, 166, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(16, 20, 42, 0.78), rgba(7, 10, 24, 0.86));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(170, 180, 210, 0.22);
  padding: 16px 18px;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.05));
  opacity: 0.14;
  mix-blend-mode: overlay;
}

.card::after {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(420px 220px at 20% 0%, rgba(163, 255, 18, 0.08), transparent 60%),
    radial-gradient(420px 220px at 90% 15%, rgba(34, 211, 238, 0.10), transparent 58%),
    radial-gradient(460px 240px at 60% 100%, rgba(255, 62, 166, 0.09), transparent 60%);
  opacity: 0.75;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.field-inline {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

label {
  font-size: 13px;
  color: var(--muted-2);
}

input,
textarea,
select {
  background: rgba(8, 12, 24, 0.85);
  border: 1px solid rgba(170, 180, 210, 0.22);
  border-radius: 8px;
  padding: 7px 9px;
  color: rgba(238, 242, 255, 0.92);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(34, 211, 238, 0.7);
  box-shadow: var(--glow-cyan);
  background: rgba(9, 14, 30, 0.90);
}

textarea {
  resize: vertical;
}

.btn {
  border: none;
  background: rgba(170, 180, 210, 0.14);
  color: rgba(238, 242, 255, 0.92);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  border: 1px solid rgba(170, 180, 210, 0.18);
  backdrop-filter: blur(6px);
}

.btn.primary {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.95), rgba(255, 62, 166, 0.92));
  color: rgba(8, 10, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--glow-magenta);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(34, 211, 238, 0.26);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn.btn-xs {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  padding: 8px 6px;
  text-align: left;
}

.table thead th {
  font-weight: 500;
  color: rgba(238, 242, 255, 0.82);
  border-bottom: 1px solid rgba(170, 180, 210, 0.18);
}

.table tbody tr:nth-child(even) {
  background: rgba(8, 12, 24, 0.45);
}

.table tbody tr:hover {
  background: rgba(34, 211, 238, 0.08);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.status-running {
  background: rgba(74, 222, 128, 0.14);
  color: var(--success);
  box-shadow: var(--glow-lime);
}

.status-stopped {
  background: rgba(251, 113, 133, 0.12);
  color: rgba(254, 202, 202, 0.96);
  box-shadow: 0 0 0 1px rgba(251, 113, 133, 0.16);
}

.list {
  list-style: none;
  border-radius: 10px;
  border: 1px solid rgba(170, 180, 210, 0.20);
  padding: 6px;
  max-height: 260px;
  overflow: auto;
  background: rgba(8, 12, 24, 0.70);
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 7px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.list-item:hover {
  background: rgba(34, 211, 238, 0.08);
}

.list-item.active {
  background: rgba(255, 62, 166, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 62, 166, 0.18);
}

.list-item span {
  flex: 1;
}

.hint {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(238, 242, 255, 0.58);
}

.geo-list-wrap {
  max-height: 320px;
  overflow: auto;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid rgba(170, 180, 210, 0.20);
  background: rgba(8, 12, 24, 0.70);
}

.geo-list-wrap .list {
  max-height: none;
  border: none;
  padding: 6px;
}

.list-selectable .list-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-selectable .list-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--neon-lime);
  cursor: pointer;
}

.geo-city-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex: 1;
  padding: 2px 0;
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 10, 0.76);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal {
  background:
    radial-gradient(640px 280px at 12% 0%, rgba(163, 255, 18, 0.12), transparent 60%),
    radial-gradient(560px 320px at 100% 20%, rgba(34, 211, 238, 0.11), transparent 62%),
    radial-gradient(620px 360px at 0% 100%, rgba(255, 62, 166, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(16, 20, 42, 0.84), rgba(7, 10, 24, 0.92));
  border-radius: 16px;
  border: 1px solid rgba(170, 180, 210, 0.26);
  width: 420px;
  max-width: 95%;
  box-shadow: var(--shadow-xl);
}

.modal-header,
.modal-footer {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header {
  border-bottom: 1px solid rgba(170, 180, 210, 0.18);
}

.modal-footer {
  border-top: 1px solid rgba(170, 180, 210, 0.18);
}

.modal-body {
  padding: 12px 16px;
}

.modal-close {
  border: none;
  background: transparent;
  color: rgba(238, 242, 255, 0.85);
  font-size: 20px;
  cursor: pointer;
}

/* Better scrollbars (WebKit + Firefox) */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 211, 238, 0.35) rgba(8, 12, 24, 0.65);
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: rgba(8, 12, 24, 0.65);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.35), rgba(255, 62, 166, 0.25));
  border: 2px solid rgba(8, 12, 24, 0.65);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.52), rgba(255, 62, 166, 0.38));
}

@media (prefers-reduced-motion: no-preference) {
  .card::after {
    animation: gog-drift 12s ease-in-out infinite alternate;
  }
}

@keyframes gog-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, -6px, 0); }
}

/* ================= MOBILE ================= */
@media (max-width: 900px) {
  .app {
    flex-direction: column;
  }

  /* Сайдбар -> горизонтальная прокручиваемая навигация сверху */
  .sidebar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border-right: none;
    border-bottom: 1px solid rgba(170, 180, 210, 0.14);
  }

  .nav {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    white-space: nowrap;
    flex: 0 0 auto;
    padding: 10px 14px;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    padding: 12px;
    gap: 12px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .topbar-title {
    font-size: 16px;
  }

  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Таблицы -> горизонтальный скролл внутри карточек */
  .card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 640px;
  }

  /* Модалки на весь экран телефона */
  .modal-backdrop {
    padding: 0;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-header,
  .modal-footer {
    padding: 12px;
  }

  .modal-body {
    padding: 12px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
  }

  /* Формы и кнопки удобнее пальцем */
  input,
  select,
  textarea,
  button {
    font-size: 16px; /* защита от авто-зума iOS */
  }
}

/* очень узкие экраны */
@media (max-width: 480px) {
  .main {
    padding: 10px;
  }

  .topbar-title {
    font-size: 15px;
  }

  .nav-item {
    padding: 8px 12px;
  }
}

