/* Styling for the server-rendered pages outside the React SPA (login/signup/settings/my-daemons) --
   these never had any CSS at all (not a collectstatic regression, confirmed 2026-10-26: the
   templates simply had no <link> and no styles, ever). Color tokens copied from the React app's
   index.css (DESIGN.md §4.1) so these pages feel like the same product, not a bolted-on admin
   screen. Deliberately plain CSS, no build step -- these pages don't need the React app's tooling. */
:root {
  color-scheme: dark;
  --bg-canvas: #09090b;
  --bg-surface: #121215;
  --bg-subtle: #18181b;
  --border-muted: #27272a;
  --border-focus: #3f3f46;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --status-error: #ef4444;
  --brand-accent: #6366f1;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg-canvas: #ffffff;
    --bg-surface: #f4f4f5;
    --bg-subtle: #e4e4e7;
    --border-muted: #d4d4d8;
    --border-focus: #a1a1aa;
    --text-primary: #18181b;
    --text-secondary: #52525b;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-muted);
  background: var(--bg-surface);
}

header a,
header button {
  color: var(--text-secondary);
  text-decoration: none;
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

header a:hover,
header button:hover {
  color: var(--text-primary);
}

main {
  max-width: 420px;
  margin: 10vh auto 0;
  padding: 2rem;
}

/* Pages with real content tables (my_daemons, api_keys) need more width than the narrow
   login/signup card -- opt in with this class rather than widening `main` for everyone. */
main.wide {
  max-width: 720px;
  margin-top: 4rem;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

input,
select {
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-muted);
  background: var(--bg-surface);
  color: var(--text-primary);
  font: inherit;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
}

button[type="submit"] {
  padding: 0.65rem 1rem;
  border-radius: 6px;
  border: none;
  background: var(--brand-accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button[type="submit"]:hover {
  filter: brightness(1.08);
}

.errorlist,
p.error {
  color: var(--status-error);
  font-size: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--brand-accent);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

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