:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e2129;
  --border: #2a2e38;
  --text: #e6e8ec;
  --muted: #9aa0ac;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --warn-bg: #2a2213;
  --warn-border: #6b571f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1a1d26 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}

.shell { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid var(--border);
  background: rgba(23, 26, 33, 0.7); backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { font-size: 22px; }
.brand-name { letter-spacing: 0.3px; }

.content { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 40px 24px; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; border-top: 1px solid var(--border); }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
}
.center-card { max-width: 460px; margin: 8vh auto 0; text-align: center; }
.center-card h1 { margin: 0 0 8px; font-size: 26px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }

.btn {
  display: inline-block; border: none; border-radius: 10px; cursor: pointer;
  padding: 12px 20px; font-size: 15px; font-weight: 600; text-decoration: none;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-discord { background: var(--accent); color: #fff; margin-top: 18px; }
.btn-discord:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--panel-2); }

.notice { text-align: left; border-radius: 10px; padding: 16px; margin-top: 18px; }
.notice-warn { background: var(--warn-bg); border: 1px solid var(--warn-border); }
.notice ul { margin: 8px 0; padding-left: 20px; }
code { background: #0d0f14; border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; font-size: 13px; }
code.redirect { display: block; margin-top: 6px; padding: 10px; word-break: break-all; }

.deny-mark { font-size: 40px; margin-bottom: 6px; }

.whoami { display: flex; align-items: center; gap: 12px; }
.whoami-name { font-weight: 600; }
.whoami-roles { display: flex; gap: 6px; }
.tag {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 3px 10px; font-size: 12px;
}
.tag-admin { color: #f0b232; border-color: #6b571f; }

.dash-head h1 { margin: 0 0 4px; }

.access-strip {
  margin: 22px 0; padding: 14px 18px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--border); font-size: 14px;
}
.access-eye { margin-right: 6px; }
.access-strip .small { margin-left: 8px; }

.config-banner {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 0 20px; padding: 14px 18px; border-radius: 12px;
  background: rgba(240, 82, 82, 0.08); border: 1px solid #6b2f2f;
  color: #f5c6c6; font-size: 14px; line-height: 1.5;
}
.config-banner-icon { font-size: 18px; line-height: 1.4; }
.config-banner-list { display: block; margin-top: 4px; font-family: monospace; color: #f0b232; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 8px; }
.panel { position: relative; }
.panel-icon { font-size: 26px; margin-bottom: 10px; }
.panel h2 { margin: 0 0 8px; font-size: 18px; }
.soon {
  display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 600;
  color: var(--muted); background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px;
}

@media (max-width: 600px) {
  .content { padding: 24px 16px; }
  .topbar { flex-direction: column; gap: 12px; align-items: flex-start; }
  .whoami { flex-wrap: wrap; }
}

/* ── Configuration UI ─────────────────────────────────────────────────────── */
.breadcrumb { margin: 0 0 18px; font-size: 13px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }

.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 6px; font-size: 24px; }

.flash-stack { margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.flash { padding: 12px 16px; border-radius: 10px; font-size: 14px; border: 1px solid var(--border); }
.flash-success { background: #14251a; border-color: #2f6b3f; color: #b9f0c8; }
.flash-error { background: #2a1518; border-color: #7a2f38; color: #f2c2c8; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.feature-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 22px;
  transition: border-color 0.15s ease, transform 0.05s ease;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.feature-card h2 { margin: 0 0 8px; font-size: 17px; }
.feature-card p { margin: 0; }

.config-section { margin-bottom: 26px; }
.config-section > h2 { font-size: 18px; margin: 0 0 4px; }
.config-section > .section-desc { margin: 0 0 14px; }

.field { margin-bottom: 16px; }
.field label.field-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }

input[type="text"], input[type="number"], textarea, select {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; font-family: inherit;
}
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; }

.checklist {
  max-height: 220px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; background: var(--panel-2);
}
.checklist.short { max-height: 150px; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.check-row input { width: auto; }

.switch-row { display: flex; align-items: center; gap: 10px; }
.switch-row input { width: auto; }

.form-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: #7a2f38; color: #fff; }
.btn-danger:hover { background: #93343f; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table th { color: var(--muted); font-weight: 600; }

.kv-rows { display: flex; flex-direction: column; gap: 8px; }
.kv-row { display: flex; gap: 8px; align-items: center; }
.kv-row input[type="text"] { flex: 1; }
.kv-row select { flex: 1; }
.kv-del {
  flex: 0 0 auto; width: 36px; height: 36px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 20px; line-height: 1;
  color: var(--muted); background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; transition: all 0.12s ease;
}
.kv-del:hover { color: #fff; background: #7a2f38; border-color: #93343f; }

.empty { color: var(--muted); font-style: italic; padding: 8px 0; }
.pill { display: inline-block; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: 12px; margin: 2px; }
.beta-badge { display: inline-block; vertical-align: middle; background: #2c1e3a; border: 1px solid #452e5c; color: #c79bf0; border-radius: 999px; padding: 1px 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; margin-left: 6px; }
.subcard { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 14px; }

/* Activity Log viewer */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 16px;
}
.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field label { color: var(--muted); font-size: 12px; font-weight: 600; }
.filter-field select, .filter-field input[type="date"] {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel-2); color: inherit;
}
.filter-actions { display: flex; gap: 8px; margin-left: auto; }

.table-scroll { overflow-x: auto; }
.activity-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.activity-table th, .activity-table td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top;
}
.activity-table th { color: var(--muted); font-weight: 600; }
.activity-table tbody tr:hover { background: var(--panel-2); }
.nowrap { white-space: nowrap; }

.badge {
  display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px;
  font-weight: 600; border: 1px solid var(--border); background: var(--panel-2); white-space: nowrap;
}
.badge-channel_created { background: #1e3a29; border-color: #2e5c40; color: #7ee2a8; }
.badge-channel_deleted { background: #3a1e22; border-color: #5c2e34; color: #f0959d; }
.badge-role_created { background: #1e2a3a; border-color: #2e455c; color: #8fbcf0; }
.badge-role_deleted { background: #3a2c1e; border-color: #5c452e; color: #f0c28f; }
.badge-genre_changed { background: #2c1e3a; border-color: #452e5c; color: #c79bf0; }
.badge-owner_reassigned { background: #3a331e; border-color: #5c522e; color: #f0dd8f; }

.pagination { display: flex; align-items: center; gap: 14px; margin-top: 16px; justify-content: center; }
.page-info { color: var(--muted); font-size: 13px; }
.btn.disabled { opacity: 0.4; pointer-events: none; }
