:root {
  --bg: #09090b;
  --sidebar: #0b0b0d;
  --card: #111113;
  --card-2: #161618;
  --border: rgba(255,255,255,.06);
  --text: #f4f4f5;
  --muted: #8a8a93;
  --dim: #52525b;
  --green: #22c55e;
  --green-2: #4ade80;
  --red: #ef4444;
  --orange: #f59e0b;
  --blue: #60a5fa;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100%;
}
a { color: inherit; text-decoration: none; cursor: pointer; }
button, input, select, textarea { font-family: inherit; }

.sidebar {
  width: 232px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 12px;
  flex-shrink: 0;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(180deg, #1a1a1e, #0e0e10);
  border: 1px solid var(--border);
  display: grid; place-items: center; font-weight: 700; color: #d4d4d8;
  overflow: hidden; flex-shrink: 0;
}
.logo-mark.has-logo { background: none; border: 0; padding: 0; }
.logo-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-preview { display: flex; gap: 16px; align-items: flex-start; margin: 8px 0 4px; }
.brand-preview .logo-mark { width: 56px; height: 56px; font-size: 20px; }
.brand-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.brand-kicker, .login-kicker { font-size: 10px; letter-spacing: .14em; color: var(--dim); font-weight: 600; }
.brand-name { font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.nav-section {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); padding: 14px 10px 6px; font-weight: 600;
}
nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  color: #a1a1aa; font-size: 13.5px; font-weight: 500;
}
nav a:hover { background: rgba(255,255,255,.03); color: var(--text); }
nav a.active { background: #17171a; color: var(--text); }
.ico { width: 16px; text-align: center; color: #71717a; font-size: 12px; }
.sidebar-user {
  margin-top: auto; display: flex; gap: 10px; align-items: center;
  padding: 10px; border-radius: 12px; border: 1px solid var(--border);
}
.sidebar-user img { width: 32px; height: 32px; border-radius: 50%; }
.sidebar-user .meta { font-size: 12px; }
.sidebar-user .meta small { color: var(--muted); display: block; }

main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; border-bottom: 1px solid var(--border);
}
.crumbs { color: var(--muted); font-size: 13px; }
.crumbs .sep { margin: 0 8px; color: var(--dim); }
.top-right { display: flex; gap: 10px; align-items: center; }
.chip {
  border: 1px solid var(--border); background: #121214;
  padding: 6px 10px; border-radius: 999px; font-size: 12px; color: #d4d4d8;
}
.content { padding: 18px 22px 32px; overflow: auto; }

.banner {
  border: 1px solid var(--border); background: #101012;
  border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--muted); margin-bottom: 16px;
}
.hero {
  background: linear-gradient(180deg, #121214, #0e0e10);
  border: 1px solid var(--border); border-radius: 18px; padding: 22px 24px;
  display: flex; justify-content: space-between; gap: 24px; align-items: flex-end;
  margin-bottom: 16px;
}
.hero h1 { margin: 6px 0 6px; font-size: 32px; letter-spacing: -.03em; }
.hero p { margin: 0; color: var(--muted); max-width: 520px; line-height: 1.5; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--green-2); font-weight: 600; }
.dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.kpis { display: flex; gap: 28px; }
.kpi { text-align: right; }
.kpi span { display: block; font-size: 11px; letter-spacing: .12em; color: var(--dim); }
.kpi b { font-size: 28px; font-weight: 600; }

.tabs { display: flex; gap: 6px; margin: 4px 0 14px; }
.tabs button, .range button {
  background: transparent; border: 0; color: var(--muted); padding: 7px 12px; border-radius: 8px; cursor: pointer;
}
.tabs button.on, .range button.on { background: #17171a; color: var(--text); }

.grid-2 { display: grid; grid-template-columns: 1.5fr .9fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
}
.card h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.card p.sub { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.mini div { background: #0d0d0f; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.mini span { display: block; font-size: 11px; color: var(--dim); }
.mini b { font-size: 22px; }
.bar { height: 6px; background: #1c1c20; border-radius: 99px; overflow: hidden; margin: 8px 0 14px; }
.bar i { display: block; height: 100%; background: #e4e4e7; width: 0; }
.kv { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 6px 0; border-top: 1px solid var(--border); }
.kv b { color: var(--text); font-weight: 500; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--dim); font-weight: 500; font-size: 11px; letter-spacing: .08em; padding: 8px 10px; }
td { padding: 10px; border-top: 1px solid var(--border); vertical-align: middle; }
.who { display: flex; align-items: center; gap: 10px; }
.who img { width: 28px; height: 28px; border-radius: 50%; }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--border); }
.badge.on { color: var(--green-2); background: rgba(34,197,94,.08); }
.badge.off { color: #a1a1aa; }
.badge.exp { color: var(--orange); background: rgba(245,158,11,.08); }

.btn, .btn-discord, .btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 9px 12px; cursor: pointer; font-weight: 600; font-size: 13px;
}
.btn { background: #1a1a1e; color: var(--text); border: 1px solid var(--border); }
.btn-primary { background: #f4f4f5; color: #111; width: 100%; }
.btn-discord { background: #5865F2; color: #fff; width: 100%; margin: 12px 0; }
.btn.ok { background: rgba(34,197,94,.12); color: var(--green-2); }
.btn.warn { background: rgba(96,165,250,.12); color: var(--blue); }
.btn.danger { background: rgba(239,68,68,.12); color: #fca5a5; }
.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 10px; padding: 7px 10px; cursor: pointer; }
.row-actions { display: flex; gap: 6px; }
.search {
  width: 100%; background: #0e0e10; border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 10px 12px; outline: none; margin-bottom: 12px;
}
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
input, select, textarea {
  width: 100%; background: #0e0e10; border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 10px 12px; outline: none;
}
textarea { min-height: 280px; font-family: ui-monospace, monospace; font-size: 12px; }
.tabbar { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0 16px; }
.tabbar button { background: transparent; border: 0; color: var(--muted); padding: 8px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.tabbar button.on { background: #17171a; color: var(--text); }
.bot-head { display: flex; gap: 14px; align-items: center; }
.bot-head img { width: 56px; height: 56px; border-radius: 16px; }
.bot-head h2 { margin: 0; font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 800px) { .form-grid { grid-template-columns: 1fr; } }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: rgba(255,255,255,.03); }
.range { display: flex; gap: 4px; }
.chart { height: 180px; width: 100%; }
.empty { color: var(--dim); font-size: 13px; padding: 24px 0; }
.cmd-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cmd-toolbar > * { flex: 1; min-width: 180px; }
.cmd-cats { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.cmd-cats button {
  background: #101012; border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 6px 11px; cursor: pointer; font-size: 12px; font-weight: 500;
}
.cmd-cats button.on { background: #f4f4f5; color: #111; border-color: #f4f4f5; }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.cmd-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 14px 12px;
}
.cmd-card h4 { margin: 0 0 4px; font-size: 14px; }
.cmd-card .desc { color: var(--muted); font-size: 12.5px; min-height: 34px; line-height: 1.4; }
.cmd-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.cmd-access {
  font-size: 11px; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--border); color: #d4d4d8;
}
.cmd-access.public { color: var(--green-2); background: rgba(34,197,94,.08); }
.cmd-access.perm { color: var(--blue); background: rgba(96,165,250,.08); }
.cmd-access.off { color: var(--orange); background: rgba(245,158,11,.08); }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { display: none; }
.switch i {
  position: absolute; inset: 0; background: #2a2a2e; border-radius: 99px; cursor: pointer;
  transition: .15s ease;
}
.switch i:before {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: #d4d4d8; top: 3px; left: 3px; transition: .15s ease;
}
.switch input:checked + i { background: #22c55e; }
.switch input:checked + i:before { transform: translateX(16px); background: #fff; }
.cmd-edit { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.cmd-edit label { margin-top: 8px; }
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 8px; }
.sys-card {
  background: var(--card-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px;
  cursor: pointer; min-height: 112px;
}
.sys-card:hover { border-color: rgba(255,255,255,.14); }
.sys-card h4 { margin: 0 0 6px; font-size: 14px; }
.sys-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.sys-cat { margin: 18px 0 8px; color: var(--dim); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.raid-table { width: 100%; border-collapse: collapse; }
.raid-table th, .raid-table td { padding: 8px 6px; font-size: 12px; }
.raid-table select, .raid-table input { padding: 7px 8px; }
.setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.setup-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.setup-page textarea { min-height: 92px; }
.ai-plan {
  margin-top: 14px; background: #0e0e10; border: 1px solid var(--border);
  border-radius: 12px; padding: 14px;
}
.ai-plan h5 { margin: 0 0 6px; font-size: 14px; }
.ai-plan p { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.ai-cat { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.ai-cat strong { font-size: 13px; }
.ai-cat span { color: var(--muted); font-size: 12px; }
.setup-opt {
  background: #0e0e10; border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-top: 10px;
}
.setup-opt h5 { margin: 0 0 8px; font-size: 13px; }
.check-list {
  max-height: 160px; overflow: auto; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: #0e0e10;
}
.check-list label { display: flex; gap: 8px; align-items: center; margin: 0; color: var(--text); font-size: 12px; }
.check-list input { width: auto; }
.toggle-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: 0; }
.toggle-row span { color: var(--text); font-size: 13px; }
.chip-setup { font-size: 11px; color: #111; background: #f4f4f5; border-radius: 99px; padding: 3px 8px; font-weight: 600; }
.perm-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.perm-list label { display: flex; gap: 6px; align-items: center; margin: 0; color: var(--text); font-size: 12px; }
.perm-list input { width: auto; }
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.asset { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; text-align: center; }
.asset img { width: 64px; height: 64px; border-radius: 16px; }
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.guide ol { color: var(--muted); line-height: 1.7; }
.muted { color: var(--muted); }
.error { color: #fca5a5; min-height: 20px; font-size: 13px; }

.login-body {
  display: grid;
  place-items: center;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #050507;
}
.login-body::before {
  content: '';
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(820px 480px at 50% -8%, rgba(88,101,242,.32), transparent 58%),
    radial-gradient(520px 360px at 88% 108%, rgba(168,85,247,.14), transparent 52%),
    radial-gradient(420px 280px at 8% 90%, rgba(96,165,250,.1), transparent 46%);
  pointer-events: none;
}
.login-body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 10%, transparent 72%);
  pointer-events: none;
}
.login-card {
  width: min(440px, 92vw);
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(24,24,28,.94), rgba(11,11,13,.96));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  padding: 36px 32px 26px;
  box-shadow:
    0 28px 80px rgba(0,0,0,.55),
    0 0 0 1px rgba(88,101,242,.08),
    inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(18px);
}
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.login-card .logo-mark { width: 46px; height: 46px; border-radius: 13px; font-size: 17px; }
.login-kicker { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.login-card h1 { margin: 2px 0 0; font-size: 28px; letter-spacing: -.035em; }
.login-lead { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.login-body .btn-discord {
  height: 48px;
  border-radius: 13px;
  margin: 0;
  font-size: 14.5px;
  background: #5865F2;
  box-shadow: 0 10px 28px rgba(88,101,242,.28);
}
.login-body .btn-discord:hover { background: #4752c4; }
.login-body .btn-discord svg { width: 20px; height: 20px; flex-shrink: 0; }
.or {
  display: flex; align-items: center; gap: 12px;
  color: var(--dim); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  margin: 20px 0 6px; font-weight: 600;
}
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.08); }
.login-body input {
  padding: 12px 14px;
  border-radius: 12px;
  background: #0a0a0c;
}
.login-body input:focus {
  border-color: rgba(88,101,242,.55);
  box-shadow: 0 0 0 3px rgba(88,101,242,.16);
}
.login-body .btn-primary {
  height: 48px;
  border-radius: 13px;
  margin-top: 16px;
  font-size: 14.5px;
}
.login-body .error { min-height: 0; }
.login-body .error:not(:empty) {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.22);
  color: #fecaca;
  padding: 10px 12px;
  border-radius: 12px;
  margin-top: 14px;
}
.login-foot {
  display: block;
  text-align: center;
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
}
.login-foot:hover { color: #fff; }

.maint-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: #fbbf24; background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.22);
  border-radius: 99px; padding: 6px 12px; margin: 0 0 16px;
}
.maint-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.15); }
.maint-card .btn-primary { margin-top: 8px; }
.maint-banner {
  background: rgba(245,158,11,.12);
  border-bottom: 1px solid rgba(245,158,11,.25);
  color: #fbbf24;
  font-size: 13px; font-weight: 600;
  padding: 10px 22px;
}
.maint-banner a { color: #fff; text-decoration: underline; margin-left: 6px; }
#maintMsg { min-height: 88px; font-family: inherit; font-size: 13px; }

@media (max-width: 980px) {
  .grid-2, .cards, .grid-3 { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .sidebar { display: none; }
}
