:root {
  --bg: #0f1419;
  --card: #1a222c;
  --text: #e8eef4;
  --muted: #9aa7b4;
  --accent: #3d8bfd;
  --warn: #d4a017;
  --danger: #e5534b;
  --ok: #3fb950;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: #151c24;
  border-bottom: 1px solid #2a3544;
}
.brand { font-weight: 600; }
.userbar { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.userbar .who { color: var(--muted); }
.userbar .role {
  background: #2a3544;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 1.25rem; }
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  row-gap: 0.45rem;
  margin: 0 0 1rem;
}
.tabs a {
  text-decoration: none;
  color: var(--text);
  border: 1px solid #2a3544;
  background: #1a222c;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.88rem;
}
.tabs a.active {
  background: #243041;
  border-color: #3a4a60;
}
h1 { font-size: 1.35rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.muted { color: var(--muted); font-size: 0.9rem; }
.navhint { font-size: 0.85rem; margin-top: -0.25rem; }
.card {
  background: var(--card);
  border: 1px solid #2a3544;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.card.narrow { max-width: 420px; margin: 2rem auto; }
.dangerzone { border-color: #5c2d2d; }
.stack label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; }
.stack .fieldrange { display: block; font-size: 0.8rem; margin-top: 0.15rem; color: var(--muted); }
.stack input, .stack textarea, .stack select {
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #2a3544;
  background: #0f1419;
  color: var(--text);
}
.inlinegrid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
}
.btnrow { display: flex; flex-wrap: wrap; gap: 0.5rem; }
button {
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #2a3544;
  background: #243041;
  color: var(--text);
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
}
.btnlink {
  display: inline-block;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid #2a3544;
  background: #243041;
  color: var(--text);
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
}
button.primary { background: var(--accent); border-color: #2f6fd6; color: #fff; }
button.warn { background: #4a3d12; border-color: var(--warn); }
button.danger { background: #5c2220; border-color: var(--danger); color: #ffd6d4; }
button.linkbtn {
  background: transparent;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  padding: 0;
}
.inline { display: inline; margin: 0; }
.flash { list-style: none; padding: 0; margin: 0 0 1rem; }
.flash li { padding: 0.5rem 0.75rem; border-radius: 6px; margin-bottom: 0.35rem; }
.flash .ok { background: #14321f; color: #b6f0c8; }
.flash .warning { background: #3d300f; color: #f3d991; }
.flash .error { background: #3a1515; color: #ffb4b0; }
table.audit { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
table.audit th, table.audit td { text-align: left; padding: 0.35rem 0.4rem; border-bottom: 1px solid #2a3544; }
table.audit th { color: var(--muted); font-weight: 500; }
table.userlist { min-width: 1250px; }
table.userlist .useractions { white-space: nowrap; text-align: right; }
table.userlist .useractions form { display: inline; margin-left: 0.25rem; }
table.userlist .useractions button { padding: 0.3rem 0.55rem; font-size: 0.8rem; }
table.userlist .rolecell { vertical-align: middle; min-width: 11rem; }
table.userlist .roleform {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
table.userlist .roleselect {
  flex: 1 1 7rem;
  min-width: 6.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid #2a3544;
  background: #0f1419;
  color: var(--text);
  font-size: 0.82rem;
}
table.userlist .compactbtn {
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
}
table.userlist .suspendcell { min-width: 13rem; vertical-align: top; }
table.userlist .suspendform { display: flex; align-items: center; gap: 0.35rem; }
table.userlist .suspendform input[type="datetime-local"] {
  width: 9.5rem;
  min-width: 0;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  border: 1px solid #2a3544;
  background: #0f1419;
  color: var(--text);
  font-size: 0.77rem;
}
.tablewrap { overflow-x: auto; }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  border: 1px solid #2a3544;
  background: #243041;
}
.badge-mod { background: #1e2a22; border-color: #2d4a38; color: #9ed4b0; }
.badge-admin { background: #222a3a; border-color: #3a4a70; color: #a8c4ff; }
.badge-senior { background: #2a2438; border-color: #5a4a80; color: #d4c4ff; }
.badge-owner { background: #3a2820; border-color: #8a5a30; color: #ffc9a0; }
.oktext { color: var(--ok); font-size: 0.85rem; }
.warnpill {
  font-size: 0.75rem;
  color: #e8c86a;
  background: #2a2410;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
.actionpill {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid #2a3544;
  font-size: 0.74rem;
}
.actionpill.ok { color: #b6f0c8; background: #14321f; border-color: #2b5a3f; }
.actionpill.warn { color: #ffd3a0; background: #3b2416; border-color: #6b3f20; }
.actionpill.muted { color: var(--muted); background: #1f2731; border-color: #33455d; }
code { background: #0f1419; padding: 0.1rem 0.25rem; border-radius: 4px; font-size: 0.85em; }
