:root {
  --bg: #070708;
  --panel: #121216;
  --panel-2: #19191e;
  --line: rgba(255, 255, 255, .11);
  --text: #f7f7f8;
  --muted: #96969f;
  --red: #e6152b;
  --red-bright: #ff3047;
  --green: #4cdf83;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 0, rgba(230, 21, 43, .13), transparent 32rem),
    var(--bg);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea { font: inherit; }
a { color: inherit; }
code { color: #d9d9dd; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 250px;
  flex-direction: column;
  padding: 30px 22px;
  border-right: 1px solid var(--line);
  background: rgba(8, 8, 10, .94);
  backdrop-filter: blur(24px);
}
.brand { margin-bottom: 42px; font-size: 21px; font-weight: 950; letter-spacing: .1em; }
.brand span, .eyebrow { color: var(--red-bright); }
.brand small { margin-left: 6px; color: #81818b; font-size: 9px; letter-spacing: .12em; }
.sidebar nav { display: grid; gap: 7px; }
.sidebar nav a {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #b6b6bd;
  text-decoration: none;
}
.sidebar nav a:hover { color: #fff; border-color: var(--line); background: rgba(255,255,255,.04); }
.sidebar nav span { color: var(--red-bright); font-size: 10px; font-weight: 900; }
.sidebar-api { display: grid; gap: 8px; margin-top: auto; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #0d0d10; }
.sidebar-api small { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .15em; }
.sidebar-api code { overflow: hidden; text-overflow: ellipsis; }

.workspace { min-height: 100vh; margin-left: 250px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 8, .88);
  backdrop-filter: blur(20px);
}
.topbar > div { display: grid; }
.topbar strong { font-size: 17px; }
.eyebrow { font-size: 10px; font-weight: 900; letter-spacing: .17em; }
.admin-menu { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.content { width: min(1450px, 92%); margin: 0 auto; padding: 42px 0 80px; }

.hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 10px 0 28px; }
.hero h1, .auth-card h1 { margin: 6px 0; font-size: clamp(30px, 3vw, 46px); line-height: 1.08; }
.hero p, .panel-head p, .auth-card p { margin: 0; color: var(--muted); }
.live-dot { display: inline-flex; align-items: center; gap: 9px; color: #baf3cc; }
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 16px var(--green); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.stats article {
  display: grid;
  gap: 4px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(145deg, #19191e, #0d0d10);
}
.stats small { color: var(--red-bright); font-size: 9px; font-weight: 900; letter-spacing: .13em; }
.stats strong { font-size: 30px; }
.stats span { color: var(--muted); font-size: 12px; }

.panel { margin-top: 18px; padding: 22px; scroll-margin-top: 88px; border: 1px solid var(--line); border-radius: 15px; background: rgba(18,18,22,.95); box-shadow: 0 24px 60px rgba(0,0,0,.22); }
.panel-head { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 18px; }
.panel h2 { margin: 3px 0 2px; font-size: 23px; }
.big-number { color: var(--red-bright); font-size: 34px; }
.pill { display: inline-flex; padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.pill.on { color: #aef3c5; background: rgba(76,223,131,.12); }
.pill.off { color: #ff9aaa; background: rgba(230,21,43,.14); }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 11px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: #7f7f88; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
td { color: #d5d5da; }
td strong { color: #fff; }
.row-id { display: block; color: #73737c; font-size: 9px; }
.actions, .actions form { display: flex; gap: 6px; align-items: center; }

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  background: #222228;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { border-color: rgba(255,255,255,.55); }
.button.primary { border: 0; background: linear-gradient(135deg, #f11934, #a80718); font-weight: 800; }
.button.ghost { background: rgba(255,255,255,.04); }
.button.danger { color: #ff9aab; border-color: rgba(230,21,43,.36); background: rgba(230,21,43,.09); }
.button.wide { width: 100%; margin-top: 4px; }

label { display: grid; gap: 6px; color: #bdbdc4; font-size: 12px; }
label span { color: #777780; }
input, textarea {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: #fff;
  background: #09090c;
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: #fff; box-shadow: 0 0 0 2px rgba(230,21,43,.52); }
.surface-form { display: flex; align-items: end; gap: 10px; margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: #0c0c0f; }
.surface-form.compact { max-width: 800px; }
.surface-form .grow { flex: 1; }
.stack-form { display: grid; gap: 14px; margin-top: 24px; }
.settings-form { max-width: 850px; }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.check { display: flex; grid-auto-flow: column; align-items: center; justify-content: start; gap: 8px; }
.check input { width: auto; min-height: 0; }
.panel-action { margin-top: 16px; }
.platforms { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.platforms span { display: flex; gap: 18px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--red-bright); background: #0c0c0f; }
.platforms b { color: #fff; font-weight: 600; }

.notice { margin: 0 0 16px; padding: 12px 14px; border: 1px solid rgba(76,223,131,.28); border-radius: 9px; color: #baf3cc; background: rgba(76,223,131,.08); }
.notice.warn { color: #ffd58d; border-color: rgba(255,181,65,.3); background: rgba(255,181,65,.08); }
.notice.error { color: #ffb1bd; border-color: rgba(230,21,43,.36); background: rgba(230,21,43,.1); }

.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 30px; }
.auth-card { width: min(520px, 96vw); padding: 34px; border: 1px solid var(--line); border-radius: 17px; background: rgba(18,18,22,.97); box-shadow: 0 36px 110px rgba(0,0,0,.72); }
.auth-card .brand { margin-bottom: 30px; }
.install-card { width: min(760px, 96vw); }

@media (max-width: 1050px) {
  .sidebar { position: static; width: auto; min-height: auto; padding: 18px 4vw; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin: 0 0 15px; }
  .sidebar nav { display: flex; overflow: auto; }
  .sidebar nav a { white-space: nowrap; }
  .sidebar-api { display: none; }
  .workspace { margin-left: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .topbar, .hero, .panel-head, .surface-form { align-items: stretch; flex-direction: column; }
  .topbar { position: static; gap: 12px; padding: 16px 5vw; }
  .admin-menu { justify-content: space-between; }
  .content { width: 92%; padding-top: 24px; }
  .stats, .form-grid.two { grid-template-columns: 1fr; }
  .actions { min-width: 260px; }
  .auth-page { padding: 14px; }
  .auth-card { padding: 24px; }
}

