* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #222;
}
header {
  padding: 1rem 1.5rem;
  background: #004f9f;
  color: white;
}
header h1 {
  margin: 0;
  font-size: 1.4rem;
}
header p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  opacity: 0.9;
}
main {
  display: flex;
  padding: 1rem;
  height: calc(100vh - 72px);
  gap: 0;
}
.panel {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  overflow: auto;
}
.panel-left {
  flex: 0 0 58%;
  width: 58%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: auto;
}
.panel-right {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  overflow: auto;
}
/* Versleepbare scheidingslijn */
.panel-divider {
  flex: 0 0 16px;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  z-index: 10;
}
.panel-divider:hover .divider-line,
.panel-divider.dragging .divider-line {
  background: #004f9f;
  width: 4px;
  height: 64px;
  opacity: 0.7;
}
.divider-line {
  width: 3px;
  height: 48px;
  background: #bbb;
  border-radius: 3px;
  opacity: 0.5;
  transition: background 0.15s, opacity 0.15s, height 0.15s, width 0.15s;
}
body.resizing-panels {
  cursor: col-resize !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
body.resizing-panels * {
  cursor: col-resize !important;
  pointer-events: none !important;
}
body.resizing-panels .panel-divider,
body.resizing-panels .panel-divider * {
  pointer-events: auto !important;
}
h2 {
  margin-top: 0;
  font-size: 1.1rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.3rem;
}
h3 {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.95rem;
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
textarea,
input[type="text"] {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
  font-family: inherit;
}
textarea {
  resize: vertical;
  min-height: 60px;
}
.small {
  font-size: 0.8rem;
  color: #666;
}
.goal {
  margin: 0.2rem 0 0.6rem;
  font-style: italic;
}
.form-section {
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed #e5e7eb;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #e6f2ff;
  color: #004f9f;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.4rem 0 0.2rem;
}
.field-list {
  border-top: 1px solid #eee;
  margin-top: 0.2rem;
}
.field-row {
  display: grid;
  grid-template-columns: 2fr 1.1fr 1.4fr 1.4fr 32px;
  gap: 0.4rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f4f4f4;
  align-items: flex-start;
}
.field-row input[type="checkbox"] {
  transform: scale(1.1);
  margin-right: 0.2rem;
}
select {
  width: 100%;
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 0.85rem;
  font-family: inherit;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  background: #004f9f;
  color: white;
}
.btn.secondary {
  background: #e4e7ec;
  color: #111827;
}
.btn-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.form-preview {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  background: #ffffff;
  font-size: 0.9rem;
}
.preview-title {
  font-weight: 700;
  margin-bottom: 0.15rem;
  font-size: 1.05rem;
}
.preview-subtitle {
  font-size: 0.85rem;
  color: #4b5563;
  margin-bottom: 0.6rem;
}
.preview-section {
  padding: 0.4rem 0;
  border-top: 1px solid #e5e7eb;
  margin-top: 0.2rem;
}
.preview-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}
.preview-input {
  padding: 0.25rem 0.3rem;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background: white;
  min-height: 1.5rem;
}
.section-description {
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 0.3rem;
}

.followup-container {
  grid-column: 1 / -1;
  margin-left: 0.8rem;
  padding-left: 0.5rem;
  border-left: 1px dashed #e5e7eb;
  margin-top: 0.3rem;
  margin-bottom: 0.3rem;
}
.followup-row {
  margin-top: 0.35rem;
}
.followup-row-header {
  font-size: 0.78rem;
  color: #4b5563;
  margin-bottom: 0.15rem;
  font-style: italic;
}
.followup-row-inner {
  display: grid;
  grid-template-columns: 2fr 1.1fr 1.4fr 1.3fr;
  gap: 0.3rem;
  align-items: flex-start;
}
.followup-row-inner label {
  font-size: 0.78rem;
}

.conditional-block {
  margin-left: 0.8rem;
  margin-top: 0.2rem;
  padding-left: 0.5rem;
  border-left: 2px solid #d1d5db;
}
.conditional-note {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.15rem;
  font-style: italic;
}

.waarom-band {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0.75rem;
  margin: 0.6rem 0 0.4rem;
  align-items: stretch;
}
.waarom-image {
  border-radius: 10px;
  background: linear-gradient(135deg, #00778A 0%, #E6000F 50%, #FF9E1B 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.6rem;
  text-align: center;
  overflow: hidden;
}
.waarom-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}
/* Verberg gradient-achtergrond als er een afbeelding is ingeladen */
.waarom-image:has(img) {
  background: none;
  padding: 0;
}
.waarom-text {
  background: white;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
}

.warnings {
  font-size: 0.85rem;
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0 0;
}
.warnings li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.warnings li span.icon {
  margin-top: 0.1rem;
}
.warnings li.ok {
  color: #166534;
}
.warnings li.warn {
  color: #b45309;
}
.warnings li.error {
  color: #b91c1c;
}

.principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.principles label {
  font-weight: 500;
}

.upload-block {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px dashed #d1d5db;
  background: #f9fafb;
}
.upload-block label {
  margin-bottom: 0.2rem;
}

.req-star {
  color: #b91c1c;
  margin-right: 4px;
}
.required-note {
  font-size: 0.8rem;
  color: #4b5563;
  margin: 0.3rem 0 0.4rem;
}

.bottom-image {
  margin-top: 0.5rem;
}
.bottom-image img {
  max-width: 100%;
  height: auto;
  display: block;
}

.preview-actions {
  margin-top: 0.8rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 0.6rem;
  display: flex;
  gap: 0.5rem;
}
.preview-actions button {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.preview-actions .primary {
  background: #004f9f;
  color: #ffffff;
}
.preview-actions .secondary {
  background: #e4e7ec;
  color: #111827;
}

/* ===================== Standaardregels-tabel (sectie 4a) ===================== */
.standards-block {
  margin-bottom: 0.6rem;
}
.standards-heading {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: #004f9f;
}
.standards-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.standards-table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  color: #4b5563;
  padding: 0.3rem 0.4rem;
  border-bottom: 2px solid #e5e7eb;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.standards-table tbody td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}
.std-onderdeel {
  font-weight: 600;
  white-space: nowrap;
  color: #374151;
  width: 80px;
}
.std-regel {
  color: #222;
  line-height: 1.4;
}
.std-toelichting {
  font-size: 0.75rem;
  color: #92400e;
  margin-top: 0.15rem;
  font-style: italic;
}
.std-status {
  white-space: nowrap;
  text-align: center;
  width: 90px;
}
/* Rij-kleuring op basis van status */
tr.std-ok td {
  background: #f0fdf4;
}
tr.std-warn td {
  background: #fffbeb;
}
tr.std-na td {
  background: #f9fafb;
  color: #9ca3af;
}

.translate-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.translate-bar .label {
  font-size: 0.8rem;
  color: #555;
}

.translate-status {
  font-size: 0.8rem;
  color: #004f9f;
  padding: 0.3rem 0.5rem;
  margin-bottom: 0.4rem;
  border-radius: 4px;
  background: #e6f2ff;
}
.translate-status .progress-bar {
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  margin-top: 0.3rem;
  overflow: hidden;
}
.translate-status .progress-fill {
  height: 100%;
  border-radius: 3px;
  background: #004f9f;
  transition: width 0.3s ease;
}
.translate-status.done {
  background: #f0fdf4;
  color: #166534;
}

/* Bewerkbare labels en opties in Engelse mockup */
.editable-label,
.editable-option {
  outline: none;
  border-bottom: 1px dashed #aaa;
  padding: 0 2px;
  cursor: text;
  display: inline-block;
  min-width: 1rem;
}
.editable-label:hover,
.editable-option:hover {
  background: #e6f2ff;
}
.editable-label:focus,
.editable-option:focus {
  background: #fff;
  border-bottom-color: #004f9f;
}
/* ===================== Commentaar veldtype ===================== */
.preview-comment {
  font-size: 0.85rem;
  color: #374151;
  background: #f9fafb;
  border-left: 3px solid #004f9f;
  padding: 0.4rem 0.6rem;
  margin: 0.25rem 0;
  border-radius: 0 4px 4px 0;
  line-height: 1.5;
}

/* ===================== Tabel veldtype ===================== */
.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 0.25rem 0 0.4rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}
.preview-table thead th {
  background: #f3f4f6;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid #d1d5db;
  text-align: left;
  color: #374151;
}
.preview-table tbody td {
  padding: 0.2rem 0.3rem;
  border: 1px solid #e5e7eb;
}
.preview-table .table-cell-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  padding: 0.15rem 0.2rem;
  outline: none;
}
.preview-table .table-cell-input:focus {
  background: #e6f2ff;
}

/* Tabel-rijen invoer in builder */
.fld-table-rows-wrap,
.fup-table-rows-wrap {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.fld-table-rows-wrap label,
.fup-table-rows-wrap label {
  white-space: nowrap;
}
.fld-table-rows-wrap input[type="number"],
.fup-table-rows-wrap input[type="number"] {
  width: 60px;
}

.dropdown-wrapper {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.dropdown-wrapper select {
  flex: 1;
}
.dropdown-edit-btn {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  font-size: 0.8rem;
  line-height: 1;
}
.dropdown-edit-btn:hover {
  background: #f3f4f6;
}
.dropdown-edit-list {
  padding: 0.3rem 0.5rem;
  background: #fefce8;
  border: 1px dashed #d97706;
  border-radius: 4px;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}
.dropdown-edit-item {
  padding: 0.15rem 0;
  font-size: 0.82rem;
}
.dropdown-edit-item::before {
  content: "• ";
  color: #9ca3af;
}
.dropdown-edit-item .editable-option {
  border-bottom: 1px dashed #d97706;
}

/* ===================== Klantvriendelijkheidscheck (sectie 6) ===================== */
.review-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.review-bar .label {
  font-size: 0.8rem;
  color: #555;
}

.review-status {
  font-size: 0.8rem;
  color: #004f9f;
  padding: 0.3rem 0.5rem;
  margin-bottom: 0.4rem;
  border-radius: 4px;
  background: #e6f2ff;
}
.review-status .progress-bar {
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  margin-top: 0.3rem;
  overflow: hidden;
}
.review-status .progress-fill {
  height: 100%;
  border-radius: 3px;
  background: #004f9f;
  transition: width 0.3s ease;
}
.review-pulse {
  animation: reviewPulse 1.5s infinite ease-in-out;
}
@keyframes reviewPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.review-status.done {
  background: #f0fdf4;
  color: #166534;
}

.review-result {
  margin-top: 0.5rem;
}
.review-content {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #222;
  padding: 0.6rem 0.8rem;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.review-content strong {
  color: #004f9f;
}
.review-now {
  display: block;
  margin: 0.3rem 0 0.15rem 1rem;
  padding: 0.2rem 0.5rem;
  background: #fef2f2;
  border-left: 3px solid #dc2626;
  color: #991b1b;
  font-size: 0.82rem;
  border-radius: 0 4px 4px 0;
}
.review-better {
  display: block;
  margin: 0.15rem 0 0.4rem 1rem;
  padding: 0.2rem 0.5rem;
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
  color: #166534;
  font-size: 0.82rem;
  border-radius: 0 4px 4px 0;
}

@media (max-width: 1100px) {
  main {
    flex-direction: column;
    height: auto;
  }
  .panel-left {
    flex: none !important;
    max-width: 100% !important;
    min-width: 100% !important;
  }
  .panel-divider {
    display: none;
  }
  .waarom-band {
    grid-template-columns: 1fr;
  }
}