/* ============================================================
   BARAEM GRADEFLOW — IMPORT CENTRE

   Same visual language as the Overview and 3-Year pages: one identity block, a
   quiet progress rule, hairline-divided figures rather than coloured cards, and
   panels rather than floating blocks.

   State colour is used where it means something — a rejected row is red because
   it is a real problem, not because the block is decorative.
   ============================================================ */

.im-wrap {
  padding-block: var(--s-5) var(--s-8);
  max-width: 1320px;
}

/* ------------------------------------------------------------
   HEAD
   ------------------------------------------------------------ */
.im-head { margin-block-end: var(--s-6); }
.im-head .ac-eyebrow {
  font-size: var(--t-10);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-600);
  margin-block-end: var(--s-2);
}
.im-head .ac-title {
  margin: 0 0 var(--s-2);
  font-size: var(--t-28);
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--text);
}
.im-sub {
  margin: 0;
  font-size: var(--t-13);
  color: var(--text-mute);
  max-width: 68ch;
  line-height: var(--lh-body);
}

/* ------------------------------------------------------------
   PROGRESS — a thin rule plus labels. No floating numbered chips.
   ------------------------------------------------------------ */
.im-progress { margin-block-start: var(--s-5); }
.im-progress-bar {
  height: 2px; background: var(--border); border-radius: 2px; overflow: hidden;
}
.im-progress-bar > i {
  display: block; height: 100%;
  background: var(--accent);
  transition: width var(--t-slow) var(--ease-out);
}
.im-steps {
  display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5);
  list-style: none; margin: var(--s-3) 0 0; padding: 0;
}
.im-step-l {
  font-size: var(--t-12);
  color: var(--text-mute);
  position: relative;
  padding-inline-start: var(--s-3);
}
/* a small marker instead of a badge */
.im-step-l::before {
  content: '';
  position: absolute; inset-inline-start: 0; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--border-strong);
}
.im-step.done .im-step-l { color: var(--text-faint); }
.im-step.done .im-step-l::before { background: var(--ok-600); }
.im-step.now .im-step-l { color: var(--accent-700); font-weight: 650; }
.im-step.now .im-step-l::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-100);
}

/* ------------------------------------------------------------
   UPLOAD
   ------------------------------------------------------------ */
.im-drop {
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: var(--s-10) var(--s-6);
  text-align: center;
  transition: border-color var(--t-base) var(--ease), background var(--t-base) var(--ease);
}
.im-drop.over { border-color: var(--accent); background: var(--accent-50); }
.im-drop-ic {
  width: 44px; height: 44px; margin: 0 auto var(--s-4);
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2); color: var(--accent-700);
}
.im-drop-ic svg { width: 20px; height: 20px; }
.im-drop h3 {
  margin: 0 0 var(--s-2);
  font-size: var(--t-17); font-weight: 650; color: var(--text);
}
.im-drop p {
  margin: 0 0 var(--s-5);
  font-size: var(--t-13); color: var(--text-mute);
}
.im-pick { display: inline-flex; }
.im-tmpl {
  display: inline-block; margin-inline-start: var(--s-4);
  font-size: var(--t-13); color: var(--accent-700);
  text-decoration: underline; text-underline-offset: 3px;
}

/* the file bar after a file is chosen */
.im-bar {
  display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap;
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface);
  border-inline-start: 3px solid var(--accent);
}
.im-file { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.im-file-n {
  font-size: var(--t-13); font-weight: 650; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch;
}
.im-file-s { font-size: var(--t-11); color: var(--text-faint); }
.im-bar-a {
  display: flex; align-items: center; gap: var(--s-2);
  margin-inline-start: auto; flex-wrap: wrap;
}

/* ------------------------------------------------------------
   WHAT THE FILE NEEDS — a real panel, not floating text
   ------------------------------------------------------------ */
.im-help {
  margin-block-start: var(--s-6);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden;
}
.im-help h4 {
  margin: 0; padding: var(--s-4) var(--s-5);
  font-size: var(--t-11); font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.im-help .im-tbl { margin: 0; }
.im-alt { color: var(--text-faint); font-size: var(--t-12); }
.im-req { color: var(--bad-600); font-weight: 650; }
.im-opt { color: var(--text-faint); }

/* generic table used inside the help panel and the done summary */
.im-tbl { width: 100%; border-collapse: collapse; font-size: var(--t-13); }
.im-tbl th, .im-tbl td {
  padding: var(--s-3) var(--s-5);
  text-align: start;
  border-bottom: 1px solid var(--border-soft);
}
.im-tbl tbody tr:last-child td { border-bottom: 0; }
.im-tbl tbody tr:hover td { background: var(--surface-2); }
.im-tbl th {
  font-size: var(--t-11); font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-faint);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.im-tbl td.n, .im-tbl th.n {
  text-align: end; font-variant-numeric: tabular-nums;
  direction: ltr; unicode-bidi: isolate;
}

/* ------------------------------------------------------------
   FIGURE STRIP — hairline-divided, not coloured cards
   ------------------------------------------------------------ */
.im-sum {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  background: var(--border-soft);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden;
  margin-block-end: var(--s-5);
}
.im-stat {
  background: var(--surface);
  padding: var(--s-4);
  display: flex; flex-direction: column; gap: 2px;
}
.im-stat b {
  font-size: var(--t-22); font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1.1;
  direction: ltr; unicode-bidi: isolate;
}
.im-stat span { font-size: var(--t-11); color: var(--text-faint); }
.im-stat.im-ok   { background: var(--ok-50); }
.im-stat.im-ok b { color: var(--ok-700); }
.im-stat.im-warn { background: var(--warn-50); }
.im-stat.im-warn b { color: var(--warn-700); }
.im-stat.im-err  { background: var(--bad-50); }
.im-stat.im-err b { color: var(--bad-700); }

/* ------------------------------------------------------------
   BANNERS
   ------------------------------------------------------------ */
.im-banner {
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  font-size: var(--t-13);
  margin-block-end: var(--s-5);
  border: 1px solid transparent;
  line-height: var(--lh-body);
}
.im-bad { background: var(--bad-50); color: var(--bad-800); border-color: var(--bad-200); }
.im-warn-soft { background: var(--warn-50); color: var(--warn-800); border-color: var(--warn-200); }

/* ------------------------------------------------------------
   COLUMN MAPPING
   ------------------------------------------------------------ */
.im-map {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface);
  padding: var(--s-5);
  margin-block-end: var(--s-5);
}
.im-map h3 {
  margin: 0 0 var(--s-1);
  font-size: var(--t-15); font-weight: 650; color: var(--text);
}
.im-map-n {
  margin: 0 0 var(--s-4);
  font-size: var(--t-12); color: var(--text-mute);
  max-width: 74ch; line-height: var(--lh-body);
}
.im-map-g {
  display: grid; gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.im-map-f { display: flex; flex-direction: column; gap: var(--s-1); }
.im-map-l {
  font-size: var(--t-11); font-weight: 650; color: var(--text-soft);
  letter-spacing: .02em;
}
.im-map-f.miss .im-map-l { color: var(--bad-700); }
.im-map-f.miss select { border-color: var(--bad-500); }
.im-map-a { display: flex; gap: var(--s-2); margin-block-start: var(--s-4); flex-wrap: wrap; }

/* ------------------------------------------------------------
   PREVIEW
   ------------------------------------------------------------ */
.im-prev { margin-block-end: var(--s-5); }
.im-prev-bar {
  display: flex; align-items: center; gap: var(--s-4);
  flex-wrap: wrap; margin-block-end: var(--s-3);
}
.im-prev-bar h3 {
  margin: 0; font-size: var(--t-15); font-weight: 650; color: var(--text);
}
.im-tools {
  display: flex; align-items: center; gap: var(--s-3);
  margin-inline-start: auto; flex-wrap: wrap;
}
.im-prev-n { margin: var(--s-2) 0 0; font-size: var(--t-11); color: var(--text-mute); }
.im-none {
  padding: var(--s-7) var(--s-4);
  text-align: center; font-size: var(--t-13); color: var(--text-mute);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

/* the status filter, matching the segmented control used elsewhere */
.im-seg {
  display: flex; border: 1px solid var(--border);
  border-radius: var(--r-sm); overflow: hidden;
}
.im-seg-b {
  border: 0; background: var(--surface); color: var(--text-mute);
  padding: var(--s-2) var(--s-3); font-size: var(--t-12);
  cursor: pointer; font-family: inherit;
  border-inline-end: 1px solid var(--border-soft);
  white-space: nowrap;
}
.im-seg-b:last-child { border-inline-end: 0; }
.im-seg-b i {
  font-style: normal; opacity: .65;
  font-variant-numeric: tabular-nums;
}
.im-seg-b.on { background: var(--accent); color: #fff; }
.im-seg-b.on i { opacity: .85; }

/* search field */
.an-inp {
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  font-size: var(--t-13); font-family: inherit;
  min-width: 190px;
}
.an-inp:focus {
  outline: 2px solid var(--accent); outline-offset: -1px;
}

/* sortable headers inside the shared scroller */
.scroller th.sortable { cursor: pointer; user-select: none; }
.scroller th.sortable:hover { color: var(--text); }
.scroller th.sortable::after {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  margin-inline-start: 5px;
  vertical-align: middle;
  border-inline: 3.5px solid transparent;
  border-bottom: 4px solid var(--text-mute);
  opacity: .5;
}

/* ------------------------------------------------------------
   ROW STATUS
   ------------------------------------------------------------ */
.im-b {
  display: inline-block;
  font-size: var(--t-10, 10px); font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 2px var(--s-2);
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.im-b-ok   { background: var(--ok-100);   color: var(--ok-700); }
.im-b-warn { background: var(--warn-100); color: var(--warn-700); }
.im-b-err  { background: var(--bad-100);  color: var(--bad-700); }
.im-msg { color: var(--text-faint); font-size: var(--t-12); }

/* ------------------------------------------------------------
   COMMIT
   ------------------------------------------------------------ */
.im-commit {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface);
  padding: var(--s-5);
  border-inline-start: 3px solid var(--accent);
}
.im-check {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--t-13); color: var(--text-soft); margin-block-end: var(--s-4);
  cursor: pointer;
}
.im-commit-a { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.im-commit-n {
  margin: var(--s-3) 0 0;
  font-size: var(--t-11); color: var(--text-mute); max-width: 76ch;
}
.btn-lg { padding: var(--s-3) var(--s-5); font-size: var(--t-14); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------
   DONE
   ------------------------------------------------------------ */
.im-done { max-width: 820px; }
.im-done-ic {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ok-100); color: var(--ok-700);
  margin-block-end: var(--s-4);
}
.im-done-ic svg { width: 24px; height: 24px; }
.im-done h2 {
  margin: 0 0 var(--s-4);
  font-size: var(--t-24); font-weight: 700; color: var(--text);
}
.im-done-n {
  margin: 0 0 var(--s-4);
  font-size: var(--t-13); color: var(--text-soft); line-height: var(--lh-body);
}
.im-done-t {
  margin-block-end: var(--s-5);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden;
}
.im-done-a { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 720px) {
  .im-wrap { padding-block: var(--s-4) var(--s-6); }
  .im-head .ac-title { font-size: var(--t-22); }
  .im-drop { padding: var(--s-7) var(--s-4); }
  .im-bar-a { margin-inline-start: 0; width: 100%; }
  .im-bar-a .btn { flex: 1 1 auto; justify-content: center; }
  .im-tools { margin-inline-start: 0; width: 100%; }
  .im-tools .an-inp { flex: 1 1 160px; min-width: 0; }
  .im-tmpl { display: block; margin-inline-start: 0; margin-block-start: var(--s-3); }
  .im-commit { padding: var(--s-4); }
  .im-commit-a .btn { flex: 1 1 auto; justify-content: center; }
  .im-seg { width: 100%; }
  .im-seg-b { flex: 1 1 auto; justify-content: center; }
}

/* ------------------------------------------------------------
   PRINT — only the result matters on paper
   ------------------------------------------------------------ */
@media print {
  .no-print { display: none !important; }
  .im-drop, .im-help, .im-bar, .im-map, .im-prev, .im-commit { display: none !important; }
  .im-tbl th { position: static; background: transparent; }
  .im-done { max-width: none; }
}