:root {
  --surface-0: #f1f0ea;
  --surface-1: #f8f8f6;
  --surface-2: #ffffff;
  --text-primary: #1a1a18;
  --text-secondary: #5f5e5a;
  --text-muted: #888780;
  --border: rgba(0,0,0,0.1);
  --border-strong: rgba(0,0,0,0.2);
  --rws-blue: #007BC7;
  --green: #1a7f4b;
  --red: #c0392b;
  --radius: 8px;
  --font-sans: system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); color: var(--text-primary); background: var(--surface-0); }

/* ── Login ─────────────────────────────────────────── */
.login-overlay { position: fixed; inset: 0; background: var(--surface-0); display: flex; align-items: center; justify-content: center; z-index: 100; }
.login-card { background: var(--surface-2); border: 0.5px solid var(--border); border-radius: 12px; padding: 2rem; width: 340px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.login-logo .rws-name { font-size: 15px; font-weight: 600; }
.login-logo .rws-sub { font-size: 12px; color: var(--text-muted); }
.login-card label { font-size: 13px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 5px; }
.login-card input { padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 14px; }

/* ── Layout ────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; min-width: 240px; border-right: 0.5px solid var(--border); background: var(--surface-1); display: flex; flex-direction: column; }
.sidebar-logo { padding: 1.25rem 1rem 1rem; border-bottom: 0.5px solid var(--border); }
.rws { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rws-mark { width: 28px; height: 28px; background: var(--rws-blue); border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rws-mark svg { width: 18px; height: 18px; fill: white; }
.rws-name { font-size: 14px; font-weight: 500; }
.sidebar-sub { font-size: 12px; color: var(--text-muted); }
.nav-section { padding: 1rem 0 0.5rem; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; padding: 0 1rem 0.4rem; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 1rem; font-size: 13.5px; color: var(--text-secondary); cursor: pointer; border-left: 2px solid transparent; }
.nav-item:hover { background: var(--surface-0); color: var(--text-primary); }
.nav-item.active { color: var(--rws-blue); border-left-color: var(--rws-blue); background: var(--surface-0); font-weight: 500; }
.nav-item i { font-size: 16px; opacity: 0.85; }
.nav-divider { height: 0.5px; background: var(--border); margin: 0.25rem 0; }

.main { flex: 1; display: flex; flex-direction: column; }
.topbar { height: 52px; border-bottom: 0.5px solid var(--border); display: flex; align-items: center; padding: 0 1.5rem; gap: 10px; background: var(--surface-2); }
.topbar-title { font-size: 15px; font-weight: 500; }
.topbar-sub { font-size: 13px; color: var(--text-muted); }
.topbar-sep { color: var(--border-strong); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.ingelogd { font-size: 12.5px; color: var(--text-secondary); }
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); }
.health-dot.ok { background: var(--green); }
.health-dot.down { background: var(--red); }
.content { padding: 2rem 1.5rem; flex: 1; }

/* ── Formulieren ───────────────────────────────────── */
.view-head { margin-bottom: 1.5rem; }
.view-head h1 { font-size: 20px; font-weight: 500; margin-bottom: 4px; }
.view-head p { font-size: 13.5px; color: var(--text-secondary); max-width: 620px; line-height: 1.5; }
.form-card { background: var(--surface-2); border: 0.5px solid var(--border); border-radius: 12px; padding: 1.5rem; max-width: 720px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.field .opt { color: var(--text-muted); font-weight: 400; }
.field input, .field select, .field textarea { padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 13.5px; font-family: inherit; background: var(--surface-2); width: 100%; }
.field textarea { resize: vertical; }
.field textarea.mono { font-family: var(--font-mono); font-size: 12.5px; }
.field .hint { font-size: 11.5px; color: var(--text-muted); }
.field .check { flex-direction: row; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-primary); cursor: pointer; }
.field .check input { width: auto; }
.form-sub { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 8px; padding-bottom: 4px; border-bottom: 0.5px solid var(--border); }
.form-actions { margin-top: 1.5rem; display: flex; align-items: center; gap: 12px; }

/* ── Knoppen ───────────────────────────────────────── */
.btn { padding: 8px 16px; border-radius: var(--radius); font-size: 13.5px; font-weight: 500; cursor: pointer; border: 1px solid transparent; font-family: inherit; }
.btn-primary { background: var(--rws-blue); color: #fff; }
.btn-primary:hover { background: #0069ab; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-0); }
.btn:disabled { opacity: 0.55; cursor: default; }

/* ── Meldingen / resultaat ─────────────────────────── */
.melding { font-size: 13px; padding: 10px 12px; border-radius: var(--radius); }
.melding.succes { background: #e5f4ec; color: var(--green); }
.melding.fout { background: #fbeae8; color: var(--red); }
.resultaat-blok { margin-top: 1.25rem; }
.resultaat-blok pre { background: #1a1a18; color: #e8e8e4; padding: 12px 14px; border-radius: var(--radius); font-family: var(--font-mono); font-size: 12px; overflow: auto; max-height: 320px; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
