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

/* ── Design Tokens ──────────────────────────────────────────────────────────── */
:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --elevated: #1c1c1c;
  --border: #2a2a2a;
  --text: #f0f0f0;
  --text-muted: #777;
  --text-dim: #444;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #eab308;
  --info: #3b82f6;
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 240px;
  --sidebar-collapsed: 56px;
  --transition: 200ms ease;
  --font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* ── Base ───────────────────────────────────────────────────────────────────── */
html { height: 100%; }

body {
  display: flex;
  height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width var(--transition);
  flex-shrink: 0;
  overflow: hidden;
  z-index: 50;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  min-height: 57px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-logo-text {
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  transition: opacity var(--transition);
}

.sidebar-logo-text em {
  font-style: normal;
  color: var(--accent);
}

.collapsed .sidebar-logo-text,
.collapsed .guild-selector-label,
.collapsed .nav-label,
.collapsed .sidebar-user-name,
.collapsed .sidebar-user-tag {
  opacity: 0;
  width: 0;
  pointer-events: none;
}

.collapse-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.collapse-btn:hover {
  background: var(--elevated);
  color: var(--text);
}

/* Guild selector */
.guild-selector {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background var(--transition);
  min-height: 52px;
  overflow: hidden;
  white-space: nowrap;
}

.guild-selector:hover { background: var(--elevated); }

.guild-selector-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--elevated);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  overflow: hidden;
}

.guild-selector-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.guild-selector-label {
  flex: 1;
  overflow: hidden;
}

.guild-selector-name {
  font-family: var(--font);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guild-selector-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 8px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}

.collapsed .nav-section-label {
  opacity: 0;
  height: 0;
  padding: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--elevated);
  color: var(--text);
}

.nav-item.active {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent);
  border-left: 2px solid var(--accent);
  padding-left: 8px;
}

.nav-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.nav-label {
  transition: opacity var(--transition), width var(--transition);
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 8px;
}

.sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(var(--sidebar-collapsed) + 8px);
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 100;
}

.sidebar.collapsed .nav-item:hover::after {
  opacity: 1;
}

/* Sidebar user */
.sidebar-user {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--elevated);
  object-fit: cover;
}

.sidebar-user-name {
  font-family: var(--font);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.sidebar-user-tag {
  font-size: 10px;
  color: var(--text-muted);
}

.sidebar-user-logout {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
  background: none;
  border: none;
  transition: color var(--transition);
}

.sidebar-user-logout:hover { color: var(--danger); }

/* ── Main Content ────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.content {
  flex: 1;
  padding: 28px 32px;
  max-width: 1200px;
  width: 100%;
}

/* ── Page Header ─────────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 13px;
}

.page-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

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

.card-title {
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
}

/* Stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-value {
  font-family: var(--font);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-trend {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  background: var(--surface);
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.table tbody tr {
  background: var(--surface);
  transition: background var(--transition);
}

.table tbody tr:hover { background: var(--elevated); }

/* ── Form Elements ───────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-family: var(--font);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.input,
.select,
.textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 12px;
  transition: border-color var(--transition);
  outline: none;
  appearance: none;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
}

.input::placeholder,
.textarea::placeholder { color: var(--text-dim); }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23777' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.input-row .form-group { flex: 1; margin-bottom: 0; }

/* Number input */
input[type="number"].input::-webkit-inner-spin-button,
input[type="number"].input::-webkit-outer-spin-button {
  opacity: 0.5;
}

/* Range slider */
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.slider-value {
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  min-width: 36px;
  text-align: center;
}

/* Color input */
input[type="color"].color-input {
  width: 40px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
}

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

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

.toggle-info {}

.toggle-info .toggle-name {
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
}

.toggle-info .toggle-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle input:checked + .toggle-track {
  background: var(--success);
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(18px);
}

/* Module toggles grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.module-toggle-card {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.module-toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-icon { font-size: 18px; }

.module-name {
  font-family: var(--font);
  font-weight: 600;
  font-size: 13px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: background var(--transition), opacity var(--transition), transform var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); opacity: 1; }

.btn-secondary {
  background: var(--elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); opacity: 1; }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--elevated); opacity: 1; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius);
}

/* ── Badges ───────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-warning { background: rgba(234,179,8,0.15); color: var(--warning); }
.badge-info { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-accent { background: rgba(245,158,11,0.15); color: var(--accent); }
.badge-muted { background: var(--elevated); color: var(--text-muted); }

/* ── Modals ───────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
  animation: fadeIn 150ms ease;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 200ms ease;
}

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

.modal-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
}

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

.modal-close:hover { color: var(--text); }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

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

/* ── Skeleton Loading ─────────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--elevated) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
  display: block;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 22px; margin-bottom: 12px; width: 60%; }
.skeleton-card { height: 90px; margin-bottom: 12px; border-radius: var(--radius-lg); }

/* ── Toast Notifications ──────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  min-width: 240px;
  max-width: 380px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: slideInRight 250ms ease;
  transition: opacity 250ms ease, transform 250ms ease;
}

.toast.hide {
  opacity: 0;
  transform: translateX(16px);
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--accent); }

.toast-icon { font-size: 16px; }
.toast-msg { flex: 1; }

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

/* ── Tag Input ────────────────────────────────────────────────────────────────── */
.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 40px;
  cursor: text;
  transition: border-color var(--transition);
}

.tag-input-wrap:focus-within { border-color: var(--accent); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text);
}

.tag-remove {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  background: none;
  border: none;
  padding: 0;
}

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

.tag-input-field {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  min-width: 80px;
  flex: 1;
}

/* ── Multi-select ─────────────────────────────────────────────────────────────── */
.multi-select {
  position: relative;
}

.multi-select-trigger {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 30px 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 40px;
  transition: border-color var(--transition);
  position: relative;
}

.multi-select-trigger:focus,
.multi-select-trigger.open { border-color: var(--accent); }

.multi-select-trigger::after {
  content: '▾';
  position: absolute;
  right: 10px;
  color: var(--text-muted);
  font-size: 11px;
}

.multi-select-placeholder { color: var(--text-dim); font-size: 13px; }

.multi-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.multi-select-dropdown.open { display: block; }

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: background var(--transition);
}

.multi-select-option:hover { background: var(--surface); }
.multi-select-option.selected { color: var(--accent); }

/* ── Section dividers ─────────────────────────────────────────────────────────── */
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.section-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ── Charts ───────────────────────────────────────────────────────────────────── */
.chart-wrap {
  position: relative;
  width: 100%;
}

/* ── Server cards (server selector page) ─────────────────────────────────────── */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.server-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  transition: border-color var(--transition), transform var(--transition);
}

.server-card:hover {
  border-color: rgba(245,158,11,0.3);
  transform: translateY(-2px);
}

.server-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-muted);
  overflow: hidden;
}

.server-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

.server-card-name {
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
}

.server-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Danger zone ──────────────────────────────────────────────────────────────── */
.danger-zone {
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-top: 24px;
}

.danger-zone-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 8px;
}

/* ── Pagination ───────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.page-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.page-btn:hover,
.page-btn.active {
  background: var(--elevated);
  color: var(--text);
}

.page-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Premium card ─────────────────────────────────────────────────────────────── */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plan-card.highlighted {
  border-color: var(--accent);
  background: rgba(245,158,11,0.04);
}

.plan-name {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.plan-highlighted .plan-name { color: var(--accent); }

.plan-price {
  font-family: var(--font);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.plan-price span { font-size: 14px; color: var(--text-muted); font-weight: 400; }

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.plan-features li.has { color: var(--text); }
.plan-features li::before { content: '✓'; color: var(--success); font-weight: 700; }
.plan-features li.no::before { content: '×'; color: var(--text-dim); }

/* ── Empty states ─────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 40px; margin-bottom: 12px; }

.empty-state h3 {
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state p { font-size: 13px; }

/* ── Variable chips ───────────────────────────────────────────────────────────── */
.variable-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.var-chip {
  padding: 2px 8px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
  color: var(--accent);
  cursor: pointer;
  transition: background var(--transition);
}

.var-chip:hover { background: rgba(245,158,11,0.2); }

/* ── Warning escalation table ─────────────────────────────────────────────────── */
.escalation-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.escalation-row .input { max-width: 80px; }

/* ── Spinner ──────────────────────────────────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

.spinner-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
}

/* ── Error state ──────────────────────────────────────────────────────────────── */
.error-state {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.error-state h3 {
  font-family: var(--font);
  color: var(--danger);
  margin-bottom: 8px;
}

/* ── Giveaway countdown ───────────────────────────────────────────────────────── */
.countdown {
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
}

/* ── Top bar (mobile) ─────────────────────────────────────────────────────────── */
.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.hamburger {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  line-height: 1;
}

/* ── Mobile overlay ───────────────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 45;
}

/* ── Responsive ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body { flex-direction: column; overflow: auto; }

  .topbar { display: flex; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform var(--transition), width var(--transition);
    width: var(--sidebar-width) !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

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

  .main { height: calc(100vh - 49px); overflow-y: auto; }

  .content { padding: 16px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .server-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
}
