/* ─── Tinx Forms Admin Tab Styles ─────────────────────────────────────────── */

.txplf-admin-loading{display:flex;align-items:center;gap:10px;color:#7b6fa0;font-size:13px;padding:20px 0}
.txplf-spinner-sm{width:18px;height:18px;border:2px solid #e4e0f0;border-top-color:#52d048;border-radius:50%;animation:txplf-spin .7s linear infinite;flex-shrink:0}
@keyframes txplf-spin{to{transform:rotate(360deg)}}
.txplf-admin-err{color:#c0392b;font-size:13px;padding:12px 0}
.txplf-admin-notice{background:#fff8e1;border:1px solid #ffe082;border-radius:8px;padding:12px 16px;font-size:13px;color:#7b5c00;margin-bottom:14px}
.txplf-admin-empty{text-align:center;padding:32px 16px;color:#b0a8c8;font-size:13px;background:#f8f6fc;border:1px dashed #d4cef0;border-radius:12px}

/* Toolbar */
.txplf-admin-wrap{display:flex;flex-direction:column;gap:12px}
.txplf-admin-toolbar{display:flex;justify-content:flex-end}

/* Buttons */
.txplf-admin-btn{display:inline-flex;align-items:center;gap:5px;padding:7px 16px;border-radius:20px;font-size:12.5px;font-weight:600;border:none;cursor:pointer;transition:background .15s,opacity .15s;white-space:nowrap;line-height:1}
.txplf-admin-btn:disabled{opacity:.55;cursor:not-allowed}
.txplf-admin-btn-primary{background:#52d048;color:#17014c}
.txplf-admin-btn-primary:hover:not(:disabled){background:#3dbd34}
.txplf-admin-btn-ghost{background:transparent;color:#7b6fa0;border:1px solid #e4e0f0}
.txplf-admin-btn-ghost:hover:not(:disabled){border-color:#52d048;color:#17014c}
.txplf-admin-btn-sm{padding:5px 12px;font-size:11.5px}
.txplf-admin-btn-xs{padding:4px 10px;font-size:11px;border-radius:14px;border:1px solid #e4e0f0;background:#fff;color:#7b6fa0}
.txplf-admin-btn-xs:hover{border-color:#52d048;color:#17014c}

/* Inputs */
.txplf-input{width:100%;border:1px solid #e4e0f0;border-radius:8px;padding:8px 12px;font-size:12.5px;color:#17014c;background:#fff;transition:border-color .15s;box-sizing:border-box}
.txplf-input:focus{outline:none;border-color:#52d048;box-shadow:0 0 0 3px rgba(82,208,72,.12)}
.txplf-input-sm{padding:5px 10px;font-size:11.5px}
.txplf-select{width:100%;border:1px solid #e4e0f0;border-radius:8px;padding:8px 12px;font-size:12.5px;color:#17014c;background:#fff;box-sizing:border-box;cursor:pointer}
.txplf-select:focus{outline:none;border-color:#52d048}
.txplf-field-row{display:flex;flex-direction:column;gap:5px;margin-bottom:12px}
.txplf-field-row label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#7b6fa0}

/* New form panel */
.txplf-new-form-panel{background:#f0edfa;border:1px solid #d4cef0;border-radius:12px;padding:16px 18px}
.txplf-new-form-panel h4{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#17014c;margin:0 0 14px}
.txplf-panel-actions{display:flex;gap:8px;padding-top:4px}

/* Form card */
.txplf-form-card{background:#fff;border:1px solid #e4e0f0;border-radius:12px;padding:14px 16px;transition:border-color .15s}
.txplf-form-card:hover{border-color:#c4bde8}
.txplf-form-card-hdr{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.txplf-form-card-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.txplf-form-tmpl-name{font-size:13px;font-weight:600;color:#17014c}
.txplf-form-card-actions{display:flex;gap:6px;flex-shrink:0}

/* Status badges */
.txplf-status{font-size:10.5px;font-weight:700;padding:2px 8px;border-radius:10px;text-transform:uppercase;letter-spacing:.05em}
.txplf-status-draft{background:#f0f0f0;color:#666}
.txplf-status-sent{background:#e8f0ff;color:#2255cc}
.txplf-status-submitted{background:#e6f9e4;color:#1a7a16}
.txplf-status-reopened{background:#fff5e0;color:#c07800}

/* Send row */
.txplf-send-row{display:flex;align-items:center;gap:8px;padding:10px 0;border-top:1px solid #f0edfa}
.txplf-send-row .txplf-input{flex:1}

/* Response accordion */
.txplf-resp-summary{border-top:1px solid #f0edfa;padding-top:10px;margin-top:6px}
.txplf-resp-toggle{background:none;border:none;cursor:pointer;font-size:12px;font-weight:600;color:#17014c;padding:4px 0;display:flex;align-items:center;gap:6px}
.txplf-resp-toggle:hover{color:#52d048}
.txplf-toggle-icon{font-size:10px;color:#52d048}
.txplf-resp-body{margin-top:10px;display:flex;flex-direction:column;gap:2px}
.txplf-ans-row{display:grid;grid-template-columns:1fr 1.4fr;gap:8px;padding:5px 0;border-bottom:1px solid #f8f6fc;align-items:baseline}
.txplf-ans-row:last-child{border-bottom:none}
.txplf-ans-label{font-size:11.5px;color:#7b6fa0}
.txplf-ans-value{font-size:12.5px;color:#17014c;font-weight:500;white-space:pre-wrap;word-break:break-word}
.txplf-submitted-at{font-size:11px;color:#b0a8c8;text-align:right;padding-top:8px;border-top:1px solid #f8f6fc;margin-top:8px}
.txplf-no-resp{font-size:12px;color:#b0a8c8;font-style:italic;margin:6px 0 0}

/* ─── Taal badge ──────────────────────────────────────────────────────────── */
.txplf-lang-badge{display:none} /* verborgen, zit al in de toggle knop */
.txplf-lang-switch{background:#f8f6fc;border:1px solid #e4e0f0;border-radius:8px;padding:10px 14px;margin:8px 0}

/* ─── Prefill ────────────────────────────────────────────────────────────── */
.txplf-prefill-wrap{border-top:1px solid #f0edfa;margin-top:8px;padding-top:8px}
.txplf-prefill-hint{font-size:11.5px;color:#7b6fa0;margin-bottom:12px;font-style:italic}
.txplf-prefill-section{margin-bottom:14px}
.txplf-prefill-section h5{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#17014c;margin:0 0 8px;padding-bottom:4px;border-bottom:1px solid #52d048}
.txplf-prefill-field{display:grid;grid-template-columns:1fr 1.5fr;gap:8px;align-items:center;margin-bottom:6px}
.txplf-prefill-label{font-size:11.5px;color:#555}

/* Grid voor twee kolommen */
.txplf-form-row-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}

/* ─── Template Builder ────────────────────────────────────────────────────── */
.txpl-modal-xl{width:min(1400px,96vw);height:90vh;max-height:90vh;overflow:hidden;display:flex;flex-direction:column}
.txplf-builder-body{display:flex;gap:0;padding:0;flex:1;overflow:hidden;min-height:0;height:calc(90vh - 60px)}

.txplf-builder-sidebar{width:200px;flex-shrink:0;background:#f8f6fc;border-right:1px solid #e4e0f0;padding:16px;overflow-y:auto}
.txplf-builder-sidebar h4{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#17014c;margin:0 0 12px}

.txplf-tmpl-list-item{display:flex;align-items:center;justify-content:space-between;padding:8px 10px;border-radius:8px;cursor:pointer;font-size:12.5px;color:#17014c;margin-bottom:4px;border:1px solid transparent;transition:all .15s}
.txplf-tmpl-list-item:hover{background:#ede9f8;border-color:#d4cef0}
.txplf-tmpl-list-item.active{background:#17014c;color:#fff;border-color:#17014c}
.txplf-tmpl-list-item.active .txplf-tmpl-del-btn{color:rgba(255,255,255,0.5)}
.txplf-tmpl-del-btn{background:none;border:none;cursor:pointer;color:#c0a8d0;font-size:14px;line-height:1;padding:2px 4px;flex-shrink:0}
.txplf-tmpl-del-btn:hover{color:#c0392b}

.txplf-builder-main{flex:1;overflow-y:auto;padding:20px}
.txplf-builder-placeholder{color:#b0a8c8;font-size:13px;text-align:center;padding:40px 20px}

.txplf-builder-editor{}
.txplf-builder-meta{background:#f8f6fc;border:1px solid #e4e0f0;border-radius:10px;padding:16px;margin-bottom:16px}

.txplf-builder-section{background:#fff;border:1px solid #e4e0f0;border-radius:10px;margin-bottom:12px;overflow:hidden}
.txplf-builder-section-hdr{display:flex;align-items:center;gap:8px;padding:10px 14px;background:#f0edfa;flex-wrap:wrap}
.txplf-builder-sec-num{background:#17014c;color:#52d048;font-size:11px;font-weight:800;border-radius:50%;width:22px;height:22px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.txplf-builder-del-sec{background:none;border:none;cursor:pointer;color:#c0a8d0;font-size:14px;margin-left:auto;padding:2px 4px;flex-shrink:0}
.txplf-builder-del-sec:hover{color:#c0392b}
.txplf-repeat-labels{padding:8px 14px;background:#faf9fc;border-bottom:1px solid #f0edfa}

.txplf-builder-fields{padding:12px 14px}
.txplf-builder-field{background:#f8f6fc;border:1px solid #e4e0f0;border-radius:8px;padding:10px 12px;margin-bottom:8px}
.txplf-builder-field-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.txplf-builder-del-field{background:none;border:none;cursor:pointer;color:#c0a8d0;font-size:13px;flex-shrink:0}
.txplf-builder-del-field:hover{color:#c0392b}
.txplf-fld-options-wrap{margin-top:8px;padding-top:8px;border-top:1px solid #e4e0f0}
.txplf-builder-add-field{background:none;border:1.5px dashed #c4bde8;color:#7b6fa0;border-radius:6px;padding:6px 14px;font-size:12px;cursor:pointer;margin:8px 14px 12px;transition:all .15s}
.txplf-builder-add-field:hover{border-color:#52d048;color:#17014c}

/* ===== VERSIEGESCHIEDENIS ===== */
.txplf-history-panel {
  border-top: 1px solid #ede9f7;
  margin-top: 10px;
  padding-top: 10px;
}
.txplf-history-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #17014c;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 10px;
}
.txplf-history-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 260px;
  overflow-y: auto;
}
.txplf-history-loading {
  font-size: 12px;
  color: #aaa;
  padding: 8px 0;
}
.txplf-history-empty {
  font-size: 12px;
  color: #aaa;
  font-style: italic;
  padding: 8px 0;
  line-height: 1.5;
}
.txplf-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #faf9fc;
  border: 1px solid #ede9f7;
  border-radius: 6px;
  padding: 6px 10px;
  gap: 8px;
}
.txplf-history-row:hover { background: #f5f2fb; }
.txplf-history-row-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.txplf-history-by {
  font-size: 10px;
  font-weight: 700;
  color: #7c3aed;
  white-space: nowrap;
  background: #f0ebff;
  border-radius: 4px;
  padding: 2px 6px;
}
.txplf-history-label {
  font-size: 12px;
  color: #333;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.txplf-history-date {
  font-size: 10px;
  color: #aaa;
  white-space: nowrap;
}
.txplf-history-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Diff modal */
.txplf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.txplf-modal-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(23,1,76,.18);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  width: 560px;
}
.txplf-modal-box.txplf-modal-lg { width: 720px; }
.txplf-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #ede9f7;
  font-size: 14px;
  font-weight: 700;
  color: #17014c;
}
.txplf-modal-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #aaa;
  line-height: 1;
}
.txplf-modal-close-btn:hover { color: #17014c; }
.txplf-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Diff layout */
.txplf-diff-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.txplf-diff-meta-item {
  flex: 1;
  background: #f9f8fc;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.6;
}
.txplf-diff-meta-item.txplf-diff-new { border-left: 3px solid #52d048; }
.txplf-diff-meta-item.txplf-diff-old { border-left: 3px solid #e0d9f0; }
.txplf-diff-arrow { font-size: 20px; color: #ccc; flex-shrink: 0; }
.txplf-diff-count {
  font-size: 11px;
  font-weight: 700;
  color: #7c3aed;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 12px;
}
.txplf-diff-unchanged {
  font-size: 13px;
  color: #52d048;
  font-weight: 600;
  padding: 16px;
  background: #f0fdf4;
  border-radius: 8px;
  text-align: center;
}
.txplf-diff-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.txplf-diff-row {
  border: 1px solid #ede9f7;
  border-radius: 8px;
  overflow: hidden;
}
.txplf-diff-field {
  background: #f5f3fa;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #17014c;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.txplf-diff-vals {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.txplf-diff-old-val, .txplf-diff-new-val {
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}
.txplf-diff-old-val {
  background: #fff5f5;
  color: #c0392b;
  border-right: 1px solid #ede9f7;
}
.txplf-diff-new-val {
  background: #f0fdf4;
  color: #27ae60;
}
