/* ============================================================
   Vitality Dashboard — styles.css
   Premium Dark Design System — v2.0
   Deep Navy · Electric Indigo · Better than Greed
   ============================================================ */

/* ── Google Fonts ───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* ── Greed-matched design tokens ── */
  --dash-background:       #0b0b0f;
  --dash-foreground:       #e4e4e7;
  --dash-card:             #0f0f14;
  --dash-primary:          #7c6af7;
  --dash-primary-muted:    rgba(124,106,247,0.2);
  --dash-secondary:        #12121a;
  --dash-muted:            #1c1c26;
  --dash-muted-foreground: #a1a1aa;
  --dash-accent:           #252530;
  --dash-border:           #1f1f2a;
  --dash-sidebar:          #08080c;

  /* ── Vitality accent layer (premium upgrades over Greed) ── */
  --accent:        #7c6af7;
  --accent-light:  rgba(124,106,247,0.14);
  --accent-dark:   #5a4fd4;
  --accent-hover:  #9585ff;
  --accent-glow:   rgba(124,106,247,0.3);
  --accent-border: rgba(124,106,247,0.4);
  --primary:       #7c6af7;
  --primary-light: rgba(124,106,247,0.14);
  --primary-dark:  #5a4fd4;

  /* ── Background aliases (legacy compat) ── */
  --bg-base:      var(--dash-background);
  --bg-sidebar:   var(--dash-sidebar);
  --bg-surface:   var(--dash-card);
  --bg-elevated:  var(--dash-secondary);
  --bg-overlay:   var(--dash-muted);
  --bg-dark:      var(--dash-background);
  --bg-darker:    var(--dash-sidebar);
  --bg-light:     var(--dash-secondary);
  --bg-lighter:   var(--dash-muted);
  --bg-card:      var(--dash-card);
  --bg-primary:   var(--dash-card);
  --bg-secondary: var(--dash-secondary);
  --bg-tertiary:  var(--dash-muted);

  /* ── Text aliases ── */
  --text-primary:   var(--dash-foreground);
  --text-secondary: var(--dash-muted-foreground);
  --text-tertiary:  rgba(161,161,170,0.5);

  /* ── Borders ── */
  --border:        var(--dash-border);
  --border-light:  rgba(255,255,255,0.04);
  --border-medium: rgba(255,255,255,0.1);

  /* ── Radii ── */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-full: 9999px;

  /* ── Transitions ── */
  --ease:              cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast:   0.14s ease;
  --transition-medium: 0.2s ease;

  /* ── Shadows (premium over Greed's minimal shadows) ── */
  --shadow-card:  0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.03);
  --shadow-hover: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(124,106,247,0.15);
  --shadow-glow:  0 0 20px rgba(124,106,247,0.25);
  --shadow-modal: 0 32px 80px rgba(0,0,0,0.8), 0 0 0 1px rgba(124,106,247,0.12);

  /* ── Status ── */
  --success: #22c55e;
  --danger:  #ef4444;
  --warning: #f59e0b;
  --info:    #3b82f6;
  --premium: #f59e0b;

  /* ── Fonts ── */
  --font-heading: 'Outfit', system-ui, sans-serif;
  --font-body:    'Outfit', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* ── Layout ── */
  --sidebar-width: 256px;
}

/* ── Reset / Base ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--dash-foreground);
  background: var(--dash-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

/* ── App Layout ─────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--dash-background);
  padding: 8px;
  gap: 8px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100%;
  background: var(--dash-sidebar);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

/* Aurora top glow — premium effect Greed doesn't have */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 220px;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,106,247,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  border-radius: 20px 20px 0 0;
}

.sidebar > * { position: relative; z-index: 1; }
.sidebar-header { z-index: 10; }
.sidebar { user-select: none; -webkit-user-select: none; }

/* ── Sidebar Header ─────────────────────────────────────────── */
.sidebar-header {
  padding: 12px 8px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

/* ── Logo ───────────────────────────────────────────────────── */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 12px;
}

.sidebar-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dash-primary), #5a4fd4);
  box-shadow: 0 2px 8px rgba(124,106,247,0.35);
}

.sidebar-logo-text {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, #e8eef8 0%, #a8bde8 55%, var(--dash-primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.3px;
}

.sidebar-logo-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(124,106,247,0.12);
  border: 1px solid rgba(124,106,247,0.28);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Server Picker ──────────────────────────────────────────── */
.server-picker {
  position: relative;
}

.server-picker-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 52px;
  padding: 0 10px;
  background: var(--dash-card);
  border: 2px solid var(--dash-border);
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  gap: 8px;
  margin-bottom: 8px;
}

.server-picker-btn:hover {
  background: var(--dash-accent);
  border-color: rgba(228,228,231,0.1);
}

.server-picker-btn:active { transform: translateY(0.5px); }

.server-picker-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.server-picker-icon-wrap {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(124,106,247,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.server-picker-initials {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
}

.server-picker-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.server-picker-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.server-picker-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.server-picker-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform var(--transition-medium);
}

.server-picker.open .server-picker-chevron {
  transform: rotate(180deg);
}

.server-picker-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--dash-muted);
  border: 1px solid rgba(124,106,247,0.2);
  border-radius: 16px;
  z-index: 9999;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.server-picker.open .server-picker-dropdown {
  display: block;
}

.spd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.spd-item:hover { background: var(--dash-accent); }

.spd-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(124,106,247,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spd-initials {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
}

.spd-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 8px 12px;
  scrollbar-width: none;
  min-height: 0;
}

.sidebar-nav::-webkit-scrollbar { width: 0; }

.nav-section { margin-bottom: 4px; }

.nav-section h3 {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 10px 10px 4px;
}

/* ── Nav Item ───────────────────────────────────────────────── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--dash-muted-foreground);
  font-size: 13.5px;
  font-weight: 400;
  transition: color 0.12s, background 0.12s;
  position: relative;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border: none;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.12s;
  width: 15px;
  height: 15px;
}

.nav-item:hover {
  color: var(--dash-foreground);
  background: var(--dash-accent);
}

.nav-item:hover svg { opacity: 1; }

/* Active nav item */
.nav-item.active {
  color: var(--dash-foreground);
  background: var(--dash-primary-muted);
  font-weight: 500;
}

.nav-item.active:hover { background: rgba(124,106,247,0.28); }
.nav-item.active svg { opacity: 1; color: var(--dash-primary); }

/* ── Collapsible Nav Groups ─────────────────────────────────── */
.nav-group { margin-bottom: 1px; }

.nav-group-btn {
  display: flex;
  align-items: center;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: none;
  border: none;
  color: var(--dash-muted-foreground);
  cursor: pointer;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 400;
  gap: 10px;
  transition: color 0.12s, background 0.12s;
  text-align: left;
  margin-bottom: 1px;
}

.nav-group-btn svg:first-child {
  flex-shrink: 0;
  opacity: 0.65;
  width: 15px;
  height: 15px;
}

.nav-group-btn:hover {
  color: var(--dash-foreground);
  background: var(--dash-accent);
}

.nav-group-btn[aria-expanded="true"] {
  color: var(--dash-foreground);
}

.nav-group-btn[aria-expanded="true"] svg:first-child {
  opacity: 1;
}

.nav-chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--dash-muted-foreground);
  opacity: 0.7;
  transition: transform 0.2s ease;
  transform: rotate(-90deg);
}

.nav-group-btn[aria-expanded="true"] .nav-chevron {
  transform: rotate(0deg);
}

.nav-group-children {
  display: none;
  padding-left: 0;
  padding-bottom: 2px;
  margin-left: 0;
}

.nav-group-children.open {
  display: block;
  animation: fadeIn 0.14s ease;
}

.nav-group-children .nav-item {
  font-size: 13px;
  height: 34px;
  padding: 0 12px 0 36px;
  color: var(--dash-muted-foreground);
}

/* ── Sidebar Footer ─────────────────────────────────────────── */
.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  margin-top: 4px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-info-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 12px;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
}

.user-info-btn:hover { background: var(--dash-accent); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(124,106,247,0.3);
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.user-details span:first-child {
  font-size: 13px;
  font-weight: 500;
  color: var(--dash-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-status {
  font-size: 11px;
  color: var(--success);
}

.user-chevron {
  color: var(--dash-muted-foreground);
  opacity: 0.7;
  flex-shrink: 0;
  transition: transform 0.2s;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  height: 100%;
  background: var(--dash-background);
  border-radius: 24px;
  border: 2px solid var(--dash-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ── Top Header Bar ─────────────────────────────────────────── */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: rgba(11,11,15,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--dash-border);
  flex-shrink: 0;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  border-radius: 22px 22px 0 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--dash-muted-foreground);
}

.breadcrumb svg { opacity: 0.5; flex-shrink: 0; }

.breadcrumb-server {
  color: var(--dash-muted-foreground);
  transition: color 0.12s;
}

.breadcrumb-server:hover { color: var(--dash-foreground); }

#breadcrumbPage {
  color: var(--dash-foreground);
  font-weight: 500;
}

/* Page header styles (inside #content) */
.page-header { margin-bottom: 24px; }

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #E8EDFF 0%, rgba(140,155,255,0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 5px;
  line-height: 1.55;
}

/* ── Content Scroll Area ────────────────────────────────────── */
#content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-border) transparent;
  /* glass-automation-page handles its own padding/max-width */
  padding: 0;
  max-width: none !important;
  margin: 0 !important;
  background: none;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#content::-webkit-scrollbar { width: 5px; }
#content::-webkit-scrollbar-track { background: transparent; }
#content::-webkit-scrollbar-thumb {
  background: var(--dash-border);
  border-radius: 3px;
}
#content::-webkit-scrollbar-thumb:hover { background: rgba(124,106,247,0.4); }

/* ============================================================
   GLASS PANEL — frosted glass effect (premium over Greed)
   ============================================================ */
.glass-panel {
  background: rgba(15,15,20,0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* ============================================================
   CARDS & SETTINGS SECTIONS
   ============================================================ */
.settings-section {
  margin-bottom: .75rem;
  background: rgba(15,15,20,.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.04);
  padding: 1.25rem;
  position: relative;
}

.settings-section > h2,
.settings-section > h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--dash-foreground);
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.settings-grid .settings-section { margin: 0; max-width: none; }

.card {
  background: var(--dash-card);
  border: 1px solid var(--dash-border);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.card:hover {
  border-color: rgba(124,106,247,0.2);
  box-shadow: var(--shadow-hover);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--dash-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h2,
.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--dash-foreground);
  letter-spacing: -0.01em;
}

.card-header p {
  font-size: 12px;
  color: var(--dash-muted-foreground);
  margin-top: 2px;
}

.card-body { padding: 16px 20px; }

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(232,237,255,0.65);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--dash-foreground);
  padding: 0 12px;
  height: 36px;
  font-size: 13.5px;
  font-family: var(--font-body);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--dash-muted-foreground);
  opacity: 0.7;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--dash-primary);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 2px rgba(124,106,247,0.18);
}

.form-group select option {
  background: var(--dash-card);
  color: var(--dash-foreground);
}

.form-group textarea {
  resize: vertical;
  height: auto;
  min-height: 80px;
  padding: 8px 12px;
  line-height: 1.55;
}

/* ============================================================
   BUTTONS
   ============================================================ */

/* Base button shared styles */
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s, filter 0.15s;
  height: 36px;
  padding: 0 16px;
  font-size: 13.5px;
  border-radius: 16px;
}

.btn-primary:active, .btn-secondary:active,
.btn-ghost:active, .btn-danger:active { transform: translateY(0.5px); }

/* Primary */
.btn-primary {
  background: var(--dash-primary);
  color: #fff;
  border: 2px solid transparent;
  box-shadow: 0 2px 12px rgba(124,106,247,0.35);
}

.btn-primary:hover:not(:disabled) { filter: brightness(1.12); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Secondary */
.btn-secondary {
  background: var(--dash-accent);
  color: var(--dash-foreground);
  border: 2px solid var(--dash-border);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(228,228,231,0.08);
  border-color: rgba(228,228,231,0.12);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--dash-muted-foreground);
  border: 2px solid transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--dash-accent);
  color: var(--dash-foreground);
}

/* Danger */
.btn-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  border: 2px solid rgba(239,68,68,0.3);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.45);
}

.btn-sm-danger,
.btn.btn-sm.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: rgba(248,113,113,0.09);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.22);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.btn-sm-danger:hover,
.btn.btn-sm.btn-danger:hover {
  background: rgba(248,113,113,0.18);
  border-color: rgba(248,113,113,0.38);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--dash-foreground);
}

.badge-purple, .badge-active {
  background: rgba(124,106,247,0.14);
  color: #a899ff;
  border-color: rgba(124,106,247,0.3);
}

.badge-green {
  background: rgba(34,197,94,0.1);
  color: var(--success);
  border-color: rgba(34,197,94,0.2);
}

.badge-red, .badge-inactive {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border-color: rgba(239,68,68,0.2);
}

.badge-yellow, .badge-premium {
  background: rgba(245,158,11,0.1);
  color: var(--premium);
  border-color: rgba(245,158,11,0.2);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  gap: 8px;
  text-align: center;
}

.empty-state svg {
  width: 36px;
  height: 36px;
  opacity: 0.3;
  color: var(--dash-muted-foreground);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 13px;
  font-weight: 500;
  color: var(--dash-muted-foreground);
  margin: 0;
}

/* ============================================================
   LOADING
   ============================================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: var(--dash-muted-foreground);
  font-size: 13px;
  gap: 10px;
}

.loading::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid rgba(124,106,247,0.2);
  border-top-color: var(--dash-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ============================================================
   OVERVIEW / STATS
   ============================================================ */
.overview-greeting { margin-bottom: 20px; }

.overview-greeting h1, .overview-greeting h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--dash-foreground);
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #e8eef8 0%, #a8bde8 55%, var(--dash-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.overview-greeting p {
  font-size: 13px;
  color: var(--dash-muted-foreground);
  margin-top: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--dash-card);
  border: 2px solid var(--dash-border);
  border-radius: 20px;
  padding: 16px 18px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, rgba(124,106,247,0.06) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.stat-card:hover {
  border-color: rgba(124,106,247,0.28);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.stat-card:hover::before { opacity: 1; }

.stat-card .stat-label,
.stat-card .label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.stat-card .stat-value,
.stat-card .value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1;
}

.stat-card .stat-change,
.stat-card .change {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 7px;
}

.stat-card .change.negative { color: var(--danger); }

.stat-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}
.stat-header-row .label { margin-bottom: 0; }

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 15px; height: 15px; }

.stat-icon-messages      { background: rgba(96,165,250,0.14); color: #60A5FA; }
.stat-icon-reactions     { background: rgba(244,114,182,0.13); color: #F472B6; }
.stat-icon-voice         { background: rgba(52,211,153,0.13); color: #34D399; }
.stat-icon-communicators { background: rgba(251,146,60,0.13); color: #FB923C; }

/* Gradient top-border per stat */
.stat-messages    { border-top: 2px solid rgba(96,165,250,0.5); }
.stat-reactions   { border-top: 2px solid rgba(244,114,182,0.45); }
.stat-voice       { border-top: 2px solid rgba(52,211,153,0.45); }
.stat-communicators { border-top: 2px solid rgba(251,146,60,0.45); }

/* Time Selector */
.time-selector-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.time-selector {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.time-btn {
  padding: 6px 12px;
  background: transparent;
  border: 2px solid transparent;
  color: var(--dash-muted-foreground);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  font-family: var(--font-body);
}

.time-btn:hover { color: var(--dash-foreground); background: var(--dash-accent); }

.time-btn.active {
  color: var(--dash-foreground);
  background: var(--dash-primary-muted);
  border-color: rgba(124,106,247,0.3);
  font-weight: 500;
}

/* Chart */
.chart-wrapper {
  background: var(--dash-card);
  border: 2px solid var(--dash-border);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Engagement / Moderation cards */
.engagement-card,
.moderation-card {
  background: var(--dash-card);
  border: 1px solid var(--dash-border);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color 0.2s;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  margin-bottom: 14px;
}

.engagement-card:hover,
.moderation-card:hover { border-color: rgba(124,106,247,0.2); }

.engagement-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--dash-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.engagement-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--dash-foreground);
}

.engagement-metric {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  font-size: 13px;
}

.engagement-metric .label {
  font-size: 11px;
  font-weight: 500;
  color: var(--dash-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.engagement-metric .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--dash-foreground);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.engagement-metric .change { font-size: 11px; color: var(--dash-muted-foreground); margin-top: 4px; }
.engagement-metric .change.negative { color: var(--danger); }

.top-channels-card {
  background: var(--dash-card);
  border: 1px solid var(--dash-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  background: var(--dash-card);
  border: 1px solid var(--dash-border);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 14px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.table-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--dash-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.table-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--dash-foreground);
}

.table-wrapper { overflow-x: auto; }

.table-wrapper table,
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-wrapper table th,
.data-table th {
  padding: 8px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--dash-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}

.table-wrapper table td,
.data-table td {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--dash-foreground);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}

.table-wrapper table tr:last-child td,
.data-table tr:last-child td { border-bottom: none; }

.table-wrapper table tbody tr:hover td,
.data-table tbody tr:hover td {
  background: rgba(255,255,255,0.025);
  color: var(--text-primary);
}

.channel-name { color: var(--text-primary); font-weight: 600; }
.percentage { color: var(--text-tertiary); font-size: 12px; }
.change-positive { color: var(--success); }
.change-negative { color: var(--danger); }

/* ============================================================
   MOBILE / HAMBURGER
   ============================================================ */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.hamburger-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 99;
}

.sidebar-overlay.active { display: block; }

/* ============================================================
   COMMANDS PAGE
   ============================================================ */
.cmd-page { display: flex; flex-direction: column; gap: 20px; }

.cmd-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px;
  background: linear-gradient(145deg, var(--dash-card), var(--dash-secondary));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-xl);
}

.cmd-page-title {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--accent);
}

.cmd-page-title h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 2px;
  letter-spacing: -0.03em;
}

.cmd-page-title p {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

.cmd-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cmd-search-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 0 12px;
  transition: border-color 0.18s ease;
}

.cmd-search-wrap:focus-within {
  border-color: rgba(124,106,247,0.45);
  background: rgba(124,106,247,0.05);
}

.cmd-search-wrap svg { color: var(--text-tertiary); flex-shrink: 0; }

.cmd-search-wrap input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13.5px;
  padding: 9px 0;
  width: 200px;
}

/* Quick-jump chips */
.cmd-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cmd-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cmd-stat-chip:hover {
  background: color-mix(in srgb, var(--chip-color) 12%, transparent);
  border-color: color-mix(in srgb, var(--chip-color) 35%, transparent);
  color: var(--text-primary);
}

.cmd-stat-chip svg { flex-shrink: 0; }

.cmd-stat-chip-count {
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-tertiary);
}

/* Accordion */
.cmd-accordion-list { display: flex; flex-direction: column; gap: 6px; }

.cmd-accordion {
  background: linear-gradient(145deg, var(--dash-card), var(--dash-secondary));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.18s ease;
}

.cmd-accordion:hover { border-color: rgba(124,106,247,0.18); }
.cmd-accordion.open  { border-color: rgba(124,106,247,0.25); }

.cmd-accordion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease;
}

.cmd-accordion-head:hover { background: rgba(255,255,255,0.03); }
.cmd-accordion.open .cmd-accordion-head { background: rgba(124,106,247,0.06); }

.cmd-acc-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cmd-acc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.cmd-acc-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.cmd-acc-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  background: rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 1px 8px;
}

.cmd-acc-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 0.22s var(--ease);
}

.cmd-accordion.open .cmd-acc-chevron { transform: rotate(180deg); }

/* Accordion body */
.cmd-accordion-body {
  display: none;
  padding: 0 14px 14px;
}

.cmd-accordion.open .cmd-accordion-body { display: block; }

/* Command grid */
.cmd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px;
  padding-top: 8px;
}

.cmd-card {
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  transition: background 0.14s ease, border-color 0.14s ease;
  overflow: hidden;
  min-width: 0;
}

.cmd-card:hover {
  background: rgba(124,106,247,0.07);
  border-color: rgba(124,106,247,0.2);
}

.cmd-card-top {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 4px;
}

.cmd-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #A89DFF;
  font-family: var(--font-mono, 'Courier New', monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cmd-example {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.cmd-example code {
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

.cmd-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }

.cmd-badge {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 500;
}

.cmd-badge.perm  { background: rgba(251,146,60,0.12); color: #FB923C; border: 1px solid rgba(251,146,60,0.2); }
.cmd-badge.cool  { background: rgba(148,163,184,0.1);  color: var(--text-tertiary); border: 1px solid rgba(148,163,184,0.15); }
.cmd-badge.alias { background: rgba(124,106,247,0.1);   color: #A89DFF; border: 1px solid rgba(124,106,247,0.2); }

@media (max-width: 600px) {
  .cmd-page-header { padding: 16px; }
  .cmd-search-wrap input { width: 140px; }
  .cmd-grid { grid-template-columns: 1fr; }
  .cmd-header-actions { width: 100%; }
  .cmd-search-wrap { flex: 1; }
}

/* ============================================================
   WORD FILTER
   ============================================================ */
.word-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
}

.word-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(124,106,247,0.1);
  border: 1px solid rgba(124,106,247,0.22);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
}

.word-tag-x {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  font-size: 15px;
  line-height: 1;
  transition: color var(--transition-fast);
}

.word-tag-x:hover { color: var(--danger); }

/* ============================================================
   AUTOMOD
   ============================================================ */
.am-filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
}

.am-filter-row:last-child { border-bottom: none; }

.am-filter-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: rgba(124,106,247,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.am-filter-info { flex: 1; }

.am-filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.am-filter-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.an-toggle {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center;
  box-sizing: border-box;
  width: 44px; height: 24px;
  padding: 0 4px; margin: 0; border-radius: 12px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.08);
  cursor: pointer; flex-shrink: 0; outline: none;
  font-size: 0; line-height: 0;
  transition: background .15s, border-color .15s;
  position: relative;
}
.an-toggle::after {
  content: ''; flex-shrink: 0;
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,.4);
  margin-left: 0;
  transition: margin-left .15s ease, background .15s;
}
.an-toggle.on {
  background: rgba(124,106,247,.25);
  border-color: rgba(124,106,247,.35);
}
.an-toggle.on::after { margin-left: 20px; background: var(--dash-primary); }
.an-toggle.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.an-toggle:hover { opacity: .85; }

/* ============================================================
   GREED DESIGN SYSTEM — glass-* and dash-* classes
   ============================================================ */

/* glass-btn */
.glass-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem;
  padding: 0 .875rem; height: 2rem; border-radius: .5rem;
  font-size: .8125rem; font-weight: 500; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1);
  color: var(--dash-foreground); transition: background .15s, border-color .15s;
  white-space: nowrap; flex-shrink: 0;
}
.glass-btn:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.16); }
.glass-btn:disabled { opacity: .5; cursor: not-allowed; }
.glass-btn--sm { height: 1.75rem; padding: 0 .625rem; font-size: .75rem; }
.glass-btn--outline { background: transparent; border-color: rgba(255,255,255,.15); }
.glass-btn--outline:hover { background: rgba(255,255,255,.06); }
.glass-btn--primary { background: var(--dash-primary); border-color: transparent; color: #fff; }
.glass-btn--primary:hover { background: #6b5ae0; }

/* glass-inline-toggle — Greed's exact toggle */
.glass-inline-toggle {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center;
  box-sizing: border-box; width: 32px; height: 18px;
  padding: 0 3px; margin: 0; border-radius: 9px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.08);
  cursor: pointer; flex-shrink: 0; outline: none;
  font-size: 0; line-height: 0;
  transition: background .15s, border-color .15s;
}
.glass-inline-toggle::after {
  content: ''; flex-shrink: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.4);
  margin-left: 0; transition: margin-left .15s ease, background .15s;
}
.glass-inline-toggle--active {
  background: rgba(124,106,247,.25);
  border-color: rgba(124,106,247,.35);
}
.glass-inline-toggle--active::after { margin-left: 14px; background: var(--dash-primary); }
.glass-inline-toggle--lg { width: 44px; height: 24px; padding: 0 4px; border-radius: 12px; }
.glass-inline-toggle--lg::after { width: 14px; height: 14px; }
.glass-inline-toggle--lg.glass-inline-toggle--active::after { margin-left: 20px; }

/* glass-setting rows */
.glass-setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding: .875rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.glass-setting-row:last-child { border-bottom: none; }
.glass-setting-info { display: flex; flex-direction: column; gap: .1875rem; flex: 1; min-width: 0; }
.glass-setting-label {
  font-size: .6875rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--dash-muted-foreground);
}
.glass-setting-hint { font-size: .75rem; color: rgba(255,255,255,.35); line-height: 1.4; }
.glass-setting-hint code { background: rgba(255,255,255,.06); padding: .1rem .3rem; border-radius: .25rem; font-size: .6875rem; }
.glass-setting-control { display: flex; align-items: center; gap: .5rem; }

/* glass-table */
.glass-table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.glass-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.glass-table th {
  padding: .5rem 1rem; font-size: .6875rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--dash-muted-foreground); text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.06); white-space: nowrap;
}
.glass-table th:last-child { text-align: right; }
.glass-table td {
  padding: .375rem 1rem; font-size: .8125rem; color: var(--dash-foreground);
  border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle;
}
.glass-table td:last-child { text-align: right; }
.glass-table tbody tr:last-child td { border-bottom: none; }
.glass-table tbody tr { transition: background .12s; }
.glass-table tbody tr:hover td { background: rgba(255,255,255,.025); }
.glass-table tfoot td { padding: .5rem 1rem; font-size: .75rem; color: var(--dash-muted-foreground); border-top: 1px solid rgba(255,255,255,.06); border-bottom: none; }

/* glass-two-col */
.glass-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .glass-two-col { grid-template-columns: 1fr; } }

/* glass-badge / glass-empty / glass-tag */
.glass-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .5rem; font-size: .8125rem;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.05);
  border-radius: .5rem; color: var(--dash-foreground); white-space: nowrap;
}
.glass-badge--active { color: #22c55e; background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.2); }
.glass-tag-list { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem; }
.glass-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem 1rem; gap: .5rem; text-align: center; }
.glass-empty-icon { font-size: 2rem; color: var(--dash-muted-foreground); opacity: .4; margin-bottom: .25rem; }
.glass-empty-text { font-size: .8125rem; color: var(--dash-muted-foreground); margin: 0; }
.glass-empty svg { color: var(--dash-muted-foreground); opacity: .35; margin-bottom: .25rem; }
.glass-empty p { font-size: .875rem; font-weight: 500; color: var(--dash-foreground); margin: 0; }
.glass-empty span { font-size: .8125rem; color: var(--dash-muted-foreground); margin: 0; }
.glass-section-divider { padding: .25rem 1rem .125rem; text-align: left; }
.glass-section-divider-label { font-size: .625rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: rgba(148,156,247,.7); }

/* dash-input */
.dash-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--dash-muted-foreground); display: block; margin-bottom: .375rem; }
.dash-input-root, .dash-input-wrap { width: 100%; min-width: 0; }
.dash-input-wrap { display: flex; align-items: center; position: relative; }
.dash-input-wrap .dash-input { flex: 1; min-width: 0; }
.dash-input {
  width: 100%; min-width: 0; height: 2.25rem; padding: 0 .75rem;
  font-size: .875rem; color: var(--dash-foreground);
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: .625rem; outline: none; font-family: var(--font-body);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.dash-input::placeholder { color: var(--dash-muted-foreground); opacity: .7; }
.dash-input:hover:not(:disabled) { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.06); }
.dash-input:focus { border-color: var(--dash-primary); box-shadow: 0 0 0 2px rgba(124,106,247,.18); background: rgba(255,255,255,.06); }
.dash-input:disabled { opacity: .6; cursor: not-allowed; }
.dash-input-char-count { display: block; margin-top: .25rem; font-size: .75rem; color: var(--dash-muted-foreground); }

/* dash-textarea */
.dash-textarea-root { width: 100%; min-width: 0; }
.dash-textarea-header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .375rem; }
.dash-textarea-label { font-size: .875rem; font-weight: 500; color: var(--dash-foreground); }
.dash-textarea-char-count { font-size: .75rem; color: var(--dash-muted-foreground); margin-left: auto; }
.dash-textarea {
  width: 100%; min-width: 0; min-height: 5rem; padding: .5rem .75rem;
  font-size: .875rem; color: var(--dash-foreground); font-family: var(--font-body);
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: .625rem; outline: none; resize: vertical;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.dash-textarea::placeholder { color: var(--dash-muted-foreground); opacity: .7; }
.dash-textarea:hover:not(:disabled) { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.06); }
.dash-textarea:focus { border-color: var(--dash-primary); box-shadow: 0 0 0 2px rgba(124,106,247,.18); background: rgba(255,255,255,.06); }
.dash-textarea:disabled { opacity: .6; cursor: not-allowed; }

/* ── Antinuke ───────────────────────────────────────────────── */
.an-event-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
}

.an-event-row:last-child { border-bottom: none; }
.an-punishment { font-size: 12px; color: var(--text-tertiary); }

/* ── Antiraid ───────────────────────────────────────────────── */
.ar-rule-row {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
}

.ar-rule-row:last-child { border-bottom: none; }

.ar-rule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ar-rule-header h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ar-punishment { font-size: 12px; color: var(--text-tertiary); }

.ar-threshold {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============================================================
   BOT APPEARANCE — DISCORD PROFILE CARD
   ============================================================ */
.bot-profile-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}

/* Discord-style profile card */
.dc-bot-card {
  background: #1e1f22;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  user-select: none;
}

.dc-bot-banner {
  position: relative;
  height: 120px;
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  cursor: pointer;
  overflow: hidden;
}
.dc-bot-banner img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.dc-bot-banner-empty {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
}
.dc-bot-banner-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: #fff; font-size: 12px; font-weight: 600;
  opacity: 0; transition: opacity 0.18s;
}
.dc-bot-banner:hover .dc-bot-banner-overlay { opacity: 1; }

.dc-bot-header {
  position: relative;
  padding: 0 16px;
  height: 0;
}

.dc-bot-avatar-wrap {
  position: absolute;
  bottom: -52px;    /* pull up from the 0-height row */
  left: 16px;
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 6px solid #1e1f22;
  background: #2b2d31;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transform: translateY(-100%);  /* so it sits on the banner edge */
}
.dc-bot-avatar-wrap img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.dc-bot-avatar-overlay {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(0,0,0,0.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: #fff; font-size: 10px; font-weight: 600;
  opacity: 0; transition: opacity 0.18s;
}
.dc-bot-avatar-wrap:hover .dc-bot-avatar-overlay { opacity: 1; }

.ap-reset-avatar-btn {
  position: absolute;
  bottom: -66px;
  left: 80px;
  transform: translate(-50%, -50%) translateY(-100%);
  width: 20px; height: 20px;
  background: #ed4245; color: #fff;
  border: none; border-radius: 50%;
  font-size: 10px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.85;
  transition: opacity 0.15s, transform 0.15s;
}
.ap-reset-avatar-btn:hover { opacity: 1; transform: translate(-50%, -50%) translateY(-100%) scale(1.1); }

.dc-bot-body {
  padding: 56px 16px 16px;
}
.dc-bot-name {
  font-size: 20px; font-weight: 700; color: #fff; line-height: 1.2;
}
.dc-bot-tag {
  font-size: 13px; color: #b5bac1; margin-top: 2px;
}
.dc-bot-bio-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.dc-bot-section-label {
  font-size: 11px; font-weight: 700; color: #b5bac1; letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 6px;
}
.dc-bot-bio {
  font-size: 13px; color: #dbdee1; line-height: 1.5;
  word-break: break-word; white-space: pre-wrap;
}

/* Edit panel */
.appearance-edit-panel {
  display: flex; flex-direction: column; gap: 20px;
}
.appearance-field-group {
  display: flex; flex-direction: column; gap: 8px;
}
.ap-field-label {
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.ap-upload-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 10px;
}
.ap-or-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--text-tertiary);
}
.ap-or-line { flex: 1; height: 1px; background: var(--border); }
.ap-url-input {
  width: 100%; box-sizing: border-box;
}
.ap-text-btn {
  background: none; border: none; padding: 0;
  font-size: 12px; color: var(--text-tertiary); cursor: pointer;
  text-decoration: underline; text-align: left;
  transition: color 0.15s;
}
.ap-text-btn:hover { color: var(--accent); }

@media (max-width: 768px) {
  .bot-profile-layout { grid-template-columns: 1fr; }
  .dc-bot-card { max-width: 100%; }
}

/* ============================================================
   CUSTOMIZE PAGE — Greed's exact CSS classes
   ============================================================ */

/* Page wrapper */
.glass-automation-page {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  width: 100%;
}
@media (max-width: 640px) {
  .glass-automation-page { padding: 1rem; }
}

/* Page header */
.glass-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  gap: 1rem;
}
.glass-page-header-copy { min-width: 0; }
.glass-page-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dash-foreground);
  letter-spacing: -.01em;
}
.glass-page-subtitle {
  margin: .2rem 0 0;
  font-size: .8125rem;
  color: var(--dash-muted-foreground);
  line-height: 1.4;
}
@media (max-width: 640px) {
  .glass-page-header { flex-direction: column; align-items: stretch; gap: .75rem; }
}

/* Customize two-panel layout */
.dc-customize-layout {
  display: flex;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  border-radius: .75rem;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  background: #131416;
  min-height: 580px;
}
@media (max-width: 640px) {
  .dc-customize-layout { flex-direction: column; }
}

/* Profile card — left panel */
.dc-profile-card {
  width: 45%;
  min-width: 300px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #111214;
  border-right: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .dc-profile-card { width: 100%; max-width: none; border-right: none; border-bottom: 1px solid rgba(255,255,255,.06); }
}

.dc-profile-banner {
  position: relative;
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, rgba(124,106,247,.3), rgba(255,255,255,.05));
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}
.dc-profile-banner img { width: 100%; height: 100%; object-fit: cover; }
.dc-profile-banner-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0);
  transition: background .2s, opacity .2s;
  opacity: 0; pointer-events: none;
}
.dc-profile-banner:hover .dc-profile-banner-overlay {
  background: rgba(0,0,0,.45); opacity: 1; pointer-events: auto;
}
.dc-overlay-center {
  display: flex; flex-direction: column; align-items: center; gap: .25rem; color: #fff;
}
.dc-overlay-center span {
  font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}
.dc-overlay-delete {
  position: absolute; top: .5rem; right: .5rem;
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(239,68,68,.15); color: rgba(239,68,68,.9);
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s, transform .15s;
}
.dc-overlay-delete:hover { background: rgba(239,68,68,.3); transform: scale(1.1); }

.dc-profile-header { position: relative; padding: 0 1rem; flex-shrink: 0; }
.dc-profile-avatar-wrap {
  position: relative;
  width: 92px; height: 92px;
  margin-top: -46px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  padding: 4px;
  cursor: pointer;
}
.dc-profile-avatar-wrap img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.dc-profile-avatar-overlay {
  position: absolute; inset: 4px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0); transition: background .2s; opacity: 0;
}
.dc-profile-avatar-wrap:hover .dc-profile-avatar-overlay { background: rgba(0,0,0,.5); opacity: 1; }
.dc-profile-avatar-overlay .dc-overlay-center { gap: .125rem; }
.dc-profile-avatar-overlay .dc-overlay-center span { font-size: .55rem; }

.dc-avatar-delete {
  position: absolute; bottom: 2px; right: -2px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,.6);
  background: rgba(239,68,68,.8); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s, transform .15s;
  z-index: 2; opacity: 0; pointer-events: none;
}
.dc-profile-avatar-wrap:hover .dc-avatar-delete { opacity: 1; pointer-events: auto; }
.dc-avatar-delete:hover { background: rgb(239,68,68); transform: scale(1.15); }

.dc-profile-body {
  display: flex; flex-direction: column; gap: 1rem;
  padding: .75rem 1rem 1rem;
  overflow-y: auto; flex: 1;
}
.dc-profile-name-section { display: flex; flex-direction: column; gap: .125rem; }
.dc-profile-displayname {
  font-size: 1.25rem; font-weight: 700; color: #fff; line-height: 1.3;
  border-radius: .25rem; padding: .125rem 0;
}
.dc-profile-username-row { display: flex; align-items: center; gap: .375rem; }
.dc-profile-username { font-size: .8125rem; color: rgba(255,255,255,.5); font-weight: 400; }
.dc-profile-separator { height: 1px; background: rgba(255,255,255,.06); margin: 0; }
.dc-profile-section { display: flex; flex-direction: column; gap: .375rem; }
.dc-profile-section-label {
  font-size: .6875rem; font-weight: 700; text-transform: uppercase;
  color: rgba(255,255,255,.5); letter-spacing: .02em;
}
.dc-profile-bio,
.dc-profile-section-value {
  font-size: .8125rem; color: rgba(255,255,255,.8); line-height: 1.4;
}
.dc-profile-bio {
  cursor: pointer; border-radius: .25rem; padding: .25rem; margin: -.25rem;
  transition: background .15s; min-height: 1.5em; word-break: break-word; white-space: pre-wrap;
}
.dc-profile-bio:hover { background: rgba(255,255,255,.06); }
.dc-profile-bio-placeholder { color: rgba(255,255,255,.25); font-style: italic; }

/* Right sidebar panel */
.dc-sidebar-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #131416; }
.dc-sidebar-panel-body { flex: 1; overflow-y: auto; min-height: 0; padding: 1rem; }
.dc-tab-bar {
  display: flex; flex-direction: row;
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 0 1rem; flex-shrink: 0;
}
.dc-tab-item {
  padding: .75rem .5rem; margin-bottom: -1px;
  font-size: .8125rem; font-weight: 500;
  color: rgba(255,255,255,.35); cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap; user-select: none;
}
.dc-tab-item:hover { color: rgba(255,255,255,.6); border-bottom-color: rgba(255,255,255,.15); }
.dc-tab-item--active { color: #fff; border-bottom-color: #fff; }
.dc-tab-item + .dc-tab-item { margin-left: 1.25rem; }

/* Mutual servers list */
.dc-mutual-list { padding: .75rem 0; }
.dc-mutual-row {
  display: flex; align-items: center; gap: .625rem;
  padding: .3rem .5rem; margin: 1px .75rem 1px 0;
  border-radius: 4px; cursor: pointer; line-height: 1.875rem;
  color: rgba(255,255,255,.85); font-weight: 500; font-size: .8125rem;
  transition: background .1s;
}
.dc-mutual-row:hover { background: rgba(255,255,255,.06); }
.dc-mutual-icon {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background-color: rgba(255,255,255,.08); background-size: cover; background-position: 50%;
  display: flex; align-items: center; justify-content: center;
}
.dc-mutual-icon-fallback { font-size: .625rem; font-weight: 600; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .02em; }
.dc-mutual-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Edit fields in sidebar */
.dc-edit-fields { display: flex; flex-direction: column; gap: 1rem; }
.dc-edit-field { display: flex; flex-direction: column; gap: .375rem; }
.dc-edit-label {
  font-size: .6875rem; font-weight: 700; text-transform: uppercase;
  color: rgba(255,255,255,.5); letter-spacing: .05em;
}
.dc-edit-input,
.dc-edit-textarea {
  width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: .5rem;
  color: #fff; font-size: .875rem; font-family: inherit;
  padding: .5rem .75rem;
  transition: border-color .15s; outline: none;
}
.dc-edit-input:focus, .dc-edit-textarea:focus { border-color: rgba(124,106,247,.5); }
.dc-edit-textarea { resize: vertical; min-height: 80px; line-height: 1.4; }
.dc-edit-hint { font-size: .75rem; color: rgba(255,255,255,.3); }
.dc-edit-upload-btn {
  display: flex; align-items: center; justify-content: center; gap: .375rem;
  width: 100%; padding: .5rem; border-radius: .5rem;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.7); font-size: .8125rem; font-weight: 500; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.dc-edit-upload-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); }
.dc-edit-or { display: flex; align-items: center; gap: .5rem; font-size: .75rem; color: rgba(255,255,255,.25); }
.dc-edit-or::before, .dc-edit-or::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.08); }
.dc-edit-clear { background: none; border: none; font-size: .75rem; color: rgba(255,255,255,.3); cursor: pointer; text-decoration: underline; padding: 0; text-align: left; transition: color .15s; }
.dc-edit-clear:hover { color: rgba(255,255,255,.6); }

/* ============================================================
   ROLES PAGE
   ============================================================ */
.roles-page-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  background: linear-gradient(145deg, var(--dash-card), var(--dash-secondary));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 600px;
}

.role-list-panel {
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.role-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.role-list-count-badge {
  background: rgba(124,106,247,0.15);
  color: var(--accent);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 700;
}

.role-list-body {
  overflow-y: auto;
  flex: 1;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,106,247,0.3) transparent;
}

.role-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.14s ease;
}

.role-list-item:hover { background: rgba(255,255,255,0.04); }
.role-list-item.active { background: rgba(124,106,247,0.14); }

.role-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.15);
}

.role-color-dot.lg {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.role-list-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-list-count {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.role-managed-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.role-managed-badge.lg {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 6px;
}

.role-editor-panel {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,106,247,0.3) transparent;
}

.role-editor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.role-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  gap: 12px;
  flex-wrap: wrap;
}

.role-editor-color-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-editor-section {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.role-editor-section:last-child { border-bottom: none; }

.role-editor-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

.role-editor-row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.role-perm-group { margin-bottom: 16px; }
.role-perm-group:last-child { margin-bottom: 0; }

.role-perm-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.role-perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}

.role-perm-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-secondary);
  transition: background 0.14s ease, border-color 0.14s ease;
  user-select: none;
}

.role-perm-toggle:hover:not(.disabled) {
  background: rgba(124,106,247,0.07);
  border-color: rgba(124,106,247,0.2);
  color: var(--text-primary);
}

.role-perm-toggle.disabled {
  opacity: 0.5;
  cursor: default;
}

@media (max-width: 768px) {
  .roles-page-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .role-list-panel {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    max-height: 280px;
  }
}

@media (max-width: 600px) {
  .role-perm-grid { grid-template-columns: 1fr 1fr; }
  .role-editor-header { padding: 14px 16px; }
  .role-editor-section { padding: 14px 16px; }
}

/* Member add row */
.role-add-member-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}

.role-add-member-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-md);
  padding: 0 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.role-add-member-input-wrap:focus-within {
  border-color: rgba(124,106,247,0.55);
  background: rgba(124,106,247,0.05);
}

.role-add-member-input-wrap svg { color: var(--text-tertiary); flex-shrink: 0; }

.role-add-member-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  padding: 10px 0;
}

.role-add-member-input-wrap input::placeholder { color: rgba(255,255,255,0.2); }

/* Member list */
.role-member-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,106,247,0.3) transparent;
}

.role-member-empty,
.role-member-loading {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.role-member-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  transition: background 0.14s ease;
}

.role-member-card:hover { background: rgba(255,255,255,0.05); }

.role-member-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.08);
}

.role-member-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.role-member-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-member-tag {
  font-size: 11px;
  color: var(--text-tertiary);
}

.role-member-remove {
  padding: 4px 11px;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.22);
  border-radius: var(--radius-md);
  color: #F87171;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.role-member-remove:hover {
  background: rgba(248,113,113,0.2);
  border-color: rgba(248,113,113,0.4);
}

/* ============================================================
   FAKE PERMS
   ============================================================ */
.fp-layout {
  display: flex;
  gap: 0;
  min-height: 400px;
}

.fp-sidebar {
  width: 190px;
  min-width: 190px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
}

.fp-sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.fp-main {
  flex: 1;
  padding: 16px;
  min-width: 0;
}

.fp-main-header { margin-bottom: 14px; }

.fp-main-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.fp-perm-grid { display: grid; gap: 6px; }

.fp-perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  font-size: 13px;
  color: var(--text-secondary);
  gap: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.fp-perm-row:hover {
  border-color: rgba(124,106,247,0.2);
  background: rgba(124,106,247,0.04);
}

.fp-perm-section { margin-bottom: 16px; }

.fp-perm-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
  padding: 0 2px;
}

.fp-role-list { display: flex; flex-direction: column; }

.fp-role-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.fp-role-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.fp-role-item.active {
  background: rgba(124,106,247,0.1);
  color: var(--text-primary);
}

.fp-role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-tertiary);
}

.fp-role-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   DURATION BUTTONS
   ============================================================ */
.dur-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
}

.dur-btn {
  padding: 5px 13px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.dur-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.dur-btn.active {
  background: rgba(124,106,247,0.14);
  border-color: rgba(124,106,247,0.4);
  color: #A99DFF;
}

/* ============================================================
   AUTOPFP CATEGORY GRID
   ============================================================ */
.pfp-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.pfp-cat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  user-select: none;
}

.pfp-cat-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
}

.pfp-cat-card.active {
  background: rgba(124,106,247,0.12);
  border-color: rgba(124,106,247,0.38);
}

.pfp-cat-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border-medium);
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--accent);
  flex-shrink: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.pfp-cat-card.active .pfp-cat-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pfp-cat-name { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.pfp-cat-card.active .pfp-cat-name { color: var(--text-primary); }

/* ============================================================
   CALENDAR
   ============================================================ */
.cal-popup {
  display: none;
  position: fixed;
  z-index: 9999;
  background: var(--bg-overlay);
  border: 1px solid rgba(124,106,247,0.2);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(124,106,247,0.08);
  min-width: 280px;
}

.cal-visible { display: block; }

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-header-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.cal-nav {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
  display: flex;
  align-items: center;
}

.cal-nav:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.07);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-wd {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  padding: 4px 0;
  text-transform: uppercase;
}

.cal-day {
  text-align: center;
  padding: 6px 4px;
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.cal-day:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.cal-today { color: var(--accent); font-weight: 700; }

.cal-sel {
  background: linear-gradient(135deg, #7c6af7, #5b4ee0) !important;
  color: #fff !important;
  font-weight: 700;
}

.cal-disabled { color: rgba(255,255,255,0.18); cursor: default; pointer-events: none; }
.cal-empty { pointer-events: none; }

.cal-months-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.cal-month-item {
  padding: 8px;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.cal-month-item:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }
.cal-month-item.cal-sel { background: linear-gradient(135deg, #7c6af7, #5b4ee0); color: #fff; }
.cal-month-disabled { color: rgba(255,255,255,0.18); pointer-events: none; }

.cal-month-btn { background: none; border: none; cursor: pointer; color: inherit; font: inherit; padding: 0; }
.cal-month-label { font-size: 11px; color: var(--text-tertiary); text-align: center; padding: 6px 0 2px; }

.cal-year-input-wrap { display: flex; gap: 6px; align-items: center; margin-top: 10px; }

.cal-year-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
}

.cal-year-input:focus { border-color: rgba(124,106,247,0.5); }

.cal-year-go {
  padding: 6px 12px;
  background: linear-gradient(135deg, #7c6af7, #5b4ee0);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.cal-year-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.cal-year-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.07); }

/* ============================================================
   LOGGING
   ============================================================ */
.log-events-list { display: flex; flex-direction: column; }

.log-event-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border-light);
}

.log-event-row:last-child { border-bottom: none; }

.log-event-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(124,106,247,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.log-event-info { flex: 1; min-width: 0; }
.log-event-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.log-event-desc { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

.log-event-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.log-ch-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-secondary);
}

/* ============================================================
   DROPDOWN
   ============================================================ */
.dd-root {
  position: relative;
  display: block;
  width: auto;
  min-width: 120px;
}

.form-group .dd-root { width: 100%; }
[style*="width:"] .dd-root,
[style*="width: "] .dd-root { width: 100%; }

.dd-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--dash-foreground);
  font-size: 13.5px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  width: 100%;
  justify-content: space-between;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}

.dd-trigger:hover {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
}

.dd-root.open .dd-trigger {
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 2px rgba(124,106,247,0.18);
  background: rgba(255,255,255,0.06);
}

.dd-chevron {
  color: var(--dash-muted-foreground);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  min-width: 16px;
  display: block;
}

.dd-root.open .dd-chevron { transform: rotate(180deg); }
.dd-label { color: var(--dash-foreground); }

.dd-content {
  display: none;
  position: fixed;
  background: var(--dash-muted);
  border: 1px solid rgba(124,106,247,0.2);
  border-radius: 14px;
  z-index: 9999;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  overflow: hidden;
  overflow-y: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dd-content.open { display: block; }

.dd-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 9px 14px;
  font-size: 13.5px;
  color: var(--dash-muted-foreground);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  gap: 8px;
}

.dd-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dd-item:hover {
  background: var(--dash-accent);
  color: var(--dash-foreground);
}

.dd-item.selected { color: var(--dash-primary); }

.dd-check {
  color: var(--dash-primary);
  opacity: 0;
  width: 14px;
  height: 14px;
  min-width: 14px;
  flex-shrink: 0;
  display: block;
  margin-left: auto;
}
.dd-item.selected .dd-check { opacity: 1; }

/* ============================================================
   GLOW CARD (cursor spotlight)
   ============================================================ */
.glowing-effect { position: relative; }

.glowing-effect::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(124,106,247,0.2), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.glowing-effect:hover::after { opacity: 1; }

.glow-spot {
  position: absolute;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(124,106,247,0.11) 0%, transparent 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  border-radius: 50%;
  will-change: left, top;
}

.settings-section > *:not(.glow-spot),
.section-card > *:not(.glow-spot),
.stat-card > *:not(.glow-spot),
.card > *:not(.glow-spot),
.engagement-card > *:not(.glow-spot),
.table-container > *:not(.glow-spot) {
  position: relative;
  z-index: 1;
}

/* ============================================================
   KEYFRAMES
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(18px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.93); pointer-events: none; }
}

@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
/* ── 768px: Sidebar hides, main content takes full width ── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100%;
    z-index: 150;
    transition: left 0.25s var(--ease);
    box-shadow: 6px 0 32px rgba(0,0,0,0.6);
  }
  .sidebar.mobile-open { left: 0; }
  .hamburger-btn { display: flex; }
  .main-content { width: 100%; }
  #content { padding: 20px 16px; }
  .settings-section { max-width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* FakePerms layout stacks */
  .fp-layout { flex-direction: column; }
  .fp-sidebar {
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  /* Embedder: stack preview + settings vertically */
  .emb-outer-grid {
    grid-template-columns: 1fr !important;
  }
  .emb-right-panel {
    position: static !important;
  }

  /* Moderation settings 2-col grids → single col */
  .modsettings-grid {
    grid-template-columns: 1fr !important;
  }

  /* feat108 panel: stack icon below text */
  .feat108-panel {
    flex-direction: column-reverse;
    gap: 20px;
  }
  .feat108-img {
    width: 56px;
    height: 56px;
  }
}

/* ── 600px: Most multi-column form grids stack ── */
@media (max-width: 600px) {
  #content { padding: 16px 12px; }
  .content-header { padding: 0 12px; }
  .stats-grid { grid-template-columns: 1fr; }

  /* Antiraid rule rows — stack controls below the label */
  .ar-rule-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .ar-rule-header > label { width: 100%; }
  .ar-rule-header > div {
    width: 100% !important;
    justify-content: flex-start;
  }
  .ar-rule-header > div select,
  .ar-rule-header > div input { flex: 1; width: auto; }

  /* Autoroles add form — stack all 4 columns */
  .ar-add-grid {
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
  }
  .ar-add-grid .btn-primary { width: 100%; }

  /* Command Restrictions add form — stack 3 columns */
  .cr-add-grid { grid-template-columns: 1fr !important; }

  /* Autopurge add form */
  .ap-add-grid {
    grid-template-columns: 1fr !important;
  }
  .ap-add-grid button {
    width: 100% !important;
    height: auto !important;
  }

  /* Joinable ranks 1fr 300px → single col */
  [style*="grid-template-columns:1fr 300px"] {
    grid-template-columns: 1fr !important;
  }

  /* Changelog 3-col stats → single col */
  .changelog-stats-grid {
    grid-template-columns: 1fr !important;
  }

  /* form-grid-2 */
  .form-grid-2 { grid-template-columns: 1fr !important; }

  /* Premium card — stack icon above text */
  .premium-card {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* Overview time selector: wrap gracefully */
  .time-selector-wrap {
    gap: 8px;
  }
  .time-selector-wrap .time-btns {
    flex-wrap: wrap;
    gap: 4px;
  }

  /* All tables — horizontal scroll */
  .table-container,
  .table-wrapper,
  .settings-section table,
  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  /* Keep thead/tbody as table elements for layout */
  .table-container table,
  .table-wrapper table,
  .data-table { display: table; width: 100%; }

  /* Content header: breadcrumb + refresh button */
  .content-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Settings section headings */
  .settings-section h2 {
    font-size: 15px;
  }

  /* Buttons row in header areas */
  .section-header-actions {
    flex-wrap: wrap;
  }

  /* Logging / starboard select row with inline buttons */
  [style*="display:flex;gap:10px;align-items:flex-end"],
  [style*="display:flex;gap:10px;align-items: flex-end"] {
    flex-wrap: wrap !important;
  }
  [style*="display:flex;gap:10px;align-items:flex-end"] > *,
  [style*="display:flex;gap:10px;align-items: flex-end"] > * {
    min-width: 0;
    flex: 1 1 auto;
  }

  /* Overview engagement chart header */
  .engagement-header {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  /* Automod action row */
  [style*="display:flex;gap:16px;flex-wrap:wrap"] {
    flex-direction: column !important;
  }

  /* Dropdown date picker root: don't overflow */
  .dd-root { width: 100% !important; }

  /* Pre/code blocks — don't overflow */
  pre, code { white-space: pre-wrap !important; word-break: break-all !important; }
}

/* ── 480px: Extra tight phones ── */
@media (max-width: 480px) {
  #content { padding: 12px 10px; }

  /* Stat cards: tighten padding */
  .stat-card { padding: 14px; }

  /* Buttons: full width when alone */
  .btn-primary:only-child,
  .btn-secondary:only-child { width: 100%; }

  /* Settings section padding */
  .settings-section { padding: 16px; }

  /* Page header */
  .page-header h1 { font-size: 18px; }
}

/* ============================================================
   PAGE WRAP
   ============================================================ */
.page-wrap {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ============================================================
   SECTION CARD
   ============================================================ */
.section-card {
  background: var(--dash-card);
  border: 1px solid var(--dash-border);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.section-card:hover {
  border-color: rgba(124,106,247,0.2);
  box-shadow: var(--shadow-hover);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 0;
}

.section-header-text h2,
.section-header-text h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--dash-foreground);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.section-header-text p {
  font-size: 13px;
  color: var(--dash-muted-foreground);
  margin: 0;
  line-height: 1.5;
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}

.section-body { padding: 16px 20px; }

.section-divider {
  height: 1px;
  background: var(--dash-border);
  margin: 0 20px;
}

/* ============================================================
   FORM GRID
   ============================================================ */
.form-grid { display: grid; gap: 14px; }

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.form-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }
.form-counter { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; text-align: right; }

/* ============================================================
   STATUS NOTICES
   ============================================================ */
.notice-success {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 12px;
  font-size: 13px;
  color: var(--success);
}

.notice-warning {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 12px;
  font-size: 13px;
  color: var(--warning);
}

.notice-info {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  background: rgba(124,106,247,0.08);
  border: 1px solid rgba(124,106,247,0.2);
  border-radius: 12px;
  font-size: 13px;
  color: #a899ff;
}

/* ============================================================
   EMPTY STATE (enhanced)
   ============================================================ */
.empty-state-lg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 12px;
  text-align: center;
}

/* Gradient icon backdrop circle — premium vs Greed's flat opacity */
.empty-state-lg svg {
  width: 44px;
  height: 44px;
  opacity: 0.35;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 16px rgba(124,106,247,0.3));
}

.empty-state-lg .es-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(232,237,255,0.4);
  margin: 0;
}

.empty-state-lg .es-sub {
  font-size: 12px;
  color: rgba(232,237,255,0.22);
  margin: 0;
}

/* ============================================================
   MODAL OVERLAY
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,5,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: linear-gradient(145deg, #0F1526 0%, #0C1020 100%);
  border: 1px solid rgba(124,106,247,0.18);
  border-radius: 18px;
  padding: 0;
  width: min(530px, 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-modal);
  animation: modalIn 0.2s cubic-bezier(0.34,1.3,0.64,1);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 0;
  gap: 12px;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.modal-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.modal-close {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}

.modal-msg { font-size: 12px; flex: 1; }

/* ============================================================
   PREMIUM CARD
   ============================================================ */
.premium-card {
  background: linear-gradient(135deg, rgba(124,106,247,0.1), rgba(80,65,210,0.05));
  border: 1px solid rgba(124,106,247,0.25);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.premium-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(124,106,247,0.12) 0%, transparent 65%);
  pointer-events: none;
}

.premium-icon {
  width: 42px;
  height: 42px;
  background: rgba(124,106,247,0.18);
  border: 1px solid rgba(124,106,247,0.3);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #A99DFF;
}

.premium-text h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 5px;
  background: linear-gradient(135deg, #E8EDFF, #A99DFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.premium-text p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0 0 14px;
}

.premium-actions { display: flex; gap: 8px; }

.btn-premium {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  background: linear-gradient(135deg, #7c6af7, #5b4ee0);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
  box-shadow: 0 2px 12px rgba(124,106,247,0.4);
}

.btn-premium:hover {
  box-shadow: 0 4px 20px rgba(124,106,247,0.6);
  transform: translateY(-1px);
}

/* ============================================================
   SAVE ROW
   ============================================================ */
.save-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.save-msg { font-size: 12px; opacity: 0; transition: opacity 0.2s; }
.save-msg.show { opacity: 1; }
.save-msg.ok   { color: var(--success); }
.save-msg.err  { color: var(--danger); }

/* ============================================================
   SECTION TABS
   ============================================================ */
.section-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: relative;
}

.section-tab {
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  position: relative;
  z-index: 1;
}

.section-tab:hover { color: var(--text-secondary); }

.section-tab.active {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: transparent;
}

/* Vercel-style sliding tab indicator */
.vtab-hover-pill {
  position: absolute;
  height: 28px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  top: 50%;
  transform: translateY(-60%);
  transition: left 0.2s ease, width 0.2s ease, opacity 0.15s ease;
  z-index: 0;
}

.vtab-indicator {
  position: absolute;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, #7c6af7, #5b4ee0);
  border-radius: 2px 2px 0 0;
  pointer-events: none;
  transition: left 0.25s cubic-bezier(0.4,0,0.2,1), width 0.25s cubic-bezier(0.4,0,0.2,1), opacity 0.2s ease;
  z-index: 2;
}

/* ============================================================
   TOGGLE ROW
   ============================================================ */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.toggle-row:last-child { border-bottom: none; }

.toggle-row-text h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 3px;
}

.toggle-row-text p {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.55;
}

/* ============================================================
   REMOVE BUTTON
   ============================================================ */
.btn-remove {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

.btn-remove:hover {
  background: rgba(248,113,113,0.16);
  border-color: rgba(248,113,113,0.35);
}

/* ============================================================
   INLINE CODE
   ============================================================ */
code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(124,106,247,0.1);
  border: 1px solid rgba(124,106,247,0.18);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  color: #A99DFF;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  background: rgba(12,16,32,0.92);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.06) inset;
  animation: toastIn 0.22s cubic-bezier(0.34,1.56,0.64,1), toastOut 0.2s ease 2.8s forwards;
  pointer-events: all;
  min-width: 230px;
  max-width: 360px;
}

.toast.toast-ok {
  border-left: 3px solid var(--success);
  background: rgba(7,20,16,0.95);
}

.toast.toast-err {
  border-left: 3px solid var(--danger);
  background: rgba(20,7,7,0.95);
}

.toast.toast-info {
  border-left: 3px solid var(--accent);
  background: rgba(10,8,28,0.95);
}

.toast.toast-warn {
  border-left: 3px solid #f59e0b;
  background: rgba(20,16,4,0.95);
}

/* ============================================================
   BUTTON RIPPLE
   ============================================================ */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  animation: rippleAnim 0.55s linear;
  pointer-events: none;
}

/* ============================================================
   BADGE SYSTEM (full set)
   ============================================================ */
.badge-lg { font-size: 12px; padding: 4px 12px; }
.badge-md { font-size: 11px; padding: 3px 9px; }
.badge-sm { font-size: 10px; padding: 2px 8px; }
.badge-xs { font-size: 10px; padding: 1px 7px; letter-spacing: 0.03em; }

.badge-primary {
  background: rgba(124,106,247,0.16);
  color: #A99DFF;
  border: 1px solid rgba(124,106,247,0.32);
}
.badge-success {
  background: rgba(52,211,153,0.12);
  color: #34D399;
  border: 1px solid rgba(52,211,153,0.28);
}
.badge-warning {
  background: rgba(251,191,36,0.12);
  color: #FBBF24;
  border: 1px solid rgba(251,191,36,0.28);
}
.badge-info {
  background: rgba(96,165,250,0.13);
  color: #60A5FA;
  border: 1px solid rgba(96,165,250,0.28);
}
.badge-danger {
  background: rgba(248,113,113,0.12);
  color: #FCA5A5;
  border: 1px solid rgba(248,113,113,0.28);
}
.badge-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.badge-success-light {
  background: rgba(52,211,153,0.07);
  color: #34D399;
  border: 1px solid rgba(52,211,153,0.16);
}
.badge-primary-light {
  background: rgba(124,106,247,0.08);
  color: var(--accent);
  border: 1px solid rgba(124,106,247,0.18);
}
.badge-warning-light {
  background: rgba(251,191,36,0.07);
  color: #FBBF24;
  border: 1px solid rgba(251,191,36,0.16);
}
.badge-info-light {
  background: rgba(96,165,250,0.07);
  color: #60A5FA;
  border: 1px solid rgba(96,165,250,0.16);
}

.badge-circle {
  border-radius: 50%;
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   USER DROPDOWN
   ============================================================ */
.user-dropdown { position: relative; }

.user-dropdown.open .user-chevron { transform: rotate(180deg); }

.user-dropdown-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--dash-muted);
  border: 1px solid rgba(124,106,247,0.2);
  border-radius: 14px;
  z-index: 300;
  overflow: hidden;
  box-shadow: 0 -12px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.user-dropdown.open .user-dropdown-menu { display: block; }

.user-dd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  font-size: 13px;
  color: var(--dash-muted-foreground);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}

.user-dd-item:hover {
  background: var(--dash-accent);
  color: var(--dash-foreground);
}

.user-dd-signout:hover {
  color: var(--danger);
  background: rgba(239,68,68,0.08);
}

/* ============================================================
   ACTIVITY LOGS TABLE
   ============================================================ */
.logs-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.logs-search-wrap {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.logs-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.logs-search {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 7px 10px 7px 32px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}
.logs-search:focus { border-color: rgba(124,106,247,0.5); }
.logs-search::placeholder { color: rgba(255,255,255,0.2); }

.logs-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.logs-filter-btn:hover,
.logs-filter-btn.active {
  border-color: rgba(124,106,247,0.38);
  background: rgba(124,106,247,0.08);
  color: var(--text-primary);
}

.logs-table-body { display: flex; flex-direction: column; }

.log-row {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background 0.12s ease;
}
.log-row:last-child { border-bottom: none; }
.log-row:hover .log-row-main { background: rgba(124,106,247,0.05); }

.log-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  transition: background 0.12s ease;
}

.log-row-expand {
  padding: 0 20px 12px 60px;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  line-height: 1.65;
  display: none;
  animation: fadeIn 0.18s ease;
  background: rgba(124,106,247,0.03);
  border-top: 1px solid rgba(255,255,255,0.03);
}
.log-row.expanded .log-row-expand { display: block; }

.log-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.log-row.expanded .log-chevron { transform: rotate(90deg); }

.log-time {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
  width: 70px;
}

.log-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  width: 46px;
}
.log-level-info  { background: rgba(96,165,250,0.13); color: #60A5FA; border: 1px solid rgba(96,165,250,0.24); }
.log-level-warn  { background: rgba(251,191,36,0.12); color: #FBBF24; border: 1px solid rgba(251,191,36,0.24); }
.log-level-error { background: rgba(248,113,113,0.12); color: #FCA5A5; border: 1px solid rgba(248,113,113,0.24); }
.log-level-debug { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.32); border: 1px solid rgba(255,255,255,0.08); }

.log-service {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-message {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-row.expanded .log-message { white-space: normal; overflow: visible; }

/* ============================================================
   FEATURE TABS (overview)
   ============================================================ */
.feat108-wrap { margin-top: 28px; }

.feat108-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.feat108-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  letter-spacing: 0.01em;
}

.feat108-tab:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.12);
}

.feat108-tab.active {
  background: rgba(124,106,247,0.14);
  border-color: rgba(124,106,247,0.38);
  color: #D4CFFF;
  box-shadow: 0 0 16px rgba(124,106,247,0.22);
}

.feat108-panel {
  display: none;
  align-items: center;
  gap: 32px;
  background: linear-gradient(145deg, var(--dash-card), var(--dash-secondary));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  padding: 32px;
  min-height: 160px;
}

.feat108-panel.active { display: flex; }

.feat108-content { flex: 1; }

.feat108-content-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #A89DFF;
  background: rgba(124,106,247,0.15);
  border: 1px solid rgba(124,106,247,0.3);
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 12px;
}

.feat108-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.feat108-content p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.feat108-img {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124,106,247,0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(124,106,247,0.2);
}

.feat108-img svg {
  width: 36px;
  height: 36px;
  color: #A89DFF;
  flex-shrink: 0;
}

/* ============================================================
   PULSE ANIMATION (active/live status)
   ============================================================ */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-active {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(52,211,153,0.25);
  animation: pulse 2s ease-in-out infinite;
}

.status-dot-inactive {
  background: var(--text-tertiary);
}
