@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #0b0b0d;
  --bg-2: #101012;
  --sidebar: #0e0e10;
  --card: #161618;
  --card-2: #1a1a1d;
  --card-hover: #1e1e22;
  --border: #242428;
  --border-2: #2e2e34;
  --text: #f2f2f4;
  --muted: #8a8a93;
  --dim: #5c5c66;
  --accent: #3b9eff;
  --accent-2: #6bb6ff;
  --accent-dim: rgba(59, 158, 255, 0.14);
  --accent-glow: rgba(59, 158, 255, 0.42);
  --green: #3dd68c;
  --red: #ff5c5c;
  --yellow: #f5c14a;
  --discord: #5865f2;
  --r: 10px;
  --font: Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --nav: 64px;
  --nav-open: 248px;
  --rail: 248px;
  --top: 52px;
}

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

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ══════════════ Custom scrollbars ══════════════ */
* {
  scrollbar-width: thin;
  scrollbar-color: #3a3a44 transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: #3a3a44;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: #4a4a58;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

.main,
.rail-list,
.log-list,
.console-body {
  scrollbar-width: thin;
  scrollbar-color: #3b9eff55 transparent;
}

.main::-webkit-scrollbar-thumb,
.rail-list::-webkit-scrollbar-thumb,
.log-list::-webkit-scrollbar-thumb,
.console-body::-webkit-scrollbar-thumb {
  background: rgba(59, 158, 255, 0.35);
}

.main::-webkit-scrollbar-thumb:hover,
.rail-list::-webkit-scrollbar-thumb:hover,
.log-list::-webkit-scrollbar-thumb:hover,
.console-body::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 158, 255, 0.55);
}

/* ══════════════ LOGIN ══════════════ */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(59, 158, 255, 0.12), transparent 55%),
    var(--bg);
}
.login-card {
  width: min(400px, calc(100% - 32px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 44px 36px 32px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.login-logo {
  width: 108px;
  height: auto;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 22px var(--accent-glow));
}
.login-brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.18em;
}
.login-sub {
  color: var(--muted);
  margin: 8px 0 28px;
  font-size: 13px;
}
.login-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 92, 92, 0.1);
  border: 1px solid rgba(255, 92, 92, 0.3);
  color: var(--red);
  font-size: 12px;
}
.login-hint { margin-top: 18px; color: var(--dim); font-size: 11px; }

/* ══════════════ APP SHELL ══════════════ */
.app {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--nav) 1fr var(--rail);
  grid-template-rows: var(--top) 1fr;
  grid-template-areas:
    "top top top"
    "nav main rail";
  background: var(--bg);
  overflow: hidden;
  transition: grid-template-columns 0.22s ease;
}
.app.nav-open {
  grid-template-columns: var(--nav-open) 1fr var(--rail);
}

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 10px;
  background: #0d0d0f;
  border-bottom: 1px solid var(--border);
  z-index: 20;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}
.topbar-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-text b {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.brand-text span {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}
.topbar-mid {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 11px;
}
.status-dot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.uptime {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  letter-spacing: 0.04em;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-user img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
}
.topbar-user .uname {
  font-weight: 600;
  font-size: 12px;
}
.ico-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
}
.ico-btn:hover {
  color: var(--accent-2);
  background: var(--accent-dim);
  border-color: var(--border);
}
.ico-btn svg { width: 16px; height: 16px; }

/* left nav */
.sidebar {
  grid-area: nav;
  background: #111113;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 10px 8px 12px;
  overflow: hidden;
  min-width: 0;
}
.sidebar-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.sidebar-toggle {
  width: 40px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
}
.sidebar-toggle:hover {
  color: var(--accent-2);
  border-color: #3a3a44;
}
.sidebar-toggle svg { width: 16px; height: 16px; }

.sidebar-search {
  position: relative;
  flex: 1;
  min-width: 0;
  display: none;
}
.app.nav-open .sidebar-search { display: block; }
.sidebar-search input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px 8px 32px;
  outline: none;
  font-size: 12px;
  color: var(--text);
}
.sidebar-search input:focus {
  border-color: rgba(59, 158, 255, 0.4);
}
.sidebar-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--dim);
  pointer-events: none;
}

.sidebar-scroll {
  flex: 1;
  overflow: auto;
  padding-right: 2px;
}

.nav-group {
  margin-bottom: 14px;
}
.nav-group-title {
  display: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding: 4px 10px 8px;
}
.app.nav-open .nav-group-title { display: block; }

.nav-tree {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.app.nav-open .nav-tree {
  margin-left: 10px;
  padding-left: 12px;
}
.app.nav-open .nav-tree::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: #2a2a30;
}

.nav-item {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: #9a9aa3;
  position: relative;
  padding: 0;
  text-align: left;
}
.app.nav-open .nav-item {
  justify-content: flex-start;
  padding: 0 10px;
}
.nav-item .ic {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 8px;
}
.nav-item svg { width: 17px; height: 17px; }
.nav-item .lbl {
  display: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app.nav-open .nav-item .lbl { display: block; }

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.nav-item.active {
  color: #fff;
  background: #1c1c21;
}
.nav-item.active .ic {
  color: var(--accent);
  background: var(--accent-dim);
}
.nav-item.active .lbl { font-weight: 650; }

.nav-item.hidden-nav { display: none !important; }

.sidebar-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.sidebar-foot .nav-item { color: var(--muted); }

/* main */
.main {
  grid-area: main;
  overflow: auto;
  padding: 14px 14px 18px;
  background: var(--bg);
}

/* right rail */
.rail {
  grid-area: rail;
  background: var(--sidebar);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rail-search {
  padding: 12px 12px 8px;
}
.rail-search input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px 8px 32px;
  outline: none;
}
.rail-search { position: relative; }
.rail-search svg {
  position: absolute;
  left: 22px;
  top: 22px;
  width: 14px;
  height: 14px;
  color: var(--dim);
}
.rail-list {
  flex: 1;
  overflow: auto;
  padding: 4px 10px 10px;
}
.rail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.rail-item:hover { background: var(--card); }
.rail-item .pid {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  min-width: 28px;
}
.rail-item .nm {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}
.rail-item .tag {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.rail-actions {
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.rail-actions .btn { width: 100%; font-size: 11px; padding: 10px 8px; }

/* ══════════════ CARDS / CHIPS ══════════════ */
.server-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.chip {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.chip svg { width: 14px; height: 14px; color: var(--accent); }
.chip b { color: var(--text); font-weight: 700; letter-spacing: 0; text-transform: none; font-size: 12px; }
.host-cpu {
  color: var(--dim);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.viz-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.viz {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 14px 10px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
}
.viz .k {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.viz .big {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.viz .sub {
  margin-top: 6px;
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}
.viz .sub b { color: var(--text); font-weight: 600; }
.spark {
  margin-top: auto;
  height: 36px;
  width: 100%;
}
.spark svg { width: 100%; height: 36px; display: block; }

.mini-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.mini {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mini .ic {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.mini .ic svg { width: 14px; height: 14px; }
.mini .n { font-size: 16px; font-weight: 800; line-height: 1; }
.mini .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

.action-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.act {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.act:hover {
  background: var(--card-hover);
  border-color: #3a3a44;
}
.act .ic {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-dim);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.act .ic svg { width: 18px; height: 18px; }
.act .t { flex: 1; }
.act strong { display: block; font-size: 13px; font-weight: 700; }
.act span { color: var(--muted); font-size: 11px; }
.act .chev { color: var(--dim); }
.act .chev svg { width: 16px; height: 16px; }

.logs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.panel-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
}
.panel-h span { color: var(--muted); font-weight: 500; font-size: 11px; }
.log-list { max-height: 168px; overflow: auto; }
.log-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid #1e1e22;
  font-size: 12px;
  align-items: center;
}
.log-row:last-child { border-bottom: 0; }
.log-row time { color: var(--dim); font-family: var(--mono); font-size: 10px; }
.log-row .who { color: var(--accent-2); font-weight: 600; }
.log-row .actn { color: var(--text); }
.empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--dim);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-fivem { background: var(--accent-dim); color: var(--accent-2); }
.badge-txadmin { background: rgba(245, 193, 74, 0.12); color: var(--yellow); }
.badge-on { background: rgba(61, 214, 140, 0.12); color: var(--green); }
.badge-off { background: rgba(255, 92, 92, 0.12); color: var(--red); }
.badge-ssl { background: var(--accent-dim); color: var(--accent); }
.badge-kick { background: rgba(255, 92, 92, 0.15); color: var(--red); }
.badge-warn { background: rgba(245, 193, 74, 0.15); color: var(--yellow); }
.badge-ok { background: rgba(61, 214, 140, 0.12); color: var(--green); }

/* console */
.console {
  background: #0a0a0c;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  min-height: 210px;
  display: flex;
  flex-direction: column;
}
.console-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #101012;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.console-h .tools { display: flex; gap: 4px; }
.console-h .ico-btn.copied {
  color: var(--green);
  border-color: rgba(61, 214, 140, 0.35);
}
.console-body {
  flex: 1;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  overflow: auto;
  max-height: 280px;
  min-height: 180px;
  color: #c8c8ce;
  white-space: pre-wrap;
  word-break: break-all;
}
.console-body .ln-info { color: #d0d0d6; }
.console-body .ln-ok { color: var(--green); }
.console-body .ln-err { color: var(--red); }
.console-body .ln-warn { color: var(--yellow); }
.console-body .ts { color: #5a5a64; }
.console-in {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: #0e0e10;
}
.console-in span { color: var(--accent); font-family: var(--mono); }
.console-in input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 12px;
}

/* tables / other views */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}
.page-head h1 { font-size: 18px; font-weight: 750; }
.page-head p { color: var(--muted); font-size: 12px; margin-top: 2px; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
th {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
tr:last-child td { border-bottom: 0; }
code.dom { font-family: var(--mono); font-size: 11px; color: var(--accent-2); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.help-box {
  padding: 12px 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(59, 158, 255, 0.22);
  border-radius: var(--r);
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 12px;
}
.help-box code, .help-box pre {
  font-family: var(--mono);
  color: var(--accent-2);
  font-size: 11px;
}
.help-box ol { margin: 8px 0 0 18px; }
.help-box li { margin-bottom: 3px; }
.help-box.warn-box {
  background: rgba(255, 120, 80, 0.08);
  border-color: rgba(255, 120, 80, 0.28);
}
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--accent-2); }

.input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.input-row input { flex: 1; min-width: 0; }

.faq-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.faq-tab {
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.faq-tab:hover { color: var(--text); border-color: #3a3a44; }
.faq-tab.active {
  background: var(--accent-dim);
  border-color: rgba(59, 158, 255, 0.35);
  color: var(--accent-2);
}

.code-block {
  background: #0a0a0c;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.code-block-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.04em;
}
.code-block pre,
.cfg-out {
  margin: 0;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: #c8c8d0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow: auto;
}
.err-sample {
  background: #0a0a0c;
  border: 1px solid rgba(255, 120, 80, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: #ff9a7a;
  white-space: pre-wrap;
}

.faq-steps {
  margin: 0 0 14px 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.faq-steps li { margin-bottom: 6px; }
.faq-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.5;
}
.faq-docs h3 {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 8px;
}
.faq-dl {
  display: grid;
  gap: 10px;
  margin: 0;
}
.faq-dl dt {
  font-size: 12px;
  color: var(--accent-2);
  margin: 0;
}
.faq-dl dd {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
  letter-spacing: 0.04em;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #3a6a9a;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 12px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #061018;
  box-shadow: 0 6px 18px var(--accent-glow);
}
.btn-discord {
  width: 100%;
  background: var(--discord);
  color: #fff;
  padding: 12px;
  box-shadow: 0 8px 22px rgba(88, 101, 242, 0.35);
}
.btn-discord:hover { background: #4752c4; }
.btn-ghost {
  background: transparent;
  border-color: var(--border-2);
  color: var(--muted);
}
.btn-ghost:hover { color: var(--text); background: var(--card-2); }
.btn-danger {
  background: rgba(255, 92, 92, 0.1);
  border-color: rgba(255, 92, 92, 0.3);
  color: var(--red);
}
.btn-warn {
  background: rgba(245, 193, 74, 0.1);
  border-color: rgba(245, 193, 74, 0.3);
  color: var(--yellow);
}
.btn-sm { padding: 5px 9px; font-size: 11px; }
.btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none !important;
}
.btn .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(6, 16, 24, 0.25);
  border-top-color: #061018;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 12px;
  line-height: 1.4;
}
.modal-status.loading {
  background: rgba(59, 158, 255, 0.1);
  border: 1px solid rgba(59, 158, 255, 0.35);
  color: var(--accent-2);
}
.modal-status.ok {
  background: rgba(61, 214, 140, 0.1);
  border: 1px solid rgba(61, 214, 140, 0.35);
  color: var(--green);
}
.modal-status.err {
  background: rgba(255, 92, 92, 0.1);
  border: 1px solid rgba(255, 92, 92, 0.35);
  color: var(--red);
}
.modal-status .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(59, 158, 255, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-top: 1px;
  flex-shrink: 0;
}
.modal-status strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}
.modal-status span { opacity: 0.9; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
}
.modal {
  width: min(560px, 100%);
  background: #141416;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.modal-head, .modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-foot {
  border-bottom: 0;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
  gap: 8px;
}
.modal-body { padding: 16px; }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid #3a6a9a;
  border-radius: 8px;
  z-index: 80;
  max-width: 340px;
  font-size: 12px;
}
.toast.error { border-color: rgba(255, 92, 92, 0.5); }

.ws-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  display: inline-block;
}
.ws-dot.on { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

.empty-hero {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-hero strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 6px;
}
.empty-hero p { margin-bottom: 16px; }

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.user-card:last-child { border-bottom: 0; }
.user-card img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  object-fit: cover;
}
.user-card .meta { flex: 1; min-width: 0; }
.user-card .meta b { display: block; }
.user-card .meta span { color: var(--muted); font-size: 11px; }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.wg-status {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.wg-status .viz { padding: 12px 14px; }
@media (max-width: 1100px) {
  .wg-status { grid-template-columns: repeat(2, 1fr); }
}

.pending-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 24px var(--accent-glow);
  margin: 0 auto 14px;
  object-fit: cover;
}

.bar {
  height: 4px;
  background: #222;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.live-tag {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 1280px) {
  .viz-row { grid-template-columns: repeat(2, 1fr); }
  .mini-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  .app,
  .app.nav-open {
    grid-template-columns: 1fr;
    grid-template-rows: var(--top) auto 1fr;
    grid-template-areas: "top" "nav" "main";
  }
  .rail { display: none; }
  .sidebar {
    flex-direction: column;
    max-height: 42vh;
  }
  .sidebar-search { display: block !important; }
  .nav-group-title { display: block !important; }
  .nav-item .lbl { display: block !important; }
  .nav-item { justify-content: flex-start; padding: 0 10px; }
  .nav-tree {
    margin-left: 10px;
    padding-left: 12px;
  }
  .nav-tree::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: #2a2a30;
  }
  .action-row, .logs-row, .form-grid { grid-template-columns: 1fr; }
  .mini-row { grid-template-columns: repeat(2, 1fr); }
}
