:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4f;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #3d8bfd;
  --accent-dim: #2563c7;
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 10px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-height: 3.5rem;
}
.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.nav a { font-size: 0.95rem; }

.main { padding: 2rem 0 3rem; }

.footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

h1 { font-size: 1.75rem; margin: 0 0 1rem; font-weight: 600; }
h2 { font-size: 1.2rem; margin: 0 0 0.75rem; color: var(--muted); font-weight: 600; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.alert.ok { background: rgba(74, 222, 128, 0.12); border: 1px solid var(--ok); color: #bbf7d0; }
.alert.err { background: rgba(248, 113, 113, 0.12); border: 1px solid var(--danger); color: #fecaca; }

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  max-width: 28rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}
textarea { max-width: 100%; min-height: 5rem; resize: vertical; }

.row { margin-bottom: 1rem; }

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.btn:hover { background: var(--accent-dim); text-decoration: none; }
.btn.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.danger { background: #b91c1c; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
th { color: var(--muted); font-weight: 600; }
tr:hover td { background: rgba(255,255,255,0.02); }

.mono { font-family: ui-monospace, monospace; font-size: 0.9em; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.stat strong { display: block; font-size: 1.5rem; }
.stat span { color: var(--muted); font-size: 0.85rem; }

.qr-wrap { margin-top: 1rem; }
.qr-wrap img { border-radius: 8px; background: #fff; padding: 8px; }

.login-box { max-width: 380px; margin: 3rem auto; }
