:root {
  color-scheme: dark;
  --hq-bg: #07080D;
  --hq-surface: #0F111A;
  --hq-surface-elevated: rgba(18, 21, 33, 0.94);
  --hq-surface-deep: rgba(11, 13, 21, 0.96);
  --hq-inset: rgba(7, 8, 13, 0.72);
  --hq-border: rgba(255, 255, 255, 0.085);
  --hq-border-strong: rgba(255, 255, 255, 0.14);
  --hq-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --hq-gold: #F59E0B;
  --hq-gold-glow: #FBBF24;
  --hq-crimson: #E11D48;
  --hq-indigo: #6366F1;
  --hq-emerald: #10B981;
  --hq-discord: #5865F2;
  --hq-text: #F8FAFC;
  --hq-text-secondary: #CBD5E1;
  --hq-text-muted: #94A3B8;
  --hq-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hq-spring: cubic-bezier(0.34, 1.5, 0.64, 1);
  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  background-color: var(--hq-bg);
  color: var(--hq-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden !important; }

.hidden { display: none !important; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }
.gap-1 { gap: 4px; }
.gap-1\.5 { gap: 6px; }
.gap-2 { gap: 8px; }
.gap-2\.5 { gap: 10px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.text-xs { font-size: 12px; line-height: 1.4; }
.text-sm { font-size: 13.5px; line-height: 1.5; }
.text-base { font-size: 15px; line-height: 1.55; }
.text-lg { font-size: 18px; line-height: 1.35; }
.text-xl { font-size: 21px; line-height: 1.25; }
.text-2xl { font-size: 26px; line-height: 1.2; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.text-muted { color: var(--hq-text-muted); }
.text-secondary { color: var(--hq-text-secondary); }
.text-gold { color: #FBBF24; }
.text-emerald { color: #34D399; }
.text-crimson { color: #FB7185; }
.text-indigo { color: #A5B4FC; }
.link-subtle { color: var(--hq-text-secondary); text-decoration: none; transition: color 0.16s ease; }
.link-subtle:hover { color: #FBBF24; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.w-3\.5 { width: 14px; height: 14px; }
.w-4 { width: 16px; height: 16px; }
.w-5 { width: 20px; height: 20px; }
.w-6 { width: 24px; height: 24px; }

/* =========================================================
   BACKGROUND GRID & STATIC TOP ORBS (60FPS SAFE)
   ========================================================= */
.cyber-grid {
  position: relative;
  background-color: var(--hq-bg);
  background-size: 48px 48px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

.ambient-stage {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 520px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient-orb-amber {
  position: absolute;
  top: -190px;
  left: -130px;
  width: 520px;
  height: 520px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.14) 0%, rgba(245, 158, 11, 0.04) 42%, transparent 72%);
}

.ambient-orb-indigo {
  position: absolute;
  top: -140px;
  right: -130px;
  width: 500px;
  height: 500px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.14) 0%, rgba(99, 102, 241, 0.04) 42%, transparent 72%);
}

/* =========================================================
   UNIFIED OBSIDIAN COMPONENT SYSTEM
   ========================================================= */
.spotlight-card {
  position: relative;
  background: linear-gradient(160deg, var(--hq-surface-elevated) 0%, var(--hq-surface-deep) 100%);
  border: 1px solid var(--hq-border);
  box-shadow: var(--hq-highlight), 0 16px 36px -24px rgba(0, 0, 0, 0.88);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.22s var(--hq-ease), border-color 0.22s ease;
}

.spotlight-card:not(.spotlight-static):hover {
  border-color: rgba(245, 158, 11, 0.38);
  transform: translateY(-2px);
}

.spotlight-static:hover { transform: none !important; }

/* Cursor-tracking spotlight card (.fx-card) */
.fx-card {
  --fx-x: 50%;
  --fx-y: 50%;
  --fx-glow: rgba(245, 158, 11, 0.13);
  --fx-border: rgba(251, 191, 36, 0.58);
}

.fx-card[data-fx-card="emerald"] {
  --fx-glow: rgba(16, 185, 129, 0.14);
  --fx-border: rgba(52, 211, 153, 0.58);
}
.fx-card[data-fx-card="crimson"] {
  --fx-glow: rgba(225, 29, 72, 0.14);
  --fx-border: rgba(251, 113, 133, 0.58);
}
.fx-card[data-fx-card="indigo"] {
  --fx-glow: rgba(99, 102, 241, 0.15);
  --fx-border: rgba(129, 140, 248, 0.58);
}

.fx-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--fx-x) var(--fx-y), var(--fx-glow), transparent 68%);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.28s ease;
}

.fx-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(240px circle at var(--fx-x) var(--fx-y), var(--fx-border), transparent 72%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.28s ease;
}

@media (hover: hover) and (pointer: fine) {
  .fx-card.is-fx-active::before,
  .fx-card.is-fx-active::after {
    opacity: 1;
  }
}

.fx-card > * { position: relative; z-index: 2; }

.ui-inset-card {
  background: rgba(7, 8, 13, 0.58);
  border: 1px solid var(--hq-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  border-radius: 14px;
}

.ui-input {
  width: 100%;
  background: var(--hq-inset);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  color: #F8FAFC;
  font-family: var(--font-sans);
  font-size: 13.5px;
  padding: 10px 13px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.ui-input:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.22); }
.ui-input:focus {
  outline: none;
  border-color: rgba(251, 191, 36, 0.72);
  background: rgba(7, 8, 13, 0.92);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}
.ui-input:disabled { opacity: 0.55; cursor: not-allowed; }
.ui-input--mono { font-family: var(--font-mono); }
textarea.ui-input { min-height: 92px; resize: vertical; line-height: 1.5; }
select.ui-input { cursor: pointer; }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--hq-text-secondary);
  margin-bottom: 6px;
}

.ui-btn-primary,
.ui-btn-secondary,
.ui-btn-danger,
.ui-btn-discord,
.ui-btn-emerald,
.ui-btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s var(--hq-ease), filter 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.ui-btn-sm {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 9px;
}

.ui-btn-primary {
  background: linear-gradient(90deg, #FBBF24 0%, #F59E0B 100%);
  color: #07080D;
  font-weight: 800;
  border: 1px solid rgba(253, 224, 71, 0.35);
  box-shadow: 0 10px 24px -8px rgba(245, 158, 11, 0.42);
}
.ui-btn-primary:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }

.ui-btn-secondary {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #E2E8F0;
}
.ui-btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.22); color: #FFFFFF; }

.ui-btn-danger {
  background: rgba(225, 29, 72, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.36);
  color: #FDA4AF;
}
.ui-btn-danger:hover:not(:disabled) { background: rgba(225, 29, 72, 0.28); border-color: rgba(251, 113, 133, 0.55); color: #FFFFFF; }

.ui-btn-emerald {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.36);
  color: #6EE7B7;
}
.ui-btn-emerald:hover:not(:disabled) { background: rgba(16, 185, 129, 0.26); border-color: rgba(52, 211, 153, 0.58); color: #FFFFFF; }

.ui-btn-discord {
  background: #5865F2;
  border: 1px solid rgba(129, 140, 248, 0.4);
  color: #FFFFFF;
}
.ui-btn-discord:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }

.ui-btn-google {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #F8FAFC;
}
.ui-btn-google:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(251, 191, 36, 0.45);
  transform: translateY(-1px);
}

button:active:not(:disabled), a.ui-btn-secondary:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #FBBF24;
  outline-offset: 2px;
}

.ui-scroll-thin {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.24) transparent;
}
.ui-scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.ui-scroll-thin::-webkit-scrollbar-track { background: transparent; }
.ui-scroll-thin::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.24); border-radius: 9999px; }
.ui-scroll-thin::-webkit-scrollbar-thumb:hover { background: rgba(245, 158, 11, 0.6); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}
.badge-gold { background: rgba(245, 158, 11, 0.14); border-color: rgba(251, 191, 36, 0.34); color: #FDE68A; }
.badge-emerald { background: rgba(16, 185, 129, 0.14); border-color: rgba(52, 211, 153, 0.34); color: #6EE7B7; }
.badge-crimson { background: rgba(225, 29, 72, 0.14); border-color: rgba(251, 113, 133, 0.34); color: #FDA4AF; }
.badge-indigo { background: rgba(99, 102, 241, 0.15); border-color: rgba(129, 140, 248, 0.34); color: #C7D2FE; }
.badge-muted { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.24); color: #CBD5E1; }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #34D399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.75);
  display: inline-block;
}
.live-dot--offline {
  background: #FB7185;
  box-shadow: 0 0 10px rgba(251, 113, 133, 0.75);
}

/* =========================================================
   LOGIN PAGE (FORTRESS AUTH)
   ========================================================= */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 460px;
}

.login-card {
  padding: 30px 26px 24px;
  border-radius: 24px;
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow: var(--hq-highlight), 0 28px 68px rgba(0, 0, 0, 0.85), 0 0 42px -14px rgba(245, 158, 11, 0.2);
}

.brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, #FBBF24, #D97706);
  color: #07080D;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px -6px rgba(245, 158, 11, 0.45);
  flex-shrink: 0;
}

.brand-badge--sm {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.login-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #FBBF24;
  font-weight: 700;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(225, 29, 72, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.42);
  color: #FECDD3;
  font-size: 13px;
  font-weight: 600;
}

.login-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.13);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #A7F3D0;
  font-size: 13px;
  font-weight: 600;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 6px 0 2px;
}

.pin-dot {
  width: 11px;
  height: 11px;
  border-radius: 9999px;
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.16s var(--hq-spring), background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.pin-dot.is-filled {
  background: #FBBF24;
  border-color: #FBBF24;
  transform: scale(1.16);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.65);
}

.pin-input-wrap { position: relative; }

.pin-input-wrap .ui-input {
  padding: 13px 46px 13px 16px;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.36em;
  text-align: center;
}

.totp-code-input {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-align: center;
  padding: 13px 16px;
}

.pin-vis-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--hq-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pin-vis-btn:hover { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--hq-text-muted);
  font-size: 12px;
  margin: 14px 0;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--hq-border);
}

/* =========================================================
   DASHBOARD LAYOUT (FIXED HEADER + SIDEBAR + MAIN STAGE)
   ========================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  z-index: 40;
  background: rgba(7, 8, 13, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 12px;
}

.header-bot-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: #0F111A;
}

.dash-shell {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100dvh;
  padding-top: 68px;
}

.dash-sidebar {
  width: 268px;
  flex-shrink: 0;
  border-right: 1px solid var(--hq-border);
  background: rgba(10, 12, 20, 0.82);
  padding: 18px 14px 28px;
  position: sticky;
  top: 68px;
  height: calc(100dvh - 68px);
  overflow-y: auto;
}

.sidebar-group-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hq-text-muted);
  padding: 10px 10px 6px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 41px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--hq-text-secondary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  margin-bottom: 3px;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.16s var(--hq-ease);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
}

.nav-item.is-active {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), rgba(245, 158, 11, 0.04));
  border-color: rgba(251, 191, 36, 0.36);
  color: #FDE68A;
  font-weight: 700;
}

.nav-item-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--hq-text-secondary);
}

.dash-main {
  flex: 1;
  min-width: 0;
  padding: 26px 28px 64px;
  max-width: 1360px;
  margin: 0 auto;
}

.section-view {
  display: none;
  animation: viewFadeIn 0.24s var(--hq-ease);
}
.section-view.is-active { display: block; }

@keyframes viewFadeIn {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Grids */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}
.col-span-12 { grid-column: span 12 / span 12; }
.col-span-8 { grid-column: span 8 / span 8; }
.col-span-7 { grid-column: span 7 / span 7; }
.col-span-6 { grid-column: span 6 / span 6; }
.col-span-5 { grid-column: span 5 / span 5; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-3 { grid-column: span 3 / span 3; }

.card-pad { padding: 22px; }
.card-pad-sm { padding: 16px; }

/* =========================================================
   ISOLATED DISCORD PREVIEW SUB-THEME (#2b2d31 / #232428)
   ========================================================= */
.discord-preview-card {
  background: #232428;
  border: 1px solid #1e1f22;
  border-radius: 16px;
  overflow: hidden;
  color: #dbdee1;
  font-family: var(--font-sans);
}
.discord-preview-banner {
  height: 72px;
  background: linear-gradient(135deg, #F59E0B 0%, #7C3AED 55%, #1E1F22 100%);
}
.discord-preview-body {
  padding: 0 18px 18px;
  position: relative;
}
.discord-preview-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin-top: -36px;
  border-radius: 9999px;
  border: 5px solid #232428;
  background: #2b2d31;
}
.discord-preview-avatar {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  object-fit: cover;
}
.discord-status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  border: 4px solid #232428;
  background: #23a55a;
}
.discord-status-dot[data-status="idle"] { background: #f0b232; }
.discord-status-dot[data-status="dnd"] { background: #f23f43; }
.discord-status-dot[data-status="invisible"],
.discord-status-dot[data-status="offline"] { background: #80848e; }

.discord-bot-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: #5865f2;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.discord-preview-box {
  background: #2b2d31;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  border: 1px solid #1e1f22;
}

.discord-embed-preview {
  background: #2b2d31;
  border-left: 4px solid #F59E0B;
  border-radius: 6px;
  padding: 14px 16px;
  color: #dbdee1;
}

.discord-embed-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.discord-embed-image {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  margin-top: 10px;
  object-fit: cover;
}

/* =========================================================
   WELCOME BG PREVIEW, CHIPS, TABLES & TERMINAL LOGS
   ========================================================= */
.welcome-bg-preview {
  width: 100%;
  aspect-ratio: 1024 / 330;
  border-radius: 14px;
  border: 1px solid var(--hq-border);
  object-fit: cover;
  background: #0B0D15;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #FDE68A;
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.chip-btn:hover { background: rgba(245, 158, 11, 0.16); border-color: rgba(251, 191, 36, 0.45); }

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.color-swatch:hover { transform: scale(1.1); border-color: #ffffff; }
.swatch-gold { background: #F59E0B; }
.swatch-emerald { background: #10B981; }
.swatch-crimson { background: #E11D48; }
.swatch-indigo { background: #6366F1; }
.swatch-discord { background: #5865F2; }
.swatch-sky { background: #38BDF8; }

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--hq-border);
  background: rgba(7, 8, 13, 0.56);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hq-text-muted);
  border-bottom: 1px solid var(--hq-border);
  background: rgba(15, 17, 26, 0.72);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--hq-text-secondary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.025); }

.mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  object-fit: cover;
  background: #1E293B;
  flex-shrink: 0;
}

.logs-terminal {
  width: 100%;
  height: 440px;
  overflow: auto;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--hq-border);
  background: #05060A;
  color: #CBD5E1;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.qr-preview-box {
  width: 220px;
  height: 220px;
  border-radius: 16px;
  padding: 8px;
  background: #F8FAFC;
  border: 2px solid rgba(251, 191, 36, 0.55);
}
.qr-preview-box img { width: 100%; height: 100%; display: block; }

.auth-mode-card {
  padding: 15px;
  border-radius: 14px;
  border: 1px solid var(--hq-border);
  background: rgba(7, 8, 13, 0.62);
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s var(--hq-ease);
}
.auth-mode-card:hover { border-color: rgba(255, 255, 255, 0.22); }
.auth-mode-card.is-selected {
  border-color: rgba(251, 191, 36, 0.62);
  background: rgba(245, 158, 11, 0.1);
}

.role-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 165px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--hq-border);
  background: rgba(7, 8, 13, 0.55);
}

.role-chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--hq-text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.role-chip-toggle.is-selected {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(251, 191, 36, 0.55);
  color: #FDE68A;
}

.music-thumb {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  object-fit: cover;
  background: #141826;
  flex-shrink: 0;
}

/* =========================================================
   MODALS & TOASTS
   ========================================================= */
@keyframes uiBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes uiModalIn {
  from { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.975); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.ui-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(5, 6, 11, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ui-modal-backdrop:not(.hidden) { animation: uiBackdropIn 0.16s var(--hq-ease); }

.ui-modal-panel {
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--hq-border-strong);
  background: linear-gradient(165deg, rgba(18, 21, 33, 0.98) 0%, rgba(10, 12, 20, 0.99) 100%);
  box-shadow: var(--hq-highlight), 0 28px 64px -16px rgba(0, 0, 0, 0.92);
}
.ui-modal-backdrop:not(.hidden) > .ui-modal-panel { animation: uiModalIn 0.2s var(--hq-ease); }

.ui-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hq-border);
  color: #94a3b8;
  cursor: pointer;
  flex-shrink: 0;
}
.ui-modal-close:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.18); color: #FFFFFF; }

.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(390px, calc(100vw - 32px));
}

.ui-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 16px;
  background: rgba(15, 17, 26, 0.97);
  border: 1px solid rgba(251, 191, 36, 0.42);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.72);
  color: #F8FAFC;
  font-size: 13.5px;
  font-weight: 600;
  animation: uiModalIn 0.2s var(--hq-ease);
}
.ui-toast--error { border-color: rgba(251, 113, 133, 0.55); color: #FECDD3; }
.ui-toast--success { border-color: rgba(52, 211, 153, 0.5); color: #D1FAE5; }

/* Mobile drawer & responsiveness */
.mobile-menu-btn { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 1024px) {
  .col-span-8, .col-span-7, .col-span-6, .col-span-5, .col-span-4, .col-span-3 {
    grid-column: span 12 / span 12;
  }
  .dash-main { padding: 20px 16px 56px; }
}

@media (max-width: 900px) {
  .mobile-menu-btn { display: inline-flex; }
  .dash-sidebar {
    position: fixed;
    top: 68px;
    left: 0;
    bottom: 0;
    height: calc(100dvh - 68px);
    z-index: 50;
    background: rgba(9, 11, 18, 0.98);
    transform: translateX(-105%);
    transition: transform 0.24s var(--hq-ease);
  }
  .dash-sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 68px 0 0 0;
    z-index: 45;
    background: rgba(5, 6, 11, 0.72);
    backdrop-filter: blur(4px);
  }
  .header-hide-sm { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-card, .fx-card::before, .fx-card::after, .section-view, .ui-modal-backdrop, .ui-modal-panel, .dash-sidebar {
    animation: none !important;
    transition: none !important;
  }
}

/* CSP-safe layout & spacing utilities (zero inline style attributes) */
.grid-auto-140 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.grid-auto-180 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-auto-200 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-2-90 { grid-template-columns: 1fr 1fr 90px; }
.hr-divider { border: 0; border-top: 1px solid var(--hq-border); margin: 20px 0; }
.pre-wrap { white-space: pre-wrap; }
.w-auto { width: auto; }
.min-w-240 { min-width: 240px; }
.max-w-240 { max-width: 240px; }
.max-w-150 { max-width: 150px; }
.scroll-h-490 { max-height: 490px; overflow-y: auto; }
.scroll-h-440 { max-height: 440px; overflow-y: auto; }
.scroll-h-340 { max-height: 340px; overflow-y: auto; }
.scroll-h-290 { max-height: 290px; overflow-y: auto; }
.break-all { word-break: break-all; }
