@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500&family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --zwart: #111111;
  --zwart-nav: #1C2333;
  --wit: #FFFFFF;
  --grijs-bg: #F2F3F5;
  --grijs-card: #FFFFFF;
  --grijs-border: #E2E4E8;
  --grijs-border-dark: #C8CAD0;
  --grijs-mid: #6B7280;
  --grijs-light: #9CA3AF;
  --groen: #1A5C38;
  --groen-light: #EAF4EE;
  --amber: #92600A;
  --amber-light: #FEF3DC;
  --rood: #991B1B;
  --rood-light: #FEF2F2;
  --radius: 6px;
  --shadow: 0 1px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--grijs-bg);
  color: var(--zwart);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── LOGIN ──────────────────────────────────────────────── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--zwart-nav);
  padding: 24px;
}

.login-card {
  background: var(--wit);
  border-radius: 4px;
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--grijs-border);
}

.login-logo img {
  height: 64px;
  width: auto;
  object-fit: contain;
}

.login-logo .sub {
  font-size: 10px;
  color: var(--grijs-light);
  margin-top: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 600;
}

/* ─── APP HEADER ─────────────────────────────────────────── */
#app { display: none; min-height: 100vh; flex-direction: column; }
#app.visible { display: flex; }

.app-header {
  background: var(--zwart-nav);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.header-logo img {
  height: 26px;
  width: auto;
  object-fit: contain;
  /* geen filter nodig - aparte witte versie */
  opacity: 0.92;
}

.header-right { display: flex; align-items: center; gap: 12px; }
.user-badge { font-size: 13px; color: rgba(255,255,255,0.55); font-weight: 500; }

/* ─── BOTTOM NAV ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--wit);
  border-top: 1px solid var(--grijs-border);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px;
  cursor: pointer;
  color: var(--grijs-light);
  font-size: 9px;
  font-weight: 700;
  gap: 4px;
  transition: color 0.15s;
  border: none;
  background: none;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.nav-item svg { width: 20px; height: 20px; stroke-width: 1.8; }
.nav-item.active { color: var(--zwart-nav); }
.nav-item:active { opacity: 0.6; }

/* ─── MAIN CONTENT ───────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 20px 16px 100px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.screen { display: none; }
.screen.active { display: block; }

/* ─── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--grijs-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1px solid var(--grijs-border);
}

.card-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--grijs-mid);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}

/* ─── STATUS CARD ────────────────────────────────────────── */
.status-card {
  background: var(--zwart-nav);
  color: white;
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-lg);
  border: none;
}

.status-card.ingeklokt {
  background: var(--groen);
}

.status-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.6;
  margin-bottom: 6px;
}

.status-time {
  font-size: 54px;
  font-weight: 300;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}

.status-detail {
  font-size: 13px;
  opacity: 0.65;
  margin-bottom: 24px;
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--zwart-nav); color: white; }
.btn-primary:hover { background: #2A3347; }

.btn-success { background: var(--groen); color: white; }
.btn-success:hover { background: #154d2f; }

.btn-outline {
  background: transparent;
  color: var(--zwart);
  border: 1.5px solid var(--grijs-border-dark);
}
.btn-outline:hover { background: var(--grijs-bg); }

.btn-danger { background: var(--rood-light); color: var(--rood); border: 1px solid #f0c8c8; }

.btn-sm { padding: 7px 13px; font-size: 12px; border-radius: 5px; }
.btn-full { width: 100%; }

.btn-ghost {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-ghost:hover { background: rgba(255,255,255,0.18); }

/* ─── FORMS ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--grijs-mid);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--grijs-border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--zwart);
  background: var(--wit);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--zwart-nav);
  box-shadow: 0 0 0 3px rgba(28,35,51,0.08);
}

textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── LISTS ──────────────────────────────────────────────── */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--grijs-border);
}
.list-item:last-child { border-bottom: none; }
.list-item-main { flex: 1; min-width: 0; }
.list-item-title { font-size: 14px; font-weight: 600; color: var(--zwart); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-sub { font-size: 12px; color: var(--grijs-mid); }

/* ─── BADGES ─────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.badge-green { background: var(--groen-light); color: var(--groen); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-red { background: var(--rood-light); color: var(--rood); }
.badge-gray { background: var(--grijs-bg); color: var(--grijs-mid); border: 1px solid var(--grijs-border); }

/* ─── MODALS ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--wit);
  border-radius: 12px 12px 0 0;
  padding: 20px 24px 40px;
  width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32,0.72,0,1);
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-handle { width: 36px; height: 3px; background: var(--grijs-border); border-radius: 2px; margin: 0 auto 20px; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.3px; }

/* ─── TABLES ─────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 8px 12px; background: var(--grijs-bg); font-weight: 700; font-size: 11px; color: var(--grijs-mid); border-bottom: 1px solid var(--grijs-border); letter-spacing: 0.8px; text-transform: uppercase; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--grijs-border); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--grijs-bg); }

/* ─── STATS ──────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 20px; }
.stat-box { background: var(--wit); border-radius: var(--radius); padding: 16px 12px; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--grijs-border); }
.stat-value { font-size: 30px; font-weight: 300; font-family: 'Cormorant Garamond', serif; color: var(--zwart-nav); letter-spacing: -1px; line-height: 1.1; }
.stat-label { font-size: 10px; color: var(--grijs-light); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* ─── PHOTOS ─────────────────────────────────────────────── */
.photo-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 12px; }
.photo-thumb { aspect-ratio: 1; border-radius: 4px; overflow: hidden; position: relative; cursor: pointer; background: var(--grijs-bg); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-delete { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.6); color: white; border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; }

/* ─── MISC ───────────────────────────────────────────────── */
.locatie-info { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--grijs-mid); margin-top: 8px; }

.toast-container { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: calc(100% - 32px); max-width: 400px; }
.toast { background: var(--zwart); color: white; padding: 12px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn 0.25s ease, toastOut 0.25s ease 2.75s forwards; }
.toast.success { background: var(--groen); }
.toast.error { background: var(--rood); }
@keyframes toastIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { to { opacity:0; } }

.empty-state { text-align: center; padding: 48px 24px; color: var(--grijs-light); }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--grijs-mid); margin-bottom: 4px; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.96); z-index: 400; display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); color: white; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.tab-bar { display: flex; gap: 3px; background: var(--grijs-bg); border-radius: var(--radius); padding: 3px; margin-bottom: 20px; border: 1px solid var(--grijs-border); }
.tab { flex: 1; padding: 8px; border: none; background: none; border-radius: 4px; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600; color: var(--grijs-mid); cursor: pointer; transition: all 0.15s; }
.tab.active { background: var(--zwart-nav); color: white; box-shadow: var(--shadow); }

.filter-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip { padding: 5px 13px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1.5px solid var(--grijs-border); background: var(--wit); cursor: pointer; transition: all 0.15s; color: var(--grijs-mid); }
.filter-chip.active { background: var(--zwart-nav); color: white; border-color: var(--zwart-nav); }

.upload-zone { border: 1.5px dashed var(--grijs-border-dark); border-radius: var(--radius); padding: 20px; text-align: center; cursor: pointer; transition: all 0.15s; color: var(--grijs-mid); font-size: 13px; display: block; }
.upload-zone:hover { border-color: var(--zwart-nav); color: var(--zwart-nav); background: rgba(28,35,51,0.03); }

.divider { height: 1px; background: var(--grijs-border); margin: 16px 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.spinner { width: 28px; height: 28px; border: 2px solid var(--grijs-border); border-top-color: var(--zwart-nav); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { text-align: center; padding: 40px; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (min-width: 600px) {
  .main-content { padding: 28px 24px 100px; }
  .bottom-nav { max-width: 640px; left: 50%; transform: translateX(-50%); border-radius: 10px 10px 0 0; }
}
@media (max-width: 360px) {
  .status-time { font-size: 44px; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .login-card { padding: 36px 24px; }
}

/* Upload spinner inline in knop */
.upload-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

/* Disabled knop stijl */
.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Validatie feedback */
textarea.fout, input.fout {
  border-color: var(--rood) !important;
  animation: schud 0.3s ease;
}

@keyframes schud {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
