@font-face {
  font-family: 'Plex Mono';
  font-weight: 400;
  font-style: normal;
  src: url('/static/fonts/plexmono-400.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  font-weight: 500;
  font-style: normal;
  src: url('/static/fonts/plexmono-500.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  font-weight: 600;
  font-style: normal;
  src: url('/static/fonts/plexmono-600.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Obviously';
  src: url('/static/fonts/brand/Obviously.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Obviously';
  src: url('/static/fonts/brand/Obviously-Black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Proxima Nova';
  src: url('/static/fonts/brand/ProximaNova-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Proxima Nova';
  src: url('/static/fonts/brand/ProximaNova-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Palette and type match netherhost.net exactly — this dashboard is a sibling
   property to that site and intentionally shares its single dark identity. */
:root {
  --bg: #0b0b12;
  --surface: #131321;
  --surface-raised: #1c1c2e;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --text-faint: rgba(255, 255, 255, 0.32);
  --accent: #8b3dff;
  --accent-hover: #a855ff;
  --accent-text: #ffffff;
  --accent-wash: rgba(139, 61, 255, 0.16);
  --good: #10b981;
  --good-wash: rgba(16, 185, 129, 0.12);
  --warn: #f59e0b;
  --warn-wash: rgba(245, 158, 11, 0.12);
  --crit: #ef4444;
  --crit-wash: rgba(239, 68, 68, 0.12);
  --neutral: rgba(255, 255, 255, 0.6);
  --neutral-wash: rgba(255, 255, 255, 0.06);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 40px -20px rgba(139,61,255,.35);
  --discord: #5865F2;
  --discord-hover: #4956E3;
  --font-headings: 'Obviously', 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Proxima Nova', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { text-wrap: balance; margin: 0; font-family: var(--font-headings); }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-text); }

.mono { font-family: 'Plex Mono', ui-monospace, "Cascadia Code", Consolas, monospace; }
.tab-nums { font-variant-numeric: tabular-nums; }

.eyebrow {
  font-family: 'Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ================= LOGIN ================= */
.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  overflow: hidden;
  background: var(--bg);
}
#radar {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .55;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 40px 36px 32px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
}
.brand svg { flex: none; }
.brand .word {
  font-family: var(--font-headings);
  font-weight: 900;
  font-size: 21px;
  letter-spacing: .01em;
}
.login-card h1 {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
}
.login-card p.sub {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 26px;
  max-width: 30ch;
}
.form-error {
  background: var(--crit-wash);
  color: var(--crit);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 18px;
}
.btn-discord {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--discord);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 13px 16px;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
  text-decoration: none;
}
.btn-discord:hover { background: var(--discord-hover); }
.btn-discord:active { transform: translateY(1px); }

.login-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 24px 0 18px;
}
.perm-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 9px;
}
.perm-list li {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; color: var(--text-muted);
}
.perm-list svg { flex: none; color: var(--good); }

.login-footer {
  position: relative; z-index: 2;
  margin-top: 26px;
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
}
.login-footer a { text-decoration: underline; text-underline-offset: 2px; }

/* ================= DASHBOARD ================= */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
.rail {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
}
.guild-switch {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
}
.guild-switch:hover { background: var(--neutral-wash); }
.guild-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(155deg, var(--accent-hover), var(--accent));
  color: #fff; font-family: 'Plex Mono',monospace; font-weight: 600; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
  object-fit: cover;
}
.guild-name-wrap { min-width: 0; flex: 1; }
.guild-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-sub { font-size: 11px; color: var(--text-faint); }
.guild-switch .chev { color: var(--text-faint); flex: none; }

nav.railnav { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rail-section-label {
  font-family: 'Plex Mono', monospace; font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-faint);
  padding: 14px 10px 6px;
}
.navlink {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--text-muted);
  text-decoration: none;
  position: relative;
}
.navlink svg { flex: none; opacity: .85; }
.navlink:hover { background: var(--neutral-wash); color: var(--text); }
.navlink.active {
  background: var(--accent-wash);
  color: var(--accent);
  font-weight: 600;
}
.navlink.active svg { opacity: 1; }
.navlink .count {
  margin-left: auto;
  font-family: 'Plex Mono', monospace;
  font-size: 11px;
  background: var(--neutral-wash);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 1px 7px;
}
.navlink.active .count { background: var(--accent); color: var(--accent-text); }

.rail-profile {
  display: flex; align-items: center; gap: 9px;
  border-top: 1px solid var(--border);
  padding: 12px 8px 4px;
  margin-top: 8px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(155deg, var(--accent), #5b21b6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: 'Plex Mono', monospace; font-weight: 600; font-size: 11.5px;
  flex: none;
}
.rail-profile .who { min-width: 0; }
.rail-profile .name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow:hidden; text-overflow:ellipsis; }
.rail-profile .role { font-size: 11px; color: var(--text-faint); }
.rail-profile .signout { margin-left: auto; color: var(--text-faint); }

main.content { padding: 22px 30px 60px; min-width: 0; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 26px;
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  width: 340px;
  color: var(--text-faint);
}
.search input {
  border: none; background: transparent; outline: none;
  font-size: 13px; color: var(--text); width: 100%;
  font-family: inherit;
}
.search input::placeholder { color: var(--text-faint); }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--neutral-wash); }
.btn-primary {
  display: flex; align-items: center; gap: 7px;
  background: var(--accent); color: var(--accent-text);
  border: none; border-radius: 8px;
  padding: 9px 14px; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover { background: var(--accent-hover); }

.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px;
}
.page-head h1 { font-size: 20px; font-weight: 600; }
.page-head .updated { font-size: 11.5px; color: var(--text-faint); }
.page-head .updated .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--good); margin-right: 6px;
  box-shadow: 0 0 0 3px var(--good-wash);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat-tile .label { font-size: 12px; color: var(--text-muted); }
.stat-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.stat-value {
  font-family: 'Plex Mono', monospace; font-weight: 600; font-size: 27px; line-height: 1;
}
.stat-tile.crit .stat-value { color: var(--crit); }
.stat-tile.good .stat-value { color: var(--good); }
.stat-delta { font-size: 11.5px; font-family: 'Plex Mono', monospace; }
.stat-delta.up { color: var(--crit); }
.stat-delta.down { color: var(--good); }
.spark { display: block; }

.filter-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 14px;
}
.filter-pill {
  font-family: 'Plex Mono', monospace;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.filter-pill .n { color: var(--text-faint); }
.filter-pill.active {
  background: var(--text); color: var(--bg); border-color: var(--text);
}
.filter-pill.active .n { color: var(--bg); opacity: .6; }

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
}
table.queue { width: 100%; border-collapse: collapse; min-width: 920px; }
table.queue th {
  text-align: left;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 600;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.queue td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.2px;
  vertical-align: middle;
  white-space: nowrap;
}
table.queue tbody tr:last-child td { border-bottom: none; }
table.queue tbody tr { transition: background .1s ease; }
table.queue tbody tr:hover { background: var(--neutral-wash); }
table.queue tbody tr.flag td:first-child {
  box-shadow: inset 3px 0 0 var(--crit);
}
td.subject-cell { white-space: normal; max-width: 320px; }
td.subject-cell .subj { font-weight: 600; font-size: 13.3px; }
td.subject-cell .snippet { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

.req-cell { display: flex; align-items: center; gap: 8px; }
.req-avatar {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Plex Mono', monospace; font-size: 9.5px; font-weight: 600; color: #fff;
}

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; font-family: 'Plex Mono', monospace;
  padding: 3px 9px; border-radius: 20px;
}
.pill .d { width: 6px; height: 6px; border-radius: 50%; }
.pill.open { background: var(--good-wash); color: var(--good); }
.pill.pending { background: var(--warn-wash); color: var(--warn); }
.pill.closed { background: var(--neutral-wash); color: var(--neutral); }

.cat-tag { font-size: 12px; color: var(--text-muted); }

.prio { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.prio .bar { width: 3px; height: 14px; border-radius: 2px; }
.prio.urgent .bar { background: var(--crit); }
.prio.high .bar { background: var(--warn); }
.prio.normal .bar { background: var(--border-strong); }
.prio.low .bar { background: var(--border); }

.assignee { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.assignee.unassigned { color: var(--crit); font-weight: 600; }

.id-cell { font-family: 'Plex Mono', monospace; color: var(--text-muted); font-size: 12.5px; }
.age-cell, .activity-cell { font-family: 'Plex Mono', monospace; font-size: 12px; color: var(--text-muted); }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
}

/* ================= ADMIN FORMS (categories / settings / panels) ================= */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; max-width: 480px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.field input[type="text"], .field select, .field textarea {
  font-family: inherit; font-size: 13.5px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
}
.field textarea { resize: vertical; min-height: 90px; }

.checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-chip {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 12px; font-size: 12.5px; cursor: pointer;
  background: var(--surface);
}
.checkbox-chip input { accent-color: var(--accent); }

.btn-secondary {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 14px; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-secondary:hover { background: var(--neutral-wash); }

.btn-danger {
  background: var(--crit-wash); color: var(--crit); border: 1px solid transparent;
  border-radius: 8px; padding: 7px 12px; font-size: 12.5px; font-weight: 600;
  font-family: inherit; cursor: pointer;
}
.btn-danger:hover { filter: brightness(0.95); }

.card-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.card-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px;
}
.card-row .meta { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.card-row .title { font-family: var(--font-headings); font-weight: 500; font-size: 14.5px; }
.card-row .actions { display: flex; gap: 8px; }

.form-section { margin-top: 28px; }
.form-section h2 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.empty-note { color: var(--text-muted); font-size: 13.5px; }
