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

:root {
  --bg: #0f1117;
  --bg2: #161820;
  --bg3: #1e2030;
  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.14);
  --text: #e8eaf0;
  --text2: #9399a8;
  --text3: #5a6070;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --green: #2ecc71;
  --red: #e74c3c;
  --yellow: #f5a623;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
}

body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: monospace; background: var(--bg3); padding: 2px 6px; border-radius: 4px; font-size: 13px; }

/* ── Navbar ── */
.navbar { background: var(--bg2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
.nav-brand:hover { text-decoration: none; }
.brand-dot { width: 10px; height: 10px; background: var(--accent); border-radius: 50%; display: inline-block; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-link { color: var(--text2); font-size: 14px; }
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-avatar { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text2); }
.nav-avatar img { width: 28px; height: 28px; border-radius: 50%; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: all .15s; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text2); border-color: var(--border2); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #27ae60; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-icon { background: transparent; border: none; cursor: pointer; padding: 4px 8px; border-radius: 4px; font-size: 16px; color: var(--text2); transition: all .1s; }
.btn-icon:hover { background: var(--bg3); color: var(--text); }
.btn-danger-icon:hover { color: var(--red); }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }

/* ── Page header ── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.page-header-left { display: flex; flex-direction: column; gap: 6px; }
.page-header-left h1 { font-size: 26px; font-weight: 700; }
.page-header-right { display: flex; align-items: center; gap: 10px; }
.back-link { font-size: 13px; color: var(--text3); }
.back-link:hover { color: var(--text2); }

/* ── Stat cards ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.stat-num { font-size: 32px; font-weight: 700; color: var(--text); }
.stat-num.stat-green { color: var(--green); }
.stat-num.stat-red { color: var(--red); }
.stat-label { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* ── Cards ── */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }
.mt-4 { margin-top: 20px; }
.mt-3 { margin-top: 12px; }
.mt-2 { margin-top: 8px; }
.p-4 { padding: 16px; }

/* ── Two col layout ── */
.two-col { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.col-main {}
.col-side {}

/* ── Tables ── */
.forms-table { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--bg3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text2); padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text2); vertical-align: middle; }
td a { color: var(--text); font-weight: 500; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }
.text-center { text-align: center; }
.actions-cell { display: flex; gap: 4px; align-items: center; }

/* ── Badges / pills ── */
.tier-badge { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 100px; }
.tier-free { background: var(--bg3); color: var(--text2); }
.tier-starter { background: rgba(88,101,242,.15); color: #818cf8; }
.tier-pro { background: rgba(245,166,35,.15); color: #f5a623; }
.tier-enterprise { background: rgba(46,204,113,.15); color: var(--green); }
.status-pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 100px; }
.status-open { background: rgba(46,204,113,.15); color: var(--green); }
.status-closed { background: rgba(90,96,112,.2); color: var(--text2); }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.status-dot.status-open { background: var(--green); }
.status-dot.status-closed { background: var(--text3); }
.mode-badge { font-size: 11px; padding: 2px 7px; border-radius: 4px; background: var(--bg3); color: var(--text2); }
.sub-status { font-size: 11px; padding: 2px 7px; border-radius: 4px; }
.sub-status-pending { background: rgba(245,166,35,.15); color: var(--yellow); }
.sub-status-accepted { background: rgba(46,204,113,.15); color: var(--green); }
.sub-status-denied { background: rgba(231,76,60,.15); color: var(--red); }

/* ── Forms / fields ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text2); }
.field input, .field select, .field textarea { background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text); padding: 9px 12px; font-size: 14px; font-family: inherit; width: 100%; transition: border-color .15s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox-field { flex-direction: row; align-items: center; gap: 10px; }
.checkbox-field label { margin: 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hint { font-size: 11px; color: var(--text3); font-weight: 400; }

/* ── Modals ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 999; }
.modal { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); width: 100%; max-width: 480px; box-shadow: var(--shadow); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--text2); cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }

/* ── Questions list ── */
.question-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.question-row:last-child { border-bottom: none; }
.q-num { width: 24px; height: 24px; background: var(--bg3); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--text2); flex-shrink: 0; margin-top: 2px; }
.q-body { flex: 1; }
.q-label { font-size: 14px; color: var(--text); font-weight: 500; }
.q-meta { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.q-type { font-size: 11px; background: var(--bg3); color: var(--text2); padding: 2px 6px; border-radius: 4px; }
.q-required { font-size: 11px; background: rgba(88,101,242,.15); color: #818cf8; padding: 2px 6px; border-radius: 4px; }
.q-hint { font-size: 11px; color: var(--text3); }

/* ── Submissions list ── */
.submissions-list { }
.submission-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--border); color: var(--text); transition: background .1s; }
.submission-row:last-child { border-bottom: none; }
.submission-row:hover { background: var(--bg3); text-decoration: none; }
.sub-user { font-weight: 500; font-size: 14px; }
.sub-meta { display: flex; align-items: center; gap: 10px; }
.sub-date { font-size: 12px; color: var(--text3); }

/* ── Answer blocks ── */
.answer-block { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.answer-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.answer-label { font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 8px; }
.answer-value { font-size: 15px; color: var(--text); line-height: 1.7; white-space: pre-wrap; }

/* ── Notes ── */
.note-block { background: var(--bg3); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.note-meta { font-size: 12px; color: var(--text3); margin-bottom: 6px; }
.note-text { font-size: 14px; color: var(--text2); }

/* ── Info rows ── */
.info-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; gap: 12px; }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text2); flex-shrink: 0; }
.text-danger { color: var(--red); }
.text-muted { color: var(--text2); }

/* ── Guild grid ── */
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.guild-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; transition: all .15s; color: var(--text); }
.guild-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.guild-card--install { opacity: 0.6; }
.guild-card--install:hover { opacity: 1; border-color: var(--green); }
.guild-icon { width: 64px; height: 64px; border-radius: 50%; }
.guild-icon-placeholder { width: 64px; height: 64px; border-radius: 50%; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: var(--text2); }
.guild-name { font-weight: 600; font-size: 14px; text-align: center; }
.guild-arrow { color: var(--text3); font-size: 18px; }
.install-badge { font-size: 11px; background: rgba(46,204,113,.15); color: var(--green); padding: 2px 8px; border-radius: 100px; }
.section-divider { margin: 24px 0 16px; }

/* ── Section title ── */
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); margin-bottom: 16px; }

/* ── Empty states ── */
.empty-state { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; color: var(--text2); }
.empty-state-sm { color: var(--text3); font-size: 14px; text-align: center; }

/* ── Landing ── */
.landing { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.hero { text-align: center; padding: 80px 0 60px; }
.hero-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 100px; background: rgba(88,101,242,.15); color: #818cf8; margin-bottom: 20px; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; margin-bottom: 20px; }
.accent { color: var(--accent); }
.hero-sub { font-size: 18px; color: var(--text2); max-width: 560px; margin: 0 auto 32px; line-height: 1.7; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 80px; }
.feature-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.feature-icon { font-size: 28px; margin-bottom: 12px; }
.feature-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text2); line-height: 1.6; }
.pricing { margin-bottom: 80px; }
.pricing h2 { font-size: 32px; font-weight: 700; text-align: center; margin-bottom: 32px; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pricing-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 16px; position: relative; }
.pricing-card.featured { border-color: var(--accent); }
.plan-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 12px; border-radius: 100px; white-space: nowrap; }
.plan-name { font-size: 16px; font-weight: 700; }
.plan-price { font-size: 36px; font-weight: 800; }
.plan-price span { font-size: 16px; font-weight: 400; color: var(--text2); }
.pricing-card ul { list-style: none; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pricing-card ul li { font-size: 13px; color: var(--text2); padding-left: 16px; position: relative; }
.pricing-card ul li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-size: 11px; top: 2px; }

/* ── Error page ── */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; gap: 16px; text-align: center; }
.error-code { font-size: 96px; font-weight: 800; color: var(--accent); opacity: .4; }
.error-message { font-size: 18px; color: var(--text2); }

/* ── Footer ── */
.footer { border-top: 1px solid var(--border); padding: 24px; text-align: center; font-size: 13px; color: var(--text3); margin-top: 64px; }
.footer a { color: var(--text3); }
.footer a:hover { color: var(--text2); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .guild-grid { grid-template-columns: 1fr 1fr; }
}
