:root {
  --bg:         #0d1117;
  --surface:    #161b22;
  --surface2:   #21262d;
  --accent:     #5865F2;
  --accent-dim: rgba(88,101,242,0.15);
  --text:       #e6edf3;
  --muted:      #8b949e;
  --success:    #3fb950;
  --danger:     #f85149;
  --border:     rgba(255,255,255,0.08);
  --radius:     8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

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

/* ── Hero (login page) ────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1.2rem;
  text-align: center;
  padding: 2rem;
}
.hero h1 { font-size: 2.8rem; letter-spacing: -0.02em; }
.hero p  { color: var(--muted); font-size: 1.05rem; }

/* ── Top bar ──────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand       { font-weight: 700; font-size: 1.05rem; }
.topbar-user { margin-left: auto; color: var(--muted); font-size: 0.875rem; display: flex; align-items: center; gap: 0.5rem; }
.avatar-sm   { width: 28px; height: 28px; border-radius: 50%; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.82; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); font-size: 1rem; padding: 0.75rem 2rem; }
.btn-ghost   { background: transparent; color: var(--text); border-color: var(--border); }

/* ── Layout ───────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.page-title     { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.35rem; }
.page-subtitle  { color: var(--muted); font-size: 0.875rem; margin-bottom: 1.75rem; }

/* ── Server grid ──────────────────────────────────────── */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.875rem;
}
.server-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.server-card:hover { border-color: var(--accent); background: var(--surface2); text-decoration: none; }

/* ── Guild icons ──────────────────────────────────────── */
.guild-icon, .guild-icon-fallback {
  width: 46px; height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  font-weight: 700;
}
.guild-icon { object-fit: cover; }
.guild-icon-fallback {
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.guild-name { font-weight: 500; font-size: 0.9rem; }

/* ── Server detail ────────────────────────────────────── */
.guild-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.guild-icon-lg, .guild-icon-lg-fallback {
  width: 72px; height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
}
.guild-icon-lg { object-fit: cover; }
.guild-icon-lg-fallback {
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700;
}
.guild-header h2 { font-size: 1.6rem; font-weight: 700; }

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.25rem;
}
.card-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* ── Config table ─────────────────────────────────────── */
.config-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.config-table th {
  text-align: left;
  padding: 0.45rem 0.75rem;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.config-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.config-table tr:last-child td { border-bottom: none; }

/* ── Tags & badges ────────────────────────────────────── */
.tag {
  display: inline-block;
  background: var(--accent-dim);
  color: #a5b0f5;
  border-radius: 3px;
  padding: 0.1rem 0.45rem;
  font-size: 0.8rem;
  margin: 0.1rem 0.1rem 0.1rem 0;
}
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-on  { background: rgba(63,185,80,0.15); color: var(--success); }
.badge-off { background: rgba(248,81,73,0.12); color: var(--danger); }

/* ── Utility ──────────────────────────────────────────── */
.muted { color: var(--muted); }
.hint  { font-size: 0.82rem; color: var(--muted); text-align: center; margin-top: 1.5rem; }
.error-msg { color: var(--danger); padding: 1rem; background: rgba(248,81,73,0.1); border-radius: var(--radius); }
