/* ==========================================================================
   importar.css — Modal de importação de planilhas
   ========================================================================== */

.acoes-cabecalho {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.imp-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.imp-modal.aberto { display: flex; }

.imp-fundo {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
}

.imp-caixa {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card-bg, #232323);
  border: 1px solid var(--border-color, #333);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}

.imp-topo {
  display: flex;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color, #333);
}

.imp-topo h3 {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color, #e8e8e8);
}

.imp-fechar {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  background: transparent;
  color: var(--text-muted, #9d9d9d);
}

.imp-fechar:hover { background: rgba(255, 255, 255, .07); }

.imp-corpo {
  padding: 24px;
  overflow-y: auto;
}

.imp-texto {
  font-size: .875rem;
  line-height: 1.6;
  color: var(--text-muted, #9d9d9d);
  margin: 0 0 20px;
}

/* --- Área de escolha do arquivo --- */

.imp-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 20px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  color: var(--text-muted, #9d9d9d);
  border: 2px dashed var(--border-color, #333);
  transition: border-color .15s, color .15s;
}

.imp-dropzone:hover {
  border-color: var(--accent-color, #f97316);
  color: var(--text-color, #e8e8e8);
}

.imp-dropzone strong {
  font-size: .9375rem;
  color: var(--text-color, #e8e8e8);
}

.imp-dropzone span { font-size: .75rem; }

/* --- Notas e avisos --- */

.imp-nota {
  margin-top: 20px;
  padding: 13px 16px;
  border-radius: 8px;
  font-size: .78rem;
  line-height: 1.6;
  color: var(--text-muted, #9d9d9d);
  background: rgba(255, 255, 255, .03);
  border-left: 3px solid var(--accent-color, #f97316);
}

.imp-nota code {
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .95em;
  background: rgba(255, 255, 255, .07);
}

.imp-aviso {
  margin-bottom: 16px;
  padding: 13px 16px;
  border-radius: 8px;
  font-size: .8125rem;
  line-height: 1.6;
  color: #ffca9a;
  background: rgba(199, 119, 0, .1);
  border-left: 3px solid #c77700;
}

.imp-aviso ul {
  margin: 8px 0 0 18px;
  font-size: .78rem;
}

/* --- Carregando --- */

.imp-carregando {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 50px 20px;
  text-align: center;
}

.imp-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--border-color, #333);
  border-top-color: var(--accent-color, #f97316);
  animation: imp-girar .8s linear infinite;
}

@keyframes imp-girar { to { transform: rotate(360deg); } }

.imp-carregando p {
  font-size: .875rem;
  color: var(--text-muted, #9d9d9d);
  margin: 0;
}

/* --- Prévia --- */

.imp-arquivo-nome {
  font-size: .8125rem;
  color: var(--text-muted, #9d9d9d);
  margin: 0 0 16px;
}

.imp-arquivo-nome strong { color: var(--text-color, #e8e8e8); }

.imp-resumo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.imp-numero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 16px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-color, #333);
}

.imp-numero span {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-color, #e8e8e8);
}

.imp-numero small {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted, #9d9d9d);
}

.imp-novo span { color: var(--success-color, #16a34a); }
.imp-atualiza span { color: var(--accent-color, #f97316); }

/* --- Erro --- */

.imp-erro-titulo {
  font-size: 1rem;
  margin: 0 0 10px;
  color: var(--danger-color, #dc2626);
}

.imp-detalhes {
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  padding: 13px 16px;
  margin: 0 0 20px;
  border-radius: 8px;
  font-size: .78rem;
  line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-muted, #9d9d9d);
  background: rgba(255, 255, 255, .03);
}

/* --- Sucesso --- */

.imp-sucesso-marca {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  margin: 10px auto 18px;
  border-radius: 50%;
  color: var(--success-color, #16a34a);
  background: rgba(22, 163, 74, .12);
}

.imp-sucesso-titulo {
  font-size: 1.05rem;
  text-align: center;
  margin: 0 0 10px;
  color: var(--text-color, #e8e8e8);
}

#imp-sucesso .imp-texto { text-align: center; }

/* --- Botões --- */

.imp-acoes {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.imp-btn {
  padding: 9px 18px;
  border-radius: 7px;
  font-size: .8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter .15s, border-color .15s;
}

.imp-btn:hover { filter: brightness(1.12); }
.imp-btn:disabled { opacity: .55; cursor: not-allowed; }

.imp-btn-primario {
  color: #fff;
  background: var(--accent-color, #f97316);
}

.imp-btn-secundario {
  color: var(--text-muted, #9d9d9d);
  background: transparent;
  border-color: var(--border-color, #333);
}

.imp-btn-secundario:hover { color: var(--text-color, #e8e8e8); }

@media (max-width: 620px) {
  .imp-modal { padding: 0; }
  .imp-caixa { max-height: 100vh; border-radius: 0; }
  .imp-resumo { grid-template-columns: 1fr; }
  .acoes-cabecalho { flex-direction: column; align-items: stretch; }
}
