/* =====================================================================
   CURSESTUDIO GUARD - ULTRA PREMIUM OBSIDIAN GLASS DESIGN SYSTEM
   ===================================================================== */

:root {
  --bg-primary: #07090e;
  --bg-secondary: #0c1017;
  --bg-card: rgba(14, 19, 29, 0.75);
  --bg-card-hover: rgba(20, 27, 41, 0.85);
  --bg-card-active: rgba(28, 37, 56, 0.95);

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(239, 68, 68, 0.35);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.4);
  --accent-red-dim: rgba(239, 68, 68, 0.12);

  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.3);
  --accent-cyan-dim: rgba(6, 182, 212, 0.12);

  --accent-emerald: #10b981;
  --accent-emerald-dim: rgba(16, 185, 129, 0.12);

  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Geist Mono", Menlo, Consolas, monospace;

  --shadow-panel: 0 16px 36px -8px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-subtle);
  --shadow-modal: 0 24px 60px -12px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--border-medium);
}

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

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

/* Background Gradients & Grid */
.bg-grid-overlay {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}

.glow-red {
  width: 500px;
  height: 500px;
  background: var(--accent-red);
  top: -100px;
  left: 20%;
}

.glow-cyan {
  width: 600px;
  height: 600px;
  background: var(--accent-cyan);
  bottom: -150px;
  right: 15%;
}

/* App Layout */
.app-layout {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Glass Panel Base */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* =====================================================================
   HEADER
   ===================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
  border: 1px solid rgba(239, 68, 68, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-red);
  box-shadow: 0 0 16px var(--accent-red-glow);
}

.logo-shield {
  width: 24px;
  height: 24px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
}

.brand-title span {
  color: var(--accent-red);
}

.brand-badge {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.server-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  padding-left: 16px;
  border-left: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

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

.status-online {
  background: var(--accent-emerald-dim);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.status-online .status-dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px #10b981;
}

.status-standby {
  background: var(--accent-amber-dim);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}
.status-standby .status-dot {
  background: var(--accent-amber);
  box-shadow: 0 0 8px #f59e0b;
}

.status-offline {
  background: var(--accent-red-dim);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.status-offline .status-dot {
  background: var(--accent-red);
  box-shadow: 0 0 8px #ef4444;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border-subtle);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-red), #b91c1c);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

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

/* =====================================================================
   NAV DOCK
   ===================================================================== */
.nav-dock {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  overflow-x: auto;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.nav-tab svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-tab.active {
  background: rgba(239, 68, 68, 0.15);
  color: #fff;
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}

.nav-tab.active svg {
  color: var(--accent-red);
  opacity: 1;
}

.tab-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* =====================================================================
   TABS & CONTENT SECTIONS
   ===================================================================== */
.content-tab {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.25s ease-out forwards;
}

.content-tab.active {
  display: flex;
}

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

.section-card {
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.card-title-group h2, .card-title-group h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.card-red::after { background: var(--accent-red); }
.card-amber::after { background: var(--accent-amber); }
.card-cyan::after { background: var(--accent-cyan); }
.card-emerald::after { background: var(--accent-emerald); }

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

.stat-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.icon-red { background: var(--accent-red-dim); color: var(--accent-red); border: 1px solid rgba(239, 68, 68, 0.3); }
.icon-amber { background: var(--accent-amber-dim); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.icon-cyan { background: var(--accent-cyan-dim); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.3); }
.icon-emerald { background: var(--accent-emerald-dim); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }

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

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

.stat-value {
  font-size: 2.1rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  line-height: 1.1;
  margin: 4px 0 2px;
}

.stat-sub {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
}

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

/* Two Columns */
.dash-columns {
  display: flex;
  gap: 20px;
}

.dash-card {
  padding: 24px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* System Health List */
.system-health-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.health-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
}

.health-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quick-actions-box {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.quick-actions-box h4 {
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 12px;
}

.btn-group-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =====================================================================
   TABLES
   ===================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(10, 14, 23, 0.5);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.data-table th {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.incident-row td {
  background: rgba(239, 68, 68, 0.05);
}

.incident-row:hover td {
  background: rgba(239, 68, 68, 0.09) !important;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-danger {
  background: var(--accent-red-dim);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.badge-amber {
  background: var(--accent-amber-dim);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-cyan {
  background: var(--accent-cyan-dim);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.badge-emerald, .badge-success {
  background: var(--accent-emerald-dim);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-info {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.code-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
}

/* =====================================================================
   BUTTONS & INPUTS
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f87171, #ef4444);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

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

.btn-block {
  width: 100%;
}

/* Inputs & Form Controls */
.dropdown-select, .search-input, input[type="text"], input[type="password"], input[type="number"] {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dropdown-select:focus, .search-input:focus, input:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.full-width {
  width: 100%;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.checkbox-wrap {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-wrap label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pagination-buttons {
  display: flex;
  gap: 8px;
}

/* =====================================================================
   SETTINGS GRID & SWITCHES
   ===================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.settings-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.col-span-2 {
  grid-column: span 2;
}

.col-span-all {
  grid-column: 1 / -1;
}

.setting-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
}

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

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

/* iOS Style Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: 34px;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-medium);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:checked + .slider {
  background-color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 12px var(--accent-red-glow);
}

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

/* Range Sliders */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-with-val {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.range-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-red);
}

.range-input {
  width: 100%;
  accent-color: var(--accent-red);
  cursor: pointer;
}

.field-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.thresholds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.threshold-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
}

.threshold-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.num-input {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

/* =====================================================================
   SNAPSHOTS & WHITELIST GRIDS
   ===================================================================== */
.snapshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.snapshot-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  border-left: 3px solid var(--accent-cyan);
}

.snapshot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.snapshot-id {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.snapshot-meta-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.snapshot-footer {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Whitelist Boxes */
.whitelist-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.whitelist-box {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.whitelist-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trusted-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
}

.trusted-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #e2e8f0;
}

.tag-remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.guild-trusted-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.guild-trusted-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Guild Cards Grid */
.guilds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.guild-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guild-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.guild-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
}

.guild-icon-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(6, 182, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent-cyan);
}

.guild-info h4 {
  font-size: 1.05rem;
  color: #fff;
  font-weight: 700;
}

.permissions-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  font-size: 0.74rem;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
}

.perm-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
}

.perm-item.granted {
  color: #34d399;
}

.perm-item.missing {
  color: #f87171;
}

/* =====================================================================
   MODALS
   ===================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: modalScale 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes modalScale {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-md { max-width: 480px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover { color: #fff; }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
}

/* Auth Modal Specifics */
.auth-card {
  max-width: 400px;
  width: 100%;
  padding: 32px;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.shield-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-red-dim);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--accent-red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 0 24px var(--accent-red-glow);
}

.shield-icon { width: 32px; height: 32px; }

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
}

.input-wrap input {
  padding-left: 38px;
  width: 100%;
}

.auth-hint {
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 8px;
}

.error-banner {
  background: var(--accent-red-dim);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

/* Detail Grid & JSON Viewer */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
}

.detail-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.detail-val {
  font-weight: 600;
  color: #fff;
  font-size: 0.88rem;
}

.json-viewer-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.json-header {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.json-code {
  background: #05070a;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #38bdf8;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Snapshot Tree Modal */
.snapshot-tree-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.tree-tab {
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.tree-tab.active {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.snapshot-tab-content {
  display: none;
}

.snapshot-tab-content.active {
  display: block;
}

.channels-tree, .roles-tree {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.tree-category {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
  color: #fff;
  margin-top: 8px;
}

/* =====================================================================
   TOAST NOTIFICATIONS
   ===================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.85rem;
  color: #fff;
  animation: toastSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast-success { border-color: rgba(16, 185, 129, 0.5); }
.toast-error { border-color: rgba(239, 68, 68, 0.5); }
.toast-info { border-color: rgba(6, 182, 212, 0.5); }

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

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1024px) {
  .dash-columns {
    flex-direction: column;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .col-span-2 {
    grid-column: span 1;
  }
  .whitelist-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .nav-dock {
    justify-content: flex-start;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
