/* IBEC Horizon — Smart Import modal.
 * Importação inteligente de planilhas (XLSX/CSV) com mapeamento de colunas.
 * Design alinhado ao navy/gold do plugin. */

.ibec-si-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 77, 0.62);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 100001;
  padding: 24px;
  overflow-y: auto;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.ibec-si-overlay.is-open { display: flex; }

/* v7A.9.21.30 — defensivo: o modal pode renderizar dentro do tema do site
 * (painel frontend), onde estilos globais de label/box-sizing/float vazam e
 * desalinham o conteúdo (texto sobreposto na área de upload). Forçamos um
 * baseline consistente em todo o conteúdo do modal. */
.ibec-si-overlay, .ibec-si-overlay * { box-sizing: border-box; }
.ibec-si-overlay .ibec-si-drop,
.ibec-si-overlay .ibec-si-drop strong,
.ibec-si-overlay .ibec-si-drop small,
.ibec-si-overlay label { float: none; position: static; max-width: 100%; }

/* Abas Enviar planilha / Colar dados */
.ibec-si-tabs { display: flex; gap: 8px; margin-bottom: 14px; border-bottom: 1px solid #e2e8f0; }
.ibec-si-tab {
  padding: 8px 16px;
  border: 1px solid transparent;
  border-bottom: 0;
  background: transparent;
  border-radius: 8px 8px 0 0;
  font-weight: 700;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  margin-bottom: -1px;
}
.ibec-si-tab.is-active {
  background: #fff;
  color: #0B1F4D;
  border-color: #e2e8f0;
  border-bottom: 1px solid #fff;
}
.ibec-si-tabpane { display: none; }
.ibec-si-tabpane.is-active { display: block; }

.ibec-si-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.ibec-si-paste {
  width: 100%;
  min-height: 170px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 12px;
  color: #0f172a;
  background: #fff;
}
.ibec-si-paste:focus { outline: 2px solid #c7d2fe; border-color: #0B1F4D; }

.ibec-si-modal {
  width: min(1100px, 100%);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(11, 31, 77, 0.32);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  margin-bottom: 40px;
}

.ibec-si-head {
  padding: 20px 24px;
  background: linear-gradient(135deg, #0B1F4D, #163B8C);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.ibec-si-head h2 { margin: 0; font-size: 20px; font-weight: 800; color: #fff; }
.ibec-si-head p { margin: 4px 0 0; font-size: 13px; opacity: 0.85; }
.ibec-si-close {
  background: rgba(255,255,255,0.1); color: #fff; border: 0;
  border-radius: 999px; width: 32px; height: 32px;
  font-size: 18px; cursor: pointer; line-height: 1;
}
.ibec-si-close:hover { background: rgba(255,255,255,0.22); }

.ibec-si-body { padding: 22px 24px; background: #f5f7fa; }

.ibec-si-step {
  display: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
}
.ibec-si-step.is-active { display: block; }
.ibec-si-step h3 { margin-top: 0; color: #0B1F4D; font-size: 16px; }

.ibec-si-drop {
  border: 2px dashed #c7d2fe;
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  background: #f8fafc;
  transition: background .2s, border-color .2s;
  cursor: pointer;
}
.ibec-si-drop.is-over { background: #eef2ff; border-color: #0B1F4D; }
.ibec-si-drop strong { display: block; color: #0B1F4D; font-size: 16px; margin-bottom: 6px; }
.ibec-si-drop small { color: #64748b; font-size: 13px; }
.ibec-si-drop input[type=file] { display: none; }

.ibec-si-loading { text-align: center; padding: 40px 20px; color: #475569; }
.ibec-si-spinner {
  display: inline-block;
  width: 36px; height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #FFC72C;
  border-radius: 50%;
  animation: ibec-si-spin 0.8s linear infinite;
  margin-bottom: 12px;
}
@keyframes ibec-si-spin { to { transform: rotate(360deg); } }

.ibec-si-summary {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.ibec-si-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}
.ibec-si-pill--ok { border-color: #86efac; color: #15803d; }
.ibec-si-pill--warn { border-color: #fde047; color: #a16207; }

.ibec-si-mapping-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
  table-layout: fixed;
}
.ibec-si-mapping-table th, .ibec-si-mapping-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  vertical-align: middle;
}
.ibec-si-mapping-table th {
  background: #f8fafc;
  font-size: 11px;
  text-transform: uppercase;
  color: #475569;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.ibec-si-mapping-table tr:last-child td { border-bottom: 0; }
.ibec-si-mapping-table select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
}
.ibec-si-mapping-table tr.is-auto td { background: #f0fdf4; }
.ibec-si-mapping-table tr.is-suggested td { background: #fefce8; }

.ibec-si-confidence {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.ibec-si-confidence--high { background: #dcfce7; color: #15803d; }
.ibec-si-confidence--mid { background: #fef3c7; color: #a16207; }
.ibec-si-confidence--low { background: #e2e8f0; color: #475569; }

.ibec-si-sample {
  margin-top: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: auto;
  max-height: 320px;
}
.ibec-si-sample table { width: 100%; border-collapse: collapse; min-width: 600px; }
.ibec-si-sample th, .ibec-si-sample td {
  padding: 8px 12px;
  font-size: 12px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}
.ibec-si-sample th {
  background: #f8fafc;
  text-align: left;
  font-weight: 700;
  color: #0B1F4D;
  position: sticky;
  top: 0;
  z-index: 1;
}

.ibec-si-foot {
  padding: 16px 24px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ibec-si-foot-info { font-size: 12px; color: #5a6781; }

.ibec-si-btn {
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.ibec-si-btn--primary { background: #0B1F4D; color: #fff; }
.ibec-si-btn--primary:hover { background: #163B8C; }
.ibec-si-btn--primary:disabled { background: #94a3b8; cursor: not-allowed; }
.ibec-si-btn--secondary { background: #fff; color: #0B1F4D; border-color: #cbd5e1; }
.ibec-si-btn--secondary:hover { background: #f1f5f9; }
.ibec-si-btn--gold { background: #FFC72C; color: #0B1F4D; }
.ibec-si-btn--gold:hover { background: #F2B705; }

.ibec-si-error {
  padding: 14px 18px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  color: #b42318;
  font-size: 13px;
}

.ibec-si-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #FFC72C, #F2B705);
  color: #0B1F4D;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  margin-left: 8px;
}
.ibec-si-trigger:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,199,44,0.4); }

/* v7A.9.21.29 — vínculo turma/empresa dentro do modal. */
.ibec-si-link {
  margin-top: 6px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.ibec-si-link h3 { margin: 0 0 10px; }
.ibec-si-link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ibec-si-link-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #0B1F4D;
}
.ibec-si-link-grid select {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
}
.ibec-si-link small { display: block; margin-top: 10px; color: #64748b; }
@media (max-width: 640px) { .ibec-si-link-grid { grid-template-columns: 1fr; } }

/* v7A.9.21.28 — opção de validação SERPRO + etapa de resultados + sucesso. */
.ibec-si-serpro-opt {
  margin-top: 16px;
  padding: 12px 14px;
  background: #f0f5ff;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
}
.ibec-si-serpro-opt label { font-size: 13px; color: #0B1F4D; font-weight: 700; cursor: pointer; }
.ibec-si-serpro-opt small { color: #64748b; font-weight: 400; }

.ibec-si-serpro-results {
  margin-top: 14px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.ibec-si-success {
  padding: 18px 20px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  color: #15803d;
  font-size: 14px;
  font-weight: 600;
}
