/* ============================================================
   layout.css — App shell, sidebar, main area, responsive grid
   V2: wider cinematic product dashboard
   ============================================================ */

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

.sidebar {
  width: var(--sidebar-w);
  background:
    radial-gradient(circle at 20% 10%, rgba(var(--accent-rgb),0.085), transparent 32%),
    linear-gradient(180deg, rgba(8,14,9,0.96), rgba(2,4,3,0.985));
  border-right: 1px solid rgba(var(--accent-rgb),0.13);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.03), 18px 0 70px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-header {
  padding: 30px 22px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-footer {
  padding: 8px 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.055);
  display: flex;            /* чтобы nav-logout не растягивался */
}

.nav-logout {
  opacity: 0.55;
  align-self: flex-start;   /* по содержимому, не на всю ширину */
  padding: 8px 12px;        /* компактнее обычного nav-item */
  font-size: 13px;
}
.nav-logout:hover {
  opacity: 1;
}
.nav-logout .nav-icon svg {
  width: 16px;
  height: 16px;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 54px clamp(24px, 4vw, 58px) 60px;
  width: min(1320px, calc(100vw - var(--sidebar-w)));
  max-width: 1320px;
}

.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 58px;
  background: rgba(3,5,5,0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(var(--accent-rgb),0.14);
  z-index: 99;
  align-items: center;
  padding: 0 16px;
  justify-content: space-between;
  box-shadow: 0 18px 60px rgba(0,0,0,0.34);
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.68);
  backdrop-filter: blur(4px);
  z-index: 99;
}

.dashboard-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 24px;
  align-items: start;
}

.dashboard-left  { min-width: 0; }
.dashboard-right { min-width: 0; }

@media (max-width: 1100px) {
  .dashboard-cols { grid-template-columns: 1fr; }
  .map-card { position: static; }
  .map-svg-wrap { aspect-ratio: 16/7; }
}

@media (max-width: 768px) {
  .sidebar              { transform: translateX(-100%); }
  .sidebar.open         { transform: translateX(0); }
  .mobile-header        { display: flex; }
  .main                 { margin-left: 0; width: 100%; padding: 78px 16px 34px; }
  .overlay.show         { display: block; }
  .stat-row             { grid-template-columns: 1fr 1fr; }
  .toast                { left: 12px; right: 12px; bottom: 12px; }
}

@media (max-width: 520px) {
  .stat-row             { grid-template-columns: 1fr 1fr; }
  .plans-grid           { grid-template-columns: 1fr; }
  .status-actions       { flex-direction: column; }
  .status-actions .btn  { justify-content: center; }
}


/* ============================================================
   V4 — No server map, concept-width dashboard
   ============================================================ */
.sidebar {
  background:
    radial-gradient(circle at 24% 8%, rgba(var(--accent-rgb),0.075), transparent 28%),
    linear-gradient(180deg, rgba(7,10,7,0.985), rgba(2,4,3,0.992));
  border-right: 1px solid rgba(var(--accent-rgb),0.10);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.026), 24px 0 90px rgba(0,0,0,0.40);
}

.main {
  width: min(1220px, calc(100vw - var(--sidebar-w)));
  max-width: 1220px;
  padding: 56px clamp(36px, 5.2vw, 92px) 72px;
}

.dashboard-cols {
  grid-template-columns: 1fr;
  gap: 26px;
}

.dashboard-left {
  width: 100%;
  max-width: 1120px;
}

.dashboard-right,
.map-card,
.map-svg-wrap,
.server-list {
  display: none !important;
}

@media (max-width: 768px) {
  .main {
    width: 100%;
    padding: 78px 16px 36px;
  }
  .dashboard-left { max-width: none; }
}

/* ============================================================
   CROAK PATCH — top navigation instead of left sidebar
   ============================================================ */
.app {
  display: block;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 120;
  height: 80px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 22px;
  padding: 0 clamp(18px, 2.4vw, 36px);
  background:
    radial-gradient(circle at 50% -80%, rgba(var(--accent-rgb), .22), transparent 48%),
    linear-gradient(180deg, rgba(10, 20, 9, .96), rgba(5, 9, 6, .92));
  border-bottom: 1px solid rgba(var(--accent-rgb), .16);
  box-shadow: 0 20px 70px rgba(0,0,0,.34), inset 0 -1px 0 rgba(255,255,255,.035);
  backdrop-filter: blur(22px);
}

.topbar-brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}

.topbar-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(var(--accent-rgb), .22));
}

.topbar-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-family: 'Space Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  line-height: 1;
  white-space: nowrap;
}

.topbar-wordmark-main {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .015em;
}

.topbar-wordmark-sub {
  color: rgb(var(--accent-rgb));
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .025em;
  opacity: .9;
}

.topbar-nav {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 18px 50px rgba(0,0,0,.22);
}

.topbar .nav-item,
.topbar-logout {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,.58);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.topbar .nav-item::before,
.topbar .nav-item::after {
  content: none !important;
}

.topbar .nav-item:hover,
.topbar-logout:hover {
  color: #fff;
  background: rgba(255,255,255,.055);
  transform: translateY(-1px);
}

.topbar .nav-item.active {
  color: #071105;
  background: linear-gradient(180deg, #b5ff5e, #74e237);
  box-shadow: 0 0 0 1px rgba(255,255,255,.16) inset, 0 0 28px rgba(var(--accent-rgb), .36);
}

.topbar .nav-icon,
.topbar-logout .nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.topbar .nav-icon svg,
.topbar-logout .nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-logout {
  justify-self: end;
  min-width: 136px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.045);
  color: rgba(255,255,255,.62);
}

.main {
  margin-left: 0 !important;
  width: min(1220px, calc(100vw - 48px)) !important;
  max-width: 1220px;
  margin-right: auto;
  margin-left: auto !important;
  padding-top: 42px;
}

.mobile-header,
.overlay {
  display: none !important;
}

@media (max-width: 1120px) {
  .topbar {
    height: auto;
    min-height: 78px;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand logout"
      "nav nav";
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .topbar-brand { grid-area: brand; }
  .topbar-logout { grid-area: logout; }
  .topbar-nav {
    grid-area: nav;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .topbar-nav::-webkit-scrollbar { display: none; }
}

@media (max-width: 640px) {
  .topbar {
    grid-template-columns: 1fr;
    grid-template-areas: "brand" "nav" "logout";
    align-items: stretch;
  }
  .topbar-logout {
    justify-self: stretch;
    width: 100%;
  }
  .topbar .nav-item {
    flex: 0 0 auto;
  }
  .main {
    width: 100% !important;
    padding: 28px 16px 34px !important;
  }
}
