/*
  Polimento visual isolado do modal Importar Contatos.
  Ajusta apenas scroll, altura, header natural e template XLSX real.
*/

html.modal-open,
body.modal-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.fixed.inset-0.z-50.backdrop-blur-sm:has([role="dialog"][aria-labelledby="import-title"] #csv-file) {
  overflow: hidden !important;
  align-items: center !important;
  justify-content: center !important;
}

[role="dialog"][aria-labelledby="import-title"]:has(#csv-file) {
  max-height: min(88dvh, 760px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

[role="dialog"][aria-labelledby="import-title"]:has(#csv-file) > div:first-child {
  position: static !important;
  top: auto !important;
}

[role="dialog"][aria-labelledby="import-title"]:has(#csv-file) > .space-y-6 {
  flex: initial !important;
  min-height: auto !important;
  overflow: visible !important;
}

[role="dialog"][aria-labelledby="import-title"]:has(#csv-file) > .space-y-6 > div:first-child h3,
[role="dialog"][aria-labelledby="import-title"]:has(#csv-file) > .space-y-6 > div:first-child p {
  font-size: 0 !important;
}

[role="dialog"][aria-labelledby="import-title"]:has(#csv-file) > .space-y-6 > div:first-child h3::after {
  content: "Template XLSX";
  color: #0f172a;
  font-size: .96rem;
  line-height: 1.35;
  font-weight: 850;
}

[role="dialog"][aria-labelledby="import-title"]:has(#csv-file) > .space-y-6 > div:first-child p::after {
  content: "Baixe o modelo XLSX real usado pelo sistema para preencher contatos, telefones, observacoes e categoriaId.";
  color: #64748b;
  font-size: .86rem;
  line-height: 1.45;
  font-weight: 500;
}

[role="dialog"][aria-labelledby="import-title"]:has(#csv-file) button[data-template-xlsx-polish="true"] {
  min-width: 0 !important;
}

[role="dialog"][aria-labelledby="import-title"]:has(#csv-file) > .space-y-6 > div:last-child {
  position: sticky !important;
  bottom: 0 !important;
}

@media (max-width: 768px) {
  .fixed.inset-0.z-50.backdrop-blur-sm:has([role="dialog"][aria-labelledby="import-title"] #csv-file) {
    padding: 7px !important;
  }

  [role="dialog"][aria-labelledby="import-title"]:has(#csv-file) {
    max-height: calc(100dvh - 14px) !important;
  }
}
