:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.5;
  --bg: #0f1419;
  --surface: #171d26;
  --border: #2a3444;
  --text: #e7ecf3;
  --muted: #aab4c3;
  --accent: #3b82f6;
  --ok: #4ade80;
  --warn: #fbbf24;
  --error: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.nav-signout {
  background: none;
  border: 0;
  color: #93c5fd;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  padding: 0;
}

.nav-signout:hover {
  text-decoration: underline;
}

.nav [aria-current="page"] {
  color: #e7ecf3;
  font-weight: 600;
  text-decoration: none;
}

a { color: #93c5fd; }

.layout {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.card + .card { margin-top: 1rem; }

h1 { font-size: 1.35rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
p, .lede { margin: 0 0 1rem; color: var(--muted); font-size: 0.95rem; }

label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: #c8d0dc;
}

input, textarea, select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #3a4658;
  background: var(--bg);
  color: inherit;
  font-size: 0.98rem;
}

input.code {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.field { margin-bottom: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:disabled { opacity: 0.6; cursor: wait; }
.btn--ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn--danger { background: #dc2626; }
.btn--sm { padding: 0.45rem 0.75rem; font-size: 0.85rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.status { margin-top: 1rem; min-height: 1.25rem; font-size: 0.9rem; }
.status.error { color: var(--error); }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }

.hint { font-size: 0.85rem; color: #9aa4b4; margin-top: 0.35rem; }

.credential {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  border: 1px dashed #3a4658;
  background: #11161d;
}

.credential code {
  display: block;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  margin-top: 0.35rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.35rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th { color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge--ok { background: rgba(74, 222, 128, 0.15); color: var(--ok); }
.badge--off { background: rgba(248, 113, 113, 0.15); color: var(--error); }

.hidden { display: none !important; }

@media (max-width: 600px) {
  .btn-row { flex-direction: column; }
  .btn { width: 100%; }
}
