/* Gerador FTTH · Parzbyte. Tema único claro: uso em escritório, de dia, em monitor. */
:root {
  --grafite: #111111;
  --grafite-2: #2a2a2a;
  --vermelho: #E11D2E;
  --vermelho-escuro: #A3111F;
  --vermelho-claro: #FDE7E9;
  --cinza: #E8E8E6;
  --cinza-2: #F4F4F2;
  --linha: #DCDCD8;
  --borda-campo: #A9A9A4;
  --texto: #111111;
  --apagado: #5F5F5B;
  --branco: #FFFFFF;
  --fo2: #D08C00;
  --fo6: #1F8F55;
  --fo12: #2563B0;
  --cd: #E4572E;
  --ok: #14653B;
  --ok-fundo: #E3F3EA;
  --atencao: #8A5A00;
  --atencao-fundo: #FFF3D6;
  --fonte: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --raio: 8px;
  --sombra: 0 2px 8px rgba(17, 17, 17, .16);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 400 14px/1.45 var(--fonte);
  color: var(--texto);
  background: var(--branco);
  display: grid;
  grid-template-rows: 52px 1fr;
  caret-color: var(--vermelho);
}
::selection { background: var(--vermelho-claro); color: var(--vermelho-escuro); }
:focus-visible { outline: 2px solid var(--grafite); outline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
.num, input[type="number"], .resumo b, .romaneio td { font-variant-numeric: tabular-nums; }

/* topo */
.topo {
  background: var(--grafite);
  color: var(--branco);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px 0 16px;
  min-width: 0;
}
.marca { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: inherit; text-decoration: none; white-space: nowrap; }
.marca svg { width: 26px; height: 26px; }
.marca small { font-weight: 400; font-size: 12px; color: #B5B5B0; }
.projeto { margin-left: 12px; padding-left: 16px; border-left: 1px solid #3a3a3a; font-weight: 500; color: #EDEDEA; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topo .sit { margin-left: 4px; }
.amostra { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--grafite); background: #F2C94C; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.todos { margin-left: 16px; color: #D9D9D5; font-size: 13px; text-decoration: none; white-space: nowrap; }
.todos:hover { color: var(--branco); text-decoration: underline; text-underline-offset: 3px; }

/* corpo */
.corpo { display: grid; grid-template-columns: 420px 1fr; min-height: 0; }

/* passos */
.passos {
  border-right: 1px solid var(--linha);
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--borda-campo) transparent;
}
.passos ol { list-style: none; margin: 0; padding: 0; }
.passo { border-bottom: 1px solid var(--cinza); }
.cab {
  width: 100%;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 1px 12px;
  align-items: center;
  text-align: left;
  padding: 14px 20px;
  background: none;
  border: 0;
  cursor: pointer;
}
.cab:hover { background: var(--cinza-2); }
.cab i {
  grid-row: 1 / 3;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font: 700 13px var(--fonte);
  font-style: normal;
  background: var(--grafite);
  color: var(--branco);
}
.cab b { font-size: 15px; font-weight: 600; }
.cab .res { grid-column: 2; font-size: 13px; color: var(--apagado); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cab .acao { grid-row: 1 / 3; grid-column: 3; font-size: 13px; color: var(--apagado); text-decoration: underline; text-underline-offset: 3px; }
.passo.futuro .cab i { background: var(--branco); color: var(--apagado); box-shadow: inset 0 0 0 1.5px var(--borda-campo); }
.passo.aberto { background: #FAFAF8; }
.passo.aberto .cab { cursor: default; padding-bottom: 6px; }
.passo.aberto .cab:hover { background: none; }
.passo.aberto .cab i { background: var(--vermelho); }
.passo.aberto .cab b { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.passo.aberto .cab .res, .passo.aberto .cab .acao { display: none; }
.conteudo { display: none; padding: 4px 20px 22px 62px; }
.passo.aberto .conteudo { display: flex; flex-direction: column; gap: 14px; }
.ajuda { margin: 0; font-size: 13px; color: var(--apagado); max-width: 46ch; }

/* campos */
.campos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.campo { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #3a3a37; }
.entrada {
  height: 40px;
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--borda-campo);
  border-radius: var(--raio);
  background: var(--branco);
  padding: 0 12px;
}
.entrada:focus-within { border-color: var(--grafite); box-shadow: 0 0 0 3px rgba(17, 17, 17, .18); }
.entrada input { border: 0; outline: 0; background: none; width: 100%; min-width: 0; font-size: 15px; font-weight: 600; padding: 0; }
.entrada small { font-size: 13px; color: var(--apagado); }
.entrada.invalida { border-color: var(--vermelho); }
select {
  height: 40px;
  border: 1px solid var(--borda-campo);
  border-radius: var(--raio);
  background: var(--branco);
  padding: 0 10px;
  font-size: 15px;
  font-weight: 600;
}
.erro { margin: 0; font-size: 13px; color: var(--vermelho-escuro); background: var(--vermelho-claro); border-radius: var(--raio); padding: 8px 12px; }
.pendente { margin: 0; font-size: 13px; color: var(--atencao); background: var(--atencao-fundo); border-radius: var(--raio); padding: 8px 12px; }

.segm { display: flex; border: 1px solid var(--grafite); border-radius: var(--raio); overflow: hidden; }
.segm button { flex: 1; height: 38px; padding-inline: 8px; border: 0; border-right: 1px solid var(--grafite); background: var(--branco); font-size: 13px; font-weight: 500; cursor: pointer; }
.segm button:last-child { border-right: 0; }
.segm button[aria-checked="true"] { background: var(--grafite); color: var(--branco); }

/* botões */
.btn {
  height: 44px;
  padding: 0 18px;
  border-radius: var(--raio);
  border: 1px solid var(--grafite);
  background: var(--branco);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color .15s ease-out, border-color .15s ease-out;
}
.btn:hover { background: var(--cinza-2); }
.btn.pri { background: var(--vermelho); border-color: var(--vermelho); color: var(--branco); font-size: 15px; }
.btn.pri:hover { background: var(--vermelho-escuro); border-color: var(--vermelho-escuro); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.sec { align-self: flex-start; }
#gerar { width: 100%; }

/* conferir */
.camadas { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.camadas legend { font-size: 13px; color: var(--apagado); margin-bottom: 6px; padding: 0; }
.camadas label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.camadas input { accent-color: var(--grafite); width: 16px; height: 16px; }
.conteudo h3 { margin: 6px 0 -6px; font-size: 13px; font-weight: 600; color: var(--apagado); }
.ramais, .avisos { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--cinza); }
.ramais li, .avisos li { border-bottom: 1px solid var(--cinza); }
.ramais button {
  width: 100%;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 4px;
  background: none; border: 0; text-align: left; cursor: pointer; font-size: 14px;
}
.ramais button:hover { background: var(--cinza-2); }
.ramais button[aria-pressed="true"] { font-weight: 600; }
.ramais button[aria-pressed="true"] span:first-child::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--vermelho); margin-right: 8px; vertical-align: 1px; }
.ramais span:last-child { color: var(--apagado); font-weight: 400; }
.avisos li { padding: 10px 4px; font-size: 14px; display: flex; gap: 10px; align-items: baseline; }
.avisos li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--fo2); transform: translateY(-1px); }
.avisos li.vazio::before { background: var(--ok); }
.avisos li:has(button) { padding: 0 0 0 4px; }
.avisos button { flex: 1; display: flex; justify-content: space-between; gap: 12px; padding: 10px 4px 10px 0; background: none; border: 0; text-align: left; cursor: pointer; font-size: 14px; }
.avisos button:hover { background: var(--cinza-2); }
.avisos button span:last-child, .ramais button span:last-child { white-space: nowrap; }
.avisos button span:last-child { color: var(--apagado); text-decoration: underline; text-underline-offset: 3px; }
@keyframes pulsa { from { box-shadow: 0 0 0 0 rgba(17, 17, 17, .55); } to { box-shadow: 0 0 0 16px rgba(17, 17, 17, 0); } }
.pulsa .mk-div { animation: pulsa .7s cubic-bezier(.16, 1, .3, 1) 2; }

/* entregar */
.romaneio { border-collapse: collapse; width: 100%; font-size: 14px; }
.romaneio caption { text-align: left; font-size: 13px; color: var(--apagado); padding-bottom: 6px; }
.romaneio td { padding: 6px 0; border-bottom: 1px solid var(--cinza); }
.romaneio td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.romaneio small { display: block; color: var(--apagado); font-size: 12px; font-weight: 400; }
.romaneio tr[data-fo] { cursor: default; }
.romaneio tr[data-fo]:hover td, .romaneio tr[data-fo]:focus td { background: var(--cinza-2); }
.romaneio tr.total td { border-bottom: 0; border-top: 2px solid var(--grafite); padding-top: 12px; font-weight: 700; }
.romaneio tr.total td:last-child { color: var(--vermelho); font-size: 24px; letter-spacing: -.02em; }
.entrega { display: flex; flex-direction: column; gap: 10px; position: sticky; bottom: 0; background: #FAFAF8; padding-block: 12px 4px; border-top: 2px solid var(--grafite); }
.entrega-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 700; }
.entrega-total b { color: var(--vermelho); font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.entrega-botoes { display: flex; gap: 10px; }
.entrega .btn { flex: 1; }
.entrega .btn.pri { flex: 1.3; }

/* mapa */
.mapa-area { position: relative; min-width: 0; min-height: 0; background: #E4E4E0; }
#mapa { position: absolute; inset: 0; }
.leaflet-container { font: inherit; background: #E4E4E0; }
.leaflet-tile-pane { filter: saturate(.25) contrast(.9); opacity: .62; }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--sombra) !important; border-radius: var(--raio) !important; overflow: hidden; }
.leaflet-control-zoom a { width: 36px !important; height: 36px !important; line-height: 34px !important; color: var(--grafite) !important; }
.leaflet-tooltip { font: 600 12px var(--fonte); border-radius: 6px; border: 0; box-shadow: var(--sombra); padding: 5px 8px; }

.resumo {
  position: absolute; top: 16px; right: 16px; z-index: 500;
  display: flex; gap: 22px;
  background: var(--branco);
  border-radius: 10px;
  box-shadow: var(--sombra);
  padding: 12px 18px;
}
.resumo div { display: flex; flex-direction: column; line-height: 1.2; }
.resumo span { font-size: 12px; color: var(--apagado); }
.resumo b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; transition: color .4s ease-out; }
.resumo .valor b { color: var(--vermelho); }
.resumo b.mudou { color: var(--fo6); }
.resumo .valor b.mudou { color: var(--vermelho-escuro); }

.legenda {
  position: absolute; left: 16px; bottom: 24px; z-index: 500;
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  background: var(--branco);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 8px 12px;
  font-size: 12px; color: #3a3a37;
}
.legenda span { display: flex; align-items: center; gap: 6px; }
.legenda .l { width: 18px; height: 4px; border-radius: 2px; }
.legenda .p { width: 10px; height: 10px; border-radius: 50%; }
.l.fo36 { background: #7B2D8E; height: 5px; }
.l.fo2 { background: var(--fo2); } .l.fo6 { background: var(--fo6); } .l.fo12 { background: var(--fo12); }
.p.cto { background: var(--grafite); box-shadow: 0 0 0 2px var(--branco), 0 0 0 3px var(--grafite); width: 8px; height: 8px; }
.p.cd { background: var(--branco); box-shadow: inset 0 0 0 2px var(--grafite); border-radius: 2px; }
.p.origem { background: var(--grafite); border-radius: 2px; }
.p.aviso { width: 9px; height: 9px; border-radius: 0; background: var(--branco); box-shadow: inset 0 0 0 1.5px var(--grafite); transform: rotate(45deg); }
.p.poste { background: #6F6F69; width: 6px; height: 6px; }

.falha { position: absolute; inset: auto 16px 80px; z-index: 600; margin: 0; background: var(--vermelho-claro); color: var(--vermelho-escuro); border-radius: var(--raio); padding: 12px 16px; font-weight: 500; }

/* marcadores */
.mk-cd { width: 15px; height: 15px; background: var(--branco); border: 2.5px solid var(--grafite); border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.mk-origem { width: 22px; height: 22px; background: var(--grafite); border: 2px solid var(--branco); border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.mk-div { width: 14px; height: 14px; background: var(--branco); border: 2px solid var(--grafite); transform: rotate(45deg); }

/* camada do passo: a assinatura */
.mapa-area[data-foco] .leaflet-overlay-pane svg path,
.mapa-area[data-foco] .leaflet-marker-pane > * { transition: opacity .2s ease-out; }
.apagado { opacity: .22 !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* telas estreitas: passos em cima, mapa embaixo */
@media (max-width: 900px) {
  html, body { height: auto; }
  body { grid-template-rows: auto auto; }
  .passos { min-height: auto; }
  .topo { flex-wrap: wrap; padding: 10px 16px; row-gap: 6px; }
  .topo::after { content: ""; order: 2; flex-basis: 100%; }
  .todos { order: 1; }
  .projeto { margin-left: 0; padding-left: 0; border-left: 0; order: 3; }
  .topo .sit { order: 3; }
  .amostra { order: 4; margin-left: 0; }
  .todos { margin-left: auto; }
  .corpo { grid-template-columns: 1fr; grid-template-rows: auto 60vh; }
  .passos { border-right: 0; border-bottom: 1px solid var(--linha); overflow: visible; }
  .conteudo { padding-left: 20px; }
  .resumo { left: 12px; right: 12px; top: 12px; gap: 12px; justify-content: space-between; padding: 10px 12px; }
  .resumo b { font-size: 18px; }
  .legenda { display: none; }
}
@media (max-width: 420px) {
  .campos { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- fila de projetos (tela inicial) ---------- */
.fila { grid-template-columns: 380px 1fr; }
.lista { border-right: 1px solid var(--linha); display: flex; flex-direction: column; min-height: 0; }
.lista-topo { padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--cinza); }
.busca { height: 40px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--borda-campo); border-radius: var(--raio); padding: 0 12px; background: var(--branco); }
.busca:focus-within { border-color: var(--grafite); box-shadow: 0 0 0 3px rgba(17, 17, 17, .14); }
.busca svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--apagado); stroke-width: 1.8; stroke-linecap: round; }
.busca input { border: 0; outline: 0; background: none; width: 100%; min-width: 0; font-size: 14px; }
.busca input::placeholder { color: var(--apagado); }
.filtros { display: flex; flex-wrap: wrap; gap: 4px; }
.filtros button { height: 30px; padding: 0 9px; white-space: nowrap; border-radius: 999px; border: 1px solid var(--borda-campo); background: var(--branco); font-size: 13px; cursor: pointer; }
.filtros button span { color: var(--apagado); margin-left: 2px; }
.filtros button:hover { border-color: var(--grafite); }
.filtros button[aria-checked="true"] { background: var(--grafite); border-color: var(--grafite); color: var(--branco); }
.filtros button[aria-checked="true"] span { color: #C9C9C4; }
.projetos { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--borda-campo) transparent; }
.projetos li { border-bottom: 1px solid var(--cinza); }
.projetos button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 13px 16px;
  background: none; border: 0; text-align: left; cursor: pointer;
}
.projetos button:hover { background: var(--cinza-2); }
.projetos button[aria-current="true"] { background: #EFEFEC; }
.projetos button[aria-current="true"] b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--vermelho); margin-right: 8px; vertical-align: 2px; }
.projetos b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projetos em { font-style: normal; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.projetos span { font-size: 13px; color: var(--apagado); font-variant-numeric: tabular-nums; }
.sit { justify-self: end; font-style: normal; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.sit.en { background: #E4ECF9; color: #124A91; }
.sit.ge { background: var(--ok-fundo); color: var(--ok); }
.sit.aj { background: var(--atencao-fundo); color: var(--atencao); }
.vazio-lista { padding: 28px 16px; display: flex; flex-direction: column; gap: 4px; }
.vazio-lista b { font-size: 15px; }
.vazio-lista span { font-size: 13px; color: var(--apagado); }
.lista-pe { padding: 12px 16px 16px; border-top: 1px solid var(--cinza); }
.btn.bloco { display: flex; align-items: center; justify-content: center; width: 100%; text-decoration: none; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }
a.btn.pri { color: var(--branco); }

.barra {
  position: absolute; left: 20px; right: 20px; bottom: 28px; z-index: 500;
  display: flex; align-items: center; gap: 28px;
  background: var(--branco); border-radius: 12px; box-shadow: var(--sombra);
  padding: 14px 18px;
}
.barra-nome { min-width: 0; margin-right: auto; }
.barra h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra p { margin: 2px 0 0; font-size: 13px; color: var(--apagado); }
.barra-num { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.barra-num span { font-size: 12px; color: var(--apagado); }
.barra-num b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.barra-num.valor b { color: var(--vermelho); }
.barra .btn { flex: none; }

@media (max-width: 1180px) {
  .barra { flex-wrap: wrap; gap: 10px 22px; }
  .barra-nome { flex-basis: 100%; }
  .barra .btn { margin-left: auto; }
}
@media (max-width: 900px) {
  .fila { grid-template-columns: 1fr; grid-template-rows: auto 70vh; }
  .lista { border-right: 0; border-bottom: 1px solid var(--linha); }
  .projetos { max-height: 46vh; }
  .barra { left: 12px; right: 12px; bottom: 24px; padding: 12px 14px; }
  .barra-num b { font-size: 18px; }
  .barra .btn { flex-basis: 100%; }
}

/* ---------- situação Rascunho, novo projeto, sair ---------- */
.sit.ra { background: var(--cinza); color: #3a3a37; }
button.todos { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 13px; }
.novo-projeto { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.novo-projeto h2 { margin: 0; font-size: 16px; font-weight: 600; }
.acoes-form { display: flex; gap: 10px; }
.acoes-form .btn { flex: 1; }
.barra-vazia { font-size: 14px; color: var(--apagado); }

/* ---------- tela de senha ---------- */
.pagina-entrar { grid-template-rows: 52px 1fr; background: var(--cinza-2); }
.entrar { display: grid; place-items: center; padding: 24px 16px; }
.cartao-entrar { width: min(360px, 100%); background: var(--branco); border: 1px solid var(--linha); border-radius: 12px;
  padding: 28px 24px; display: flex; flex-direction: column; gap: 16px; }
.cartao-entrar h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.cartao-entrar .btn { width: 100%; }

/* ---------- marcadores e menus da página do projeto ---------- */
.mk-cto { width: 14px; height: 14px; border-radius: 50%; background: var(--grafite); border: 2px solid var(--branco); box-shadow: 0 1px 3px rgba(0,0,0,.35); cursor: grab; }
.mk-cto.sel { border-color: var(--vermelho); box-shadow: 0 0 0 2px var(--vermelho); }
.menu-mapa { display: flex; flex-direction: column; gap: 8px; min-width: 160px; font: 14px var(--fonte); }
.menu-mapa .btn { height: 36px; width: 100%; }
a.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.passo input[type="file"] { font-size: 13px; }
#entregue { align-self: flex-start; }
.mk-ceo { width: 13px; height: 13px; background: #7B2D8E; border: 2px solid var(--branco); transform: rotate(45deg); box-shadow: 0 1px 3px rgba(0,0,0,.35); }
