/* importar.css :: janela "Importar planilha" (js/importar.js, classes imp-) e relatório "De onde vêm os clientes"
   (Financeiro, aba Funil comercial, classes org-) com o campo de origem do projeto (Clientes e Projetos, pj-origem) */

/* ===== janela ===== */
body.imp-aberto { overflow: hidden; }
.imp-fundo { position: fixed; inset: 0; z-index: 600; background: rgba(12,21,37,.55); display: flex; align-items: flex-start; justify-content: center;
  padding: 28px 16px; overflow-y: auto; overscroll-behavior: contain; }
.imp-caixa { width: 100%; max-width: 940px; background: var(--bg-surface); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.3); overflow: hidden; margin: 0 auto; }
.imp-caixa, .imp-caixa * { min-width: 0; box-sizing: border-box; }
.imp-caixa > .sc-head { position: sticky; top: 0; z-index: 2; }
.imp-caixa > .sc-head h2 { display: flex; align-items: center; gap: 6px; outline: none; }
.imp-x { background: none; border: 0; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px; font-family: var(--font-ui); }
.imp-x:hover { color: var(--orange); }
.imp-caixa .btn { min-width: 0; }
.imp-caixa select { width: 100%; }

.imp-passos { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 14px 20px 0; }
.imp-passos li { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 4px 10px;
  border-radius: 20px; background: var(--bg-zebra); border: 1px solid var(--border); }
.imp-passos li.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.imp-passos li.feito { color: var(--navy-700); background: var(--navy-100); }

.imp-dica { margin: 0 0 14px; }
.imp-proj, .imp-arqnome { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; color: var(--body); margin: 0 0 12px; overflow-wrap: anywhere; }
.imp-proj strong, .imp-arqnome strong { color: var(--ink); }
.imp-acoes { margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.imp-ok { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #067647; margin: 12px 0 0; }

/* arquivo */
.imp-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; cursor: pointer;
  border: 2px dashed var(--navy-border); border-radius: 12px; padding: 26px 16px; background: var(--bg-zebra); transition: var(--tr); }
.imp-drop:hover, .imp-drop:focus-within { border-color: var(--navy-700); background: #fff; }
.imp-drop.imp-sobre { border-color: var(--orange); background: var(--orange-light); }
.imp-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.imp-drop .av-ic { width: 44px; height: 44px; }
.imp-drop strong { color: var(--ink); font-size: 14.5px; overflow-wrap: anywhere; max-width: 100%; }
.imp-drop-sub { font-size: 12.5px; color: var(--muted); }
.imp-aba { margin-top: 14px; max-width: 420px; }

/* colunas */
.imp-cabsel { max-width: 560px; margin-bottom: 10px; }
.imp-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 10px; }
.imp-col { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; background: #fff; }
.imp-col.imp-col-on { border-color: var(--orange-border); background: #FFFAF5; }
.imp-col-cab { display: flex; align-items: center; gap: 8px; }
.imp-col-cab strong { color: var(--ink); font-size: 13.5px; overflow-wrap: anywhere; }
.imp-col-letra { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 5px; border-radius: 6px;
  background: var(--navy-100); color: var(--navy-700); font-size: 11px; font-weight: 700; }
.imp-col-ex { font-size: 12px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }

/* prévia */
.imp-cont { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.imp-cont-i { font-size: 12.5px; color: var(--body); padding: 5px 11px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-zebra); }
.imp-cont-i strong { font-variant-numeric: tabular-nums; }
.imp-c-novo { background: #ECFDF3; border-color: #ABEFC6; color: #067647; }
.imp-c-atu { background: #EFF4FF; border-color: #C7D7FE; color: #1D3F8A; }
.imp-c-erro { background: #FEF3F2; border-color: #FECDCA; color: #912018; }
.imp-c-pula { background: #F2F4F7; border-color: #D0D5DD; color: #475467; }
.imp-c-ign { color: var(--muted); }
.imp-notas { background: var(--orange-light); border: 1px solid var(--orange-border); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 12px; }
.imp-notas p { margin: 0; font-size: 13px; line-height: 1.45; color: #7A3A0C; overflow-wrap: anywhere; }
.imp-notas p + p { margin-top: 6px; }
.imp-op { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px 12px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.imp-op legend { font-size: 13px; font-weight: 700; color: var(--ink); padding: 0 4px; line-height: 1.4; }
.imp-op label, .imp-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--body); line-height: 1.4; cursor: pointer; }
.imp-op input, .imp-check input { width: 17px; height: 17px; flex: none; margin: 1px 0 0; accent-color: var(--orange); }
.imp-check { margin: 0 0 12px; }

.imp-tab-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; max-width: 100%; -webkit-overflow-scrolling: touch; }
.imp-tab-wrap:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.imp-tab { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 12.5px; }
.imp-tab th, .imp-tab td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.imp-tab th { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--bg-zebra); white-space: nowrap; }
.imp-tab td { color: var(--ink); max-width: 240px; overflow-wrap: break-word; }
.imp-tab td:first-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.imp-tab td:nth-child(2) { max-width: 200px; }
.imp-tab td.imp-td-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.imp-tab tr.imp-ign td { max-width: none; }
.imp-tab tr:last-child td { border-bottom: 0; }
.imp-tab tr.imp-ign td { background: #FAFAFB; }
.imp-tab tr.imp-tr-pular td:not(:nth-child(2)) { color: var(--muted); }
.imp-tab small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.imp-cel-erro { background: #FEF3F2; color: #912018 !important; font-weight: 600; }
.imp-cel-erro small { color: #912018; }
.imp-cel-aviso { background: #FFF7ED; }
.imp-st { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.35; padding: 2px 8px; border-radius: 12px; overflow-wrap: anywhere; }
.imp-st-novo { background: #ECFDF3; color: #067647; }
.imp-st-atu { background: #EFF4FF; color: #1D3F8A; }
.imp-st-erro { background: #FEE4E2; color: #B42318; }
.imp-st-pula { background: #F2F4F7; color: #475467; }
.imp-st-ign { background: transparent; color: var(--muted); font-weight: 600; padding-left: 0; }
.imp-st-sec { background: var(--navy-100); color: var(--navy-700); }
.imp-mostrando { margin: 8px 0 0; }
.imp-carregando { display: flex; align-items: center; gap: 10px; padding: 18px 0; color: var(--body); font-size: 14px; }
.imp-carregando .rd-spin { width: 28px; height: 28px; border-width: 3px; flex: none; }

/* gravando e resultado */
.imp-prog { padding: 8px 0; }
.imp-prog p { margin: 0 0 10px; font-size: 14px; color: var(--ink); font-weight: 600; }
.imp-prog .rd-dica { font-weight: 400; margin-top: 10px; }
.imp-barra { height: 12px; border-radius: 6px; background: var(--navy-100); overflow: hidden; }
.imp-barra span { display: block; height: 100%; width: 0; background: var(--orange); transition: width .25s ease; }
.imp-res { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.imp-res-n { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.imp-res-n strong { font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.imp-res-n span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.imp-res-frase { margin: 14px 0 6px; font-size: 14.5px; color: var(--ink); }
.imp-h3 { font-family: var(--font-ui); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 16px 0 8px; }
.imp-motivos { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r-md); max-height: 300px; overflow-y: auto; }
.imp-motivos li { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--body); line-height: 1.4; }
.imp-motivos li:last-child { border-bottom: 0; }
.imp-motivos li strong { color: var(--ink); white-space: nowrap; }
.imp-motivos li > span:last-child { flex: 1 1 100%; overflow-wrap: anywhere; }
.imp-mot-nome { color: var(--navy-700); font-weight: 600; overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .imp-fundo { padding: 8px 6px; }
  .imp-caixa .sc-body { padding: 14px; }
  .imp-passos { padding: 12px 14px 0; }
  .imp-acoes .btn { flex: 1 1 100%; white-space: normal; line-height: 1.25; }
  .imp-res { grid-template-columns: minmax(0, 1fr); }
  .imp-res-n { flex-direction: row; align-items: baseline; gap: 8px; padding: 10px 12px; }
  .imp-res-n strong { font-size: 22px; }
}

/* botão "Importar planilha" nos módulos */
.imp-botao .av-ic { width: 18px; height: 18px; }

/* ===== Clientes e Projetos: campo "Como o cliente chegou" ===== */
.pj-origem-obs[hidden] { display: none; }

/* ===== Financeiro, Funil comercial: "De onde vêm os clientes" ===== */
.org-per { display: flex; align-items: flex-end; gap: 10px 12px; flex-wrap: wrap; margin-bottom: 14px; }
.org-per .field { flex: 0 1 150px; min-width: 130px; }
.org-per .pj-chips { flex: 1 1 280px; margin: 0; }
.org-per .pj-chip { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--navy-700); }
.org-per .pj-chip.on { color: #fff; }
.org-destaques { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; margin-bottom: 4px; }
.org-dest { border: 1px solid var(--border); border-left: 4px solid var(--orange); border-radius: var(--r-md); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; background: #FFFCF8; }
.org-dest .av-ic { width: 34px; height: 34px; flex: none; }
.org-dest-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.org-dest-rot { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; color: var(--muted); }
.org-dest-val { font-size: 16px; font-weight: 700; color: var(--navy-800); overflow-wrap: anywhere; }
.org-dest-sub { font-size: 12.5px; color: var(--body); }
.org-dest-vazio { border-left-color: var(--border); background: var(--bg-zebra); }
.org-tab th[scope=row] { min-width: 150px; }
.org-tab .org-selo { display: inline-block; margin: 2px 4px 0 0; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 10px; background: var(--orange-light); color: #9A4A12; vertical-align: 1px; }
.org-tab tr.org-top th, .org-tab tr.org-top td { background: #FFFAF5; }
.org-tab tr.org-nao th, .org-tab tr.org-nao td { color: var(--muted); }
.org-tab .org-preencher { display: block; margin-top: 2px; font-size: 12.5px; }
.org-sub { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
.org-pend-aviso { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 12px; padding: 10px 12px;
  border: 1px dashed var(--navy-border); border-radius: var(--r-md); font-size: 13px; color: var(--body); }
.org-pend { display: flex; flex-direction: column; margin-top: 10px; border: 1px solid var(--border); border-radius: var(--r-md); }
.org-pend[hidden] { display: none; }
.org-pend-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px 14px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.org-pend-item:last-child { border-bottom: 0; }
.org-pend-info { display: flex; flex-direction: column; gap: 2px; }
.org-pend-info strong { color: var(--ink); font-size: 13.5px; overflow-wrap: anywhere; }
.org-pend-ctl { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.org-pend-ctl select { flex: 1 1 200px; }
.org-pend-ctl input[type=text] { flex: 1 1 180px; }
.org-pend-ctl input[hidden], .org-pend-ctl .btn[hidden] { display: none; }
.org-pend-ctl .fc-link { font-size: 12.5px; }
@media (max-width: 760px) {
  .org-pend-item { grid-template-columns: minmax(0, 1fr); }
  .org-tab th[scope=row] { min-width: 0; }
}
