:root {
  --bg: #0c0f0d;
  --panel: #121613;
  --panel-raised: #181d1a;
  --border: #263028;
  --accent: #5be38c;
  --accent-dim: #2c5c41;
  --text: #e7ede9;
  --text-dim: #8a9a90;
  --warn: #e3b65b;
  --danger: #e35b5b;
  --font-display: 'Bahnschrift', 'Segoe UI Semibold', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'Consolas', 'SF Mono', monospace;
  --sidebar-w: 220px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
}

.hidden { display: none !important; }
.accent { color: var(--accent); }

a { color: var(--accent); text-decoration: none; }

/* ---------- Login screen ---------- */

#login-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 48px 56px;
  text-align: center;
  max-width: 380px;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0 0 8px;
}

.login-sub {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 28px;
}

.btn-discord {
  display: inline-block;
  background: #5865F2;
  color: white;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 4px;
  transition: filter 0.12s;
}
.btn-discord:hover { filter: brightness(1.1); }

/* ---------- App shell ---------- */

#app {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
}

.sidebar-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 13px;
  text-align: left;
  padding: 11px 20px;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-item:hover { color: var(--text); background: var(--panel-raised); }
.nav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

#staff-card {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#staff-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-raised);
}
#staff-name {
  font-size: 12px;
  flex: 1;
}
#logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
}
#logout-btn:hover { color: var(--danger); border-color: var(--danger); }

#content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 40px;
  max-width: 1100px;
}

.view { display: none; }
.view.active { display: block; }

h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 24px;
}
h3 {
  font-size: 15px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 32px 0 12px;
}
h4 {
  font-size: 13px;
  color: var(--text-dim);
  margin: 24px 0 10px;
}

/* ---------- Status cards ---------- */

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.status-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.status-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
}

/* ---------- Tables ---------- */

.data-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dt-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px 14px;
  font-size: 13px;
}
.dt-row.dt-header {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 14px 4px;
}

.dt-cell-dim { color: var(--text-dim); font-size: 12px; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.badge-active { background: rgba(227,91,91,0.15); color: var(--danger); }
.badge-revoked { background: rgba(91,227,140,0.15); color: var(--accent); }
.badge-expired { background: rgba(138,154,144,0.15); color: var(--text-dim); }

/* ---------- Forms / controls ---------- */

input[type="text"], select {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 4px;
  outline: none;
  width: 100%;
  margin-bottom: 16px;
}
input[type="text"]:focus, select:focus { border-color: var(--accent-dim); }

.panel-toolbar { display: flex; gap: 10px; align-items: center; }
.panel-toolbar select { width: auto; margin-bottom: 16px; }

.btn-ghost, .btn-secondary, .btn-danger, .btn-warn {
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--panel-raised);
  color: var(--text);
  cursor: pointer;
}
.btn-ghost { background: transparent; color: var(--text-dim); border: none; padding-left: 0; }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: rgba(227,91,91,0.12); }
.btn-warn { background: transparent; color: var(--warn); border-color: var(--warn); }

/* ---------- New ban form ---------- */

#new-ban-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 28px;
}
#new-ban-form h3 { margin-top: 0; }
#new-ban-form input, #new-ban-form select {
  margin-bottom: 10px;
}
#new-ban-form .hint {
  font-size: 11px;
  color: var(--text-dim);
  margin: 8px 0 0;
}

/* ---------- Profile ---------- */

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.profile-meta span { color: var(--text); }

/* ---------- Toasts ---------- */

#toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}
.toast {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 3px;
  min-width: 220px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.toast.error { border-left-color: var(--danger); }

/* ---------- Responsive ---------- */

@media (max-width: 800px) {
  #sidebar { position: relative; width: 100%; height: auto; }
  #content { margin-left: 0; padding: 20px; }
  .status-grid { grid-template-columns: 1fr; }
  .dt-row { grid-template-columns: 1fr; }
}
