/* ── Person import modal ──────────────────────────────────────────────── */
.import-body { display: flex; flex-direction: column; gap: 18px; padding: 20px 22px 22px; }
.import-guide { display: flex; flex-direction: column; gap: 10px; }
.import-rules { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text); line-height: 1.5; }
.import-rules code, .import-tpl code { font-family: var(--font-mono); font-size: 12px; background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }
.import-tpl { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); margin: 0; }
.import-tpl a { display: inline-flex; align-items: center; gap: 5px; }
/* The note under the sample links — same voice as .import-tpl, but a full line. */
.import-tpl-hint { font-size: 12px; margin: -4px 0 0; line-height: 1.5; }

/* The allowed values for the columns whose vocabulary is *data* — the live «Звання»
   and «Стани» catalogues in the person-import modal. A framed, scrollable block: a
   formation with forty ranks must not push the dropzone off the modal. */
.import-vocab {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2); padding: 12px 14px;
  max-height: 240px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.import-vocab-head { margin: 0; font-size: 12.5px; color: var(--muted); }
.import-vocab-head:not(:first-child) { margin-top: 6px; }
.import-vocab-head strong { color: var(--text); }
.import-vocab-list { margin: 0; font-size: 12px; line-height: 2; color: var(--muted-2); }
.import-vocab-list code {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text);
  background: var(--panel); padding: 1px 5px; border-radius: 5px;
}
.import-vocab-states { list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 5px; }
.import-vocab-states li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px;
}
.import-vocab-states code {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
  background: var(--panel); padding: 1px 5px; border-radius: 5px;
}

.import-drop {
  border: 1px dashed var(--border-bright); border-radius: var(--radius);
  background: var(--bg); transition: border-color .12s, background .12s;
}
.import-drop.is-dragover { border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 8%, transparent); }
.import-drop.has-file { border-style: solid; border-color: var(--accent-2); }
.import-drop-zone {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 30px 20px; text-align: center; cursor: default;
}
.import-drop-zone .icon { width: 30px; height: 30px; color: var(--muted); }
.import-drop.has-file .import-drop-zone .icon { color: var(--accent-2); }
.import-drop-hint { margin: 0; font-size: 14px; color: var(--text); }
.import-drop-name { margin: 0; font-size: 12px; font-family: var(--font-mono); }
.import-drop.has-file .import-drop-name { color: var(--text-strong); }

.import-summary { display: flex; gap: 12px; flex-wrap: wrap; }
.import-stat {
  flex: 1; min-width: 90px; display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2);
}
.import-stat-num { font-size: 24px; font-weight: 700; font-family: var(--font-mono); color: var(--text-strong); line-height: 1; }
.import-stat-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.import-stat.ok .import-stat-num { color: var(--accent-2); }
.import-stat.bad .import-stat-num { color: var(--danger); }
/* «уже було» is neither: nothing was written and nothing needs fixing, so it must
   not read as a failure beside «відкинуто» — the two tallies sit next to each other
   and the colour is what tells them apart at a glance. */
.import-stat.warn .import-stat-num { color: var(--warn); }

/* `min-width: 0` is what keeps a long reason (the «Стан» rejection lists the whole
   catalogue) from widening the modal instead of wrapping inside it — a flex item's
   automatic minimum is its content, so without it the table pushes the dialog past
   the viewport and the whole page scrolls sideways. */
.import-errors { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.import-errors .eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); }
.import-existing .eyebrow { color: var(--warn); }
/* The «показано перші N із M» notice is `muted fz-sm` like the other two in the app;
   all it needs of its own is the margin reset a <p> wants inside a gapped flex column. */
.import-errors > p { margin: 0; }
.import-errors .eyebrow .icon { width: 15px; height: 15px; }
.import-error-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.import-error-table th, .import-error-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.import-error-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.import-error-table td:first-child { font-family: var(--font-mono); color: var(--muted); width: 48px; }
.import-allgood { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--accent-2); font-size: 14px; }
.import-allgood .icon { width: 16px; height: 16px; }

/* ── The run overlay: what is on screen while an import is working ──────────
   A sheet over the whole window (`.modal-backdrop`'s child, not the box's — the box
   scrolls), which is what makes it both the readout and the reason nothing underneath
   can be touched. Its card is a `.panel`, so it takes `--surface` and the letterpress
   on its own title through the selectors those two already have — a new panel-like
   surface here would otherwise have needed a line in base/relief.css to avoid reading
   flat beside the modal head above it. */
.import-run {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: var(--backdrop);
}
.import-run-card {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 12px;
}
.import-run-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.import-run-head b { color: var(--text-strong); }
/* The clock is the one thing on the card that keeps moving when the numbers cannot
   (a file still being read, a slow row) — so it is what says «alive», and it is
   monospaced so a digit rolling over doesn't shift the line. */
.import-run-clock {
  margin-left: auto; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted);
}
.import-run-spin {
  flex: none; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--border-bright); border-top-color: var(--accent-2);
  animation: importSpin .8s linear infinite;
}
@keyframes importSpin { to { transform: rotate(360deg); } }
.import-run-phase { margin: 0; font-size: 13px; color: var(--text); }
.import-run-counts { margin: 0; font-size: 12px; color: var(--muted); }
.import-run-note { margin: 0; font-size: 13px; color: var(--danger); }
.import-run-warn {
  display: flex; align-items: flex-start; gap: 6px; margin: 0;
  font-size: 12px; line-height: 1.45; color: var(--muted);
}
.import-run-warn .icon { flex: none; width: 14px; height: 14px; margin-top: 1px; color: var(--warn); }

@media (prefers-reduced-motion: reduce) {
  .import-run-spin { animation: none; }
}
