:root {
  --bg: #030508;
  --bg-elevated: #10151c;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.68);
  --line: rgba(255, 255, 255, 0.1);
  --cyan: #00e7ff;
  --lime: #d8ff3a;
  --danger: #ff8d8d;
  --ok: #9dffc7;
  --warn: #ffd27a;
  --radius: 18px;
  --font-display: "Anton", Impact, sans-serif;
  --font-ui: "Montserrat", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(0, 231, 255, 0.16), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(216, 255, 58, 0.08), transparent 55%),
    var(--bg);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--cyan); }

button, input, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(3, 5, 8, 0.86);
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(12px);
}

.brand {
  color: white;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.brand span {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0;
  color: var(--lime);
}

.userbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem 0.75rem;
  max-width: 100%;
  color: var(--muted);
}

.userbar span { overflow-wrap: anywhere; }

.wrap {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

.nav {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.nav a {
  color: white;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
}

.nav a[aria-current="page"] {
  background: var(--lime);
  color: #111;
  border-color: var(--lime);
}

.callout, .banner, .card, .panel {
  background: rgba(16, 21, 28, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.callout, .banner {
  padding: 0.9rem 1rem;
  color: var(--muted);
}

.banner {
  margin-bottom: 1rem;
  border-color: rgba(216, 255, 58, 0.45);
  color: white;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: start;
}

.card, .panel { padding: 1rem 1.1rem 1.2rem; }

.card h2, .panel h2, .login h1 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }

.feed li { display: grid; gap: 0.15rem; }

.muted { color: var(--muted); }
.small { font-size: 0.78rem; }
.error { color: var(--danger); }
.ok { color: var(--ok); }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.4rem 0.55rem;
}

td {
  padding: 0.75rem 0.55rem;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.subject { color: white; font-weight: 600; text-decoration: none; white-space: nowrap; }
.subject:hover { color: var(--lime); }

.tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
}

.tag-sent, .tag-submitted { color: var(--ok); }
.tag-failed { color: var(--danger); }
.tag-partial, .tag-sending, .tag-queued { color: var(--warn); }

.login {
  max-width: 560px;
  margin: 8vh auto 0;
  padding: 1.5rem;
}

.btn, .btn-primary, .btn-ghost {
  border-radius: 999px;
  border: 0;
  padding: 0.7rem 1rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary { background: var(--lime); color: #111; font-weight: 700; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: 0.55; cursor: wait; }
.btn-ghost {
  background: transparent;
  color: white;
  border: 1px solid var(--line);
}

label { display: grid; gap: 0.35rem; margin-bottom: 0.85rem; font-weight: 600; }
label span { font-weight: 600; }

input, textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #070b10;
  padding: 0.7rem 0.8rem;
}

textarea { min-height: 180px; resize: vertical; }

.hint { color: var(--muted); margin-top: 0; }

.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

.back { color: var(--muted); text-decoration: none; }
.stats { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.stat strong { display: block; font-size: 1.4rem; }

.empty { color: var(--muted); margin: 0.5rem 0; }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .wrap { width: min(1100px, calc(100% - 1.25rem)); }
  table, thead, tbody, tr, th, td { display: block; width: 100%; }
  table thead { display: none; }
  table tr { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
  table td { border: 0; padding: 0.15rem 0; overflow-wrap: anywhere; }
  table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
}
