/* ==========================================================
   ai-fill.css — Estilos dos componentes de preenchimento automático.
   Carregar depois de base.css. Nunca aplicado a #pdf-document (impressão).
   ========================================================== */

.ai-fill-upload__dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  font-family: Arial, sans-serif;
  background: #f8fafc;
  transition: border-color .15s, background .15s;
}
.ai-fill-upload__dropzone--active { border-color: #2563eb; background: #eff6ff; }
.ai-fill-upload__hint { margin: 0 0 12px; color: #475569; font-size: 13px; }
.ai-fill-upload__pick-btn, .ai-fill-upload__camera-btn {
  font-family: Arial, sans-serif;
  font-size: 13px;
  padding: 8px 14px;
  margin: 0 4px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}
.ai-fill-upload__camera-btn { background: #fff; color: #2563eb; }
.ai-fill-upload__errors { color: #dc2626; font-size: 12px; margin-top: 8px; font-family: Arial, sans-serif; }

.ai-fill-upload__paste { margin-top: 14px; font-family: Arial, sans-serif; }
.ai-fill-upload__paste-hint { font-size: 12px; color: #64748b; margin: 0 0 6px; }
.ai-fill-upload__paste-textarea { width: 100%; min-height: 70px; font-size: 13px; padding: 8px; border: 1px solid #cbd5e1; border-radius: 6px; resize: vertical; box-sizing: border-box; font-family: inherit; }
.ai-fill-upload__paste-btn { margin-top: 6px; font-size: 12px; padding: 6px 12px; border: 1px solid #2563eb; background: #fff; color: #2563eb; border-radius: 6px; cursor: pointer; }
.ai-fill-doc-card--text .ai-fill-doc-card__preview { background: #eff6ff; color: #1e3a5f; font-size: 10px; padding: 6px; text-align: left; align-items: flex-start; }

.ai-fill-upload__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.ai-fill-doc-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  font-family: Arial, sans-serif;
  font-size: 11px;
}
.ai-fill-doc-card__preview { height: 100px; display: flex; align-items: center; justify-content: center; background: #f1f5f9; overflow: hidden; }
.ai-fill-doc-card__preview img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .2s; }
.ai-fill-doc-card__file-icon { font-weight: 700; color: #64748b; }
.ai-fill-doc-card__meta { padding: 6px 8px; }
.ai-fill-doc-card__name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.ai-fill-doc-card__actions { display: flex; border-top: 1px solid #e2e8f0; }
.ai-fill-doc-card__btn { flex: 1; border: 0; background: #fff; padding: 6px 0; cursor: pointer; border-right: 1px solid #e2e8f0; }
.ai-fill-doc-card__btn:last-child { border-right: 0; }

.ai-fill-type-selector { display: block; padding: 0 8px 6px; font-family: Arial, sans-serif; font-size: 11px; }
.ai-fill-type-selector__label { display: block; color: #64748b; margin-bottom: 2px; }
.ai-fill-type-selector__select { width: 100%; font-size: 11px; padding: 2px; }

.ai-fill-confidence {
  display: inline-block;
  font-family: Arial, sans-serif;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}
.ai-fill-confidence--automatic { background: #dcfce7; color: #15803d; }
.ai-fill-confidence--review { background: #fef3c7; color: #b45309; }
.ai-fill-confidence--reject { background: #fee2e2; color: #dc2626; }

.ai-fill-progress { font-family: Arial, sans-serif; font-size: 12px; display: flex; gap: 12px; margin: 12px 0; }
.ai-fill-progress__step { color: #94a3b8; padding-bottom: 4px; border-bottom: 2px solid transparent; }
.ai-fill-progress__step--active { color: #2563eb; border-color: #2563eb; font-weight: 600; }
.ai-fill-progress__step--done { color: #15803d; }
.ai-fill-progress__error { color: #dc2626; width: 100%; }

.ai-fill-checklist { list-style: none; padding: 0; margin: 0; font-family: Arial, sans-serif; font-size: 13px; }
.ai-fill-checklist__item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.ai-fill-checklist__bullet { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; flex-shrink: 0; }
.ai-fill-checklist__item--received .ai-fill-checklist__bullet { background: #16a34a; }
.ai-fill-checklist__required { color: #dc2626; font-size: 10px; margin-left: auto; }

.ai-fill-missing { background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; padding: 10px 12px; font-family: Arial, sans-serif; font-size: 12px; margin: 12px 0; }
.ai-fill-missing__title { margin: 0 0 6px; color: #991b1b; font-weight: 600; }
.ai-fill-missing__list { margin: 0; padding-left: 16px; }
.ai-fill-missing__link { background: none; border: none; color: #b91c1c; text-decoration: underline; cursor: pointer; padding: 0; font-size: 12px; }

.ai-fill-conflicts { background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 10px 12px; font-family: Arial, sans-serif; font-size: 12px; margin: 12px 0; }
.ai-fill-conflicts__title { margin: 0 0 8px; color: #92400e; font-weight: 600; }
.ai-fill-conflicts__item { margin-bottom: 10px; }
.ai-fill-conflicts__field-label { font-weight: 600; margin: 0; }
.ai-fill-conflicts__reason { color: #78350f; margin: 2px 0 6px; }
.ai-fill-conflicts__option { display: block; margin: 2px 0; }

.ai-fill-review { font-family: Arial, sans-serif; font-size: 12px; }
.ai-fill-review__row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.ai-fill-review__label { width: 160px; flex-shrink: 0; color: #475569; }
.ai-fill-review__value { flex: 1; padding: 4px 6px; }
.ai-fill-review__source { color: #94a3b8; font-size: 10px; }
.ai-fill-review__row--needs-review { background: #fffbeb; }
.ai-fill-review__confirm-btn { border: 1px solid #16a34a; color: #16a34a; background: #fff; border-radius: 4px; padding: 3px 8px; cursor: pointer; font-size: 11px; }
.ai-fill-review__row--confirmed .ai-fill-review__confirm-btn { display: none; }

/* Realce nos campos reais do formulário — nunca aplicado dentro de #pdf-document */
.ai-fill-field--auto { background-color: #f0fdf4; border-color: #86efac !important; }
.ai-fill-field--needs-review { background-color: #fffbeb; border-color: #fcd34d !important; }

.ai-fill-mount { font-family: Arial, sans-serif; margin: 0 0 24px; padding: 16px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fafafa; }
.ai-fill-panel__title { margin: 0 0 4px; font-size: 16px; color: #0f172a; }
.ai-fill-panel__desc { margin: 0 0 14px; font-size: 13px; color: #64748b; }
.ai-fill-consent { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: #475569; margin: 12px 0; }
.ai-fill-consent input { margin-top: 2px; }
.ai-fill-panel__actions { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.ai-fill-panel__purge-btn { background: none; border: none; color: #dc2626; font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0; }

@media print {
  .ai-fill-mount, .ai-fill-upload, .ai-fill-progress, .ai-fill-missing, .ai-fill-conflicts, .ai-fill-review {
    display: none !important;
  }
}
