:root {
  --bg: #0a0e17;
  --bg-panel: #111726;
  --bg-rail: #070a12;
  --border: #1e2636;
  --text: #eef0f3;
  --text-dim: #8b93a7;
  --accent: #3b8eff;
  --accent-hover: #2f74d6;
  --green: #57f287;
  --toggle-off: #3a3f4b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, system-ui, sans-serif;
  line-height: 1.5;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.navbar .brand { display: flex; align-items: center; gap: 10px; color: var(--accent); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: 0.5px; }
.navbar .brand .brand-logo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; }

.container { max-width: 1100px; margin: 0 auto; padding: 40px 24px; }

.hero { text-align: center; padding: 90px 0 70px; }
.hero-logo { width: 140px; height: 140px; margin: 0 auto 20px; border-radius: 50%; object-fit: cover; }
.hero .eyebrow { color: var(--text-dim); font-size: 1rem; margin-bottom: 4px; }
.hero h1 { font-size: 2.4rem; margin: 0 0 20px; color: var(--accent); }

.stat-pill { display: inline-block; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 30px; padding: 10px 22px; font-size: 0.9rem; color: var(--text-dim); }
.stat-pill strong { color: var(--accent); }

.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: white; padding: 13px 26px; border-radius: 8px; text-decoration: none; font-weight: 700; border: none; cursor: pointer; font-size: 0.95rem; }
.btn:hover { background: var(--accent-hover); }
.btn.small { padding: 8px 16px; font-size: 0.85rem; }
.btn.outline { background: transparent; border: 1px solid var(--accent); color: var(--accent); }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 40px; }
.feature-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 22px; }
.feature-card.premium { border-color: var(--accent); }
.feature-card h3 { margin: 0 0 8px; color: var(--accent); }
.feature-card p { color: var(--text-dim); font-size: 0.9rem; margin: 0; }

.app-shell { display: flex; min-height: calc(100vh - 62px); }

.guild-rail { width: 76px; background: var(--bg-rail); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; padding: 16px 0; gap: 12px; flex-shrink: 0; }
.rail-icon { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid transparent; }
.rail-icon.placeholder { display: flex; align-items: center; justify-content: center; background: var(--bg-panel); color: var(--text-dim); font-weight: 700; }
.guild-rail a.active .rail-icon, .guild-rail a:hover .rail-icon { border-color: var(--accent); }

.category-nav { width: 240px; background: var(--bg-panel); border-right: 1px solid var(--border); padding: 24px 0; flex-shrink: 0; }
.category-nav .guild-header { padding: 0 20px 20px; border-bottom: 1px solid var(--border); margin-bottom: 12px; text-align: center; }
.category-nav .guild-header img { width: 56px; height: 56px; border-radius: 50%; margin-bottom: 8px; }
.category-nav .guild-header .g-icon-placeholder { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.3rem; }
.category-nav button.cat-btn { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; color: var(--text-dim); padding: 11px 20px; text-align: left; cursor: pointer; font-size: 0.92rem; border-left: 3px solid transparent; }
.category-nav button.cat-btn:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.category-nav button.cat-btn.active { color: var(--accent); border-left-color: var(--accent); background: rgba(59,142,255,0.08); font-weight: 600; }

.content-panel { flex: 1; padding: 36px 44px; max-width: 1020px; }
.content-panel h1 { margin: 0 0 8px; font-size: 1.5rem; }
.content-panel .subtitle { color: var(--text-dim); margin-bottom: 32px; }

.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--border); gap: 20px; }
.setting-row:last-child { border-bottom: none; }
.setting-row .setting-text h4 { margin: 0 0 4px; font-size: 1rem; }
.setting-row .setting-text p { margin: 0; color: var(--text-dim); font-size: 0.87rem; }
.setting-row .setting-control { flex-shrink: 0; min-width: 160px; text-align: right; }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--toggle-off); transition: 0.2s; border-radius: 26px; }
.slider::before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background: white; transition: 0.2s; border-radius: 50%; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.content-panel input[type=text], .content-panel input[type=number], .content-panel textarea, .content-panel select {
  padding: 9px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-family: inherit; font-size: 0.85rem; width: 220px;
}
.content-panel textarea { width: 280px; min-height: 60px; resize: vertical; }
.content-panel input[type=color] {
  width: 56px; height: 38px; padding: 3px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; appearance: none; -webkit-appearance: none;
}
.content-panel input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.content-panel input[type=color]::-webkit-color-swatch { border: none; border-radius: 4px; }

.category-section { display: none; }
.category-section.active { display: block; }

.welcome-panel { max-width: 640px; }
.welcome-panel h1 { color: var(--accent); }

.save-bar { position: sticky; bottom: 0; background: var(--bg); padding: 16px 0; margin-top: 10px; }

.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.guild-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 20px; text-align: center; }
.guild-icon { width: 64px; height: 64px; border-radius: 50%; margin-bottom: 12px; }
.guild-icon.placeholder { display: flex; align-items: center; justify-content: center; background: var(--accent); font-size: 1.5rem; font-weight: 700; margin: 0 auto 12px; }

.status-badge { padding: 12px 18px; border-radius: 8px; background: var(--bg-panel); border: 1px solid var(--border); display: inline-block; margin-bottom: 24px; }
.status-badge.active { border-color: var(--green); color: var(--green); }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.plan-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 24px; text-align: center; }
.plan-card .price { font-size: 1.6rem; font-weight: 700; margin: 10px 0 20px; }

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

.premium-tag { font-size: 0.65rem; background: var(--accent); color: white; padding: 2px 6px; border-radius: 4px; vertical-align: middle; margin-left: 6px; }
.setting-row.locked { opacity: 0.6; }

.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 20px 0; }
.rule-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.rule-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rule-card h4 { margin: 0; font-size: 0.9rem; }
.rule-card p { margin: 0; color: var(--text-dim); font-size: 0.82rem; }
.rule-card select { width: 100%; margin-top: 4px; }

.log-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.log-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.log-card h4 { margin: 0 0 8px; font-size: 0.88rem; }
.log-card select { width: 100%; }

.rr-form { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 4px 24px; margin-bottom: 20px; }

/* ---------- Welcome/Tickets split layout + Discord-like preview ---------- */
.welcome-split { display: flex; gap: 32px; align-items: flex-start; }
.welcome-form { flex: 1; min-width: 0; }
.welcome-preview { width: 340px; flex-shrink: 0; position: sticky; top: 20px; }
.preview-label { color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.section-sub { color: var(--accent); font-size: 0.95rem; margin: 24px 0 4px; border-top: 1px solid var(--border); padding-top: 20px; }

.discord-msg { background: #313338; border-radius: 10px; padding: 16px; display: flex; gap: 12px; font-family: "gg sans", "Segoe UI", sans-serif; }
.discord-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.discord-body { flex: 1; min-width: 0; }
.discord-author { color: #f2f3f5; font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.discord-bot-tag { background: var(--accent); color: white; font-size: 0.6rem; padding: 1px 5px; border-radius: 3px; font-weight: 700; }
.discord-embed { background: #2b2d31; border-left: 4px solid var(--accent); border-radius: 4px; padding: 12px 14px; margin-top: 4px; }
.discord-embed-text { color: #f2f3f5; font-weight: 700; font-size: 0.92rem; margin-bottom: 6px; }
.discord-embed-desc { color: #dbdee1; font-size: 0.85rem; white-space: pre-line; line-height: 1.4; }
.discord-banner { margin-top: 12px; border-radius: 6px; height: 110px; background-size: cover; background-position: center; position: relative; overflow: hidden; }
.discord-banner-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0.55), rgba(0,0,0,0.15)); display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.discord-banner-icon { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.15); flex-shrink: 0; }
.discord-banner-text { color: white; font-size: 0.78rem; line-height: 1.3; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.discord-fake-btn { margin-top: 12px; background: #3ba55c; color: white; border: none; padding: 8px 16px; border-radius: 4px; font-size: 0.85rem; font-weight: 600; cursor: default; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; background: var(--bg-rail); }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 36px 24px; display: flex; gap: 60px; flex-wrap: wrap; align-items: flex-start; }
.footer-logo { width: 56px; height: 56px; border-radius: 50%; }
.footer-col h4 { color: var(--accent); margin: 0 0 10px; font-size: 0.9rem; }
.footer-col a, .footer-col span { display: block; color: var(--text-dim); text-decoration: none; font-size: 0.85rem; margin-bottom: 6px; }
.footer-col a:hover { color: var(--text); }

/* ---------- Documentation ---------- */
.docs-shell { display: flex; min-height: calc(100vh - 62px); }
.docs-nav { width: 240px; background: var(--bg-panel); border-right: 1px solid var(--border); padding: 24px 0; flex-shrink: 0; }
.docs-nav a { display: block; padding: 9px 22px; color: var(--text-dim); text-decoration: none; font-size: 0.88rem; }
.docs-nav a:hover { color: var(--accent); }
.docs-content { flex: 1; padding: 40px 48px; max-width: 760px; }
.docs-content h1 { color: var(--accent); }
.docs-content section { margin-bottom: 48px; scroll-margin-top: 20px; }
.docs-content h2 { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.docs-content ul, .docs-content ol { color: var(--text-dim); line-height: 1.8; }
.docs-content .steps { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px 24px; }

/* ---------- Admin ---------- */
.admin-table { display: flex; flex-direction: column; gap: 10px; }
.admin-row { display: flex; align-items: center; gap: 16px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 20px; }
.admin-icon { width: 42px; height: 42px; border-radius: 50%; }
.admin-icon.placeholder { display: flex; align-items: center; justify-content: center; background: var(--accent); font-weight: 700; }
.admin-info { flex: 1; }
.admin-info h4 { margin: 0; }
.admin-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Legal ---------- */
.legal-title { color: var(--accent); text-align: center; margin-bottom: 32px; }
.legal-grid { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.legal-card {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 22px 26px; color: var(--text); text-decoration: none; text-align: center;
  min-width: 180px; font-weight: 600; transition: border-color 0.15s;
}
.legal-card:hover { border-color: var(--accent); color: var(--accent); }
.legal-content { max-width: 720px; margin-top: 20px; color: var(--text-dim); line-height: 1.7; }
.legal-content p { margin: 0 0 14px; }

/* ---------- Team credits ---------- */
.team-grid { display: flex; flex-wrap: wrap; gap: 20px; margin: 24px 0; }
.team-card {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 26px 24px; text-align: center; width: 200px;
}
.member-avatar { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; margin-bottom: 14px; }
.member-name { margin: 0 0 4px; font-size: 1.05rem; }
.member-role { margin: 0 0 14px; color: var(--text-dim); font-size: 0.82rem; }
.member-ping {
  display: inline-block; background: rgba(59,142,255,0.15); color: var(--accent);
  padding: 4px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 600;
  text-decoration: none;
}
.member-ping:hover { background: rgba(59,142,255,0.28); }
