:root {
  --bg: #07070b;
  --bg-2: #101018;
  --card: rgba(18, 16, 24, 0.78);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4eef2;
  --muted: #9a8f99;
  --accent: #e11d48;
  --accent-2: #fb7185;
  --ok: #34d399;
  --warn: #fbbf24;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(225, 29, 72, 0.22), transparent 55%),
    radial-gradient(900px 400px at 0% 100%, rgba(127, 29, 29, 0.18), transparent 50%),
    var(--bg);
}

a { color: inherit; }
.muted { color: var(--muted); }
.flash { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.flash.error, .banner.error { background: rgba(225, 29, 72, 0.16); border: 1px solid rgba(225, 29, 72, 0.35); }
.flash.ok { background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.3); }

.login-shell, .denied-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card, .denied-card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.brand-hero, .brand-side {
  flex-direction: column;
  gap: 8px;
  text-align: center;
}
.brand-logo {
  display: block;
  width: 128px;
  height: 128px;
  object-fit: contain;
  border-radius: 16px;
}
.brand-hero .brand-logo,
.denied-card .brand-logo {
  width: 160px;
  height: 160px;
}
.brand-side .brand-logo { width: 128px; height: 128px; margin: 0 auto 4px; }
.login-card h1, .denied-card h1 { margin: 0 0 8px; font-size: 28px; }
.discord-btn, .ghost-btn, .save-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; border: 0; border-radius: 12px; padding: 12px 16px;
  font-weight: 700; text-decoration: none; cursor: pointer;
}
.discord-btn { background: #5865f2; color: white; margin-top: 8px; }
.ghost-btn { background: transparent; color: var(--text); border: 1px solid var(--line); margin-top: 10px; }
.save-btn { width: auto; background: var(--accent); color: white; padding: 10px 16px; }
.setup { margin-top: 18px; padding: 12px; border-radius: 12px; background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.25); font-size: 13px; }
code { background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 6px; }

.denied-card { text-align: center; }
.denied-card .brand-logo { margin: 0 auto 14px; }
.denied-card .user-avatar { width: 56px; height: 56px; border-radius: 50%; margin-bottom: 10px; }
.role-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; }
.pill { font-size: 12px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

.dash { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side {
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(8, 8, 12, 0.72);
}
.nav a {
  display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); margin-bottom: 4px;
}
.nav a:hover, .nav a.active { background: rgba(225, 29, 72, 0.12); color: var(--text); }
.main { padding: 22px 26px 40px; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px; gap: 16px;
}
.who { display: flex; align-items: center; gap: 10px; }
.who img { width: 40px; height: 40px; border-radius: 50%; }
.role-badge {
  display: inline-block; margin-top: 2px; font-size: 11px; letter-spacing: 0.04em;
  color: var(--accent-2); text-transform: uppercase;
}
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
}
.card span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.card strong { display: block; margin-top: 8px; font-size: 26px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; background: #64748b; }
.dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.panel { margin-top: 18px; }
.panel h2 { margin: 0 0 14px; font-size: 18px; }
.logs { list-style: none; margin: 0; padding: 0; }
.logs li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.toggles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; margin-bottom: 16px; }
label.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%; background: #0c0c12; color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin: 6px 0 12px;
}
.row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.footer-note { margin-top: 18px; font-size: 12px; }
.subhead { margin: 18px 0 8px; font-size: 15px; }
textarea { min-height: 120px; resize: vertical; }
.ticket-preview { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.ticket-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #e11d48; color: #fff; font-weight: 700; font-size: 13px;
  border-radius: 999px; padding: 8px 14px;
}
.ticket-type {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 10px;
  margin-bottom: 12px; background: rgba(8, 8, 12, 0.45);
}
.ticket-type-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.switch.compact { margin: 0; font-size: 13px; }
.ticket-grid { grid-template-columns: 1fr 1fr 1fr; }
.add-type { margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--line); }
.publish-row { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.danger-btn { color: #fda4af; border-color: rgba(225, 29, 72, 0.35); }
select.role-multi { min-height: 180px; }

@media (max-width: 980px) {
  .dash { grid-template-columns: 1fr; }
  .grid, .row, .toggles, .ticket-grid { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
}
