/* Perroq — huisstijl. Licht standaard, donker automatisch via prefers-color-scheme.
   Componenten: .btn, .card, .chip, .badge, .field/.input, .list, .tabbar. Alles telefoon-eerst (390 px). */
:root {
  --purple: #756D83;
  --orange: #F87644;
  --orange-press: #E5663A;
  --bg: #F6F3F0;
  --surface: #FFFFFF;
  --text: #2B2730;
  --muted: #8B8494;
  --line: #E6E1DC;
  --good: #2E8B57;
  --warn: #D4A64A;
  --bad: #C0392B;
  --tint: rgba(117, 109, 131, .08);
  --shadow: 0 1px 2px rgba(43, 39, 48, .05), 0 6px 20px rgba(43, 39, 48, .06);
  --radius: 16px;
  --radius-sm: 12px;
  --tap: 44px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --purple: #A79FB5;
    --bg: #1C1A20;
    --surface: #26232C;
    --text: #F1EEF4;
    --muted: #9C95A6;
    --line: #36323D;
    --tint: rgba(167, 159, 181, .12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--purple); }
h1, h2, h3 { color: var(--purple); line-height: 1.2; margin: 0; font-weight: 650; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Logo: lichte of donkere versie van het woordmerk */
.logo { display: block; height: 28px; width: auto; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .logo-light { display: none; } .logo-dark { display: block; } }

/* Knoppen */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:active { background: var(--orange-press); }
.btn.secondary { background: var(--purple); border-color: var(--purple); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.secondary { color: #1C1A20; } }
.btn.ghost { background: transparent; border-color: transparent; color: var(--purple); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }

/* Kaart */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}

/* Chip (rol, filter) en badge (aantal) */
.chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px;
  background: var(--tint); color: var(--purple); font-size: 13px; font-weight: 600; border: 0;
}
button.chip { min-height: 36px; padding: 0 14px; font: inherit; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--purple); color: var(--surface); }
.chip.good { background: rgba(46, 139, 87, .12); color: var(--good); }
.chip.warn { background: rgba(212, 166, 74, .16); color: #9C7424; }
.chip.bad { background: rgba(192, 57, 43, .12); color: var(--bad); }
@media (prefers-color-scheme: dark) { .chip.warn { color: var(--warn); } }
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: 999px; background: var(--orange); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 1;
}

/* Invoer */
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.input {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px; /* 16 px: iOS zoomt dan niet in */
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--tint); }

/* Lijst */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
.list > li, .list > a { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px;
  border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.list > :first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }

/* Tabbalk (onderaan op de telefoon) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a, .tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px;
  font-weight: 600; text-decoration: none; cursor: pointer;
}
.tabbar .on { color: var(--orange); }
.tabbar svg { width: 24px; height: 24px; }
.tabbar[hidden] { display: none; }
