/* buddy-app — mobiel-first, NXM-look (slate + cyan) */
:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e2e8f0;
  --cyan: #0891b2;
  --cyan-soft: #ecfeff;
  --indigo: #4f46e5;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --radius: 16px;
  --tabbar-h: 62px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: #0f172a; color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-ico { font-size: 26px; }
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; }
.topbar .sub { margin: 0; font-size: 11px; color: #94a3b8; }
.badge {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: #1e293b; color: #94a3b8; white-space: nowrap;
}
.badge.ok { background: rgba(5,150,105,.18); color: #34d399; }
.badge.warn { background: rgba(217,119,6,.18); color: #fbbf24; }
.badge.bad { background: rgba(220,38,38,.18); color: #f87171; }

/* ---------- layout ---------- */
main { padding: 14px 14px 0; max-width: 560px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 16px; margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.card.muted { color: var(--ink-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h2 { font-size: 15px; margin: 0; font-weight: 700; }
.hint { font-size: 12px; color: var(--ink-3); margin: 4px 0 8px; line-height: 1.45; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.hidden { display: none !important; }
.error {
  background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.25);
  color: var(--red); font-size: 12px; border-radius: 10px; padding: 8px 10px; margin-top: 8px;
}

/* ---------- formulier ---------- */
.field-row { display: flex; gap: 8px; margin: 6px 0; }
.field-row input {
  flex: 1; min-width: 0; font-size: 15px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; color: var(--ink);
}
.field-row input:focus { outline: 2px solid rgba(8,145,178,.35); border-color: var(--cyan); background: #fff; }
.lbl { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-top: 10px; }

.btn {
  font-size: 14px; font-weight: 600; padding: 10px 16px; border-radius: 12px; border: none;
  background: var(--cyan); color: #fff; cursor: pointer; transition: filter .15s;
}
.btn:active { filter: brightness(.9); }
.btn.wide { width: 100%; margin-top: 10px; }
.btn.sm { padding: 8px 12px; font-size: 13px; }
.btn.ghost { background: var(--cyan-soft); color: var(--cyan); border: 1px solid rgba(8,145,178,.25); }
.btn[disabled] { opacity: .55; cursor: wait; }

details.optional { margin: 6px 0; }
details.optional summary { font-size: 12px; color: var(--ink-2); cursor: pointer; padding: 4px 0; }

/* ---------- lijsten ---------- */
.item {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fafcfe;
}
.item .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.item .id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 700; }
.item .meta { font-size: 12px; color: var(--ink-2); margin-top: 3px; line-height: 1.5; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.on { background: var(--green); }
.dot.off { background: var(--ink-3); }

.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 10px; }
.kv { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.kv .k { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; }
.kv .v { font-size: 13px; font-weight: 600; margin-top: 2px; word-break: break-word; }

.big-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 52px; font-weight: 800; letter-spacing: .18em;
  text-align: center; color: var(--indigo);
  background: #eef2ff; border: 1px dashed rgba(79,70,229,.4);
  border-radius: 14px; padding: 10px 0 6px; margin: 8px 0;
}

.ext-link {
  display: block; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; background: #fafcfe;
}

/* ---------- tabbar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; background: #fff; border-top: 1px solid var(--line);
}
.tabbtn {
  flex: 1; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10.5px; font-weight: 600; color: var(--ink-3); font-family: inherit;
}
.tabbtn .ti { font-size: 19px; line-height: 1; filter: grayscale(1) opacity(.6); }
.tabbtn.active { color: var(--cyan); }
.tabbtn.active .ti { filter: none; }
