:root {
  --bg: #f7f7f5;
  --fg: #1f2328;
  --muted: #6b7280;
  --border: #d9dce1;
  --accent: #2f5d8a;
  --accent-fg: #ffffff;
  --danger: #b3261e;
  --ok: #1e6b3e;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.topbar .brand {
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
}

.topbar nav a {
  margin-left: 1.25rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}

.topbar nav a:hover { text-decoration: underline; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

h1 { margin-top: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.card {
  display: block;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg);
}

.card:hover { border-color: var(--accent); }
.card h2 { margin: 0 0 0.35rem 0; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; }

textarea {
  width: 100%;
  min-height: 60vh;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

form.inline { display: inline; }

button, .btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
}

button.secondary, .btn.secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}

button.danger { background: var(--danger); }

label { display: block; margin-top: 0.9rem; font-weight: 600; font-size: 0.9rem; }
input[type=text], input[type=password], select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 0.25rem;
}

.flashes { list-style: none; padding: 0; }
.flash { padding: 0.6rem 0.9rem; border-radius: 6px; margin-bottom: 0.75rem; }
.flash-success { background: #e6f4ea; color: var(--ok); }
.flash-error { background: #fbe9e7; color: var(--danger); }
.flash-warning { background: #fff4e0; color: #8a5a00; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #eef2f6;
  color: var(--muted);
}

.log {
  background: #12161c;
  color: #d7dee7;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  padding: 1rem;
  border-radius: 6px;
  height: 50vh;
  overflow-y: auto;
  white-space: pre-wrap;
}
