/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f5f5f5; color: #333; line-height: 1.5; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navbar */
.navbar { background: #1e293b; color: #fff; padding: 0.75rem 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.navbar-brand { color: #fff; font-weight: 700; font-size: 1.2rem; }
.navbar-brand:hover { color: #fff; text-decoration: none; }
.navbar-menu { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.navbar-menu a { color: #94a3b8; }
.navbar-menu a:hover { color: #fff; text-decoration: none; }
.navbar-user { color: #64748b; font-size: 0.875rem; }
.navbar-logout { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: inherit; padding: 0; }
.navbar-logout:hover { color: #fff; }

/* Container */
.container { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.page-header h1 { margin: 0; }
.subtitle { color: #64748b; margin-top: 0.25rem; }
.location-detail { color: #64748b; margin-bottom: 1.5rem; }

/* Buttons */
.btn { display: inline-block; padding: 0.5rem 1rem; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: #333; cursor: pointer; font-size: 0.875rem; text-align: center; }
.btn:hover { background: #f3f4f6; text-decoration: none; }
.btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.8rem; }
.btn-block { display: block; width: 100%; }

/* Forms */
.form { max-width: 600px; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.25rem; font-size: 0.875rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.875rem; }
.form-group small { color: #64748b; font-size: 0.75rem; }
.field-error { color: #dc2626; font-size: 0.8rem; margin-top: 0.25rem; }
.form-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 1rem; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.table th, .table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid #e5e7eb; }
.table th { background: #f8fafc; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; color: #64748b; }
.table tbody tr:hover { background: #f8fafc; }

/* Badges */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-submitted { background: #dbeafe; color: #1e40af; }
.badge-reviewed { background: #d1fae5; color: #065f46; }
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-niet_ok { background: #fee2e2; color: #991b1b; }
.badge-nvt { background: #e5e7eb; color: #374151; }
.badge-niet_gecontroleerd { background: #fef3c7; color: #92400e; }

/* Category sections */
.category-section { margin-bottom: 2rem; }
.category-header { background: #1e293b; color: #fff; padding: 0.75rem 1rem; border-radius: 8px 8px 0 0; font-size: 1rem; margin-bottom: 0; }

/* Checklist items */
.checklist-item { background: #fff; border: 1px solid #e5e7eb; border-top: none; padding: 0; }
.checklist-item:last-child { border-radius: 0 0 8px 8px; }
.checklist-point { padding: 0.75rem 1rem; }
.checklist-point.saved { border-left: 3px solid #22c55e; }
.point-header { margin-bottom: 0.5rem; }
.point-ref { color: #2563eb; margin-right: 0.5rem; font-size: 0.875rem; }
.point-desc { font-size: 0.875rem; }

/* Result options */
.result-options { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.result-option { display: flex; align-items: center; gap: 0.25rem; padding: 0.35rem 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer; font-size: 0.8rem; transition: all 0.15s; }
.result-option:hover { background: #f3f4f6; }
.result-option.selected { font-weight: 600; }
.result-option input[type="radio"] { display: none; }
.result-option:has(input[value="ok"]).selected { background: #d1fae5; border-color: #22c55e; color: #065f46; }
.result-option:has(input[value="niet_ok"]).selected { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.result-option:has(input[value="nvt"]).selected { background: #e5e7eb; border-color: #9ca3af; color: #374151; }
.result-option:has(input[value="niet_gecontroleerd"]).selected { background: #fef3c7; border-color: #f59e0b; color: #92400e; }

.remark-input { width: 100%; padding: 0.35rem 0.5rem; border: 1px solid #e5e7eb; border-radius: 4px; font-size: 0.8rem; }
.remark-input:focus { border-color: #2563eb; outline: none; }

/* Result rows */
.result-niet_ok { background: #fef2f2; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; padding: 1rem; border-radius: 8px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.stat-value { display: block; font-size: 2rem; font-weight: 700; }
.stat-label { display: block; font-size: 0.75rem; color: #64748b; text-transform: uppercase; margin-top: 0.25rem; }
.stat-ok .stat-value { color: #22c55e; }
.stat-niet-ok .stat-value { color: #ef4444; }
.stat-nvt .stat-value { color: #6b7280; }
.stat-nc .stat-value { color: #f59e0b; }
.stat-missing .stat-value { color: #94a3b8; }
.stat-danger .stat-value { color: #ef4444; }
.stat-success .stat-value { color: #22c55e; }
.stat-info .stat-value { color: #2563eb; }

/* Issues chart */
.issues-chart { margin-bottom: 2rem; }
.issue-bar { display: flex; align-items: center; margin-bottom: 0.4rem; }
.issue-label { width: 60px; font-weight: 600; font-size: 0.85rem; }
.issue-fill { background: #fee2e2; color: #991b1b; padding: 0.25rem 0.75rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600; min-width: 30px; text-align: center; }

/* Detail grid */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 2rem; margin-bottom: 1.5rem; background: #fff; padding: 1rem; border-radius: 8px; }
.remarks-box { background: #fff; padding: 1rem; border-radius: 8px; margin-bottom: 1.5rem; }

/* Login */
.login-container { max-width: 400px; margin: 4rem auto; padding: 2rem; background: #fff; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); text-align: center; }
.login-container h1 { font-size: 2rem; margin-bottom: 0.25rem; }
.login-container h2 { font-size: 1.1rem; color: #64748b; margin-bottom: 1.5rem; }
.login-container .form-group { text-align: left; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #d1fae5; color: #065f46; }

/* Empty state */
.empty-state { text-align: center; color: #64748b; padding: 3rem; background: #fff; border-radius: 8px; }

/* Filters */
.filters { margin-bottom: 1.5rem; }
.filter-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.filter-form select { padding: 0.4rem 0.5rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.85rem; }

/* Action status */
.status-select { padding: 0.25rem; border-radius: 4px; font-size: 0.8rem; border: 1px solid #d1d5db; }
.status-open { background: #dbeafe; }
.status-in_progress { background: #fef3c7; }
.status-resolved { background: #d1fae5; }
.status-overdue { background: #fee2e2; }
.badge-priority-low { background: #e5e7eb; color: #374151; }
.badge-priority-medium { background: #fef3c7; color: #92400e; }
.badge-priority-high { background: #fed7aa; color: #9a3412; }
.badge-priority-critical { background: #fee2e2; color: #991b1b; }
.badge-open { background: #dbeafe; color: #1e40af; }
.badge-in_progress { background: #fef3c7; color: #92400e; }
.badge-resolved { background: #d1fae5; color: #065f46; }
.badge-overdue { background: #fee2e2; color: #991b1b; }

/* Photos */
.photo-section { margin-top: 0.5rem; }
.photo-gallery { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.25rem 0; }
.photo-thumb { position: relative; display: inline-block; }
.photo-thumb img { height: 80px; width: auto; border-radius: 4px; border: 1px solid #e5e7eb; object-fit: cover; }
.photo-caption { display: block; font-size: 0.7rem; color: #64748b; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-delete { position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; cursor: pointer; line-height: 1; padding: 0; }
.photo-upload-form { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.photo-btn { cursor: pointer; }
.detail-photo { max-height: 150px; width: auto; border-radius: 4px; border: 1px solid #e5e7eb; margin: 0.25rem; }
.photo-row { background: #f8fafc !important; }
.general-photos-section { background: #fff; border: 1px solid #e5e7eb; border-top: none; border-radius: 0 0 8px 8px; padding: 0.75rem 1rem; }

/* Signature pad */
.signature-canvas { border: 1px solid #d1d5db; border-radius: 4px; background: #fff; width: 300px; height: 100px; touch-action: none; cursor: crosshair; }
.signature-pad-container { margin: 0.5rem 0; }

/* Responsive */
@media (max-width: 640px) {
    .container { padding: 1rem 0.75rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .detail-grid { grid-template-columns: 1fr; }
    .table { font-size: 0.8rem; }
    .table th, .table td { padding: 0.5rem; }
    .result-options { gap: 0.35rem; }
    .result-option { padding: 0.3rem 0.5rem; font-size: 0.75rem; }
}
