/* ============================================================
   VERJANS APP - Stijlen
   ============================================================ */

:root {
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

/* === UTILITY === */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: #cbd5e1; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-success { background: var(--success); color: white; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.82rem; }
.btn-full { width: 100%; }

/* === FORMS === */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}
label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}
input, select, textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input[type="number"] { -moz-appearance: textfield; }
textarea { resize: vertical; min-height: 70px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}

/* === CARDS === */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem;
  margin-bottom: 0.9rem;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
  color: var(--text);
}

/* === ALERTS === */
.alert {
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #bbf7d0; }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fed7aa; }

/* === BADGE === */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-red { background: #fee2e2; color: #dc2626; }

/* === LOGIN PAGINA === */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}
.login-container {
  width: 100%;
  max-width: 380px;
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-logo h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.login-logo p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* === APP HEADER === */
.app-header {
  background: var(--primary);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
}
.header-top h1 {
  font-size: 1.15rem;
  font-weight: 700;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
}
.header-user span { opacity: 0.85; }
.btn-logout {
  background: rgba(255,255,255,0.18);
  color: white;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
}
.btn-logout:hover { background: rgba(255,255,255,0.28); }

/* === HOOFD TABS === */
.tabs {
  display: flex;
  background: rgba(0,0,0,0.18);
}
.tab-btn {
  flex: 1;
  padding: 0.6rem;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-family: inherit;
}
.tab-btn.active {
  color: white;
  border-bottom-color: white;
  background: rgba(255,255,255,0.1);
}

/* === MAIN CONTENT === */
.app-main {
  padding: 0.9rem;
  max-width: 680px;
  margin: 0 auto;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === SUB-TABS (uren/materialen/bonnen) === */
.sub-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  background: white;
  padding: 0.35rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.sub-tab-btn {
  flex: 1;
  padding: 0.45rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  font-family: inherit;
}
.sub-tab-btn.active {
  background: var(--primary);
  color: white;
}

/* === WERF/DATUM SELECTOR === */
.werf-selector {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem;
  margin-bottom: 0.9rem;
}
.werf-selector .form-row { margin: 0; }
.werf-selector .form-group { margin-bottom: 0; }

/* === ITEM LIJSTEN === */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.9rem;
}
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.item-info { flex: 1; min-width: 0; }
.item-title {
  font-weight: 500;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-sub { font-size: 0.8rem; color: var(--text-muted); }
.item-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

/* === TOTAAL BALK === */
.totaal-balk {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: var(--primary-light);
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  margin-top: 0.65rem;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.95rem;
}

/* === UPLOAD ZONE === */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 0.9rem;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-zone .upload-icon { font-size: 2.2rem; margin-bottom: 0.4rem; }
.upload-zone p { color: var(--text-muted); font-size: 0.88rem; }
.upload-zone strong { color: var(--primary); }

/* === WERF GRID (baas) === */
.werf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}
@media (max-width: 500px) {
  .werf-grid { grid-template-columns: 1fr; }
}
.werf-kaart {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--primary);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}
.werf-kaart:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.werf-kaart h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.2rem; }
.werf-kaart p { font-size: 0.82rem; color: var(--text-muted); }
.werf-kaart.inactief { border-left-color: var(--border); opacity: 0.65; }

/* === RAPPORT SECTIE (baas) === */
.rapport-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.rapport-naam {
  font-size: 1.1rem;
  font-weight: 700;
}
.rapport-sectie { margin-bottom: 1.25rem; }
.rapport-sectie-titel {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* === SPINNER === */
.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 1.5rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === LEGE STAAT === */
.empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* === LAAD OVERLAY === */
.laad-scherm {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  flex-direction: column;
  gap: 1rem;
  color: var(--text-muted);
}

hr { border: none; border-top: 1px solid var(--border); margin: 0.75rem 0; }
