:root {
  --bg: #080b10;
  --panel: #111722;
  --panel-2: #151d2b;
  --line: #273247;
  --text: #edf3ff;
  --muted: #9aa7bd;
  --accent: #37d6ff;
  --accent-2: #78e08f;
  --warn: #f5c451;
  --danger: #ff5b68;
  --ink: #05070b;
  --shadow: 0 24px 80px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.45;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font: inherit;
}
button {
  border: 0;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 3vw, 42px);
  background: rgba(8, 11, 16, .88);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041116;
  font-weight: 900;
}
.brand strong, .brand small {
  display: block;
}
.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
}
.nav a {
  padding: 9px 12px;
  border-radius: 6px;
  color: #cfd7e8;
  font-size: 14px;
  font-weight: 700;
}
.nav a.active, .nav a:hover {
  background: #20304a;
  color: white;
}

.top-actions {
  justify-self: end;
  display: flex;
  gap: 10px;
}

.primary, .ghost, .danger, .success {
  min-height: 38px;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
}
.primary {
  background: linear-gradient(135deg, #2f7cff, #35d0ff);
  color: white;
  box-shadow: 0 10px 28px rgba(47,124,255,.24);
}
.ghost {
  background: #172031;
  color: #e7efff;
  border: 1px solid #2d3a52;
}
.danger {
  background: #351923;
  color: #ffd8de;
  border: 1px solid #863445;
}
.success {
  background: #153323;
  color: #d9ffe5;
  border: 1px solid #337d4b;
}
.square {
  width: 36px;
  height: 36px;
  padding: 0;
}
.icon-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

#app {
  min-height: calc(100vh - 72px);
}

.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5,7,11,.95) 0%, rgba(5,7,11,.72) 42%, rgba(5,7,11,.2) 100%),
    url("assets/hero.png") center / cover no-repeat;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32%;
  background: linear-gradient(0deg, var(--bg), transparent);
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 92px 0 86px;
}
.hero-kicker {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 13px;
}
.hero h1 {
  margin: 12px 0 14px;
  max-width: 760px;
  font-size: clamp(42px, 7vw, 92px);
  line-height: .94;
  letter-spacing: 0;
}
.hero p {
  max-width: 680px;
  color: #d5dfef;
  font-size: clamp(17px, 2vw, 21px);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.server-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 42px;
  max-width: 920px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.12);
}
.server-strip div {
  padding: 16px;
  background: rgba(12,18,28,.82);
}
.server-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.server-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.band {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0;
}
.band.tight { padding-top: 26px; }
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 22px;
}
.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
}
.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.grid {
  display: grid;
  gap: 16px;
}
.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #141c29, #0f1520);
  box-shadow: 0 14px 42px rgba(0,0,0,.25);
}
.feature {
  padding: 18px;
  min-height: 150px;
}
.feature .dot {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #061016;
  background: var(--accent);
  font-weight: 900;
}
.feature h3, .product h3, .news-item h3 {
  margin: 14px 0 8px;
  font-size: 19px;
}
.feature p, .product p, .news-item p {
  color: var(--muted);
  margin: 0;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
}
.side {
  position: sticky;
  top: 88px;
  align-self: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1520;
}
.side input, .field input, .field select, .field textarea, .json-editor {
  width: 100%;
  min-height: 42px;
  border: 1px solid #2c3850;
  border-radius: 8px;
  background: #080c14;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}
.side input:focus, .field input:focus, .field select:focus, .field textarea:focus, .json-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(55,214,255,.13);
}
.pill-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}
.pill-list button {
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  color: #d9e3f7;
  border: 1px solid transparent;
  font-weight: 700;
}
.pill-list button.active, .pill-list button:hover {
  border-color: #38527a;
  background: #162238;
}

.wiki-article {
  min-height: 520px;
  padding: clamp(20px, 4vw, 38px);
}
.wiki-article .category {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 13px;
}
.wiki-article h1 {
  margin: 10px 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}
.wiki-body {
  color: #dce5f4;
  white-space: pre-wrap;
  font-size: 16px;
}

.shop-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.product {
  overflow: hidden;
}
.product-image {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}
.product-body {
  padding: 16px;
}
.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid #3d4c66;
  border-radius: 999px;
  padding: 4px 9px;
  color: #c8d4e7;
  font-size: 12px;
  font-weight: 800;
}
.price {
  color: var(--accent-2);
  font-size: 22px;
  font-weight: 900;
}
.product ul {
  margin: 14px 0;
  padding-left: 18px;
  color: #cbd6e9;
}

.news-item {
  padding: 18px;
}
.news-date {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.admin-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
}
.admin-menu {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0f1520;
}
.admin-menu button {
  text-align: left;
  background: transparent;
  color: #d7e1f4;
  border-radius: 8px;
  padding: 11px 12px;
  font-weight: 800;
}
.admin-menu button.active, .admin-menu button:hover {
  background: #1a2942;
}
.admin-panel {
  padding: 18px;
  min-height: 620px;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.field {
  display: grid;
  gap: 7px;
}
.field span, .field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.field textarea, .json-editor {
  min-height: 140px;
  resize: vertical;
}
.json-editor {
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.5;
}
.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.table th, .table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}
.table tr:last-child td { border-bottom: 0; }
.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: #1a2434;
  color: #cfd9ee;
  font-size: 12px;
  font-weight: 900;
}
.status.executed { background: #163922; color: #c9ffd9; }
.status.paid { background: #102f3f; color: #bdeeff; }
.status.pending_payment { background: #3d2f14; color: #ffe3a4; }
.status.cancelled, .status.refunded { background: #3b1720; color: #ffd7de; }

.dialog {
  border: 0;
  background: transparent;
  padding: 16px;
}
.dialog::backdrop {
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(5px);
}
.dialog-panel {
  width: min(520px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101724;
  box-shadow: var(--shadow);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.dialog-head strong, .dialog-head span {
  display: block;
}
.dialog-head span {
  margin-top: 4px;
  color: var(--muted);
}
.dialog-actions, .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.login-box {
  width: min(480px, 100%);
  padding: 22px;
}
.muted { color: var(--muted); }
.error { color: #ffb2bd; }
.ok { color: #bfffd0; }
.hidden { display: none !important; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 36px));
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid #30405c;
  background: #111a29;
  color: white;
  box-shadow: var(--shadow);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.empty {
  padding: 28px;
  border: 1px dashed #34435e;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 16px;
}
.code {
  font-family: Consolas, Monaco, monospace;
  color: #dbe7ff;
  background: #070b13;
  border: 1px solid #2d3850;
  border-radius: 8px;
  padding: 10px;
  overflow: auto;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
  }
  .nav {
    width: 100%;
    overflow-x: auto;
  }
  .top-actions {
    justify-self: stretch;
  }
  .top-actions button {
    flex: 1;
  }
  .server-strip, .grid.cols-4, .grid.cols-3, .layout, .admin-shell, .admin-grid, .split {
    grid-template-columns: 1fr;
  }
  .side, .admin-menu {
    position: static;
  }
}

@media (max-width: 620px) {
  .hero {
    min-height: 720px;
  }
  .hero-content {
    padding-bottom: 58px;
  }
  .section-head {
    display: block;
  }
  .server-strip div {
    padding: 13px;
  }
  .brand {
    width: 100%;
  }
}
