:root {
  --bg-0: #07080b;
  --bg-1: #0c0d12;
  --bg-2: #11131a;
  --bg-3: #161924;
  --line: #1c1f2b;
  --line-2: #262a38;
  --text: #e7e9f0;
  --text-dim: #8a8fa3;
  --text-faint: #4f5566;
  --accent: #8b6cff;
  --accent-2: #5cd2ff;
  --green: #5fe3a1;
  --red: #ff6b6b;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
.bg-grad {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(139,108,255,0.10), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(92,210,255,0.06), transparent 60%),
    radial-gradient(1000px 700px at 50% 110%, rgba(139,108,255,0.05), transparent 70%);
}
.noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.4'/></svg>");
}

.topbar {
  position: sticky;
  top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(12,13,18,0.85), rgba(7,8,11,0.6));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: conic-gradient(from 220deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow: 0 0 18px rgba(139,108,255,0.45), inset 0 0 0 1px rgba(255,255,255,0.08);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 6px;
  border-radius: 4px;
  background: var(--bg-0);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.brand-text { font-weight: 600; font-size: 14px; letter-spacing: 0.02em; }
.brand-text .dim { color: var(--text-faint); font-weight: 400; }
.topbar-nav {
  display: flex; align-items: center; gap: 22px;
  font-size: 13.5px;
}
.topbar-nav a {
  color: var(--text-dim); text-decoration: none;
  transition: color 180ms ease;
}
.topbar-nav a:hover { color: var(--text); }

main {
  position: relative; z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 28px 80px;
}

.loading { text-align: center; padding: 80px 20px; color: var(--text-faint); }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  margin: 0 auto 18px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.blink { animation: blink 1.1s steps(2) infinite; font-family: "JetBrains Mono", monospace; }
@keyframes blink { 50% { opacity: 0; } }

h1.page-title {
  font-size: 38px; font-weight: 700; letter-spacing: -0.025em;
  margin: 0 0 10px;
  background: linear-gradient(180deg, #fff 0%, #b6bacb 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle { color: var(--text-dim); font-size: 15px; max-width: 64ch; margin: 0 0 36px; }
.crumb {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px; color: var(--text-faint);
  letter-spacing: 0.05em; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.crumb .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.crumb a { color: var(--text-dim); text-decoration: none; }
.crumb a:hover { color: var(--text); }

/* Landing */
.cta-card {
  background: linear-gradient(180deg, rgba(17,19,26,0.6), rgba(12,13,18,0.6));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 48px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-card::before {
  content: "";
  position: absolute; inset: -2px;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(139,108,255,0.4), transparent 50%, rgba(92,210,255,0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.cta-card h2 { font-size: 26px; margin: 0 0 12px; letter-spacing: -0.02em; }
.cta-card p { color: var(--text-dim); margin: 0 0 28px; }
.login-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px;
  background: linear-gradient(135deg, #5865f2 0%, #7b85ff 100%);
  color: #fff; font-weight: 600; font-size: 14.5px;
  text-decoration: none; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow:
    0 0 0 1px rgba(88,101,242,0.35),
    0 10px 36px -8px rgba(88,101,242,0.5),
    inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 220ms cubic-bezier(0.34, 1.3, 0.64, 1), box-shadow 280ms ease;
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(88,101,242,0.55),
    0 16px 48px -10px rgba(88,101,242,0.7),
    inset 0 1px 0 rgba(255,255,255,0.22);
}
.login-btn svg { width: 20px; height: 20px; }

/* User chip */
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 180ms ease;
}
.user-chip:hover { border-color: var(--line-2); }
.user-chip img {
  width: 22px; height: 22px; border-radius: 50%;
}
.user-chip .name { color: var(--text); }
.user-chip .out {
  margin-left: 4px;
  color: var(--text-faint);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
}
.user-chip:hover .out { color: var(--red); }

/* Guild grid */
.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.guild-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(17,19,26,0.6), rgba(12,13,18,0.6));
  border: 1px solid var(--line);
  border-radius: 11px;
  text-decoration: none; color: var(--text);
  position: relative; overflow: hidden;
  transition: border-color 200ms ease, transform 180ms cubic-bezier(0.34, 1.2, 0.64, 1), background 220ms ease;
}
.guild-card::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: 11px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(139,108,255,0.0), rgba(139,108,255,0.45) 50%, rgba(92,210,255,0.0));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 280ms ease;
  pointer-events: none;
}
.guild-card:hover {
  transform: translateY(-2px);
  border-color: transparent;
}
.guild-card:hover::before { opacity: 1; }
.guild-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  color: var(--text-dim);
  flex-shrink: 0;
  overflow: hidden;
}
.guild-icon img { width: 100%; height: 100%; object-fit: cover; }
.guild-name { font-weight: 500; font-size: 14.5px; }
.guild-meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

.empty-state {
  text-align: center; padding: 60px 20px;
  background: var(--bg-1);
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--text-dim);
}
.empty-state h3 { margin: 0 0 8px; color: var(--text); font-weight: 600; }
.empty-state code {
  background: var(--bg-2);
  padding: 1px 7px;
  border-radius: 5px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
}

/* ==========================================================================
   DYNO-STYLE LAYOUT (NEW)
   ========================================================================== */

main {
  padding: 0;
  max-width: none;
}
.srv-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 60px - 80px);
}
@media (max-width: 880px) {
  .srv-layout { grid-template-columns: 1fr; }
  .srv-sidebar { position: relative !important; height: auto !important; border-right: 0 !important; border-bottom: 1px solid var(--line); }
}

.srv-sidebar {
  position: sticky;
  top: 60px;
  align-self: start;
  height: calc(100vh - 60px);
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12,13,18,0.5), rgba(7,8,11,0.5));
  backdrop-filter: blur(10px);
  padding: 20px 14px;
  overflow-y: auto;
}
.srv-back {
  display: block;
  font-size: 12px;
  color: var(--text-faint);
  text-decoration: none;
  padding: 4px 8px;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}
.srv-back:hover { color: var(--text); }

.srv-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.srv-icon, .srv-icon-fallback {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--bg-3);
  overflow: hidden;
  flex-shrink: 0;
}
.srv-icon { object-fit: cover; }
.srv-icon-fallback {
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: var(--text-dim);
}
.srv-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.srv-stats { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

.srv-nav { display: flex; flex-direction: column; gap: 2px; }
.srv-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  position: relative;
  transition: color 160ms ease, background 200ms ease;
}
.srv-nav a:hover { color: var(--text); background: var(--bg-2); }
.srv-nav a.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(139,108,255,0.10), transparent);
}
.srv-nav a.active::before {
  content: "";
  position: absolute; left: -8px; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 16px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(139,108,255,0.6);
}
.srv-nav .ico { font-size: 15px; width: 18px; text-align: center; }

.srv-main { padding: 36px 48px 100px; max-width: 1200px; }
@media (max-width: 880px) { .srv-main { padding: 24px 18px 100px; } }

.page-head { margin-bottom: 28px; }
.page-head h1 {
  margin: 0 0 6px;
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff 0%, #b6bacb 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-sub { color: var(--text-dim); font-size: 14px; margin: 0 0 14px; }

.search-input {
  width: 100%;
  max-width: 480px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 180ms ease, box-shadow 200ms ease;
}
.search-input:focus {
  border-color: rgba(139,108,255,0.55);
  box-shadow: 0 0 0 3px rgba(139,108,255,0.12);
}

.crumb-row { margin-bottom: 16px; font-size: 13px; }
.crumb-row a { color: var(--text-dim); text-decoration: none; }
.crumb-row a:hover { color: var(--text); }

/* Sidebar SVG icons */
.srv-nav .ico, .srv-nav .ico svg {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.srv-nav .ico svg { color: currentColor; }
.srv-nav a .ico svg { stroke: currentColor; }

/* SVG icon inside section/header titles */
.section-icon { display: inline-flex; align-items: center; justify-content: center; }
.section-icon svg { width: 24px; height: 24px; color: var(--accent); }

/* Module card icon block */
.module-icon { display: inline-flex; align-items: center; justify-content: center; }
.module-icon svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(139,108,255,0.35));
}

/* Module cards (Dyno-style grid) — force at least 2 columns on big screens */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
@media (min-width: 1100px) {
  .module-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 700px) and (max-width: 1099px) {
  .module-grid { grid-template-columns: repeat(2, 1fr); }
}
.module-card {
  background: linear-gradient(180deg, rgba(17,19,26,0.7), rgba(12,13,18,0.7));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color 220ms ease, transform 180ms cubic-bezier(0.34, 1.2, 0.64, 1);
  position: relative;
}
.module-card:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
}
.module-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.module-card-title {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 14.5px;
}
.module-icon { font-size: 18px; }
.module-card-desc {
  color: var(--text-dim); font-size: 12.5px;
  margin: 0;
  flex: 1;
  line-height: 1.4;
}
.module-card-foot { margin-top: 4px; }

.status-pill {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--line);
}
.status-pill.on  { color: var(--green); background: rgba(95,227,161,0.08); border-color: rgba(95,227,161,0.3); }
.status-pill.off { color: var(--text-faint); background: var(--bg-2); }

/* Dashboard overview */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  background: linear-gradient(180deg, rgba(17,19,26,0.7), rgba(12,13,18,0.7));
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 18px 20px;
}
.stat-label { color: var(--text-faint); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.dash-row { margin-bottom: 18px; }

.enabled-list { display: flex; flex-wrap: wrap; gap: 8px; }
.enabled-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 12.5px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 180ms ease, background 220ms ease;
}
.enabled-pill:hover { border-color: rgba(139,108,255,0.5); background: rgba(139,108,255,0.05); }
.enabled-pill .ico { font-size: 14px; }

/* Commands browser */
.cmd-cat {
  margin-bottom: 32px;
}
.cmd-cat-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 12px;
}
.cmd-cat-title .dim { color: var(--text-faint); }
.cmd-cat-count { color: var(--text-faint); font-weight: 500; }
.cmd-list { display: flex; flex-direction: column; gap: 4px; }
.cmd {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 24px;
  padding: 11px 16px;
  background: linear-gradient(180deg, rgba(17,19,26,0.5), rgba(12,13,18,0.5));
  border: 1px solid var(--line);
  border-radius: 9px;
  align-items: baseline;
  transition: border-color 200ms ease;
}
.cmd:hover { border-color: var(--line-2); }
.cmd code {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  font-weight: 500;
  word-break: break-word;
}
.cmd .cmd-slash  { color: #8ea4ff; }
.cmd .cmd-prefix { color: #5fe3a1; }
.cmd .dim        { color: var(--text-faint); }
.cmd-desc { color: var(--text-dim); font-size: 13px; }
@media (max-width: 700px) { .cmd { grid-template-columns: 1fr; gap: 4px; } }

/* Config page (legacy — still used inside module pages) */
.config-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
}
@media (max-width: 800px) {
  .config-layout { grid-template-columns: 1fr; }
  .config-tabs { flex-direction: row !important; overflow-x: auto; }
}
.config-tabs {
  display: flex; flex-direction: column; gap: 1px;
  position: sticky; top: 80px; align-self: start;
  padding-right: 8px;
}
.config-tabs button {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13.5px; font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  transition: color 160ms ease, background 200ms ease;
}
.config-tabs button:hover { color: var(--text); background: var(--bg-2); }
.config-tabs button.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(139,108,255,0.10), transparent);
}
.config-tabs .tab-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  filter: saturate(0.9);
}
.config-tabs .tab-label { flex: 1; }
.config-tabs button.active::before {
  content: "";
  position: absolute;
  left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 14px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(139,108,255,0.6);
}

.section-head {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.section-head-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}
.section-head-title .section-icon { font-size: 22px; }
.section-desc {
  color: var(--text-dim);
  font-size: 13.5px;
  margin: 0;
  max-width: 64ch;
}

.config-group {
  margin-bottom: 18px;
}
.config-group .group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin: 0 0 8px 4px;
}
.config-section {
  background: linear-gradient(180deg, rgba(17,19,26,0.6), rgba(12,13,18,0.6));
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 4px 22px;
  transition: border-color 220ms ease;
}
.config-section:hover { border-color: var(--line-2); }
.field {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  gap: 20px;
}
.field:first-of-type { border-top: 0; }
.field-info { min-width: 0; flex: 1; }
.field-info .label { font-weight: 500; font-size: 13.5px; color: var(--text); }
.field-info .help {
  font-size: 12px; color: var(--text-faint);
  margin-top: 3px;
  line-height: 1.4;
  max-width: 48ch;
}
.field-control { flex-shrink: 0; }
@media (max-width: 600px) {
  .field { flex-direction: column; align-items: flex-start; }
  .field-control { width: 100%; }
  input[type="text"], input[type="number"], textarea, select { width: 100% !important; }
}

input[type="text"], input[type="number"], textarea, select {
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 13.5px;
  font-family: inherit;
  width: 220px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 200ms ease;
}
input[type="text"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
  border-color: rgba(139,108,255,0.55);
  box-shadow: 0 0 0 3px rgba(139,108,255,0.12);
}
textarea { width: 320px; min-height: 70px; resize: vertical; line-height: 1.5; }
select { cursor: pointer; }

.toggle {
  position: relative;
  width: 42px; height: 22px;
  background: var(--bg-3);
  border-radius: 100px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}
.toggle::after {
  content: "";
  position: absolute;
  left: 2px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  background: #8a8fa3;
  border-radius: 50%;
  transition: left 220ms cubic-bezier(0.34, 1.2, 0.64, 1), background 220ms ease;
}
.toggle.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(139,108,255,0.4);
}
.toggle.on::after {
  left: 22px;
  background: #fff;
}

.save-bar {
  position: sticky;
  bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 26px;
  padding: 14px 18px;
  background: rgba(17, 19, 26, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: opacity 200ms ease, transform 220ms ease;
}
.save-bar.idle { opacity: 0; transform: translateY(8px); pointer-events: none; }
.save-bar .status { font-size: 13px; color: var(--text-dim); }
.save-bar .actions { display: flex; gap: 8px; }
.btn {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 160ms ease;
}
.btn:hover { background: var(--bg-3); border-color: var(--line-2); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #6f5fe5);
  border-color: rgba(139,108,255,0.5);
  color: #fff;
  box-shadow: 0 6px 20px -6px rgba(139,108,255,0.5);
}
.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -6px rgba(139,108,255,0.65);
}
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 11px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 240ms cubic-bezier(0.34, 1.3, 0.64, 1);
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(95,227,161,0.45); }
.toast.error { border-color: rgba(255,107,107,0.45); }

/* Custom action panels */
.config-section.panel {
  padding: 22px 24px;
}
.config-section.panel label {
  display: block;
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.config-section.panel label .hint {
  font-weight: 400;
  color: var(--text-faint);
  font-size: 11px;
  margin-left: 6px;
}
.config-section.panel input,
.config-section.panel textarea,
.config-section.panel select {
  display: block;
  width: 100%;
  margin-top: 5px;
}
.config-section.panel textarea {
  min-height: 86px;
  resize: vertical;
}
.panel-row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) { .panel-row.two { grid-template-columns: 1fr; } }
.panel-help {
  font-size: 12.5px;
  color: var(--text-faint);
  margin: 0 0 16px;
}
.panel-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.panel-status { font-size: 12.5px; color: var(--text-faint); }
.panel-status .ok  { color: var(--green); }
.panel-status .err { color: var(--red);   }

/* Moderation tabs */
.moderation-tabs {
  display: inline-flex;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 18px;
  gap: 2px;
}
.moderation-tabs button {
  background: transparent;
  border: 0;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-dim);
  border-radius: 6px;
  cursor: pointer;
  transition: background 200ms ease, color 160ms ease;
}
.moderation-tabs button:hover { color: var(--text); }
.moderation-tabs button.active {
  background: var(--bg-3);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04);
}

/* Data tables */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(17,19,26,0.6), rgba(12,13,18,0.6));
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  background: rgba(0,0,0,0.2);
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(28,31,43,0.4);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.015); }
.data-table .num { font-family: "JetBrains Mono", monospace; color: var(--text-faint); width: 60px; }
.data-table .right { text-align: right; }
.data-table .reason {
  color: var(--text-dim);
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-3);
  display: block;
}
.user-line { display: flex; flex-direction: column; line-height: 1.3; }
.user-line .user-name { color: var(--text); font-weight: 500; font-size: 13px; }
.user-line .user-id {
  color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}
.case-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.btn.small {
  padding: 6px 12px;
  font-size: 12.5px;
}
.btn svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
}
.btn.danger {
  background: rgba(255,107,107,0.08);
  border-color: rgba(255,107,107,0.3);
  color: #ff8a8a;
}
.btn.danger:hover {
  background: rgba(255,107,107,0.15);
  border-color: rgba(255,107,107,0.55);
}

/* CRUD entry list (ticket panels, level rewards, etc.) */
.entry-list { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; }
.entry {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 9px;
  transition: border-color 200ms ease;
}
.entry:hover { border-color: var(--line-2); }
.entry-main { min-width: 0; flex: 1; }
.entry-title { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.entry-meta {
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.entry-meta .dim { color: var(--text-faint); }
.entry-meta code {
  background: var(--bg-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
}
.entry-actions { flex-shrink: 0; display: flex; gap: 8px; }

.loading-inline {
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  padding: 18px;
  font-family: "JetBrains Mono", monospace;
}

/* Ticket panel editor — 2-column form + live preview */
.tp-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1000px) {
  .tp-editor-grid { grid-template-columns: 1fr; }
}

.embed-preview-wrap {
  background: linear-gradient(180deg, rgba(17,19,26,0.6), rgba(12,13,18,0.6));
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 16px;
  position: sticky;
  top: 80px;
}
.preview-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

/* Discord-style embed preview */
.embed-preview {
  background: #2b2d31;
  border-radius: 6px;
  display: grid;
  grid-template-columns: 4px 1fr;
  font-family: "gg sans", "Inter", sans-serif;
  font-size: 14px;
  max-width: 520px;
  overflow: hidden;
}
.embed-stripe {
  background: #8b6cff;
  width: 4px;
  transition: background 200ms ease;
}
.embed-body { padding: 12px 16px 16px; color: #dbdee1; }
.embed-title-text {
  font-weight: 600;
  font-size: 16px;
  color: #f2f3f5;
  margin: 4px 0 8px;
  line-height: 1.4;
  word-wrap: break-word;
}
.embed-desc-text {
  font-size: 14px;
  color: #dbdee1;
  line-height: 1.45;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.embed-desc-text strong { font-weight: 700; color: #f2f3f5; }
.embed-desc-text em     { font-style: italic; }
.embed-desc-text code   {
  background: #1e1f22;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: #d4d7dc;
}
.embed-author-text {
  font-size: 13px;
  font-weight: 500;
  color: #f2f3f5;
  margin: 0 0 6px;
}
.embed-footer-text {
  font-size: 12px;
  color: #949ba4;
  margin-top: 12px;
  padding-top: 4px;
}
.embed-thumbnail {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  width: 80px;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
  margin: 12px 16px 0 0;
}
.embed-preview { grid-template-columns: 4px 1fr auto; }
.embed-buttons { margin-top: 8px; }
.embed-fake-btn {
  display: inline-flex;
  align-items: center;
  background: #5865f2;
  color: #fff;
  border: 0;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: default;
  font-family: inherit;
  transition: background 200ms ease, color 200ms ease;
}

/* Prefix command toggle chips */
.pc-group { margin-bottom: 18px; }
.pc-group h5 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin: 0 0 10px 2px;
}
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  border-radius: 100px;
  border: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  background: var(--bg-2);
  color: var(--text);
  transition: all 180ms ease;
}
.pc-chip .pc-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
}
.pc-chip.on  { border-color: rgba(95,227,161,0.4); }
.pc-chip.on  .pc-dot { background: var(--green); box-shadow: 0 0 8px rgba(95,227,161,0.7); }
.pc-chip.off { color: var(--text-faint); border-color: rgba(255,107,107,0.3); }
.pc-chip.off .pc-dot { background: var(--red); }
.pc-chip:hover { background: var(--bg-3); }
.table-footer {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
}
.ok { color: var(--green); font-weight: 500; }
.dim { color: var(--text-faint); }

.footer {
  text-align: center;
  padding: 32px 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-faint);
  display: flex; justify-content: center; gap: 14px;
}
.footer a { color: var(--text-dim); text-decoration: none; }
.footer a:hover { color: var(--text); }
.footer .dim { color: var(--text-faint); }
