:root {
  --bg: #0a0a0a;
  --bg2: #111113;
  --surface: #121214;
  --surface2: #161618;
  --surface-elevated: #1a1a1e;
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-glow: rgba(255, 255, 255, 0.09);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --text-dim: #71717a;
  --accent: #7c5cff;
  --accent-glow: rgba(124, 92, 255, 0.35);
  --accent-hover: #6d4ef0;
  --teal-light: #a78bfa;
  --gradient-brand: linear-gradient(135deg, #7c5cff 0%, #6366f1 50%, #5b8cff 100%);
  --gradient-btn: linear-gradient(135deg, #7c5cff 0%, #6366f1 50%, #5b8cff 100%);
  --gradient-btn-hover: linear-gradient(135deg, #8b6cff 0%, #7477f5 50%, #6b9cff 100%);
  --success: #34d399;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 48px rgba(124, 92, 255, 0.18);
  --glass-blur: none;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Syne", var(--font);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 40% at 50% 8%, rgba(124, 92, 255, 0.14), transparent 58%),
    radial-gradient(ellipse 70% 45% at 50% 100%, rgba(255, 255, 255, 0.02), transparent 48%);
  pointer-events: none;
  z-index: 0;
}

body::after { content: none; }

.hidden { display: none !important; }

.glass {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glow);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Login */
.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.login-card {
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-icon {
  width: 56px; height: 56px;
  margin: 0 auto 1rem;
  background: var(--gradient-brand);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}
.login-icon svg { width: 28px; height: 28px; color: white; }

.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  margin-bottom: 0.2rem;
}
.login-card > p { color: var(--muted); margin-bottom: 1.75rem; font-size: 0.9rem; }

.input-wrap {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 0.85rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}
.input-wrap:focus-within { border-color: var(--accent); }
.input-wrap svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.input-wrap input {
  flex: 1; background: none; border: none; color: var(--text);
  padding: 0.75rem 0; font-size: 0.95rem; outline: none;
}

.error { color: var(--danger); margin-top: 0.75rem; font-size: 0.85rem; }

/* Layout */
#app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  padding: 1.1rem 0.85rem 1rem 0.4rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: transparent;
  backdrop-filter: none;
}

.brand {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.35rem 0.5rem 1.35rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 42px; height: 42px;
  background: var(--gradient-brand);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.brand-title {
  display: block;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-sub { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; letter-spacing: 0.02em; }

nav#main-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; overflow-y: auto; padding-right: 0.15rem; }

.nav-btn {
  display: flex; align-items: center; gap: 0.65rem;
  background: none; border: none;
  color: var(--muted);
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-radius: 0;
  border-left: 2px solid transparent;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-btn svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-btn:hover {
  color: var(--text);
  background: transparent;
  border-left-color: rgba(255, 255, 255, 0.2);
}
.nav-btn:hover svg { opacity: 1; }
.nav-btn.hidden { display: none; }
.nav-btn.active {
  background: transparent;
  color: #fff;
  border-left-color: #fff;
  box-shadow: none;
  font-weight: 600;
}
.nav-btn.active svg { opacity: 1; color: #fff; }

.logout {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  margin-top: auto;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.7rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}
.logout svg { width: 16px; height: 16px; }
.logout:hover { border-color: var(--danger); color: var(--danger); background: rgba(242,63,67,0.08); }

.content {
  padding: 2rem 2.25rem;
  overflow-y: auto;
  max-height: 100vh;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.page-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.subtitle { color: var(--muted); font-size: 0.88rem; margin-top: 0.35rem; }

.guild-badge {
  display: flex; align-items: center; gap: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glow);
  padding: 0.45rem 1rem 0.45rem 0.45rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.guild-badge img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.08); }

.tab { display: none; animation: fadeIn 0.25s ease; }
.tab.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255,255,255,0.04);
}

.stat-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.blue { background: rgba(88,101,242,0.15); color: #7289da; }
.stat-icon.green { background: rgba(35,165,90,0.15); color: var(--success); }
.stat-icon.purple { background: rgba(155,89,182,0.15); color: #b57edc; }
.stat-icon.orange { background: rgba(240,178,50,0.15); color: var(--warning); }
.stat-icon.red { background: rgba(242,63,67,0.15); color: var(--danger); }
.stat-icon.cyan { background: rgba(0,188,212,0.15); color: #4dd0e1; }

.stat-info { flex: 1; min-width: 0; }
.stat-label { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.25rem; }
.stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.icon, .icon-wrap svg, [data-icon] svg { width: 18px; height: 18px; display: block; }
.nav-btn [data-icon], .nav-btn .icon-wrap { display: inline-flex; flex-shrink: 0; }
.stat-icon svg { width: 20px; height: 20px; }
.login-icon svg { width: 28px; height: 28px; }
.brand-icon svg { width: 22px; height: 22px; color: white; }

.lang-picker {
  display: flex;
  gap: 0.2rem;
  margin-bottom: 1rem;
  padding: 0.3rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(12px);
}
.lang-btn {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: none;
  border-radius: var(--radius-pill);
  background: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: all 0.2s;
}
.lang-btn:hover:not(.active) { color: rgba(255, 255, 255, 0.7); background: rgba(255,255,255,0.05); }
.lang-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}

.tabs-checkboxes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; margin: 0.5rem 0; }
.tabs-checkboxes label { display: flex; align-items: center; gap: 0.4rem; margin: 0; font-size: 0.82rem; color: var(--text); }
.master-only.hidden { display: none !important; }

.card-header [data-icon] { display: inline-flex; color: var(--accent); }
.btn [data-icon] { display: inline-flex; }


.status-dot {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem;
}
.status-dot::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.status-dot.online::before { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.offline::before { background: var(--danger); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 16px;
  box-shadow: none;
}
.card:hover { border-color: var(--border); }

.card-header {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.card-header svg { width: 18px; height: 18px; color: var(--teal-light); }
.card-header h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.editor-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

@media (max-width: 1100px) {
  .grid-2, .editor-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; }
  nav#main-nav { flex-direction: row; flex-wrap: wrap; }
  nav.sub-nav { flex-wrap: wrap; max-width: calc(100% - 1rem); }
}

/* Forms */
label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}
label small { font-weight: 400; opacity: 0.7; }

input, textarea, select {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.7);
  background: #0e0e10;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

textarea { resize: vertical; }
textarea.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 0.85rem; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.section-divider {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 1.25rem 0 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
.section-divider svg { width: 16px; height: 16px; }

.hint { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.5rem; line-height: 1.5; }

.toggle-row {
  display: flex !important; align-items: center; gap: 0.6rem;
  cursor: pointer; margin-top: 0.5rem;
}
.toggle-row input { width: auto; accent-color: var(--accent); }

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem;
  background: rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s;
}
fieldset:focus-within { border-color: rgba(129, 140, 248, 0.3); }
legend { color: var(--muted); font-size: 0.8rem; font-weight: 600; padding: 0 0.4rem; }

.form-grid.wide { max-width: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.65rem 1.15rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.86rem;
  font-family: inherit;
  letter-spacing: 0;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn.full { width: 100%; }
.btn.sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; border-radius: 8px; }
.btn.primary {
  background: var(--gradient-btn);
  color: white;
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.22);
}
.btn.primary:hover {
  background: var(--gradient-btn);
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.28);
}
.btn.secondary {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.secondary:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  transform: none;
}

.actions { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
.schedule-row { display: flex; gap: 0.5rem; }
.search-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

.status { margin-top: 0.75rem; font-size: 0.85rem; color: var(--success); }
.status.error { color: var(--danger); }

.embed-builder { margin-top: 1rem; }
.embed-builder summary {
  cursor: pointer; color: var(--accent);
  font-weight: 500; font-size: 0.9rem;
  display: flex; align-items: center; gap: 0.4rem;
  list-style: none;
}
.embed-builder summary svg { width: 16px; height: 16px; }

/* Discord Preview */
.discord-preview {
  background: #313338;
  border-radius: var(--radius-sm);
  padding: 1rem;
  min-height: 180px;
}

.preview-tabs,
.ticket-filter-tabs,
.verify-filter-tabs {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.3rem;
  margin-bottom: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(12px);
}
.preview-tab {
  padding: 0.45rem 1rem;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.preview-tab:hover:not(.active) {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.05);
}
.preview-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Sub-navigation — Gambo pill style */
nav.sub-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  flex: none;
  overflow: visible;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 1.75rem;
  padding: 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.sub-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0.6rem 1.35rem;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.sub-nav-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.05);
}
.sub-nav-btn.active {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  font-weight: 600;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.sub-nav-btn.hidden { display: none; }
.sub-panel { display: none; }
.sub-panel.active {
  display: block;
  animation: fadeIn 0.35s ease;
}

.preview-content { white-space: pre-wrap; word-break: break-word; line-height: 1.5; font-size: 0.9rem; }
.preview-content code { background: #1e1f22; padding: 0.15rem 0.35rem; border-radius: 4px; font-family: Consolas, monospace; font-size: 0.85em; }
.preview-content pre { background: #1e1f22; border-radius: 6px; padding: 0.75rem; margin: 0.5rem 0; overflow-x: auto; }
.preview-content pre code { background: none; padding: 0; }
.preview-content strong { font-weight: 700; }
.preview-content em { font-style: italic; }

.preview-embed, .dc-embed {
  display: flex;
  margin-top: 0.75rem;
  border-radius: 4px;
  overflow: hidden;
  background: #2b2d31;
  max-width: 520px;
}

.embed-color-bar, .dc-embed-bar { width: 4px; flex-shrink: 0; background: var(--accent); }
.embed-body, .dc-embed-body { padding: 0.75rem 1rem 0.5rem; flex: 1; min-width: 0; position: relative; }
.embed-title, .dc-embed-title { font-weight: 700; margin-bottom: 0.35rem; font-size: 1rem; }
.embed-description, .dc-embed-desc { color: #dbdee1; font-size: 0.9rem; white-space: pre-wrap; line-height: 1.45; }
.embed-footer, .dc-embed-footer { margin-top: 0.5rem; font-size: 0.72rem; color: #949ba4; }

.dc-embed-thumb {
  position: absolute; top: 0.75rem; right: 1rem;
  width: 80px; height: 80px; border-radius: 4px; object-fit: cover;
}
.dc-embed-image { width: 100%; max-height: 200px; object-fit: cover; border-radius: 4px; margin-top: 0.5rem; display: block; }

.dc-embed-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.5rem; }
.dc-embed-field { background: rgba(0,0,0,0.2); border: 1px solid rgba(88,101,242,0.3); border-radius: 4px; padding: 0.4rem 0.6rem; }
.dc-embed-field.full { grid-column: 1 / -1; }
.dc-embed-field-name { font-size: 0.72rem; font-weight: 600; color: #949ba4; margin-bottom: 0.15rem; }
.dc-embed-field-value { font-size: 0.85rem; color: #5865f2; font-weight: 600; }

.dc-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.dc-btn {
  padding: 0.35rem 1rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  border: none;
  cursor: default;
}
.dc-btn.primary { background: #5865f2; color: white; }
.dc-btn.secondary { background: #4e5058; color: white; }
.dc-btn.success { background: #248046; color: white; }
.dc-btn.danger { background: #da373c; color: white; }
.dc-btn.link { background: #4e5058; color: #00a8fc; }

.ephemeral-note {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(88,101,242,0.1);
  border: 1px solid rgba(88,101,242,0.2);
  border-radius: 6px;
  font-size: 0.75rem;
  color: #949ba4;
}

/* Lists */
.list { display: flex; flex-direction: column; gap: 0.45rem; }

.list-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.05rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.list-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}
.list-item .meta { color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; }

.badge {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge.active { background: rgba(35,165,90,0.15); color: var(--success); }
.badge.ended { background: rgba(139,139,160,0.15); color: var(--muted); }

.status-list { display: flex; flex-direction: column; gap: 0.6rem; }
.status-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.status-row:last-child { border-bottom: none; }

/* Users */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.user-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.user-card:hover {
  border-color: rgba(129, 140, 248, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.user-card img {
  width: 48px; height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-card-info h4 { font-size: 0.95rem; font-weight: 600; }
.user-card-info .username { color: var(--muted); font-size: 0.8rem; }
.user-roles { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.4rem; }
.role-tag {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
}

.user-detail-card { margin-top: 1.25rem; }
.user-detail-header {
  display: flex; gap: 1.25rem; align-items: flex-start;
  margin-bottom: 1.25rem;
}
.user-detail-header img { width: 80px; height: 80px; border-radius: 50%; }
.user-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.detail-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}
.detail-item .label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.2rem; }
.detail-item .value { font-size: 0.9rem; font-weight: 500; }
.detail-item .meta { margin-top: 0.25rem; font-size: 0.75rem; color: var(--muted); font-weight: 400; }

.rewards-tiers-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.75rem; }
.rewards-tier-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}
.rewards-tier-actions { display: flex; align-items: flex-end; justify-content: flex-end; }

.invite-section { margin-top: 1.5rem; }
.invite-section h4 { margin: 0 0 0.35rem; font-size: 1rem; }
.invite-section > .hint { margin-bottom: 0.85rem; }
.invite-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}
.invite-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  color: var(--accent, #5865f2);
  text-decoration: none;
}
.invite-code:hover { text-decoration: underline; }
.invite-uses { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.invite-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}
.invite-meta-grid .label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.1rem;
}
.invite-joins .label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.invite-join-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.invite-join-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  font-size: 0.88rem;
}
.invite-join-list .meta { color: var(--muted); font-size: 0.78rem; }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent, #5865f2);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.link-btn:hover { text-decoration: underline; }

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Login enhancements */
.login-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(88,101,242,0.08), transparent 70%);
}

.login-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.login-orbs::before,
.login-orbs::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}
.login-orbs::before {
  width: 320px; height: 320px;
  background: #5865f2;
  top: 15%; left: 20%;
  animation: float 8s ease-in-out infinite;
}
.login-orbs::after {
  width: 280px; height: 280px;
  background: #7c3aed;
  bottom: 10%; right: 15%;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -15px); }
}

.login-card {
  position: relative;
  z-index: 2;
  max-width: 420px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 80px rgba(99, 102, 241, 0.08);
}

.login-brand { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.15rem; }
.login-sub { color: var(--muted); font-size: 0.82rem; margin-bottom: 1rem; opacity: 0.85; }
.login-lang { margin-bottom: 1.25rem; }

/* Invite banner */
.invite-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(242,63,67,0.1), rgba(240,178,50,0.06));
  border: 1px solid rgba(242,63,67,0.2);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.invite-banner-text strong { display: block; margin-bottom: 0.2rem; }
.invite-banner-text p { color: var(--muted); font-size: 0.85rem; margin: 0; }
.invite-banner-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.gateway-banner-manual {
  background: linear-gradient(135deg, rgba(88,101,242,0.12), rgba(0,0,0,0.2));
  border-color: rgba(88,101,242,0.25);
}
.gateway-banner-error {
  background: linear-gradient(135deg, rgba(242,63,67,0.1), rgba(240,178,50,0.06));
  border-color: rgba(242,63,67,0.2);
}

/* Section cards */
.section-card { margin-top: 1.5rem; }
.subsection-title { margin-top: 1.25rem; font-size: 0.95rem; font-weight: 600; }

/* Layouts */
.giveaway-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.2fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.admin-keys-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.admin-create-card, .admin-keys-card { min-height: 420px; }
.bot-profile-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  max-width: 1100px;
}

.row-actions {
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mod-card { margin-top: 1.25rem; max-width: 700px; }

/* Giveaway editor */
.gw-item { cursor: default; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.gw-item-main { cursor: pointer; flex: 1; min-width: 0; }
.gw-item-main:hover strong { color: var(--accent); }
.gw-item-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.gw-item:hover { border-color: var(--accent); background: rgba(88,101,242,0.06); }
.gw-preview-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
}
.winner-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.winner-tag {
  background: rgba(88,101,242,0.15);
  border: 1px solid rgba(88,101,242,0.3);
  color: #a5b3ff;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: Consolas, monospace;
}

/* Bot profile */
.bot-avatar-section {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}
.bot-avatar-img {
  width: 88px; height: 88px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  object-fit: cover;
  background: var(--bg2);
}
.bot-profile-preview {
  background: #1a1b1e;
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-height: 220px;
}
.bot-preview-banner {
  height: 72px;
  background: linear-gradient(135deg, #f26522, #e85d04);
}
.bot-preview-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 4px solid #1a1b1e;
  margin: -36px 0 0 1rem;
  display: block;
  background: var(--bg2);
}
.bot-profile-preview h3 {
  padding: 0;
  font-size: 1.1rem;
}
.bot-preview-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0;
}
.bot-app-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: #5865f2;
  color: #fff;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.bot-preview-bio {
  padding: 0.35rem 1rem 1.25rem;
  color: #b5bac1;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.profile-info-box {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  background: rgba(88, 101, 242, 0.08);
  border: 1px solid rgba(88, 101, 242, 0.22);
  border-radius: var(--radius-sm);
  margin-bottom: 0.25rem;
}
.profile-info-box svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; margin-top: 0.1rem; }
.profile-info-box p { color: var(--muted); font-size: 0.82rem; line-height: 1.45; margin: 0; }
.commands-layout { max-width: 1200px; align-items: start; }
.cmd-preview-list { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.25rem 0; }
.cmd-preview-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}
.cmd-preview-item code {
  display: block;
  color: #a5b3ff;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  word-break: break-word;
}
.cmd-preview-item p { color: var(--muted); font-size: 0.82rem; margin: 0; }
.security-channels-section { margin: 0.75rem 0 1.25rem; }

fieldset textarea { min-height: 4.5rem; resize: vertical; }
.rules-grid fieldset { transition: border-color 0.2s, box-shadow 0.2s; }
.rules-grid fieldset:focus-within { border-color: rgba(88, 101, 242, 0.35); box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.12); }

/* Content polish */
.editor-panel, .preview-panel { min-height: 400px; }

/* Scrollbars */
.sidebar nav#main-nav::-webkit-scrollbar,
.content::-webkit-scrollbar { width: 5px; }
.sidebar nav#main-nav::-webkit-scrollbar-thumb,
.content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
}
.sidebar nav#main-nav::-webkit-scrollbar-thumb:hover,
.content::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

@media (max-width: 1100px) {
  .giveaway-layout, .bot-profile-layout, .admin-keys-layout, .edit-msg-layout { grid-template-columns: 1fr; }
}

/* Edit message */
.edit-msg-layout { max-width: 1200px; }
.inline-actions { display: flex; gap: 0.5rem; margin-bottom: 0.25rem; }
.inline-actions input { flex: 1; }

/* Users */
.users-toolbar { margin-bottom: 1rem; }
.users-meta-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.pagination { display: flex; align-items: center; gap: 0.5rem; }

/* Admin keys */
.admin-create-card { display: flex; flex-direction: column; }
.admin-form-body { display: flex; flex-direction: column; gap: 0.25rem; padding: 0 0.25rem; }
.admin-field { margin-bottom: 0.75rem; }
.admin-field label { margin-top: 0; }
.admin-keys-list-inner { min-height: 200px; }

.perm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.65rem;
}
@media (min-width: 900px) {
  .perm-grid { grid-template-columns: repeat(3, 1fr); }
}

.perm-card {
  display: block;
  margin: 0 !important;
  cursor: pointer;
}
.perm-card input { position: absolute; opacity: 0; pointer-events: none; }
.perm-card-inner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  min-height: 44px;
}
.perm-card:hover .perm-card-inner { border-color: var(--border-hover); }
.perm-card input:checked + .perm-card-inner {
  border-color: var(--accent);
  background: rgba(88, 101, 242, 0.12);
  box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.25);
}
.perm-check {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 2px solid var(--muted);
  flex-shrink: 0;
  position: relative;
}
.perm-card input:checked + .perm-card-inner .perm-check {
  border-color: var(--accent);
  background: var(--accent);
}
.perm-card input:checked + .perm-card-inner .perm-check::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.perm-label { font-size: 0.82rem; font-weight: 500; color: var(--text); line-height: 1.2; }

/* File inputs */
.file-input {
  font-size: 0.82rem;
  padding: 0.5rem;
  background: var(--bg2) !important;
  color: var(--text) !important;
  border: 1px dashed var(--border) !important;
}
.file-input::file-selector-button {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  margin-right: 0.75rem;
  cursor: pointer;
  font-family: inherit;
}

input[type="password"], input[type="text"], input[type="url"], input[type="number"] {
  background: var(--bg2);
  color: var(--text);
}

/* Bot profile extended */
.bot-media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 0.5rem; }
.bot-banner-section { display: flex; flex-direction: column; gap: 0.5rem; }
.bot-banner-preview {
  height: 72px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f26522, #e85d04);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
}
.bot-preview-summary { padding: 0 1rem; color: var(--muted); font-size: 0.82rem; }
.bot-preview-link {
  color: #00a8fc;
  font-size: inherit;
  text-decoration: none;
}
.bot-preview-link:hover { text-decoration: underline; }
.bot-preview-tags { padding: 0 1rem 1rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.bot-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(88, 101, 242, 0.15);
  color: #a5b3ff;
}

.tickets-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.4fr);
  gap: 1.25rem;
  align-items: start;
}
.ticket-panel-form { max-width: none; }
.multi-select {
  min-height: 7rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem;
}
.multi-select option {
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 2px;
}
.ticket-types-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ticket-type-row {
  position: relative;
  padding: 0.85rem 2.25rem 0.85rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
}
.ticket-type-row .tt-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}
.section-divider {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
}
.section-card { margin-top: 1.25rem; }

.panel-list-item { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.panel-list-item:hover { border-color: var(--accent); background: rgba(88, 101, 242, 0.06); }
.panel-list-item.active { border-color: var(--accent); background: rgba(88, 101, 242, 0.1); }
.panel-edit-banner {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.35);
  color: #c4cbff;
  font-size: 0.88rem;
  font-weight: 500;
}
.panel-edit-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.panel-edit-actions .btn { flex: 1; }
.btn.danger-outline {
  border-color: rgba(237, 66, 69, 0.5);
  color: #ed4245;
}
.btn.danger-outline:hover {
  background: rgba(237, 66, 69, 0.12);
  border-color: #ed4245;
}
.custom-btn-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}
.panel-link-btns-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.panel-link-btn-row {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  transition: opacity 0.15s ease;
}
.panel-link-btn-row.is-disabled {
  opacity: 0.55;
}
.panel-link-btn-row .plb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.plb-enable {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}
.plb-enable input {
  width: auto;
  margin: 0;
}
.panel-link-btn-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.panel-section {
  margin-bottom: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  overflow: hidden;
}
.panel-section > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.panel-section > summary::-webkit-details-marker { display: none; }
.panel-section-body {
  padding: 0 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.panel-action-btns-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.panel-action-btn-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 0.75rem;
  transition: opacity 0.15s ease;
}
.panel-action-btn-card.is-disabled { opacity: 0.55; }
.pab-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.pab-head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
.pab-card-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.pab-enable {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.pab-color-presets {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.pab-color-preset {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  padding: 0;
}
.pab-color-preset[data-color="#5865f2"] { background: #5865f2; }
.pab-color-preset[data-color="#4e5058"] { background: #4e5058; }
.pab-color-preset[data-color="#248046"] { background: #248046; }
.pab-color-preset[data-color="#da373c"] { background: #da373c; }
.pab-private {
  margin-top: 0.35rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}
.pab-private > summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.pab-private-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pab-link-section {
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}
.panel-preview-private-select {
  margin-bottom: 0.65rem;
}
.panel-preview-private-select select {
  width: 100%;
  margin-top: 0.25rem;
}
.panel-custom-btns-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.panel-custom-btn-row {
  position: relative;
  padding: 0.75rem 2rem 0.75rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
}
.panel-custom-btn-row .pcb-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 1.1rem;
}
.list-item-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.panel-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.staff-search { margin-bottom: 0; flex: 1; min-width: 0; }

.staff-roles-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  padding: 0.85rem;
  margin-top: 0.25rem;
}
.staff-roles-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.staff-role-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.staff-role-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 300px;
  overflow-y: auto;
  padding: 0.15rem 0.25rem 0.15rem 0;
  scrollbar-gutter: stable;
}
.staff-role-list::-webkit-scrollbar { width: 6px; }
.staff-role-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.staff-role-card { display: block; margin: 0; }
.staff-role-card .staff-role-inner {
  border-left: 3px solid var(--role-color, #99aab5);
  padding-left: 0.85rem;
  gap: 0.65rem;
}
.staff-role-card input:checked + .staff-role-inner {
  border-left-color: var(--role-color, var(--accent));
}
.staff-role-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.staff-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.staff-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.35rem 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  background: rgba(88, 101, 242, 0.1);
  border: 1px solid rgba(88, 101, 242, 0.25);
  color: var(--text);
}
.staff-chip .role-dot { width: 8px; height: 8px; }
.staff-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.staff-chip-remove:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.staff-role-count { margin: 0.65rem 0 0; text-align: right; font-size: 0.8rem; }
.role-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--role-color, #99aab5);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.card-header-row .card-header { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.ticket-detail-card { max-width: none; }
.ticket-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.meta-pill {
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: rgba(255, 255, 255, 0.75);
}
.ticket-detail-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ticket-chat {
  max-height: 480px;
  overflow-y: auto;
  padding: 0.75rem;
  background: #313338;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.chat-msg {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.chat-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chat-bubble { flex: 1; min-width: 0; }
.chat-author {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
}
.chat-time {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.72rem;
  margin-left: 0.5rem;
}
.chat-content { font-size: 0.9rem; line-height: 1.45; word-break: break-word; color: #dbdee1; }
.chat-content-empty { color: #949ba4; font-style: italic; font-size: 0.82rem; }
.chat-embed {
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border-left: 3px solid var(--accent);
  background: rgba(0,0,0,0.2);
  border-radius: 0 4px 4px 0;
  font-size: 0.85rem;
}
.chat-embed-title { font-weight: 600; margin-bottom: 0.25rem; color: #f2f3f5; }
.chat-embed-desc { color: #dbdee1; line-height: 1.4; }
.chat-embed-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; margin-top: 0.35rem; }
.chat-embed-field { background: rgba(0,0,0,0.15); border-radius: 4px; padding: 0.35rem 0.5rem; }
.chat-embed-field-name { display: block; font-size: 0.72rem; font-weight: 600; color: #949ba4; margin-bottom: 0.15rem; }
.chat-embed-field-value { font-size: 0.82rem; color: #dbdee1; }
.chat-embed-footer { margin-top: 0.35rem; font-size: 0.72rem; color: #949ba4; }
.chat-intent-hint { color: #faa61a; border: 1px solid rgba(250,166,26,0.25); background: rgba(250,166,26,0.08); padding: 0.5rem 0.75rem; border-radius: 8px; }
.chat-attachment {
  display: inline-block;
  margin-top: 0.35rem;
  color: #00a8fc;
  font-size: 0.82rem;
}
.ticket-list-item { cursor: pointer; }
.ticket-list-item.active { border-color: var(--accent); background: rgba(88,101,242,0.08); }
.chat-cache-hint { margin-bottom: 0.75rem; text-align: center; }

.verify-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.verify-hub-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.verify-hub-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.verify-pull-row { display: flex; align-items: center; gap: 0.75rem; margin: 0.75rem 0; flex-wrap: wrap; }
.verify-pull-row label { min-width: 100px; margin: 0; }
.verify-pull-row input { flex: 1; min-width: 200px; max-width: 360px; }
.verify-search-row { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.verify-search-row .staff-search { flex: 1; }
.verify-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
}
.verify-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.verify-table th, .verify-table td { padding: 0.7rem 0.85rem; text-align: left; border-bottom: 1px solid var(--border); }
.verify-table th {
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.verify-table tr:last-child td { border-bottom: none; }
.verify-table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.verify-user-cell { display: flex; align-items: center; gap: 0.5rem; }
.verify-avatar { width: 28px; height: 28px; border-radius: 50%; }
.empty-cell { text-align: center; color: var(--muted); padding: 2rem !important; }
.verify-stat-pullable .stat-value { color: #57f287; }
.verify-stat-deauth .stat-value { color: #ed4245; }
.verify-config { margin-top: 1rem; }
.verify-config-summary { cursor: pointer; font-weight: 600; padding: 0.25rem 0; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
.verify-config-summary::-webkit-details-marker { display: none; }
.verify-pull-progress { margin: 0.75rem 0; }
.progress-bar { height: 6px; background: rgba(255,255,255,0.06); border-radius: var(--radius-pill); overflow: hidden; }
.progress-fill { height: 100%; background: var(--gradient-btn); width: 0; transition: width 0.3s; border-radius: var(--radius-pill); }
.copy-link-row { display: flex; gap: 0.5rem; }
.copy-link-row input { flex: 1; }
.gw-participants-wrap { max-height: 320px; overflow: auto; margin-bottom: 0.5rem; }

.member-flow-card { margin-bottom: 1.5rem; }
.period-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.period-pill {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.period-pill.active {
  background: rgba(88,101,242,0.18);
  border-color: rgba(88,101,242,0.45);
  color: #fff;
}
.member-flow-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}
.member-flow-stat {
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}
.member-flow-stat .label { display: block; color: var(--muted); font-size: 0.78rem; margin-bottom: 0.25rem; }
.member-flow-stat .value { font-size: 1.45rem; font-weight: 700; }
.member-flow-stat.joined .value { color: var(--success); }
.member-flow-stat.left .value { color: var(--danger); }
.member-flow-item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.member-flow-item .flow-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  text-transform: uppercase;
}
.member-flow-item .flow-tag.join { background: rgba(35,165,90,0.15); color: var(--success); }
.member-flow-item .flow-tag.leave { background: rgba(242,63,67,0.15); color: var(--danger); }
@media (max-width: 700px) {
  .member-flow-stats { grid-template-columns: 1fr; }
}

.pstatus-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.pstatus-row .pstatus-name {
  flex: 1 1 140px;
  min-width: 120px;
}
.pstatus-row select { flex: 0 1 200px; }
.pstatus-row .pstatus-note { flex: 1 1 160px; min-width: 120px; }
.pstatus-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pstatus-dot.active, .pstatus-dot.undetected { background: #2ecc71; }
.pstatus-dot.updating { background: #f1c40f; }
.pstatus-dot.delayed { background: #e67e22; }
.pstatus-dot.maintenance { background: #9b59b6; }
.pstatus-dot.down, .pstatus-dot.detected { background: #e74c3c; }
.pstatus-emoji {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  object-fit: contain;
}
.keygen-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}
.keygen-picker-select { flex: 1; min-width: 220px; }
.keygen-picker-select select { width: 100%; }
.keygen-picker .row-actions { margin: 0; }
.accgen-key-batch {
  margin: 1rem 0;
  padding: 0.9rem;
  border: 1px solid rgba(124, 92, 255, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(124, 92, 255, 0.08);
}
.accgen-key-batch-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.accgen-key-batch-top h4 { margin: 0 0 0.2rem; }
.accgen-key-export {
  width: 100%;
  height: 11rem;
  max-height: 11rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre;
  overflow: auto;
}
.accgen-key-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; }
.accgen-key-code { white-space: nowrap; }
.accgen-key-code code { font-size: 0.92rem; letter-spacing: 0.01em; }
.accgen-key-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.verify-panel-editor {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.verify-panel-editor.hidden { display: none !important; }
.accgen-table-scroll {
  max-height: 380px;
  overflow: auto;
}
.accgen-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-elevated);
}

@media (max-width: 900px) {
  .verify-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .tickets-layout { grid-template-columns: 1fr; }
  .bot-media-grid { grid-template-columns: 1fr; }
  .perm-grid { grid-template-columns: 1fr; }
}
