:root {
  --ink: #1b1b1f;
  --muted: #6b6b76;
  --line: #e4e3e8;
  --bg: #fafafa;
  --card: #ffffff;
  --accent: #6d28d9;
  --accent-ink: #ffffff;
  --danger: #b3261e;
  --ok: #146c43;
  --warn: #8a5a00;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

#app { min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.topbar .brand { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.topbar .brand span { color: var(--accent); }

.topbar nav a {
  margin-left: 18px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}
.topbar nav a.active, .topbar nav a:hover { color: var(--ink); }

.container { max-width: 960px; margin: 0 auto; padding: 28px 24px 80px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=datetime-local], textarea, select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

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

button {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
}
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: var(--danger); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge.verified, .badge.sent, .badge.delivered { background: #dcfce7; color: var(--ok); }
.badge.pending, .badge.submitted, .badge.scheduled, .badge.draft { background: #fef3c7; color: var(--warn); }
.badge.rejected, .badge.failed, .badge.send_failed, .badge.delivery_failed, .badge.blocked { background: #fee2e2; color: var(--danger); }
.badge.sending { background: #ede9fe; color: var(--accent); }

.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.error { color: var(--danger); font-size: 13px; margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; }
.stat { display: inline-block; margin-right: 20px; }
.stat .n { font-size: 22px; font-weight: 700; display: block; }
.stat .l { font-size: 12px; color: var(--muted); }
a.link { color: var(--accent); cursor: pointer; text-decoration: none; font-size: 13px; }
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: none; }
