/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #1a1b1e;
  --surface:     #25262b;
  --surface-2:   #2c2e33;
  --border:      #373a40;
  --accent:      #5865f2;   /* Discord blurple */
  --accent-hover:#4752c4;
  --success:     #3ba55d;
  --text:        #dcddde;
  --text-muted:  #72767d;
  --radius:      8px;
  --shadow:      0 2px 8px rgba(0,0,0,.35);
}

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Shared icon system ────────────────────────────────────────────────────── */
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  stroke: currentColor;
  flex-shrink: 0;
}
.icon--xs { width: 14px; height: 14px; }
.icon--sm { width: 18px; height: 18px; }
.icon--md { width: 22px; height: 22px; }

/* Icon badges for section headers / cards */
.icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.icon-badge--muted {
  color: var(--text-muted);
}


/* ── Layout ────────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .75rem 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar__brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.navbar__brand:hover { text-decoration: none; color: var(--accent); }

.navbar__logo {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-block;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.navbar__link-muted {
  color: var(--text-muted);
  font-size: .9rem;
  opacity: .7;
}

.navbar__user {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .9rem;
}

.navbar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.navbar__user a {
  color: var(--text-muted);
  font-size: .85rem;
}
.navbar__user a:hover { color: var(--text); }

/* ── Main content ──────────────────────────────────────────────────────────── */
.main { padding: 2.5rem 0; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, opacity .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: .9; }

.btn--primary   { background: var(--accent);  color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--success   { background: var(--success); color: #fff; }
.btn--secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

/* ── Landing page (public) ─────────────────────────────────────────────────── */

.main--public { padding: 2.5rem 0 4rem; }
.container--wide { max-width: 1180px; }

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 2rem;
  align-items: center;
  padding: 3rem 0 4rem;
}

.landing-hero__brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .35rem .9rem .35rem .5rem;
  margin-bottom: 1.25rem;
}

.landing-hero__logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.landing-hero__name {
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .02em;
}

.landing-hero__title {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.landing-hero__subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin-bottom: 1.75rem;
}

.landing-hero__actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-card__row {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.hero-card__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(59,165,93,.12);
  flex-shrink: 0;
}

.hero-card__dot--accent {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(88,101,242,.12);
}

.hero-card__dot--muted {
  background: var(--text-muted);
  box-shadow: 0 0 0 4px rgba(114,118,125,.15);
}

.hero-card__label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  font-weight: 700;
}

.hero-card__value {
  font-size: .95rem;
  font-weight: 600;
}

.landing-section {
  padding: 2.5rem 0;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1.75rem;
}

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
}

.section-header p {
  color: var(--text-muted);
  max-width: 620px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.feature-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.feature-card p {
  color: var(--text-muted);
  font-size: .92rem;
}

.landing-cta {
  margin: 3rem 0 2rem;
  background: linear-gradient(135deg, rgba(88,101,242,.18), rgba(59,165,93,.12));
  border: 1px solid rgba(88,101,242,.35);
  border-radius: 16px;
  padding: 2rem;
}

.landing-cta__content h2 {
  font-size: 1.5rem;
  margin-bottom: .5rem;
}

.landing-cta__content p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.landing-cta__actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.landing-footer {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: 2rem;
  color: var(--text-muted);
}

.landing-footer__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.landing-footer__logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.btn--disabled {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .landing-hero {
    grid-template-columns: 1fr;
  }
  .landing-hero__visual {
    order: -1;
  }
}

@media (max-width: 640px) {
  .landing-hero__title { font-size: 2.1rem; }
  .landing-cta { padding: 1.5rem; }
  .landing-footer__inner { flex-direction: column; align-items: flex-start; }
}

/* ── Alert / error banner ──────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .9rem;
}
.alert--error { background: rgba(237,66,69,.15); border: 1px solid rgba(237,66,69,.4); color: #f38687; }

/* ── App shell (authenticated) ───────────────────────────────────────────── */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.app-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.app-topbar__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: .85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.app-brand__logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.app-brand:hover { color: var(--accent); text-decoration: none; }

.app-topbar__spacer { flex: 1; }

.app-user {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.app-user__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.app-user__meta {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  font-size: .85rem;
}

.app-user__name {
  font-weight: 600;
  color: var(--text);
}

.app-user__link {
  color: var(--text-muted);
  font-size: .78rem;
}

.app-user__link:hover { color: var(--text); }

.main--app {
  padding: 2rem 0 3rem;
}

.app-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.app-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.app-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: .5rem;
}

.app-page__header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: .2rem;
}

.app-page__header p {
  color: var(--text-muted);
  font-size: .95rem;
}

.app-page__actions {
  display: flex;
  gap: .75rem;
}

.app-page__header--guild {
  padding-bottom: 0;
}

/* ── Dashboard header (legacy) ────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.75rem;
}
.page-header h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: .25rem; }
.page-header p  { color: var(--text-muted); font-size: .95rem; }

/* ── Guild config page header ──────────────────────────────────────────────── */
.guild-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.guild-header--compact {
  margin-bottom: 0;
  width: 100%;
}

.guild-header__identity {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.guild-header__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.guild-header__meta {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.guild-header__name {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.guild-header__id {
  font-size: .8rem;
  color: var(--text-muted);
}

.guild-header__id code {
  font-size: .78rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .05rem .3rem;
}

/* ── Guild grid ────────────────────────────────────────────────────────────── */
.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.guild-grid--app {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.guild-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  transition: border-color .15s;
}
.guild-card:hover { border-color: var(--accent); }

.guild-card--app {
  flex-direction: column;
  align-items: flex-start;
  gap: .9rem;
  padding: 1.25rem;
}

.guild-card__media {
  width: 100%;
  display: flex;
  align-items: center;
}

.guild-card__icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}

.guild-card__icon--placeholder {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.guild-card__info {
  flex: 1;
  min-width: 0;
}

.guild-card__name {
  font-weight: 600;
  font-size: .975rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .25rem;
}

.guild-card__status {
  font-size: .8rem;
  color: var(--text-muted);
}
.guild-card__status--active { color: var(--success); }

.guild-card__action { flex-shrink: 0; margin-top: .2rem; }

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.empty-state--app {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: center;
}

.admin-table + .empty-state--app,
.admin-summary + .empty-state--app {
  margin-top: 1rem;
}

.empty-state h2 { font-size: 1.25rem; margin-bottom: .5rem; color: var(--text); }

/* ── Guild config page ─────────────────────────────────────────────────────── */
.config-placeholder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}
.config-placeholder h2 { font-size: 1.3rem; margin-bottom: .6rem; }
.config-placeholder p  { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── Error page ────────────────────────────────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 5rem 1rem;
  gap: 1rem;
}
.error-page__code { font-size: 5rem; font-weight: 800; color: var(--accent); line-height: 1; }
.error-page__msg  { color: var(--text-muted); font-size: 1.05rem; }

/* ── Additional button variants ────────────────────────────────────────────── */
.btn--danger  { background: #c0392b; color: #fff; }
.btn--danger:hover { background: #a93226; }
.btn--sm      { padding: .3rem .75rem; font-size: .8rem; }
.btn--success { background: var(--success); color: #fff; }

/* ── Text utility ──────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); font-size: .9rem; }

/* ── Page header row ───────────────────────────────────────────────────────── */
.page-header__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Tab navigation (legacy — kept for non-guild pages) ───────────────────── */
.tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: .5rem;
}
.tab {
  padding: .45rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab--active { background: var(--surface); border-color: var(--border); color: var(--text); }
.tab--disabled { opacity: .5; cursor: not-allowed; }

/* ── Guild config tabs ─────────────────────────────────────────────────────── */
.guild-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.guild-tabs--shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .2rem .2rem 0;
}

.guild-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.25rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;           /* overlap the container border */
  transition: color .15s, border-color .15s;
}

.guild-tab:hover {
  color: var(--text);
  text-decoration: none;
}

.guild-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.guild-tab__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.guild-tab--active .guild-tab__icon {
  color: var(--accent);
}

/* ── Badge ─────────────────────────────────────────────────────────────────── */
.badge {
  font-size: .7rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: .1rem .4rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: .3rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.card--muted { opacity: .7; }
.card__header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.card__header h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: .2rem; }

/* ── Feature header card (shared between Leveling and Temp VC) ─────────────── */
/* Compact identity banner at the top of each config section */
.feature-header {
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  /* Subtle accent left-border to distinguish it from plain content cards */
  border-left: 3px solid var(--accent);
}

.feature-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.feature-header__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.feature-header__text {
  flex: 1;
  min-width: 0;
}

.feature-header__text h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .15rem;
}

.feature-header__text p {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Optional badge slot (used by Temp VC to show Active/Inactive status) */
.feature-header__badge {
  flex-shrink: 0;
  margin-left: auto;
}

/* On small screens, let the badge wrap below the text */
@media (max-width: 600px) {
  .feature-header__inner { flex-wrap: wrap; }
  .feature-header__badge { margin-left: 0; }
}

@media (max-width: 720px) {
  .app-topbar__inner {
    flex-wrap: wrap;
  }
  .app-user {
    width: 100%;
    justify-content: flex-start;
  }
  .app-page__header {
    align-items: flex-start;
  }
  .guild-tabs--shell {
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .app-container { padding: 0 1rem; }
  .app-topbar__inner { padding: .75rem 1rem; }
  .app-user__meta { font-size: .8rem; }
  .app-page__actions { width: 100%; }
}

/* ── Admin tables ─────────────────────────────────────────────────────────── */
.admin-table {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.admin-table__row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, .9fr) minmax(0, 1.2fr) minmax(0, .6fr);
  gap: 1rem;
  padding: .75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  align-items: center;
}

.admin-table__row--head {
  background: transparent;
  border: none;
  padding: 0 .2rem .4rem;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

.admin-table__guild {
  display: flex;
  gap: .75rem;
  align-items: center;
}

.admin-table__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.admin-table__icon--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
}

.admin-invite {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.admin-invite__link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.admin-invite__link:hover {
  text-decoration: underline;
}

.admin-invite__status {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}

.admin-invite__status--muted {
  color: var(--text-muted);
  font-weight: 500;
}

.admin-invite__meta {
  font-size: .75rem;
  color: var(--text-muted);
}

.admin-invite__request {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

.admin-invite__form {
  margin-top: .15rem;
}

.admin-invite--muted {
  opacity: .7;
}

.status-badge--pending {
  background: rgba(245, 158, 11, .2);
  border: 1px solid rgba(245, 158, 11, .45);
  color: #fbbf24;
}

.status-badge--completed {
  background: rgba(59, 165, 93, .2);
  border: 1px solid rgba(59, 165, 93, .45);
  color: #6fcf97;
}

.status-badge--failed {
  background: rgba(239, 68, 68, .2);
  border: 1px solid rgba(239, 68, 68, .45);
  color: #fca5a5;
}

.admin-table__title {
  font-weight: 600;
  margin-bottom: .15rem;
}

.admin-table__meta {
  font-size: .78rem;
  color: var(--text-muted);
}

.admin-note {
  font-size: .85rem;
  color: var(--text-muted);
  background: rgba(88, 101, 242, .08);
  border: 1px solid rgba(88, 101, 242, .25);
  padding: .65rem .85rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.admin-summary {
  display: flex;
  gap: 1.5rem;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.admin-guild-id {
  display: inline-flex;
  align-items: center;
  padding: .12rem .4rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, .12);
  border: 1px solid rgba(99, 102, 241, .3);
  font-size: .78rem;
}

.admin-overview {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.admin-overview__card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.admin-overview__label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

.admin-overview__value {
  font-size: 1.2rem;
  font-weight: 600;
}

.admin-overview__meta {
  font-size: .78rem;
  color: var(--text-muted);
}

.admin-health {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.admin-health__row {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.admin-health__row--error {
  border-color: rgba(239, 68, 68, .45);
  background: rgba(239, 68, 68, .08);
}

.admin-health__row--warning {
  border-color: rgba(245, 158, 11, .45);
  background: rgba(245, 158, 11, .08);
}

.admin-health__row--ok {
  border-color: rgba(59, 165, 93, .4);
  background: rgba(59, 165, 93, .12);
}

.admin-health__label {
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 80px;
}

.admin-health__message {
  font-size: .9rem;
}

.badge--error {
  background: rgba(239, 68, 68, .12);
  border-color: rgba(239, 68, 68, .4);
  color: #fca5a5;
}

.badge--warning {
  background: rgba(245, 158, 11, .12);
  border-color: rgba(245, 158, 11, .4);
  color: #fbbf24;
}

.badge--ok {
  background: rgba(59, 165, 93, .2);
  border-color: rgba(59, 165, 93, .5);
  color: #6fcf97;
}

@media (max-width: 720px) {
  .admin-table__row {
    grid-template-columns: 1fr;
  }

  .admin-health__row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Config section ────────────────────────────────────────────────────────── */
.config-section { }

/* ── Alert variants ────────────────────────────────────────────────────────── */
.alert--success {
  background: rgba(59, 165, 93, .15);
  border: 1px solid rgba(59, 165, 93, .4);
  color: #6fcf97;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .9rem;
}
.alert__list { margin: 0; padding-left: 1.2rem; }

/* ── Settings form ─────────────────────────────────────────────────────────── */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.field-group { }
.field-group__label {
  display: block;
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: .3rem;
}
.field-group__hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .6rem;
}

.field { display: flex; flex-direction: column; gap: .3rem; }
.field--wide { flex: 2; }
.field--action { justify-content: flex-end; }
.field__label { font-size: .85rem; color: var(--text-muted); font-weight: 500; }
.field__input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: .5rem .75rem;
  font-size: .95rem;
  width: 100%;
  transition: border-color .15s;
}
.field__input:focus {
  outline: none;
  border-color: var(--accent);
}
.field__input--short { max-width: 140px; }

.field-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.field-row--top    { align-items: flex-start; }
.field-row--bottom { align-items: flex-end; }

/* ── Toggle switch ─────────────────────────────────────────────────────────── */
.toggle {
  display: flex;
  align-items: center;
  gap: .65rem;
  cursor: pointer;
  user-select: none;
}
.toggle input[type="checkbox"] { display: none; }
.toggle__track {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 999px;
  flex-shrink: 0;
  position: relative;
  transition: background .2s;
}
.toggle__track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}
.toggle input:checked + .toggle__track { background: var(--accent); }
.toggle input:checked + .toggle__track::after { transform: translateX(18px); }
.toggle__label { font-size: .9rem; }

.toggle-list { display: flex; flex-direction: column; gap: .75rem; }

/* ── Form actions row ──────────────────────────────────────────────────────── */
.form-actions { display: flex; gap: .75rem; }

/* ── Rewards table ─────────────────────────────────────────────────────────── */
.rewards-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: .9rem;
}
.rewards-table th,
.rewards-table td {
  padding: .6rem .9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.rewards-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.rewards-table__action-col { width: 100px; text-align: right; }
.rewards-table td:last-child { text-align: right; }

/* ── Add reward form ───────────────────────────────────────────────────────── */
.add-reward { border-top: 1px solid var(--border); padding-top: 1.25rem; margin-top: .5rem; }
.add-reward h3 { font-size: 1rem; font-weight: 600; margin-bottom: .85rem; }

/* ── Empty inline ──────────────────────────────────────────────────────────── */
.empty-inline {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 1.25rem;
  font-style: italic;
}

/* ── Card header row (title + status badge side-by-side) ───────────────────── */
.card__header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Status badge ──────────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem .65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.status-badge--active   { background: rgba(59,165,93,.2);  color: #6fcf97; border: 1px solid rgba(59,165,93,.4); }
.status-badge--inactive { background: rgba(114,118,125,.2); color: var(--text-muted); border: 1px solid var(--border); }
.status-badge--active::before   { content: "●"; font-size: .6rem; }
.status-badge--inactive::before { content: "○"; font-size: .6rem; }

/* ── Shared feature layout ─────────────────────────────────────────────────── */

.feature-section { margin-bottom: 2.25rem; }

.feature-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
  align-items: start;
}

.feature-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.feature-panel--side {
  gap: 1rem;
  min-width: 0;
}

.settings-card {
  padding: 1.35rem 1.5rem;
}

.side-card {
  padding: 1.1rem 1.25rem;
  min-width: 0;
  overflow: hidden;
}

.side-card__header {
  margin-bottom: .65rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

.side-card__title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
}

.side-card__text {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: .75rem;
  word-break: break-word;
}

.side-card__list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-size: .85rem;
  color: var(--text);
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.side-card__list li {
  word-break: break-word;
}

.side-card--hint {
  background: var(--surface-2);
}

.side-card--danger {
  border-color: rgba(192, 57, 43, .35);
  background: rgba(192, 57, 43, .06);
}

@media (max-width: 980px) {
  .feature-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Temp VC layout (legacy classes retained for other pages) ─────────────── */

/* ── VC form sections ───────────────────────────────────────────────────────── */

.vc-section {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

/* Top border separator for the second and subsequent sections */
.vc-section--bordered {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.vc-section__header {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: 1rem;
}

.vc-section__icon {
  font-size: 1.1rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.vc-section__title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .15rem;
}

.vc-section__desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Temp VC side panel ─────────────────────────────────────────────────────── */

.tempvc-side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Temp VC status list (shared with side cards) ─────────────────────────── */

/* Definition list for current config snapshot */
.tempvc-status-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tempvc-status-list__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
}

.tempvc-status-list__row:last-child {
  border-bottom: none;
}

.tempvc-status-list dt {
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 500;
}

.tempvc-status-list dd {
  text-align: right;
  word-break: break-all;
  color: var(--text);
}

.tempvc-status-list dd code {
  font-size: .78rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1rem .35rem;
}

/* ── Collapsible (details/summary) — kept for other potential uses ──────────── */
.collapsible {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.collapsible__trigger {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  background: var(--surface-2);
  list-style: none;
  user-select: none;
}
.collapsible__trigger::-webkit-details-marker { display: none; }
.collapsible__trigger::before { content: "▶"; font-size: .65rem; transition: transform .2s; }
details[open] .collapsible__trigger::before { transform: rotate(90deg); }
.collapsible__body { padding: 1.25rem; }

/* ── Required field marker ─────────────────────────────────────────────────── */
.required { color: #f38ba8; font-size: .85em; }

/* ── Field hint box ────────────────────────────────────────────────────────── */
.field-hint-box {
  background: rgba(88,101,242,.1);
  border: 1px solid rgba(88,101,242,.25);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}
.field-hint-box strong { color: var(--text); }

/* ── Snowflake input ───────────────────────────────────────────────────────── */
.field__input--snowflake { font-family: monospace; letter-spacing: .03em; }

/* .tempvc-disable removed — replaced by .tempvc-danger-card in the redesigned layout */

/* ── Temp VC form sections ─────────────────────────────────────────────────── */

/* Section headings inside collapsible__body (e.g. "Setup", "Defaults") */
.section-heading {
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  margin-bottom: .3rem;
  border-top: 1px solid var(--border);
}
/* Remove the top border + extra margin on the very first heading in the form */
.settings-form .section-heading:first-child,
form > .section-heading:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* Descriptive paragraph that sits directly under a .section-heading */
.section-hint {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .85rem;
  line-height: 1.55;
}

/* Warning / fallback variant of field-group__hint */
/* Used when channel lists are unavailable and the user must type an ID manually */
.field-group__hint--warn {
  color: #e0a045;          /* amber — readable on dark surface */
  margin-top: .4rem;       /* breathe below the input that precedes it */
  margin-bottom: 0;
}

/* ── Role picker ───────────────────────────────────────────────────────────── */

/* Make <select> look consistent with text inputs */
.field__select {
  appearance: none;
  -webkit-appearance: none;
  /* Brighter chevron (#a0a5ad) for legibility on dark backgrounds */
  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 fill='%23a0a5ad' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-color: var(--surface-2); /* explicit — prevents browser from overriding */
  padding-right: 2.25rem;
  cursor: pointer;
}

/* Ensure <option> elements stay dark in Chromium (ignores CSS on Firefox/Safari) */
.field__select option {
  background: var(--surface-2);
  color: var(--text);
}

.field__select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* ── Role badge (rewards table) ─────────────────────────────────────────────── */

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem 0.25rem 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid #5865f2; /* fallback; overridden by inline style */
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  vertical-align: middle;
}

/* No-color / default Discord role */
.role-badge--default {
  border-left-color: #4f545c;
}

/* Filled circle that mirrors the role color */
.role-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.role-color-dot--default {
  background: #4f545c;
}

/* ── Role color swatch next to the dropdown ─────────────────────────────────── */

.role-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.role-select-wrapper .field__select {
  flex: 1;
}

.role-color-swatch {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4f545c;          /* neutral until a role is chosen */
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: background 0.15s ease;
}

/* Tiny muted ID shown alongside the role badge */
.role-id-hint {
  color: var(--text-light);
  font-size: 0.78rem;
  margin-left: 0.35rem;
}

/* Warning shown when a stored role ID can no longer be resolved */
.role-unresolved {
  color: #b7791f;
  font-size: 0.82rem;
  margin-left: 0.25rem;
}

/* Hint shown when the role dropdown could not be loaded */
.role-picker-fallback {
  color: #b7791f;
  font-size: 0.82rem;
  margin-top: 0.4rem;
}
