/* Supremacy brand: chrome silver on near-black, no colour accents.
   Brand colours match the Discord bot (config.json): silver #C0C4CC, dark #4E5058. */
:root {
  --bg: #050709;
  --sidebar: #08090c;
  --surface: #0c0d10;
  --raised: #111317;
  --hover: #17191e;
  --border: #1d2025;
  --border-strong: #2c2f36;
  --text: #f2f3f5;
  --soft: #d6d8dd;
  --muted: #8b8f98;
  --faint: #5c606a;
  --brand: #c0c4cc;
  --brand-dark: #4e5058;
  --chrome: linear-gradient(180deg, #ffffff 0%, #e4e6ea 42%, #c0c4cc 70%, #8e929b 100%);
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse 60% 45% at 70% -5%, #c0c4cc14, transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
::selection { background: #c0c4cc44; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 26px 16px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 44px; color: inherit; text-decoration: none; }
.brand-logo {
  width: 44px; height: 44px; object-fit: contain;
  filter: drop-shadow(0 0 14px #c0c4cc55);
}
.brand strong {
  display: block; font-size: 14px; font-weight: 700; letter-spacing: .3em;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .2em; margin-top: 5px; }

.nav-label, .eyebrow { font-size: 10px; letter-spacing: .22em; color: var(--muted); font-weight: 600; }
.nav-label { padding: 0 12px 12px; }
.nav { display: grid; gap: 3px; }
.nav-item {
  position: relative;
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
  text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-icon { width: 18px; text-align: center; color: var(--faint); transition: color .15s; }
.nav-item:hover { background: var(--hover); color: var(--soft); }
.nav-item.active { background: var(--raised); color: var(--text); }
.nav-item.active::before {
  content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand); box-shadow: 0 0 12px #c0c4cc88;
}
.nav-item.active .nav-icon { color: var(--brand); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 8px; }
.environment {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--border);
  padding: 16px 12px 4px;
  font-size: 11px; color: var(--muted);
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 0 #c0c4cc88;
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 7px #c0c4cc00; } 100% { box-shadow: 0 0 0 0 #c0c4cc00; } }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 44px 22px;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 28px; font-weight: 600; letter-spacing: -.03em; margin: 8px 0 0; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.demo-badge {
  font-size: 10px; letter-spacing: .16em; font-weight: 600;
  color: var(--brand); border: 1px solid var(--brand-dark); border-radius: 99px; padding: 7px 11px;
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--raised);
  color: var(--soft); font-size: 12px; font-weight: 600;
}
.content { padding: 32px 44px 48px; max-width: 1480px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: 250px;
  display: flex; align-items: center;
  padding: 36px 40px;
  margin-bottom: 18px;
  border: 1px solid var(--border); border-radius: 18px;
  background: url("assets/banner.png") right -40px center / auto 135% no-repeat, #050709;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, #050709 0%, #050709f2 38%, #05070900 75%);
}
.hero > * { position: relative; }
.hero h2 {
  margin: 12px 0 10px; font-size: 40px; font-weight: 700; letter-spacing: -.035em; line-height: 1.05;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0; max-width: 430px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.hero-meta { display: flex; gap: 22px; margin-top: 24px; font-size: 12px; color: var(--soft); }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

/* ---------- Embed cards (Discord-style) ---------- */
.grid { display: grid; gap: 18px; }
.stats { grid-template-columns: repeat(4, 1fr); }
.two-col { grid-template-columns: 1.35fr .65fr; margin-top: 18px; }

.card, .stat, .embed {
  position: relative;
  background: linear-gradient(160deg, #131519 0%, #0c0d10 60%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 20px 25px;
  overflow: hidden;
}
.card::before, .stat::before, .embed::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand);
}
.dark::before { background: var(--brand-dark) !important; }

.embed-author { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--soft); margin-bottom: 14px; }
.embed-author img { width: 20px; height: 20px; object-fit: contain; }
.embed-footer {
  display: flex; align-items: center; gap: 8px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--muted);
}
.embed-footer img { width: 14px; height: 14px; object-fit: contain; opacity: .8; }

.stat-label { color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.stat-value { font-size: 34px; font-weight: 600; letter-spacing: -.04em; margin-top: 12px; }
.stat-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.sub { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 400; }

.card-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.card-title h2 { margin: 0; font-size: 15px; font-weight: 600; }
.link { color: var(--muted); font-size: 12px; cursor: pointer; background: none; border: 0; padding: 0; }
.link:hover { color: var(--text); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 0 12px 12px;
  font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}
.table td { padding: 14px 12px; border-top: 1px solid var(--border); color: var(--soft); font-size: 13px; vertical-align: middle; }
.table td:first-child { color: var(--text); font-weight: 500; }
.table tr:hover td { background: #ffffff04; }
.mono { font-family: var(--mono); font-size: 12px; color: var(--brand); }
.empty { padding: 36px 10px; text-align: center; color: var(--muted); font-size: 13px; }

/* Monochrome status: brightness + dot shape tell them apart */
.status {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 500; border: 1px solid transparent;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; box-sizing: border-box; }
.status.online   { color: var(--text); background: #c0c4cc1c; border-color: #c0c4cc33; }
.status.online::before { background: var(--text); box-shadow: 0 0 8px #ffffffaa; }
.status.idle     { color: var(--brand); background: #c0c4cc0d; }
.status.idle::before { border: 1.5px solid var(--brand); }
.status.offline  { color: var(--muted); background: #4e505822; }
.status.offline::before { background: var(--brand-dark); }
.status.expired  { color: var(--faint); background: transparent; border-color: var(--border-strong); text-decoration: line-through; }
.status.expired::before { border: 1.5px dashed var(--faint); }

/* ---------- Buttons & inputs ---------- */
.primary {
  background: var(--chrome); color: #08090b;
  border: 1px solid #ffffff55; border-radius: 9px;
  padding: 10px 16px; font-weight: 600; cursor: pointer;
  box-shadow: 0 0 0 0 #c0c4cc00, inset 0 -1px 0 #00000033;
  transition: box-shadow .2s, transform .1s;
}
.primary:hover { box-shadow: 0 0 22px #c0c4cc44, inset 0 -1px 0 #00000033; }
.primary:active { transform: translateY(1px); }
/* Matches Discord's grey secondary buttons the bot uses */
.secondary {
  background: var(--brand-dark); color: var(--text);
  border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 500; cursor: pointer;
  transition: background .15s;
}
.secondary:hover { background: #5d606b; }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.ghost:hover { color: var(--text); border-color: var(--brand-dark); }

.quick-actions { display: grid; gap: 10px; }
.action {
  display: flex; gap: 14px; align-items: center;
  padding: 14px; text-align: left; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 11px;
  transition: border-color .15s, background .15s;
}
.action:hover { background: var(--hover); border-color: var(--brand-dark); }
.action b { display: block; font-size: 13px; font-weight: 600; }
.action small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.action-icon {
  width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 9px; background: var(--raised); border: 1px solid var(--border-strong); color: var(--brand);
}

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.toolbar .input { width: 300px; }
.input, .select {
  width: 100%;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px #c0c4cc1f; }

/* ---------- Audit feed ---------- */
.feed { display: grid; gap: 10px; }
.feed .embed { padding: 14px 18px 14px 21px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.feed .embed b { font-size: 13px; font-weight: 500; }
.feed .embed small { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ---------- Modal & toast ---------- */
.modal-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 20px;
  background: #000000c4; backdrop-filter: blur(4px); animation: fade .15s;
}
.modal { width: min(540px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; box-shadow: 0 30px 90px #000; }
.modal h2 { margin: 0 0 20px; font-size: 20px; font-weight: 600; }
.form-grid { display: grid; gap: 14px; }
.field label { display: block; margin-bottom: 7px; font-size: 10px; letter-spacing: .16em; font-weight: 600; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; right: 24px; bottom: 24px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px 12px 16px; border-radius: 10px;
  background: var(--raised); border: 1px solid var(--border-strong); border-left: 3px solid var(--brand);
  color: var(--text); font-size: 13px;
  box-shadow: 0 14px 40px #000a;
  transform: translateY(24px); opacity: 0; pointer-events: none; transition: .25s;
}
.toast img { width: 18px; height: 18px; }
.toast.show { transform: none; opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; padding: 16px 16px 10px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 4px;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .brand { grid-column: 1 / -1; margin: 0 0 14px; }
  .nav-label, .environment { display: none; }
  .nav { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  .nav-item.active::before { left: 10px; right: 10px; top: auto; bottom: 0; width: auto; height: 2px; }
  .sidebar-bottom { margin-top: 0; border-left: 1px solid var(--border); padding-left: 4px; }
  .topbar { padding: 20px 16px; }
  .topbar h1 { font-size: 22px; }
  .content { padding: 20px 16px 36px; }
  .hero { padding: 26px 22px; min-height: 220px; background-position: right -180px center; }
  .hero::before { background: linear-gradient(90deg, #050709 0%, #050709e8 55%, #05070980 100%); }
  .hero h2 { font-size: 30px; }
  .hero-meta { flex-wrap: wrap; gap: 12px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .input { width: 100%; }
}

/* ---------- Live dashboard additions ---------- */
[hidden] { display: none !important; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.nowrap .ghost + .ghost { margin-left: 6px; }
.toolbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.narrow-card { max-width: 620px; }
.status.disabled { color: var(--faint); background: transparent; border-color: var(--border-strong); }
.status.disabled::before { background: var(--faint); }

.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse 50% 40% at 50% 30%, #c0c4cc14, transparent 70%), var(--bg);
}
.login-card { width: min(400px, 100%); display: grid; gap: 14px; padding: 34px 32px 28px 35px; }
.login-logo { width: 72px; height: 72px; margin: 0 auto 4px; filter: drop-shadow(0 0 22px #dfe2e766); }
.login-card h1 { margin: 0; text-align: center; font-size: 22px; font-weight: 600; }
.login-card > .stat-note { margin: -8px 0 6px; text-align: center; }
.login-card .primary { height: 44px; }
.back-link { justify-self: center; text-decoration: none; margin-top: 4px; }
.form-error { min-height: 0; color: var(--soft); font-size: 13px; }
.form-error:not(:empty) { padding: 10px 12px; border-radius: 9px; background: #4e505833; border-left: 3px solid var(--brand-dark); }

.modal.wide { width: min(720px, 100%); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.form-row .field.small { max-width: 160px; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
.mono-input { font-family: var(--mono); font-size: 13px; }
.textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 9px; height: 42px; font-size: 13px; color: var(--soft); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.danger-left { margin-right: auto; }
.modal-actions .danger-left:has(+ #kick) { margin-right: 0; }
.modal-actions .danger-left + #kick { margin-right: auto; }
.details {
  margin: 0; padding: 16px; border-radius: 10px; white-space: pre-wrap;
  background: var(--surface); border: 1px solid var(--border-strong);
  font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--soft); user-select: all;
}
.ghost:disabled, .secondary:disabled, .primary:disabled { opacity: .5; cursor: default; }
@media (max-width: 760px) {
  .form-row { grid-template-columns: 1fr; }
  .form-row .field.small { max-width: none; }
  .toolbar-actions { flex-wrap: wrap; }
  .top-actions .ghost { padding: 8px 10px; }
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); }
