:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.nav-link { color: var(--muted); font-size: 0.95rem; }
.linklike { background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }
.inline-form { display: inline; }

.container { max-width: 720px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #04222f;
  border: 0;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
}
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: default; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-role { background: var(--surface-2); color: var(--text); }
.badge-unread { background: var(--danger); color: #fff; }
.badge-pending { background: var(--warn); color: #3a2a00; }
.badge-approved { background: var(--ok); color: #06300f; }
.badge-rejected { background: var(--danger); color: #fff; }
.badge-left { background: var(--surface-2); color: var(--muted); }
.badge-winner { background: #fde047; color: #3a2f00; }

.messages { list-style: none; margin: 0; padding: 8px 16px; }
.msg { padding: 10px 12px; border-radius: var(--radius); margin-bottom: 8px; }
.msg-success { background: rgba(34,197,94,0.15); }
.msg-danger, .msg-error { background: rgba(239,68,68,0.15); }
.msg-info { background: rgba(56,189,248,0.15); }
.msg-warning { background: rgba(245,158,11,0.15); }

form label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 0.9rem; }
form input, form select, form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--surface-2);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}
form .errorlist { color: var(--danger); list-style: none; padding: 0; margin: 4px 0; font-size: 0.85rem; }
.helptext { color: var(--muted); font-size: 0.8rem; }

.list { list-style: none; padding: 0; margin: 0; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 12px; }
h1 { font-size: 1.4rem; margin: 0 0 12px; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--surface-2); }
.leader-winner { background: rgba(253,224,71,0.12); }
