/* ==========================================================================
   🔥 PYROS BOT — COMMAND DASHBOARD DESIGN SYSTEM
   Modern Dark Theme with Glassmorphism, Micro-Interactions & Responsive Grid
   ========================================================================== */

:root {
  --bg-primary: #090c10;
  --bg-secondary: #0f141c;
  --bg-tertiary: #161e2b;
  --bg-card: rgba(22, 30, 43, 0.7);
  --bg-glass: rgba(18, 24, 36, 0.65);
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(99, 102, 241, 0.5);
  --border-glow: rgba(99, 102, 241, 0.25);

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --accent-flame: linear-gradient(135deg, #ff4d4d 0%, #f97316 50%, #eab308 100%);

  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --purple: #a855f7;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Ambient glow blobs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}
.glow-1 {
  width: 500px;
  height: 500px;
  background: #6366f1;
  top: -150px;
  left: -100px;
}
.glow-2 {
  width: 600px;
  height: 600px;
  background: #a855f7;
  bottom: -200px;
  right: -150px;
}
.glow-3 {
  width: 350px;
  height: 350px;
  background: #f97316;
  top: 40%;
  left: 30%;
  opacity: 0.08;
}

/* ── App Header ──────────────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(9, 12, 16, 0.82);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.9rem;
  filter: drop-shadow(0 0 12px rgba(249, 115, 22, 0.6));
  animation: flameBounce 3s ease-in-out infinite;
}

@keyframes flameBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: var(--accent-flame);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald);
}

.status-dot.pulsing {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--emerald);
}

.metric-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.metric-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Form Controls ───────────────────────────────────────────────────────── */
.custom-select, .custom-input, .custom-textarea {
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  outline: none;
}

.custom-select:focus, .custom-input:focus, .custom-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.guild-select-wrapper select {
  min-width: 220px;
  cursor: pointer;
  background-color: var(--bg-tertiary);
  font-weight: 500;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #1f2a3d;
  border-color: var(--border-focus);
}

/* ── App Layout ──────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: calc(100vh - 65px);
  position: relative;
  z-index: 1;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.app-sidebar {
  width: 260px;
  background: rgba(15, 20, 28, 0.8);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1rem;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  width: 100%;
}

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

.nav-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-weight: 600;
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.15);
}

.nav-icon {
  font-size: 1.15rem;
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.bot-card-mini {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
}

.bot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid var(--border-subtle);
}

.bot-details {
  display: flex;
  flex-direction: column;
}

.bot-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.bot-version {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Main Content Pane ───────────────────────────────────────────────────── */
.app-content {
  flex: 1;
  padding: 2rem 3rem;
  overflow-y: auto;
  max-width: 1380px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-pane.active {
  display: block;
}

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

.pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1.5rem;
}

.pane-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pane-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* ── KPI Stat Cards ──────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
}

.stat-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.stat-icon-wrapper.purple { background: rgba(168, 85, 247, 0.15); color: var(--purple); }
.stat-icon-wrapper.emerald { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.stat-icon-wrapper.amber { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.stat-icon-wrapper.rose { background: rgba(244, 63, 94, 0.15); color: var(--rose); }

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

/* ── Section Cards ───────────────────────────────────────────────────────── */
.card-section {
  margin-top: 2rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.guilds-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.guild-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.guild-card:hover {
  background: var(--bg-secondary);
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.guild-card.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.08);
}

.guild-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 56px;
}

.guild-card-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  max-width: 56px;
  min-height: 56px;
  max-height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-subtle);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.guild-card-icon-placeholder {
  width: 56px;
  height: 56px;
  min-width: 56px;
  max-width: 56px;
  min-height: 56px;
  max-height: 56px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.guild-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
}

.guild-card-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guild-card-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

.guild-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.5rem;
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.guild-card-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-k {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.stat-v {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Form Grids & Cards ──────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
}

.form-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(12px);
}

.form-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Toggle Switch ───────────────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.toggle-info {
  display: flex;
  flex-direction: column;
}

.toggle-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.toggle-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* ── Chips ───────────────────────────────────────────────────────────────── */
.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
}

.chip-remove {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.chip-remove:hover {
  color: var(--rose);
}

.chip-input-group {
  display: flex;
  gap: 0.5rem;
}

.placeholder-chips {
  display: flex;
  gap: 0.4rem;
}

.btn-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--accent-primary);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
}

/* ── Item Lists (Departments, Announcements, Stream Alerts, Tags) ───────── */
.item-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}
.item-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}
.item-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.item-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.item-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.btn-danger-sm {
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-danger-sm:hover {
  background: var(--rose);
  color: white;
}
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}
.form-row-inline {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.empty-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.75rem 0;
}

/* ── JSON Viewer ─────────────────────────────────────────────────────────── */
.json-viewer {
  background: #080b0f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: #38bdf8;
  max-height: 600px;
  overflow: auto;
}

/* ── Toasts ──────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-color: rgba(16, 185, 129, 0.5); color: #6ee7b7; }
.toast.error { border-color: rgba(244, 63, 94, 0.5); color: #fda4af; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-layout { flex-direction: column; }
  .app-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .app-content { padding: 1.5rem; }
  .header-right .metric-pill { display: none; }
}

/* ── OAuth Login & Unauthorized Overlays ─────────────────────────────────── */
.login-overlay, .unauthorized-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(239, 68, 68, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.login-brand {
  text-align: center;
}

.login-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

.login-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: center;
}

.login-desc {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.login-error-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.btn-discord-login {
  background: #5865F2;
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.35);
}

.btn-discord-login:hover {
  background: #4752c4;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

.oauth-hint-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.75rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.oauth-hint-label {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.oauth-code-uri {
  color: #38bdf8;
  font-family: monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
  word-break: break-all;
  user-select: all;
}


.login-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* ── Header User Profile Pill ────────────────────────────────────────────── */
.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.75rem 0.3rem 0.4rem;
}

.user-profile-pill .user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.user-profile-pill .user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-profile-pill .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-pill .user-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #38bdf8;
}

.user-profile-pill .user-badge.dev {
  color: #f59e0b;
}

.btn-logout {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.2rem 0.35rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  text-decoration: none;
  line-height: 1;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ── Whitelist & Access Control Management UI ────────────────────────────── */
.form-card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.server-owner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
}

.server-owner-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.owner-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #f59e0b;
}

.owner-rank {
  font-size: 0.75rem;
  font-weight: 700;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.owner-username {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.owner-perm-tag {
  font-size: 0.75rem;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.whitelist-section-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.whitelist-block-header {
  margin-bottom: 0.85rem;
}

.whitelist-block-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.whitelist-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.whitelist-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  transition: border-color 0.2s;
}

.whitelist-user-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.whitelist-user-details {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow: hidden;
}

.whitelist-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.whitelist-user-name-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.whitelist-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whitelist-userid {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: monospace;
}

.btn-remove-whitelist {
  background: transparent;
  border: none;
  color: #f87171;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.btn-remove-whitelist:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.whitelist-roles-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.whitelist-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem 0.35rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.role-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.role-badge-name {
  color: var(--text-primary);
}

.role-badge-count {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.add-whitelist-control {
  display: flex;
  gap: 0.65rem;
}

.add-whitelist-control .custom-input,
.add-whitelist-control .custom-select {
  flex: 1;
}

.whitelist-empty-state {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.5rem 0;
}

/* ==========================================================================
   🔐 AUTHENTICATION & LOGIN OVERLAYS
   ========================================================================== */

.login-overlay,
.unauthorized-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(9, 12, 16, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease-out forwards;
}

.login-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-flame);
}

.login-brand {
  text-align: center;
}

.login-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 16px rgba(249, 115, 22, 0.5));
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.login-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: center;
}

.login-error-banner {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
}

.btn-discord-login {
  background: #5865f2;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35);
  cursor: pointer;
  border: none;
  width: 100%;
}

.btn-discord-login:hover {
  background: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

/* OAuth Status Box */
.oauth-status-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.oauth-unregistered-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.badge-status-err {
  background: rgba(244, 63, 94, 0.2);
  color: #f87171;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-block;
}

.badge-status-ok {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-block;
}

.oauth-box-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.uri-copy-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.oauth-code-uri {
  flex: 1;
  font-family: monospace;
  font-size: 0.8rem;
  color: #93c5fd;
  word-break: break-all;
}

.btn-copy {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.16);
}

.oauth-steps {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.portal-direct-link {
  color: #818cf8;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-direct-link:hover {
  color: #a5b4fc;
}

.step-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.oauth-registered-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Divider */
.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 0.5rem 0;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.login-divider span {
  padding: 0 0.75rem;
}

/* Developer Password Login */
.dev-login-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dev-password-card {
  background: rgba(15, 20, 28, 0.7);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dev-password-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.dev-icon {
  font-size: 1rem;
}

.dev-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fde047;
  letter-spacing: 0.02em;
}

.dev-password-row {
  display: flex;
  gap: 0.5rem;
}

.dev-password-row .custom-input {
  flex: 1;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}

.dev-password-row .custom-input:focus {
  border-color: #fde047;
  outline: none;
  box-shadow: 0 0 10px rgba(253, 224, 71, 0.25);
}

.dev-password-error {
  color: #f87171;
  font-size: 0.78rem;
  font-weight: 500;
  padding-left: 0.2rem;
}

/* User Profile Header Pill & Logout Button */
.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.85rem 0.35rem 0.5rem;
  border-radius: var(--radius-full);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-subtle);
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.user-badge.dev {
  color: #fde047;
  font-weight: 700;
}

.btn-logout-action {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  margin-left: 0.3rem;
}

.btn-logout-action:hover {
  background: rgba(244, 63, 94, 0.3);
  border-color: #f43f5e;
  color: #ffffff;
  transform: translateY(-1px);
}

.login-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   ☢️ EMERGENCY NUKE & DANGER MODAL
   ========================================================================== */

.nav-danger-tab {
  color: #f87171 !important;
  border-left: 3px solid transparent;
}

.nav-danger-tab:hover,
.nav-danger-tab.active {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  border-left-color: #ef4444 !important;
}

.text-danger {
  color: #f87171 !important;
}

.badge-danger-glow {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.nuke-warning-card {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(153, 27, 27, 0.25) 100%);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.15);
}

.nuke-warning-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.nuke-warning-title {
  color: #fca5a5;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
}

.nuke-warning-desc {
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.nuke-target-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.snapshot-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.snapshot-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.snapshot-val {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.nuke-confirmation-container {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.nuke-confirm-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.nuke-confirm-text {
  font-size: 0.92rem;
  color: #fca5a5;
  line-height: 1.4;
}

.btn-danger-nuke {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  padding: 0.9rem 2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-danger-nuke:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(239, 68, 68, 0.6);
}

.btn-danger-nuke:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
  box-shadow: none;
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-danger {
  border-color: rgba(239, 68, 68, 0.4);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-icon {
  font-size: 1.6rem;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ef4444;
  font-family: var(--font-display);
}

.modal-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-danger-subtext {
  color: #f87171;
  font-weight: 600;
  font-size: 0.88rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-danger-solid {
  background: #ef4444;
  color: #ffffff;
  border: none;
  font-weight: 700;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger-solid:hover {
  background: #dc2626;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

/* Discord Live Embed Preview in Dashboard */
.nuke-preview-wrapper {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.preview-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.discord-embed-preview {
  background: #2b2d31;
  border-radius: 4px;
  display: flex;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.preview-stripe {
  width: 4px;
  background: #ff0033;
  flex-shrink: 0;
}

.preview-content {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.preview-header {
  font-size: 1rem;
  font-weight: 700;
  color: #f2f3f5;
  margin: 0;
}

.preview-notice-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #dbdee1;
  margin: 0 0 0.3rem 0;
}

.preview-quote {
  border-left: 4px solid #4e5058;
  padding-left: 0.75rem;
  margin: 0;
  color: #dbdee1;
  font-size: 0.9rem;
}

.preview-reason {
  color: #949ba4;
  font-size: 0.85rem;
  margin: 0.4rem 0 0 0;
}

.preview-footer {
  font-size: 0.75rem;
  color: #949ba4;
  margin-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.4rem;
}




