 :root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --row-alt: #f8f8fa;
  --border: #e4e4e7;
  --text: #18181b;
  --muted: #52525b;
  --faint: #71717a;
  --lijn-yellow: #ffd200;
  --lijn-ink: #18181b;
  --danger: #dc2626;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #121214;
  --surface: #18181c;
  --row-alt: #19191d;
  --border: #2a2a30;
  --text: #ececef;
  --muted: #a1a1aa;
  --faint: #71717a;
  --lijn-yellow: #ffd200;
  --lijn-ink: #121214;
  --danger: #f87171;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  max-width: 100%;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1rem;
}

.y-tick {
  display: inline-block;
  width: 10px;
  height: 3px;
  background: var(--lijn-yellow);
  vertical-align: middle;
  margin-right: 0.35rem;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.98rem;
}

.logo-box {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--lijn-yellow);
  color: var(--lijn-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.main-wrap {
  padding: 1.5rem 1rem 3rem;
}

.kicker {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

h1 {
  margin: 0.25rem 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.small-copy {
  font-size: 0.85rem;
}

.login-box {
  max-width: 440px;
  margin: 2rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.35rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
}

.field textarea {
  resize: vertical;
  min-height: 76px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.52rem 0.9rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
}

.btn-yellow {
  background: var(--lijn-yellow);
  color: var(--lijn-ink);
  border-color: var(--lijn-yellow);
}

.btn-ghost {
  background: var(--bg);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--row-alt);
}

.btn-sm {
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
}

.btn-danger {
  background: var(--bg);
  color: var(--danger);
  border-color: var(--border);
}

.panel-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.top-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.status-line {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  min-height: 1.2em;
}

.err-text {
  margin: 0;
  font-size: 0.84rem;
  color: var(--danger);
}

.preview-wrap {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.preview-head {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.json-pre {
  margin: 0;
  max-height: 240px;
  overflow: auto;
  padding: 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.45;
}

.list-card {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.dirty-badge {
  background: var(--lijn-yellow);
  color: var(--lijn-ink);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.admin-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.admin-table th {
  background: var(--row-alt);
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: break-word;
  font-size: 0.86rem;
}

.admin-table tbody tr:nth-child(even) {
  background: var(--row-alt);
}

.col-act {
  width: 150px;
}

.row-btns {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 60;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 820px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .col-act {
    width: 105px;
  }
}
