.import-page {
  padding: 2rem 2.5rem;
  max-width: 900px;
}

.page-header {
  margin-bottom: 1.5rem;

  h1 { margin: 0.6rem 0 0.3rem; font-size: 1.5rem; color: #f3f4f6; }
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;

  &:hover { color: #c4b5fd; }
}

.subtitle { margin: 0; color: #9ca3af; font-size: 0.9rem; }

// --- Upload -----------------------------------------------------------------
.upload-area {
  padding: 2rem;
  border: 1px dashed #374151;
  border-radius: 12px;
  text-align: center;
  background: #0b1220;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: #6c63ff;
  color: white;
  &:hover:not(:disabled) { background: #5b52e0; }
  &:disabled { opacity: 0.6; cursor: progress; }

  &.big { padding: 0.8rem 1.4rem; font-size: 0.95rem; }
}

.btn-secondary {
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid #374151;
  &:hover { background: #273244; }
}

.import-progress {
  margin: 1.25rem auto 0;
  max-width: 460px;
  text-align: left;
}

.import-phase { margin: 0 0 0.5rem; color: #c4b5fd; font-size: 0.85rem; font-weight: 500; }

.progress-bar {
  height: 6px;
  background: #1f2937;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #6c63ff;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.import-counts { margin: 0.55rem 0 0; color: #9ca3af; font-size: 0.8rem; }

.import-error,
.apply-error {
  margin: 1rem 0 0;
  padding: 0.55rem 0.8rem;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.85rem;
}

// --- Revue (arbre) ----------------------------------------------------------
.review-summary { margin: 0 0 1rem; color: #d1d5db; font-size: 0.9rem; strong { color: #fff; } em { color: #9ca3af; font-style: italic; } }

// Nœuds déjà présents dans la campagne : grisés, lecture seule.
.existing-node {
  opacity: 0.6;

  .node-name { background: transparent; border-color: transparent; cursor: default; }
}

.badge-existing {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid #1f2937;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

.tree { display: flex; flex-direction: column; gap: 0.75rem; }

.arc-card {
  border: 1px solid #1f2937;
  border-radius: 10px;
  background: #0b1220;
  overflow: hidden;
}

.node-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
}

.arc-head { background: #111827; }
.chapter-head { background: rgba(255, 255, 255, 0.02); }

.btn-collapse {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  display: flex;
  &:hover { color: #c4b5fd; }
}

.node-icon { color: #a78bfa; flex-shrink: 0; }
.scene-icon { color: #6b7280; }

.node-name {
  flex: 1;
  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 6px;
  color: #f3f4f6;
  padding: 0.35rem 0.5rem;
  font-size: 0.88rem;

  &:focus { outline: none; border-color: #6c63ff; }
}

.btn-remove {
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  &:hover { color: #f87171; }
}

.node-body { padding: 0.5rem 0.7rem 0.7rem 1.7rem; display: flex; flex-direction: column; gap: 0.5rem; }

.node-desc,
.node-desc-inline {
  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 6px;
  color: #d1d5db;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  font-family: inherit;
  resize: vertical;
  &:focus { outline: none; border-color: #6c63ff; }
}

.chapter-card {
  border: 1px solid #1f2937;
  border-radius: 8px;
  overflow: hidden;
}

// Sélecteur Linéaire / Hub
.arc-type-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toggle-label { color: #9ca3af; font-size: 0.8rem; }

.type-btn {
  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 6px;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;

  &:hover { border-color: #6c63ff; }
  &.active { background: rgba(108, 99, 255, 0.18); border-color: #6c63ff; color: #c4b5fd; font-weight: 600; }
}

.scene-card {
  border: 1px solid #161e2e;
  border-radius: 6px;
  padding: 0.3rem 0.4rem;
}

.scene-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-details {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: transparent;
  border: 1px solid #1f2937;
  border-radius: 6px;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;

  &:hover { color: #c4b5fd; border-color: #6c63ff; }
}

.scene-details {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.4rem 0 0.2rem 1.5rem;
  padding-left: 0.6rem;
  border-left: 2px solid #1f2937;
}

.field-label {
  color: #9ca3af;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.3rem;
}

.rooms {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.room-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.room-name,
.room-field {
  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 5px;
  color: #d1d5db;
  padding: 0.25rem 0.4rem;
  font-size: 0.78rem;
  &:focus { outline: none; border-color: #6c63ff; }
}

.room-name { flex: 0 0 22%; }
.room-field { flex: 1; min-width: 0; }

.scene-fields {
  flex: 1;
  display: flex;
  gap: 0.4rem;

  .node-name { flex: 0 0 40%; }
  .node-desc-inline { flex: 1; }
}

.btn-add,
.btn-add-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: 1px dashed #374151;
  border-radius: 6px;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  align-self: flex-start;

  &:hover { color: #c4b5fd; border-color: #6c63ff; }
}

.btn-add { margin-top: 0.25rem; }

.review-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

// --- Revue des PNJ détectés dans le PDF ------------------------------------
.npc-review {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--border-color, #2e2e3a);
  border-radius: 8px;

  h3 { margin: 0 0 0.25rem; font-size: 1rem; }
  .hint { margin: 0 0 0.75rem; font-size: 0.85rem; opacity: 0.75; }
}

.npc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.npc-row {
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);

  &.npc-existing { opacity: 0.55; }

  .npc-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
  }

  .npc-tag {
    font-size: 0.75rem;
    opacity: 0.7;
  }

  .npc-desc {
    margin: 0.3rem 0 0 1.6rem;
    font-size: 0.85rem;
    opacity: 0.85;
  }
}
