/* auteur: claude — Dashboard Eva. Zwart-wit zoals evaimmerzeel.nl, Akira Expanded voor koppen. */

@font-face {
  font-family: 'Akira Expanded';
  src: url('/fonts/AkiraExpanded-SuperBold.otf') format('opentype');
  font-weight: 700 900;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-soft: #f4f4f4;
  --text: #0a0a0a;
  --muted: #6b6b6b;
  --line: #dcdcdc;
  --accent: #0a0a0a;
  --danger: #b3261e;
  --late: #b3261e;
  --done: #9a9a9a;
  --radius: 14px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font-display: 'Akira Expanded', 'Arial Black', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

.display { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; }

/* ---------- layout ---------- */
.view {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(20px + var(--safe-t)) 16px calc(var(--tabbar-h) + var(--safe-b) + 96px);
}
.page-title { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 22px; letter-spacing: 0.02em; margin: 4px 0 18px; }
.page-sub { color: var(--muted); margin: -12px 0 18px; font-size: 14px; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 26px 0 8px; }
.section-title.late { color: var(--late); }
.empty { color: var(--muted); font-size: 15px; padding: 14px 0; }

.back { display: inline-block; text-decoration: none; color: var(--muted); font-size: 15px; padding: 6px 0 10px; }

/* ---------- lijsten ---------- */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list > li { border-bottom: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 2px; text-decoration: none; min-height: 56px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--muted); font-size: 14px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta .late { color: var(--late); font-weight: 600; }
.row-chev { color: var(--line); font-size: 20px; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--bg-soft); white-space: nowrap; }
.pill.status-Opgeleverd { color: var(--done); }

/* ---------- to-do's ---------- */
.todo { display: flex; align-items: flex-start; gap: 12px; padding: 12px 2px; }
.todo input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 2px solid var(--text); border-radius: 7px; display: grid; place-content: center; cursor: pointer; }
.todo input[type=checkbox]:checked { background: var(--text); }
.todo input[type=checkbox]:checked::after { content: ''; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg); }
.todo-text { flex: 1; min-width: 0; padding-top: 1px; word-break: break-word; }
.todo.klaar .todo-text { color: var(--done); text-decoration: line-through; }
.todo-from { display: block; font-size: 13px; color: var(--muted); text-decoration: none; }
.todo-del { background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 4px; cursor: pointer; }
.todo-add { display: flex; gap: 8px; margin-top: 8px; }
.todo-add input { flex: 1; }

/* ---------- filters ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 14px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed=true] { background: var(--text); color: #fff; border-color: var(--text); }

/* ---------- formulieren ---------- */
.field { margin: 0 0 16px; }
.field > label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=tel], input[type=email], input[type=date], input:not([type]), select, textarea, input[type=password] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  padding: 12px 14px;
  font-size: 16px; /* voorkomt inzoomen op iPhone */
  -webkit-appearance: none;
  appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text); }
.title-input { font-weight: 700; font-size: 20px !important; border: 0 !important; padding: 4px 0 !important; border-radius: 0 !important; border-bottom: 1px solid var(--line) !important; }
.title-input:focus { border-bottom-color: var(--text) !important; }
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; min-width: 0; }
.field-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.field-hint a { color: var(--text); }

.status-pick { display: flex; flex-wrap: wrap; gap: 6px; }

.btn { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px 16px; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--text); color: #fff; border-color: var(--text); }
.btn-danger { color: var(--danger); border-color: transparent; background: none; padding-left: 0; }
.btn:disabled { opacity: 0.4; }
.saved { font-size: 13px; color: var(--muted); min-height: 18px; margin: -8px 0 12px; }

.contact-links { display: flex; gap: 8px; margin: 0 0 18px; }
.contact-links a { flex: 1; text-align: center; text-decoration: none; }

/* ---------- vaste knoppen onderin ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: rgba(255,255,255,0.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar a { flex: 1; height: var(--tabbar-h); display: grid; place-items: center; text-decoration: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.tabbar a[aria-current=page] { color: var(--text); }
.tabbar a[aria-current=page]::before { content: ''; position: absolute; top: 0; width: 28px; height: 2px; background: var(--text); }
.tabbar a { position: relative; }

.fab {
  position: fixed; z-index: 11; right: 18px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  width: 60px; height: 60px; border-radius: 50%; border: 0;
  background: var(--text); color: #fff; font-size: 32px; line-height: 1; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}
.fab:active { transform: scale(0.96); }

/* ---------- snel toevoegen ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.35); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--bg); border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(16px + var(--safe-b));
  max-width: 640px; margin: 0 auto;
}
.sheet-label { display: block; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 15px; margin-bottom: 12px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 12px; }
.sheet-actions .btn { flex: 1; }

.toast {
  position: fixed; z-index: 30; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 90px);
  max-width: 420px; margin: 0 auto; background: var(--text); color: #fff; border-radius: 12px; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px;
}
.toast a { color: #fff; font-weight: 700; }
.toast.error { background: var(--danger); }

.offline { position: sticky; top: 0; z-index: 15; background: #fff4d6; color: #5c4400; font-size: 14px; text-align: center; padding: calc(8px + var(--safe-t)) 12px 8px; }
body.is-offline .fab { display: none; }

/* ---------- login ---------- */
body.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-form { width: 100%; max-width: 300px; text-align: center; }
.login-form h1 { font-size: 26px; margin: 0 0 28px; }
.login-form input { text-align: center; font-size: 24px; letter-spacing: 0.3em; padding: 14px; }
.login-form input::placeholder { letter-spacing: 0.05em; font-size: 16px; color: var(--muted); }
.login-form .btn { width: 100%; margin-top: 12px; padding: 14px; }
.login-error { color: var(--danger); font-size: 14px; min-height: 18px; margin-top: 14px; }

@media (min-width: 700px) {
  .fab { right: calc(50% - 320px + 4px); }
}

.danger-zone { margin-top: 28px; }
.btn-new { margin-bottom: 14px; }

[hidden] { display: none !important; }
a.btn { text-decoration: none; }
