/* The Contacts upload window (contact-import.js). Light first, dark its own;
   the lime button carries black text. */
.crm-cimp {
  --imp-ink: #0f172a;
  --imp-muted: #64748b;
  --imp-line: #e5e7eb;
  --imp-card: #ffffff;
  --imp-soft: #f8fafc;
  --imp-lime: #d4fb08;
  --imp-lime-soft: #f3fce4;
  --imp-lime-line: #d9f99d;
  --imp-ok: #15803d;
  --imp-info: #1d4ed8;
  --imp-warn: var(--crm-alert-ink, #c8243b);
  --imp-bad: #b91c1c;
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
}
.dark .crm-cimp {
  --imp-ink: #f1f5f9;
  --imp-muted: #94a3b8;
  --imp-line: #334155;
  --imp-card: #111827;
  --imp-soft: #0b1220;
  --imp-lime-soft: #1a2e05;
  --imp-lime-line: #3f6212;
  --imp-ok: #4ade80;
  --imp-info: #93c5fd;
  --imp-warn: var(--crm-alert-ink, #c8243b);
  --imp-bad: #f87171;
  background: rgba(0, 0, 0, .6);
}

.crm-cimp__card {
  width: min(600px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--imp-card);
  color: var(--imp-ink);
  border: 1px solid var(--imp-line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  overflow: hidden;
}

.crm-cimp__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 6px; }
.crm-cimp__title { margin: 0; font-size: 17px; font-weight: 700; }
/* The close button is a square with its cross in the middle: it also carries
   .crm-cimp__btn, whose padding pushed the × off centre. */
.crm-cimp__btn.crm-cimp__x {
  width: 32px; height: 32px; padding: 0; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--imp-muted); font-size: 18px; line-height: 1;
}
.crm-cimp__btn.crm-cimp__x .fi { font-size: 18px; }
.crm-cimp__btn.crm-cimp__x:hover { background: var(--imp-soft); color: var(--imp-ink); }

/* ---- the steps ---- */
.crm-cimp__steps { display: flex; gap: 6px; list-style: none; margin: 8px 22px 4px; padding: 0; }
.crm-cimp__step { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--imp-muted); }
.crm-cimp__step::before { content: ""; height: 4px; border-radius: 4px; background: var(--imp-line); }
.crm-cimp__step.is-on::before, .crm-cimp__step.is-done::before { background: var(--imp-lime); }
.crm-cimp__step.is-on { color: var(--imp-ink); font-weight: 600; }
.crm-cimp__dot { display: none; }

.crm-cimp__body { padding: 14px 22px 6px; overflow: auto; }
.crm-cimp__foot {
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  padding: 14px 22px 18px; border-top: 1px solid var(--imp-line); margin-top: 10px;
}

/* ---- buttons ---- */
.crm-cimp__btn {
  height: 36px; padding: 0 16px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; border: 1px solid var(--imp-line);
  background: var(--imp-card); color: var(--imp-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
/* An icon is exactly its 1em square: the font's own box is wider than the
   drawn outline and pushed the close cross off centre. */
.crm-cimp .fi { width: 1em; height: 1em; line-height: 1; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.crm-cimp__btn .fi { font-size: 14px; }
.crm-cimp__btn:hover:not(:disabled) { border-color: var(--imp-lime); }
.crm-cimp__btn:disabled { opacity: .5; cursor: default; }
.crm-cimp__btn--primary { background: var(--imp-lime); border-color: var(--imp-lime); color: #000 !important; }
.crm-cimp__btn--primary:hover:not(:disabled) { background: #c6ec00; }
.crm-cimp__btn--link { height: auto; padding: 0; border: 0; background: none; color: var(--imp-info); text-decoration: underline; font-weight: 600; }
.crm-cimp__foot .crm-cimp__btn--ghost:first-child { margin-inline-end: auto; }

/* ---- the file ---- */
.crm-cimp__drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 34px 20px; border: 2px dashed var(--imp-line); border-radius: 8px;
  background: var(--imp-soft); cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.crm-cimp__drop:hover, .crm-cimp__drop.is-over { border-color: var(--imp-lime); background: var(--imp-lime-soft); }
.crm-cimp__drop input { display: none; }
.crm-cimp__drop strong { font-size: 14px; }
.crm-cimp__dropicon {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--imp-lime); color: #000; font-size: 22px; font-weight: 700;
}
.crm-cimp__hint { font-size: 12px; color: var(--imp-muted); }
.crm-cimp__tips { margin: 14px 0 4px; padding-inline-start: 18px; font-size: 12.5px; color: var(--imp-muted); display: grid; gap: 4px; }

.crm-cimp__file { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.crm-cimp__file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.crm-cimp__file span { font-size: 12px; color: var(--imp-muted); flex: none; }

.crm-cimp__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.crm-cimp__col {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--imp-line); font-size: 12px; color: var(--imp-muted);
}
.crm-cimp__col b { color: var(--imp-ink); font-size: 12.5px; }
.crm-cimp__col span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.crm-cimp__col.is-found { border-color: var(--imp-lime-line); background: var(--imp-lime-soft); }

/* ---- numbers ---- */
.crm-cimp__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.crm-cimp__stat { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 8px; background: var(--imp-soft); border: 1px solid var(--imp-line); }
.crm-cimp__num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.crm-cimp__lab { font-size: 12px; color: var(--imp-muted); line-height: 1.35; }
.crm-cimp__stat.is-ok .crm-cimp__num { color: var(--imp-ok); }
.crm-cimp__stat.is-info .crm-cimp__num { color: var(--imp-info); }
.crm-cimp__stat.is-warn .crm-cimp__num { color: var(--imp-warn); }
.crm-cimp__stat.is-bad .crm-cimp__num { color: var(--imp-bad); }

.crm-cimp__fails { display: grid; gap: 4px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--imp-line); font-size: 12px; margin-bottom: 8px; }
.crm-cimp__fail { display: flex; justify-content: space-between; gap: 10px; color: var(--imp-muted); }
.crm-cimp__failv { color: var(--imp-ink); font-variant-numeric: tabular-nums; }
.crm-cimp__fails .crm-cimp__btn--link { justify-self: start; margin-top: 4px; font-size: 12px; }

/* ---- upload ---- */
.crm-cimp__lead { margin: 4px 0 12px; font-size: 14px; font-weight: 600; }
.crm-cimp__center { text-align: center; }
.crm-cimp__bar { height: 12px; border-radius: 8px; background: var(--imp-soft); border: 1px solid var(--imp-line); overflow: hidden; }
.crm-cimp__fill {
  height: 100%; width: 0; border-radius: 8px; transition: width .35s ease;
  background: linear-gradient(90deg, #d4fb08, #c6ec00);
}
[dir="rtl"] .crm-cimp__fill { margin-inline-start: auto; background: linear-gradient(270deg, #d4fb08, #c6ec00); }
.crm-cimp__count { margin: 10px 0 0; font-size: 12.5px; color: var(--imp-muted); font-variant-numeric: tabular-nums; text-align: center; }

/* ---- labels ---- */
.crm-cimp__sub { margin: 12px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--imp-muted); }
.crm-cimp__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-cimp__chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--imp-line); background: var(--imp-card);
  color: var(--imp-ink); font-size: 12.5px; cursor: pointer; unicode-bidi: plaintext;
}
.crm-cimp__chip.is-on { background: var(--imp-lime-soft); border-color: var(--imp-lime); }
.crm-cimp__chip em { font-style: normal; font-size: 10.5px; font-weight: 700; color: #000; background: var(--imp-lime); padding: 1px 6px; border-radius: 999px; }
.crm-cimp__swatch { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.crm-cimp__input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--imp-line);
  background: var(--imp-card); color: var(--imp-ink); font-size: 13px; margin: 0 !important;
}
.crm-cimp__input:focus { outline: 2px solid var(--imp-lime-line); border-color: var(--imp-lime); }

.crm-cimp__error { margin: 0 0 10px; padding: 10px 12px; border-radius: 8px; font-size: 12.5px; color: var(--imp-bad); background: rgba(239, 68, 68, .08); border: 1px solid rgba(239, 68, 68, .25); }
.crm-cimp__warn { font-size: 12.5px; color: var(--imp-warn); }

.crm-cimp__tick {
  width: 56px; height: 56px; margin: 6px auto 4px; border-radius: 50%; display: grid; place-items: center;
  background: var(--imp-lime); color: #000; font-size: 26px; font-weight: 700;
}

@media (max-width: 520px) {
  .crm-cimp__cols { grid-template-columns: 1fr; }
  .crm-cimp__steplabel { font-size: 10.5px; }
}

/* The sales upload (sales-import.js) shares this window: the day/month and
   currency questions sit on one line each. */
.crm-cimp__order { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 12px; font-size: 12.5px; color: var(--imp-muted); }
.crm-cimp__select { width: auto; min-width: 110px; height: 32px; }
