:root { --ui-bg: #EDEDED; --ui-borda: #D0D0D0; }
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--ui-bg); color: #222; }
button, .bt-like { font: inherit; font-size: 13px; font-weight: 700; border: 0; border-radius: 6px; padding: 8px 12px; cursor: pointer; }
button.pri { background: #D7262E; color: #fff; }
button.sec, .bt-like.sec { background: #fff; color: #151515; border: 1px solid var(--ui-borda); }
button.grande { width: 100%; padding: 12px; font-size: 15px; }
button:hover { filter: brightness(0.95); }

.topo { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; background: #151515; color: #fff; padding: 8px 16px; border-bottom: 3px solid #D7262E; }
.topo img { height: 34px; }
.topo .tt { font-weight: 700; font-size: 16px; flex: 1; }
.topo .tt small { display: block; font-weight: 400; font-size: 11px; color: #BFBFBF; }
.topo .acoes { display: flex; gap: 8px; }

.app { display: flex; height: calc(100vh - 53px); }
.form { width: 360px; flex: none; overflow-y: auto; background: #fff; border-right: 1px solid var(--ui-borda); padding: 12px 14px 30px; }
.bloco { border-bottom: 1px solid #EEE; padding: 8px 0 12px; }
.bloco h3 { margin: 4px 0 8px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: #D7262E; }
.form label { display: block; font-size: 12px; font-weight: 700; color: #555; margin-bottom: 8px; }
.form input, .form select, .form textarea { display: block; width: 100%; margin-top: 3px; padding: 7px 8px; font: inherit; font-size: 14px; font-weight: 400; color: #151515; border: 1px solid var(--ui-borda); border-radius: 5px; background: #fff; }
.form textarea { resize: vertical; }
.linha { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.linha > * { flex: 1; }
.resultados { display: flex; flex-direction: column; gap: 4px; margin: -2px 0 6px; }
.resultados .res { text-align: left; background: #F7F7F7; border: 1px solid #E2E2E2; font-weight: 400; padding: 6px 8px; }
.resultados .res b { color: #D7262E; } .resultados .res span { font-size: 12px; color: #555; }
.resultados .nada { font-size: 12px; color: #777; }
.num .numero { font-size: 18px; font-weight: 700; color: #151515; padding: 4px 0; }
.num label { font-size: 11px; font-weight: 700; color: #777; text-transform: uppercase; }
.dica { font-size: 11.5px; color: #777; margin: -4px 0 8px; }
.aviso { font-size: 12px; color: #2E8B57; font-weight: 700; min-height: 14px; }
.aviso.erro { color: #D7262E; }

.previa { flex: 1; overflow: auto; padding: 18px; }
#previa { transform-origin: top left; }
#previa .page { margin: 0 auto 14px; box-shadow: 0 2px 10px rgba(0,0,0,.18); }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.caixa-modal { background: #fff; width: min(760px, 94vw); max-height: 86vh; display: flex; flex-direction: column; border-radius: 8px; padding: 14px; gap: 10px; }
.caixa-modal .mt { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.caixa-modal .rodape { justify-content: flex-end; }
.caixa-modal input#busca { padding: 8px; font-size: 14px; border: 1px solid var(--ui-borda); border-radius: 5px; }
#lista-pasta { overflow-y: auto; }
.cliente { border: 1px solid #EEE; border-radius: 6px; margin-bottom: 8px; }
.cliente > .nome { background: #F2F2F2; padding: 8px 10px; font-weight: 700; }
.prop { padding: 6px 10px; border-top: 1px solid #F2F2F2; font-size: 13px; }
.prop .revs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.prop .revs button { padding: 4px 8px; font-size: 12px; }
.vazio { color: #777; padding: 20px; text-align: center; }

#impressao { display: none; }
/* área usada só durante a geração do PDF (fora da tela) */
#impressao.gerando { display: block; position: fixed; left: -10000px; top: 0; width: 210mm; }
#impressao.gerando .page { margin: 0; box-shadow: none; }
@media (max-width: 900px) {
  .app { flex-direction: column; height: auto; }
  .form { width: 100%; border-right: 0; }
  .previa { padding: 8px; }
}
@media print {
  body { background: #fff; }
  .topo, .app, .modal { display: none !important; }
  #impressao { display: block; }
}

.maq { border: 1px solid #E2E2E2; border-radius: 8px; margin-bottom: 10px; }
.maq > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: #151515; color: #fff; border-radius: 8px 8px 0 0; }
.maq > summary::-webkit-details-marker { display: none; }
.maq > summary span { font-weight: 700; font-size: 16px; }
.maq > summary small { color: #BFBFBF; flex: 1; }
.maq > summary .nova-maq { padding: 6px 10px; font-size: 12px; }
.maq .cliente { margin: 8px; }
#caminho { color: #FF5A5F !important; }

.usuario-nome { color: #D9D9D9; font-size: 13px; align-self: center; margin-right: 4px; }
.tela-login { position: fixed; inset: 0; z-index: 50; background: #151515; display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.tela-login[hidden] { display: none; }
.caixa-login { background: #fff; width: min(400px, 100%); border-radius: 10px; border-top: 5px solid #D7262E; padding: 24px; }
.caixa-login img { display: block; width: 170px; margin: 0 auto 6px; background: #151515; padding: 10px; border-radius: 6px; }
.caixa-login .tl { text-align: center; font-weight: 700; font-size: 18px; margin-bottom: 14px; }
.caixa-login label, .form-us label { display: block; font-size: 12px; font-weight: 700; color: #555; margin-bottom: 9px; }
.caixa-login input, .form-us input, .form-us select { display: block; width: 100%; margin-top: 3px; padding: 8px; font: inherit; font-size: 14px; font-weight: 400; border: 1px solid #D0D0D0; border-radius: 5px; }
.dica-login { font-size: 12.5px; color: #555; }
.login-erro { color: #D7262E; font-weight: 700; font-size: 13px; margin-top: 8px; min-height: 16px; }
.caixa-modal.largo { width: min(980px, 96vw); }
.us-grade { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; overflow-y: auto; }
.tab-us { width: 100%; border-collapse: collapse; font-size: 13px; }
.tab-us th { text-align: left; background: #F2F2F2; padding: 6px; }
.tab-us td { border-bottom: 1px solid #EEE; padding: 6px; vertical-align: top; }
.tab-us tr.inativo td { color: #999; }
.form-us { background: #F7F7F7; border-radius: 8px; padding: 12px; }
.form-us h4 { margin: 0 0 8px; color: #D7262E; }
.form-us .chk { display: flex; gap: 6px; align-items: center; } .form-us .chk input { width: auto; margin: 0; }
#us-msg { font-size: 13px; font-weight: 700; margin-top: 6px; } #us-msg.ok { color: #2E8B57; } #us-msg.falha { color: #D7262E; }
@media (max-width: 760px) { .us-grade { grid-template-columns: 1fr; } }

.alerta-pagina { color: #D7262E; font-weight: 700; font-size: 12.5px; margin-top: 6px; }
.fx-sel { display: block; font-size: 12px; font-weight: 700; color: #555; }
.fx-sel select { display: block; margin-top: 3px; padding: 7px; font: inherit; font-size: 14px; border: 1px solid #D0D0D0; border-radius: 5px; min-width: 320px; max-width: 100%; }
.dica-fx { font-size: 12.5px; color: #555; }
#fx-msg { font-weight: 700; font-size: 13px; } #fx-msg.ok { color: #2E8B57; } #fx-msg.falha { color: #D7262E; }
#fx-corpo { overflow-y: auto; }
.fx-grupo { border: 1px solid #E2E2E2; border-radius: 6px; margin-bottom: 8px; }
.fx-grupo > summary { cursor: pointer; padding: 9px 12px; font-weight: 700; background: #F2F2F2; border-radius: 6px; }
.fx-grupo[open] > summary { border-radius: 6px 6px 0 0; color: #D7262E; }
.fx-campo { display: block; padding: 8px 12px; }
.fx-rot { display: block; font-size: 12px; font-weight: 700; color: #555; margin-bottom: 3px; }
.fx-campo input, .fx-campo textarea, .fx-bloco input, .fx-bloco textarea { width: 100%; padding: 7px 8px; font: inherit; font-size: 13.5px; border: 1px solid #D0D0D0; border-radius: 5px; }
.fx-bloco { background: #FAFAFA; border: 1px solid #EEE; border-radius: 6px; padding: 8px; margin-bottom: 8px; display: grid; gap: 6px; }
.fx-bloco .fx-bt { font-weight: 700; }
.fx-bloco .fx-rem { justify-self: start; padding: 4px 8px; font-size: 12px; }
