/* Formulieren, pickers, badges en statusmeldingen: overgenomen uit de registraties-app
   (dealerflow-werkmaterieel-app/styles.css) zodat de uren- en ritformulieren hier gelijk werken.
   Kleuren komen uit de tokens in styles.css. */

.history-group { margin-top: 20px; }
.history-group h3 { margin-bottom: 12px; }
.history-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.history-summary > div { background: var(--surface-2); padding: 12px 8px; border-radius: var(--radius-sm); font-size: 12px; overflow-wrap: anywhere; }
.history-summary strong { display: block; margin-top: 6px; font-size: 15px; }
.history-group summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.history-date { margin: 12px 0 6px; color: var(--text-muted); font-size: 12px; }
#endNow { margin: 12px 0; }
.wizard-progress { margin: 8px 0 24px; scroll-margin-top: 78px; }
.wizard-progress p { color: var(--text-muted); font-size: 12px; margin-bottom: 6px; }
.wizard-dots { display: flex; gap: 6px; margin-top: 14px; }
.wizard-dots span { height: 4px; flex: 1; border-radius: 4px; background: var(--border); }
.wizard-dots .done { background: var(--accent); }
.wizard-panel { min-height: 220px; }
.form [hidden] { display: none !important; }
.form-actions { display: flex; gap: 10px; }
.form-actions > button { flex: 1; }
.review-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.review-row small { color: var(--text-muted); }
.review-row p { margin-top: 5px; white-space: pre-line; overflow-wrap: anywhere; }
.time-total { padding: 16px; border-radius: 12px; background: var(--accent-soft); margin: 16px 0; font-weight: 600; }
.pause-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pause-presets button { border: 1px solid var(--border); padding: 10px; border-radius: 9px; background: var(--surface); }
.pause-presets button[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); }
.delete-draft-btn { color: var(--danger); border: 1px solid var(--danger); border-radius: 10px; padding: 12px 16px; background: var(--surface); margin-top: 18px; }
.confirm-delete { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 16px; background: var(--surface); color: var(--text); }
.confirm-delete::backdrop { background: #0f172a88; }
.confirm-delete p { margin: 14px 0; }
.confirm-delete > div { display: flex; gap: 10px; }
.confirm-delete .delete-draft-btn { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.loading, .empty {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 12px;
  font-size: 14px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 4px 0 10px;
}

/* ---------- Entry cards ---------- */
.entry-list { display: flex; flex-direction: column; gap: 8px; }
.entry-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
  width: 100%;
}
.entry-card.clickable { transition: transform 0.12s ease, border-color 0.12s ease; }
.entry-card.clickable:active { transform: scale(0.98); border-color: var(--accent); }
.entry-icon {
  width: 38px; height: 38px; flex: none;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.entry-body { flex: 1; min-width: 0; }
.entry-title { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-meta { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.entry-duration { font-size: 13.5px; font-weight: 700; }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge-grey { background: var(--surface-2); color: var(--text-muted); }
.badge-blue { background: var(--info-soft); color: var(--info); }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-amber { background: var(--warning-soft); color: var(--warning); }

/* ---------- Status banner ---------- */
.status { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; margin-bottom: 14px; }
.status.ok { background: var(--success-soft); color: var(--success); }
.status.error { background: var(--danger-soft); color: var(--danger); }
.hidden { display: none !important; }

/* ---------- Forms ---------- */
.form-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.form-header h2 { font-size: 19px; font-weight: 700; }
.back-btn {
  border: 0; background: var(--surface-2); border-radius: 999px;
  padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--text);
}
.back-btn:active { transform: scale(0.96); }

.form label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.form input, .form select, .form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form textarea { min-height: 76px; resize: vertical; font-weight: 400; }
.field-group { border-radius: var(--radius-md); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two-col label { margin-bottom: 0; }

.segmented {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
}
.seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px 6px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }

.form-actions { margin-top: 18px; }
.primary-btn {
  width: 100%;
  border: 0;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: 15px;
  padding: 15px;
  border-radius: var(--radius-md);
  transition: transform 0.1s ease, opacity 0.15s ease;
}
.primary-btn:active { transform: scale(0.98); opacity: 0.92; }
.secondary-btn {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
}
.secondary-btn:active { transform: scale(0.98); }

/* ---------- Cards (instellingen) ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.card h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 12px; }
.employee-current { font-size: 16px; font-weight: 700; margin: 2px 0 12px; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: -6px; margin-bottom: 12px; line-height: 1.5; }

/* ---------- Employee picker ---------- */
.picker-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.picker-item:active { transform: scale(0.98); border-color: var(--accent); }
.picker-avatar {
  width: 38px; height: 38px; flex: none; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; text-transform: uppercase;
}
.picker-label { flex: 1; }

/* ---------- Picker trigger (knop die een bottom-sheet picker opent i.p.v. <select>) ---------- */
.picker-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.1s ease;
}
.picker-trigger:active { transform: scale(0.99); }
.picker-trigger:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.picker-trigger-placeholder { flex: 1; font-size: 15px; font-weight: 500; color: var(--text-muted); }
.picker-trigger-icon, .picker-trigger-img {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; object-fit: cover;
}
.picker-trigger-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.picker-trigger-text strong {
  font-size: 14.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.picker-trigger-text small { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.picker-trigger-chevron { flex: none; color: var(--text-muted); font-size: 18px; transform: rotate(90deg); }

/* ---------- Picker modal (bottom sheet met zoeken + visueel grid) ---------- */
body.no-scroll { overflow: hidden; }

.picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: picker-fade 0.15s ease;
}
@keyframes picker-fade { from { opacity: 0; } to { opacity: 1; } }

.picker-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.18);
  animation: picker-slide-up 0.2s ease;
}
@keyframes picker-slide-up { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }

.picker-sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.picker-sheet-header h3 { font-size: 16.5px; font-weight: 700; }
.picker-close {
  width: 30px; height: 30px; flex: none; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.picker-close:active { transform: scale(0.92); }

.picker-search {
  width: 100%;
  padding: 11px 13px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  flex: none;
}
.picker-search:focus { outline: none; border-color: var(--accent); }

.picker-note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: -4px 0 12px;
  flex: none;
}

.picker-body { overflow-y: auto; padding-bottom: 4px; }

.picker-items--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 420px) { .picker-items--grid { grid-template-columns: 1fr 1fr 1fr; } }
.picker-items--list { display: flex; flex-direction: column; gap: 8px; }

.picker-section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 16px 0 8px;
}
.picker-section-title:first-child { margin-top: 2px; }

.picker-clear {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.picker-clear:active { transform: scale(0.98); }

/* Kaarten (grid-layout) */
.picker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 14px 8px;
  text-align: center;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.picker-card:active { transform: scale(0.97); }
.picker-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.picker-card-icon {
  width: 52px; height: 52px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.picker-card-icon--img { object-fit: cover; }
.picker-card-label { font-size: 13px; font-weight: 600; line-height: 1.25; }
.picker-card-sub { font-size: 11px; color: var(--text-muted); }

/* Rijen (list-layout) */
.picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 11px 13px;
  text-align: left;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.picker-row:active { transform: scale(0.98); }
.picker-row.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.picker-row-icon {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.picker-row-icon--img { object-fit: cover; }
.picker-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.picker-row-text strong {
  font-size: 14.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.picker-row-text small {
  font-size: 12px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.picker-row-meta {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.picker-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  padding: 30px 10px;
}

/* Eigen SVG-iconen: schalen mee met hun container en volgen de tekstkleur. */
.icon-svg { width: 72%; height: 72%; display: block; }
.picker-trigger-icon .icon-svg { width: 80%; height: 80%; }

/* Aanmaakknop in de picker (bv. "+ Nieuw project"), zelfde vorm als .picker-clear. */
.picker-create {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}
.picker-create:active { transform: scale(0.98); }
.picker-create[disabled] { opacity: 0.55; }
