/* ============================================================
   Botrix — Matte Purple on Black-Gray
   A calm, professional design system.
   Purple is used sparingly: actions, focus, active states.
   Everything else stays quiet black-gray.
   ============================================================ */

/* ---------- Tokens ---------- */

:root {
  /* Matte purple accent */
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-active: #6d28d9;
  --accent-soft: #a78bfa;      /* accent for text/highlights */
  --accent-faint: #c4b5fd;     /* brightest accent text */
  --accent-tint: rgba(139, 92, 246, 0.10);
  --accent-tint-strong: rgba(139, 92, 246, 0.18);

  /* Black-gray neutrals */
  --bg-page: #0a0a0c;          /* page background */
  --bg-panel: #0f0f12;         /* nav, sidebar */
  --bg-card: #121215;          /* cards, surfaces */
  --bg-raised: #19191e;        /* hover surfaces */
  --bg-inset: #0d0d10;         /* inputs, wells */
  --line: #26262b;             /* hairline borders */
  --line-strong: #313138;
  --line-accent: rgba(139, 92, 246, 0.28);

  /* Text */
  --text-hi: #f4f4f5;
  --text-mid: #a6a6af;
  --text-dim: #73737c;

  /* Semantics */
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --success: #22c55e;
  --warning: #f59e0b;

  /* Bootstrap variable harmonization (dark theme) */
  --bs-primary: #8b5cf6;
  --bs-primary-rgb: 139, 92, 246;
  --bs-body-bg: #0a0a0c;
  --bs-body-color: #f4f4f5;
  --bs-border-color: #232329;
  --bs-link-color: #a78bfa;
  --bs-link-hover-color: #c4b5fd;

  /* Compact, consistent corners */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;

  /* Legacy aliases (kept so older selectors keep working) */
  --purple-matte: #8b5cf6;
  --obsidian-matte: #0a0a0c;
  --card-matte: #141417;
  --border-matte: #232329;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas,
    "Liberation Mono", monospace;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-page) !important;
  color: var(--text-mid);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* A quiet radial tint at the very top of every page — depth without noise. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 480px;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(60% 100% at 50% 0%, rgba(139, 92, 246, 0.07), transparent 70%),
    var(--bg-page);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-3, .display-4, .display-5 {
  color: var(--text-hi);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.display-3 { font-weight: 750; letter-spacing: -0.03em; }
.display-5 { font-weight: 750; letter-spacing: -0.03em; }

p, li { color: var(--text-mid); }

a { color: var(--accent-soft); text-decoration: none; }
a:hover { color: var(--accent-faint); }

strong, b { color: var(--text-hi); }

small, .small { font-size: 0.875rem; }

hr {
  border-color: var(--line);
  opacity: 1;
}

code, kbd, pre, .font-monospace {
  font-family: var(--font-mono);
}

code {
  color: var(--accent-faint);
  background: var(--accent-tint);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  font-size: 0.85em;
}

::selection {
  background: rgba(139, 92, 246, 0.35);
  color: #ffffff;
}

/* Scrollbar — thin, neutral */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #2a2a31;
  border-radius: 8px;
  border: 2px solid var(--bg-page);
}
::-webkit-scrollbar-thumb:hover { background: #3a3a44; }

:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.7);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Page-ready guard (dashboard pages reveal after auth check) */
body.servers-page:not(.botrix-ready) {
  visibility: hidden;
}

/* ---------- Bootstrap utility harmonization ---------- */

.text-light { color: var(--text-hi) !important; }
.text-muted { color: var(--text-dim) !important; }
.text-purple,
.text-purple-highlight,
.text-purple-accent,
.text-primary {
  color: var(--accent-soft) !important;
}

.bg-primary {
  background-color: var(--accent) !important;
}
.bg-secondary { background-color: #26262c !important; }
.bg-dark { background-color: var(--bg-raised) !important; }
.bg-darker { background-color: var(--bg-card) !important; }

.bg-dark-obsidian { background: transparent !important; }

.border-secondary,
.border-secondary-subtle {
  border-color: var(--line) !important;
}

/* ---------- Navbar ---------- */

.navbar {
  overflow: visible !important;
}

.bg-transparent-nav {
  background-color: rgba(10, 10, 12, 0.82) !important;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line) !important;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-link {
  color: var(--text-mid) !important;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem !important;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text-hi) !important;
  background: rgba(255, 255, 255, 0.04);
}

/* Sidebar / active states */
.nav-link.active {
  color: var(--text-hi) !important;
  background: var(--accent-tint) !important;
  border-radius: var(--radius-sm);
}

.nav-pills .nav-link.active { background: var(--accent) !important; }

.navbar-toggler {
  border: 1px solid var(--line);
  color: var(--text-hi);
}

.navbar-toggler:focus { box-shadow: none; }

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Brand marks */
.home-brand-mark {
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
  object-position: center;
  flex: 0 0 auto;
}

.dashboard-brand-mark {
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  object-fit: contain;
}

.home-hero-mark {
  display: block;
  width: min(6.5rem, 34vw);
  height: auto;
  margin: 0 auto 1.75rem;
  object-fit: contain;
}

/* ---------- Buttons ----------
   One system, four looks:
   - .btn-primary                accent fill (also: btn-purple-squared, btn-toolbox-indigo)
   - .btn-ghost-raised           raised dark surface (also: btn-dark-action, btn-dark-custom)
   - .btn-outline-secondary      outline (also: btn-outline-purple-squared, btn-support-squared)
   - .btn-ghost                  transparent (nav dropdowns, quiet actions)
   Sizes are driven by min-height + padding tokens so every button lines up. */

.btn {
  --bs-btn-focus-box-shadow: none;
  --bs-btn-padding-y: 0.5rem;
  --bs-btn-padding-x: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius-md) !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn-sm {
  --bs-btn-padding-y: 0.3rem;
  --bs-btn-padding-x: 0.7rem;
  min-height: 32px;
}

.btn-lg {
  --bs-btn-padding-y: 0.65rem;
  --bs-btn-padding-x: 1.4rem;
  min-height: 48px;
  font-size: 1rem;
}

/* Icons inside buttons sit on the same baseline with even spacing. */
.btn .bi, .btn svg.bi { font-size: 1.05em; flex-shrink: 0; }

.btn-squared { border-radius: var(--radius-md) !important; }

.btn:focus,
.btn:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-tint-strong) !important;
  outline: none;
}

/* Accent fill */
.btn-primary,
.btn-purple-squared,
.btn-toolbox-indigo {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-hover);
  --bs-btn-hover-border-color: var(--accent-hover);
  --bs-btn-active-bg: var(--accent-active);
  --bs-btn-active-border-color: var(--accent-active);
  --bs-btn-disabled-bg: var(--accent);
  --bs-btn-disabled-border-color: var(--accent);
  --bs-btn-color: #ffffff;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-active-color: #ffffff;
  color: #ffffff;
  box-shadow: none !important;
}

/* Raised ghost — secondary dashboard actions */
.btn-ghost-raised,
.btn-dark-action,
.btn-dark-custom {
  background-color: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--text-hi);
  box-shadow: none !important;
}

.btn-ghost-raised:hover,
.btn-dark-action:hover,
.btn-dark-custom:hover {
  background-color: #212127;
  border-color: var(--line-strong);
  color: #ffffff;
}

/* Outline — quiet secondary actions */
.btn-outline-purple-squared,
.btn-support-squared,
.btn-outline-secondary {
  --bs-btn-color: var(--text-mid);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-bg: var(--bg-raised);
  --bs-btn-hover-color: var(--text-hi);
  --bs-btn-hover-border-color: #3d3d47;
  --bs-btn-active-bg: #26262c;
  --bs-btn-active-border-color: #3d3d47;
  border-radius: var(--radius-md) !important;
}

.btn-outline-secondary {
  --bs-btn-bg: transparent;
}

/* Transparent ghost — nav dropdowns and quiet controls */
.btn-ghost {
  --bs-btn-bg: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: rgba(255, 255, 255, 0.05);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-color: var(--text-mid);
  --bs-btn-hover-color: var(--text-hi);
  --bs-btn-active-bg: rgba(255, 255, 255, 0.07);
  --bs-btn-active-border-color: transparent;
  box-shadow: none !important;
}

/* Sidebar panel link — flat tint instead of gradient */
.moderator-panel-link {
  min-height: 54px;
  color: var(--text-hi) !important;
  background: var(--accent-tint) !important;
  border: 1px solid var(--line-accent) !important;
  border-radius: var(--radius-md) !important;
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.moderator-panel-link:hover,
.moderator-panel-link:focus-visible {
  color: #ffffff !important;
  background: var(--accent-tint-strong) !important;
  border-color: var(--line-accent) !important;
}

.btn-dark {
  --bs-btn-bg: var(--bg-raised);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: #212127;
  --bs-btn-hover-border-color: transparent;
  --bs-btn-color: var(--text-mid);
  --bs-btn-hover-color: var(--text-hi);
}

.btn-outline-danger {
  --bs-btn-color: #f87171;
  --bs-btn-border-color: rgba(239, 68, 68, 0.35);
  --bs-btn-hover-bg: rgba(239, 68, 68, 0.12);
  --bs-btn-hover-color: #fca5a5;
  --bs-btn-hover-border-color: rgba(239, 68, 68, 0.55);
  border-radius: var(--radius-md) !important;
}

.btn-danger {
  --bs-btn-bg: rgba(239, 68, 68, 0.14);
  --bs-btn-border-color: rgba(239, 68, 68, 0.38);
  --bs-btn-color: #fca5a5;
  --bs-btn-hover-bg: rgba(239, 68, 68, 0.24);
  --bs-btn-hover-border-color: rgba(239, 68, 68, 0.55);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-active-bg: rgba(239, 68, 68, 0.3);
  --bs-btn-active-border-color: rgba(239, 68, 68, 0.6);
}

.btn-link { color: var(--text-mid); }
.btn-link:hover { color: var(--text-hi); }

/* Success actions use the accent system instead of Bootstrap green */
.btn-success {
  --bs-btn-bg: rgba(52, 211, 153, 0.14);
  --bs-btn-border-color: rgba(52, 211, 153, 0.38);
  --bs-btn-color: #6ee7b7;
  --bs-btn-hover-bg: rgba(52, 211, 153, 0.24);
  --bs-btn-hover-border-color: rgba(52, 211, 153, 0.55);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-active-bg: rgba(52, 211, 153, 0.3);
  --bs-btn-active-border-color: rgba(52, 211, 153, 0.6);
}

.shadow-purple-glow { box-shadow: none !important; }

/* ---------- Badges ---------- */

.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge.bg-primary {
  color: #ffffff;
  border-radius: 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35em 0.6em;
  vertical-align: middle;
}

.badge.text-bg-secondary {
  background-color: #26262c !important;
  color: var(--text-mid) !important;
}

/* ---------- Cards & surfaces ---------- */

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.card.border-0 { border: 1px solid var(--line) !important; }

.server-card {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.server-card:hover {
  border-color: #3a3a42 !important;
  background-color: #15151a !important;
}

.login-card {
  background-color: #121214 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  transition: none !important;
}

.login-card:hover {
  border-color: rgba(255, 255, 255, 0.08) !important;
  transform: none;
}

/* Quiet marketing feature surfaces */
.feature-card-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg) !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--line) !important;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.feature-card-item:hover {
  border-color: var(--line-strong) !important;
  background: var(--bg-raised) !important;
}

.bg-darker-box {
  background-color: var(--bg-inset) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-md) !important;
}

.dashboard-card {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
}

.active-staff-box {
  background-color: var(--bg-inset) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-md) !important;
}

/* ---------- Forms ---------- */

.form-label {
  color: var(--text-hi);
  font-weight: 600;
  font-size: 0.875rem;
}

.form-control,
.form-select,
.form-select-sm,
textarea.form-control {
  color: var(--text-hi) !important;
  background-color: var(--bg-inset) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--radius-md) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control::placeholder,
textarea.form-control::placeholder {
  color: var(--text-dim);
}

.form-control:focus,
.form-select:focus,
.form-select-sm:focus {
  background-color: var(--bg-inset) !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18) !important;
}

.form-control:hover,
.form-select:hover,
.form-select-sm:hover {
  border-color: #3d3d47 !important;
}

.form-select:not([multiple]) {
  min-height: 2.65rem;
  padding: 0.55rem 2.5rem 0.55rem 0.85rem;
  appearance: none;
  background-position: right 0.85rem center;
}

.form-select option {
  padding: 0.55rem 0.65rem;
  color: var(--text-hi);
  background-color: var(--bg-inset);
}

.form-check-input {
  background-color: transparent;
  border-color: #4a4a55;
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.form-check-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.18);
}

.input-group-text {
  background: transparent !important;
  border: 0 !important;
  color: var(--text-dim);
}

/* Inline search wells used across dashboard pages */
.servers-search-bar {
  background-color: var(--bg-inset) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-md) !important;
  transition: border-color 0.15s ease;
}

.servers-search-bar:focus-within {
  border-color: var(--line-accent) !important;
}

.servers-search-bar input::placeholder,
.servers-search-bar textarea::placeholder {
  color: var(--text-dim);
}

/* ---------- Dashboard shell ---------- */

.servers-page {
  background-color: var(--bg-page) !important;
  min-height: 100vh;
  overflow-x: clip;
}

.dashboard-sidebar {
  background-color: var(--bg-panel) !important;
  min-height: calc(100vh - 73px);
  border-color: var(--line) !important;
}

.sidebar-label,
.dashboard-sidebar .text-uppercase.small {
  color: var(--text-dim) !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.1em;
}

.server-switcher-btn {
  background-color: var(--bg-raised) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-hi);
}

.server-switcher-btn:hover {
  background-color: #212127 !important;
  border-color: var(--line-strong) !important;
}

.user-avatar-badge {
  width: 24px;
  height: 24px;
  background-color: #2a2a31 !important;
  border: 1px solid var(--line-strong);
}

.server-avatar-circle {
  width: 56px;
  height: 56px;
  background-color: var(--accent-tint) !important;
  border: 1px solid var(--line-accent);
  color: var(--accent-faint) !important;
  border-radius: 50%;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

.server-small-avatar,
.server-small-avatar-img {
  width: 32px;
  height: 32px;
  background-color: var(--accent-tint);
  border: 1px solid var(--line-accent);
  color: var(--accent-faint) !important;
  border-radius: 50%;
  font-size: 0.8rem;
}

/* ---------- My Servers tiles ---------- */

.server-tile {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-card) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.server-tile:hover {
  border-color: var(--line-strong) !important;
  background-color: #15151a !important;
}

.server-tile-banner {
  position: relative;
  height: 88px;
  overflow: hidden;
  background: linear-gradient(
    120deg,
    rgba(139, 92, 246, 0.24),
    rgba(139, 92, 246, 0.05) 55%,
    rgba(20, 20, 23, 0.95)
  );
  border-bottom: 1px solid var(--line);
}

.server-tile-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-tile-banner:not(.has-image)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    85% 130% at 18% 0%,
    rgba(139, 92, 246, 0.28),
    transparent 60%
  );
}

.server-tile-banner-initials {
  display: none;
}

.server-tile-avatar-slot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  margin-top: -32px;
}

.server-tile-avatar {
  width: 64px;
  height: 64px;
  border: 4px solid var(--bg-card);
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-raised);
  box-shadow: none;
}

span.server-tile-avatar {
  display: grid;
  place-items: center;
  color: var(--accent-faint) !important;
  background: var(--accent-tint);
  outline: 1px solid var(--line-accent);
  font-size: 1.05rem;
  font-weight: 700;
}

.server-tile-role {
  display: inline-block;
  padding: 0;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

img.server-small-avatar,
img.server-switcher-icon {
  object-fit: cover;
  background-color: var(--accent-tint);
}

.server-count-pill {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.2rem 0.8rem;
  color: var(--text-mid);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
}

/* Channel settings on the configuration page */

.channel-setting-row {
  padding: 1rem 1.1rem;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.channel-setting-row + .channel-setting-row { margin-top: 0.75rem; }

.server-logo-badge {
  width: 48px;
  height: 48px;
  background-color: var(--accent-tint);
  border: 1px solid var(--line-accent);
  color: var(--accent-faint) !important;
  font-size: 0.75rem;
}

.btn-refresh-server {
  background-color: var(--accent) !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  color: #ffffff;
  width: 42px;
  height: 42px;
}

.btn-refresh-server:hover { background-color: var(--accent-hover) !important; }

/* Sidebar: LOA entry used Bootstrap warning colors; align with accent */
.dashboard-sidebar .btn-outline-warning,
.dashboard-sidebar .nav-link.text-warning {
  color: var(--accent-soft) !important;
  background: transparent;
  border: 1px solid var(--line-accent) !important;
  border-radius: var(--radius-sm);
}

.dashboard-sidebar .btn-outline-warning:hover,
.dashboard-sidebar .nav-link.text-warning:hover {
  color: var(--accent-faint) !important;
  background: var(--accent-tint) !important;
}

.dashboard-sidebar .btn-warning,
.dashboard-sidebar .nav-link.active.btn-warning {
  background: var(--accent-tint-strong) !important;
  border: 1px solid var(--line-accent) !important;
  color: var(--accent-faint) !important;
}

/* ---------- Tables ---------- */

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-mid);
  --bs-table-border-color: var(--line);
}

.table thead th {
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom-color: var(--line-strong) !important;
}

.table td { border-color: var(--line); }

.permission-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-mid);
  --bs-table-border-color: var(--line);
}

.permission-table thead th {
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.role-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.65rem;
  border-radius: 50%;
  background: var(--accent);
}

.permission-count { color: var(--text-dim); font-size: 0.86rem; }

/* ---------- Permissions modal & role picker ---------- */

.permission-modal {
  color: var(--text-hi);
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.permission-modal .modal-header,
.permission-modal .modal-footer { border-color: var(--line); }
.permission-modal .modal-content { background: var(--bg-panel); }
.permission-modal .modal-header { min-height: 94px; padding: 1.25rem 1.5rem; }
.permission-modal .modal-body { padding: 1.25rem 1.5rem 1.5rem; }

.permission-modal-close {
  display: grid;
  flex: 0 0 54px;
  margin-left: auto;
  width: 54px;
  height: 54px;
  place-items: center;
  color: var(--text-mid);
  background: transparent;
  border: 3px solid var(--line-strong);
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}

.permission-modal-close:hover { color: #fff; border-color: #4a4a55; }
.permission-modal-close:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.7);
  outline-offset: 3px;
}

.permission-select-panel {
  padding: 1rem 1.1rem;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.permission-select-panel .form-label { margin-bottom: 0.25rem; }
.permission-select-panel p { min-height: 2.5rem; margin-bottom: 0.9rem; }

.permission-card {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  min-height: 126px;
  padding: 1rem;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.permission-card:hover {
  background: var(--bg-raised);
  border-color: var(--line-strong);
}

.permission-card:has(input:checked) {
  border-color: var(--line-accent);
  background: var(--accent-tint);
}

.permission-card .form-check-input {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin: 0.15rem 0 0;
  background-color: transparent;
  border-color: #4a4a55;
}

.permission-card .form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.permission-card-title,
.permission-card-description { display: block; }

.permission-card-title {
  margin-bottom: 0.18rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-hi);
}

.permission-card-description {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-mid);
}

.permissions-savebar {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.permissions-savebar.is-clean { opacity: 0.62; }
.permissions-savebar .text-warning { color: var(--warning) !important; }

@media (max-width: 575.98px) {
  .permission-modal .modal-body { padding: 1rem; }
  .permission-card { min-height: auto; }
  .permissions-savebar > div { width: 100%; }
  .permissions-savebar button { flex: 1; }
}

.server-card.has-open-picker { position: relative; z-index: 30; }
.server-card.has-open-picker:hover { transform: none; }

.role-picker { position: relative; width: 100%; }
.role-picker-native {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.role-picker-trigger {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  color: var(--text-hi);
  text-align: left;
  background: var(--bg-inset);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.role-picker-trigger:hover,
.role-picker-trigger[aria-expanded="true"] {
  background: var(--bg-raised);
  border-color: var(--line-accent);
}

.role-picker-trigger:focus-visible,
.role-picker-remove:focus-visible,
.role-picker-option:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.7);
  outline-offset: 2px;
}

.role-picker-chips { display: flex; flex: 1; flex-wrap: wrap; gap: 0.4rem; }
.role-picker-placeholder { flex: 1; color: var(--text-dim); }
.role-picker-chevron { margin-left: auto; color: var(--text-mid); font-size: 1.1rem; }

.role-picker-chip {
  display: inline-flex;
  align-items: center;
  color: var(--text-hi);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.role-picker-menu {
  position: absolute;
  z-index: 1080;
  top: calc(100% + 0.45rem);
  left: 0;
  display: flex;
  width: 100%;
  max-width: min(420px, 92vw);
  flex-direction: column;
  padding: 0.55rem;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.role-picker-menu[hidden] { display: none; }

.role-picker-search {
  width: 100%;
  padding: 0.55rem 0.7rem;
  color: var(--text-hi);
  background: var(--bg-inset);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.role-picker-search:focus {
  outline: 2px solid rgba(167, 139, 250, 0.7);
  outline-offset: 1px;
}

.role-picker-options {
  display: flex;
  max-height: 260px;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.2rem;
  overflow-y: auto;
  margin-top: 0.45rem;
}

.role-picker-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.65rem;
  color: var(--text-mid);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
}

.role-picker-option:hover,
.role-picker-option.is-selected {
  color: #fff;
  background: var(--bg-raised);
}

.role-picker-option.is-selected { color: var(--accent-faint); }
.role-picker-empty { padding: 0.8rem 0.65rem; color: var(--text-dim); font-size: 0.875rem; }

@media (max-width: 575.98px) {
  .role-picker-menu { max-height: 55vh; }
  .role-picker-chips { gap: 0.3rem; }
}

/* Soft violet accent scoped to the permissions page */
.servers-page:has(#permission-list-heading) {
  --permission-accent: var(--accent-soft);
  --permission-accent-hover: var(--accent-faint);
}

.servers-page:has(#permission-list-heading) .btn-primary {
  color: #ffffff;
  background-color: var(--accent);
  border-color: var(--accent);
}

.servers-page:has(#permission-list-heading) .btn-primary:hover,
.servers-page:has(#permission-list-heading) .btn-primary:focus-visible {
  color: #ffffff;
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.servers-page:has(#permission-list-heading) .text-primary {
  color: var(--accent-soft) !important;
}

.servers-page:has(#permission-list-heading) .permission-card:has(input:checked) {
  border-color: var(--line-accent);
  background: var(--accent-tint);
}

.servers-page:has(#permission-list-heading) .permission-card .form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Dropdowns ---------- */

.dropdown-menu {
  z-index: 9999 !important;
  background: var(--bg-panel) !important;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  padding: 0.35rem;
}

.dropdown-menu-dark {
  background: var(--bg-panel) !important;
  border-color: var(--line-strong);
}

.dropdown-item {
  color: var(--text-mid) !important;
  border-radius: 7px;
  padding: 0.45rem 0.75rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--bg-raised) !important;
  color: var(--text-hi) !important;
}

.dropdown-item.active,
.dropdown-item:active {
  background: var(--accent-tint-strong) !important;
  color: var(--accent-faint) !important;
}

.dropdown-divider { border-color: var(--line); opacity: 1; }

.dropdown-toggle::after { transition: transform 0.16s ease; }
.dropdown-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }

/* ---------- Danger zone ---------- */

.border-danger-subtle {
  border: 1px solid rgba(239, 68, 68, 0.18) !important;
  background-color: rgba(239, 68, 68, 0.04);
  border-radius: var(--radius-md) !important;
}

.danger-zone-card { border-color: rgba(239, 68, 68, 0.25) !important; }

/* ---------- Mod panel ---------- */

.mod-panel-page {
  background-color: var(--bg-page) !important;
  min-height: 100vh;
}

.mod-navbar {
  background-color: var(--bg-panel) !important;
  border-bottom: 1px solid var(--line) !important;
}

.min-vh-logs { min-height: calc(100vh - 120px); }
.min-vh-dashboard { min-height: calc(100vh - 73px); }

/* ============================================================
   Marketing site (home / index)
   ============================================================ */

/* ---------- Hero ---------- */

.hero-section {
  min-height: 82vh;
  padding-top: 140px;
  position: relative;
  overflow: hidden;
}

/* Soft matte glow behind the hero content */
.hero-glow {
  position: absolute;
  top: -240px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 640px;
  pointer-events: none;
  background: radial-gradient(
    closest-side,
    rgba(139, 92, 246, 0.13),
    rgba(139, 92, 246, 0.05) 55%,
    transparent 75%
  );
  filter: blur(10px);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-soft);
  background: var(--accent-tint);
  border: 1px solid var(--line-accent);
  border-radius: 999px;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.hero-lead {
  color: var(--text-hi) !important;
  font-weight: 500;
}

.hero-description {
  max-width: 620px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-mid);
}

.hero-actions .btn { padding: 0.85rem 1.6rem; font-size: 1rem; }

.hero-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.hero-chip {
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-mid);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.hero-chip:hover {
  color: var(--text-mid);
  border-color: var(--line-strong);
}

.cta-band .btn-lg { font-size: 16px; }

/* Quieter emphasis: medium weight, muted accent, no borders or shadows */
.btn-quiet {
  font-weight: 500 !important;
  box-shadow: none !important;
}

/* Gentle entrance, disabled for reduced motion */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-rise {
  animation: rise-in 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.animate-rise-1 { animation-delay: 0.05s; }
.animate-rise-2 { animation-delay: 0.12s; }
.animate-rise-3 { animation-delay: 0.2s; }
.animate-rise-4 { animation-delay: 0.28s; }

/* ---------- Section scaffolding ---------- */

.section-pad { padding: 5.5rem 0; }

.section-eyebrow {
  display: inline-block;
  margin-bottom: 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.section-title {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  font-weight: 750;
  letter-spacing: -0.025em;
}

.section-sub {
  max-width: 560px;
  color: var(--text-dim);
  font-size: 1rem;
}

/* ---------- Feature cards ---------- */

.feature-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1.1rem;
  color: var(--accent-soft);
  background: var(--accent-tint);
  border: 1px solid var(--line-accent);
  border-radius: var(--radius-md);
}

.feature-card-item h4 { font-size: 1.05rem; margin-bottom: 0.4rem; }

.feature-card-item p {
  color: var(--text-dim);
  font-size: 0.925rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* ---------- Value props ---------- */

.value-prop {
  padding: 1.4rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.value-prop h5 { font-size: 1rem; margin-bottom: 0.3rem; }
.value-prop p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 0; }

/* ---------- Steps ---------- */

.step-card {
  position: relative;
  height: 100%;
  padding: 1.6rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.step-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 1rem;
  color: var(--accent-faint);
  background: var(--accent-tint);
  border: 1px solid var(--line-accent);
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
}

.step-card h5 { font-size: 1.02rem; margin-bottom: 0.35rem; }
.step-card p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 0; }
.step-card code { font-size: 0.8rem; }

/* ---------- CTA band ---------- */

.cta-band {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 2rem;
  text-align: center;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    55% 90% at 50% 0%,
    rgba(139, 92, 246, 0.12),
    transparent 70%
  );
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-panel);
  padding: 3.5rem 0 2rem;
  margin-top: 4rem;
}

.site-footer h6 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.9rem;
}

.site-footer a {
  display: block;
  padding: 0.22rem 0;
  color: var(--text-mid);
  font-size: 0.925rem;
}

.site-footer a:hover { color: var(--text-hi); }

.footer-brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}

.footer-note {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---------- Toasts (JS-injected) & misc ---------- */

#botrix-toasts > div {
  background: var(--bg-raised);
  color: var(--text-hi);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  font-size: 0.875rem;
}

.empty-state h3 { letter-spacing: -0.01em; }

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
  .hero-section { min-height: auto; padding-top: 120px; }

  .bg-transparent-nav {
    background-color: rgba(10, 10, 12, 0.96) !important;
  }

  .navbar-collapse {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-top: 0.75rem;
  }

  .dashboard-sidebar {
    min-height: auto;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 575.98px) {
  .section-pad { padding: 3.5rem 0; }
  .hero-actions .btn { width: 100%; }
  .cta-band { padding: 2.5rem 1.25rem; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Embed editor ---------- */

.embed-mode-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.embed-mode-switch button {
  padding: 0.4rem 1rem;
  color: var(--text-mid);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.embed-mode-switch button:hover { color: var(--text-hi); }

.embed-mode-switch button[aria-selected="true"] {
  color: var(--accent-faint);
  background: var(--accent-tint);
  box-shadow: inset 0 0 0 1px var(--line-accent);
}

.variable-chip {
  padding: 0.14rem 0.55rem;
  color: var(--accent-faint);
  background: var(--accent-tint);
  border: 1px solid var(--line-accent);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.variable-chip:hover { background: var(--accent-tint-strong); }

.embed-field-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.embed-field-grip {
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: -2px;
  user-select: none;
}

.embed-field-name { flex: 0 0 34%; min-width: 0; padding: 0.35rem 0.6rem !important; font-size: 0.875rem !important; }
.embed-field-value { flex: 1 1 auto; min-width: 0; padding: 0.35rem 0.6rem !important; font-size: 0.875rem !important; }

.embed-field-inline-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: var(--text-mid);
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
}

.embed-field-remove { width: 2rem; padding: 0.25rem 0; }

/* Discord-style live preview */

.embed-preview-wrap {
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.6rem;
}

.discord-message {
  display: flex;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  background: #313338;
  border-radius: var(--radius-md);
}

.discord-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #5865f2;
}

.discord-content { flex: 1; min-width: 0; }

.discord-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.3rem;
}

.discord-name { color: #f2f3f5; font-size: 0.95rem; font-weight: 600; }

.discord-bot-tag {
  padding: 0.06rem 0.32rem;
  background: #5865f2;
  border-radius: 4px;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.discord-timestamp { color: #949ba4; font-size: 0.72rem; margin-left: 0.1rem; }

.discord-embed {
  display: flex;
  max-width: 520px;
  margin-top: 0.35rem;
  background: #2b2d31;
  border-radius: 6px;
  overflow: hidden;
}

.discord-embed-color { flex-shrink: 0; width: 4px; background: #5865f2; }

.discord-embed-main {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 0.7rem 1rem 0.75rem;
}

.discord-embed-main.has-thumb .discord-embed-content { padding-right: 96px; }

.discord-embed-author { color: #f2f3f5; font-size: 0.88rem; font-weight: 600; margin-bottom: 0.35rem; }
.discord-embed-title { color: #f2f3f5; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.35rem; }

.discord-embed-desc {
  color: #dbdee1;
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.discord-embed-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem 1rem;
  margin-top: 0.5rem;
}

.discord-field:not(.inline) { grid-column: 1 / -1; }

.discord-field-name { color: #f2f3f5; font-size: 0.82rem; font-weight: 700; margin-bottom: 0.15rem; }
.discord-field-value { color: #dbdee1; font-size: 0.82rem; line-height: 1.45; overflow-wrap: anywhere; }

.discord-embed-image {
  display: block;
  max-width: 100%;
  max-height: 300px;
  margin-top: 0.6rem;
  border-radius: 4px;
  object-fit: contain;
}

.discord-embed-thumbnail {
  position: absolute;
  top: 0.7rem;
  right: 1rem;
  width: 80px;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
}

.discord-embed-footer {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #949ba4;
  font-size: 0.78rem;
}

@media (max-width: 575.98px) {
  .discord-message { padding: 0.85rem; }
  .discord-embed-fields { grid-template-columns: 1fr 1fr; }
  .discord-embed-main.has-thumb .discord-embed-content { padding-right: 0; }
  .discord-embed-thumbnail { position: static; width: 64px; height: 64px; margin-top: 0.6rem; }
}

/* ---------- Premium Botrix homepage hero ---------- */

.hero-section {
  isolation: isolate;
}

.hero-section .hero-glow,
.hero-wordmark {
  z-index: 0;
}

.hero-wordmark {
  position: absolute;
  top: 52%;
  right: 0;
  left: 0;
  transform: translateY(-50%);
  overflow: hidden;
  color: transparent;
  background: linear-gradient(180deg, rgba(226, 220, 239, 0.005), rgba(226, 220, 239, 0.095));
  background-clip: text;
  -webkit-background-clip: text;
  font-size: clamp(8rem, 24vw, 27rem);
  font-weight: 800;
  letter-spacing: -0.095em;
  line-height: 0.76;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.hero-section > .container {
  z-index: 1;
}

.hero-section h1 {
  color: #751990;
  font-size: clamp(2.5rem, 5.2vw, 4.5rem);
  font-weight: 650 !important;
  letter-spacing: -0.055em;
  line-height: 1.03;
}

.hero-title-main {
  color: var(--text-hi);
}

.hero-title-accent {
  display: inline-block;
  margin-top: 0.12em;
  color: var(--accent-soft);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- Premium dashboard shell ---------- */

.servers-page > .navbar {
  min-height: 60px;
  padding-block: 0.55rem !important;
  padding-inline: 1.2rem !important;
  background: rgba(12, 12, 15, 0.9) !important;
}

.servers-page .navbar-brand {
  font-size: 1rem !important;
  font-weight: 600;
}

.servers-page .navbar-brand .badge {
  padding: 0.25rem 0.5rem !important;
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.14) !important;
  color: var(--accent-faint) !important;
  font-size: 0.68rem !important;
  font-weight: 500 !important;
  text-transform: none;
}

.servers-page .dashboard-brand-mark {
  width: 34px;
  height: 34px;
}

.dashboard-sidebar {
  background: linear-gradient(180deg, rgba(18, 18, 22, 0.98), rgba(14, 14, 17, 0.98)) !important;
  border-color: var(--line) !important;
}

.dashboard-sidebar .text-uppercase.small {
  margin-bottom: 0.45rem !important;
  color: #92929d !important;
  font-size: 0.69rem !important;
  font-weight: 550 !important;
  letter-spacing: 0.015em;
  text-transform: none !important;
}

.dashboard-sidebar .server-switcher-btn {
  min-height: 40px;
  padding: 0.35rem 0.55rem !important;
  background: rgba(255, 255, 255, 0.025) !important;
  border-color: rgba(255, 255, 255, 0.07) !important;
  font-size: 0.8rem;
}

.dashboard-sidebar .nav {
  gap: 0.15rem !important;
}

.dashboard-sidebar .nav-link {
  min-height: 34px;
  padding: 0.42rem 0.62rem !important;
  border: 1px solid transparent;
  border-radius: 8px !important;
  color: #aaaab4 !important;
  font-size: 0.8rem !important;
  font-weight: 450 !important;
  line-height: 1.35;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.dashboard-sidebar .nav-link svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  opacity: 0.84;
}

.dashboard-sidebar .nav-link:hover,
.dashboard-sidebar .nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.035) !important;
  border-color: rgba(255, 255, 255, 0.055);
  color: var(--text-hi) !important;
}

.dashboard-sidebar .nav-link.active,
.dashboard-sidebar .nav-link.active.bg-primary {
  background: rgba(139, 92, 246, 0.14) !important;
  border-color: rgba(139, 92, 246, 0.18) !important;
  box-shadow: inset 2px 0 0 var(--accent);
  color: #eee7ff !important;
  font-weight: 550 !important;
}

.dashboard-sidebar .nav-link.text-warning:not(.active) {
  border-color: transparent !important;
  color: #aaaab4 !important;
  font-weight: 450 !important;
}

.dashboard-sidebar .nav-link.text-warning:not(.active):hover {
  color: var(--text-hi) !important;
}

.servers-page .user-avatar-badge {
  width: 26px;
  height: 26px;
}

.servers-page .dropdown-toggle,
.servers-page .dropdown-item {
  font-size: 0.8rem !important;
}

.servers-page > .container > h1.display-6 {
  font-size: 1.6rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.035em;
}

.servers-page > .container .row.justify-content-center.mb-5 {
  margin-bottom: 1.75rem !important;
}

.servers-page .servers-search-bar {
  max-width: 560px;
  margin-inline: auto;
  padding: 0.4rem !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  background: rgba(16, 16, 19, 0.9) !important;
}

.servers-page #server-search {
  min-height: 38px;
  font-size: 0.875rem;
}

.servers-page .btn-refresh-server {
  width: 36px;
  height: 36px;
}

.servers-page .server-card,
.servers-page .card {
  border-color: rgba(255, 255, 255, 0.075) !important;
  border-radius: 12px !important;
  background: rgba(20, 20, 23, 0.78) !important;
  box-shadow: none !important;
}

.danger-zone-card > .d-flex.flex-column > div .btn-danger {
  background: #743646 !important;
  border: 1px solid #8b5260 !important;
  color: #fff !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.danger-zone-card > .d-flex.flex-column > div .btn-danger:hover,
.danger-zone-card > .d-flex.flex-column > div .btn-danger:focus-visible {
  background: #824252 !important;
  border-color: #a15f6e !important;
}

.cta-band {
  border-color: rgba(139, 92, 246, 0.25);
  background:
    radial-gradient(70% 140% at 50% 0%, rgba(139, 92, 246, 0.12), transparent 72%),
    linear-gradient(135deg, rgba(23, 20, 29, 0.96), var(--bg-panel) 68%);
}

.cta-band::before {
  background: radial-gradient(55% 90% at 50% 0%, rgba(139, 92, 246, 0.15), transparent 72%);
}

@media (min-width: 992px) {
  .servers-page > .container-fluid > .row > .dashboard-sidebar {
    flex: 0 0 236px;
    width: 236px;
    max-width: 236px;
    padding: 1rem 0.85rem !important;
  }

  .servers-page > .container-fluid > .row > .dashboard-sidebar + .col-12 {
    flex: 1 1 0;
    width: auto;
    max-width: none;
    padding: 1.75rem 2rem !important;
  }
}

@media (max-width: 991.98px) {
  .dashboard-sidebar {
    padding: 1rem !important;
  }

  .hero-wordmark {
    top: 52%;
    font-size: clamp(6.5rem, 25vw, 13rem);
  }

  .hero-section h1 {
    font-size: clamp(2.35rem, 7vw, 3.4rem);
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .servers-page > .container-fluid > .row > .dashboard-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 0.85rem 1rem;
  }

  .dashboard-sidebar > .mb-4.dropdown,
  .dashboard-sidebar > .moderator-panel-link {
    grid-column: 1 / -1;
    margin-bottom: 0 !important;
  }

  .dashboard-sidebar > .mb-4:not(.dropdown),
  .dashboard-sidebar > div:last-child {
    margin-bottom: 0 !important;
  }
}

@media (max-width: 575.98px) {
  .hero-wordmark {
    top: 52%;
    font-size: clamp(5.7rem, 25vw, 8rem);
  }

  .hero-section h1 {
    font-size: clamp(2rem, 9vw, 2.65rem);
  }
}

/* Shift type row controls (shifts page) */
.dropdown-toggle-no-caret::after {
  display: none;
}

.shift-type-role-select {
  max-width: 190px;
}

/* Small round avatars inside the server switcher menu */
.server-mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line-accent);
  flex-shrink: 0;
}

img.server-mini-avatar {
  object-fit: cover;
  background-color: var(--accent-tint);
}

/* Avatar shown next to a moderation log entry */
.mod-target-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  object-fit: cover;
  flex-shrink: 0;
  background-color: var(--bg-raised);
}
