/* Layout no mesmo formato do sistema anterior, para a equipe não estranhar. Troque --cor para mudar a cor principal. */
:root { --cor:#7c4dd6; --cor-escura:#6a3cc4; --link:#4f7fe0; --lateral:#232323; --fundo:#f0f2f8; --cartao:#fff; --texto:#23262f; --suave:#6b7280; --borda:#e4e6ec; --perigo:#e5484d; --azul:#3f51b5; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin:0; font: 13px/1.45 Poppins, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--fundo); color: var(--texto); }
.oculto { display: none !important; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #cfd3dc; border-radius: 4px; background: #fff; width: 100%; color: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cor); }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: #e8ebf3; color: #4b5563; }
label { display: grid; gap: 4px; font-weight: 500; font-size: 12px; }
button { font: inherit; font-weight: 500; padding: 8px 18px; border-radius: 5px; border: 1px solid var(--cor); background: var(--cor); color: #fff; cursor: pointer; }
button:hover { background: var(--cor-escura); }
button.sec { background: #fff; color: #111; border-color: #111; }
button.link { background: none; border: none; color: var(--cor); padding: 4px; }
button.icone { background: none; border: none; padding: 4px; color: var(--cor); display: inline-flex; }
.largo { width: 100%; } .direita { justify-self: end; font-size: 12px; }
.msg { color: var(--perigo); min-height: 1em; margin: 0; }
.espaco { flex: 1; }
.material-icons { font-size: 20px; vertical-align: middle; }

/* Login */
.login-tela { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-esq { display: grid; place-items: center; padding: 16px; background: #fff; }
.login-dir { background: var(--lateral); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px; }
.login-dir h1 { font-size: 28px; font-weight: 500; margin: 0 0 12px; }
.login-cartao { width: 100%; max-width: 340px; display: grid; gap: 14px; padding: 28px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.1); }
.login-logo { width: 150px; justify-self: center; background: var(--lateral); padding: 10px 16px; border-radius: 8px; }

/* Estrutura */
#app { display: flex; min-height: 100vh; }
#lateral { width: 240px; flex: none; background: var(--lateral); color: #cfcfcf; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
#lateral .marca { padding: 18px 24px; text-align: center; }
#lateral .marca img { width: 130px; }
#menu a, #menu .grupo { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: #cfcfcf; text-decoration: none; cursor: pointer; }
#menu a:hover, #menu .grupo:hover { background: #303030; color: #fff; }
#menu .seta { margin-left: auto; font-size: 18px; transition: transform .15s; }
#menu .aberto .seta { transform: rotate(90deg); }
#menu .sub a { padding-left: 52px; font-size: 12.5px; }
#menu a.ativo { color: #fff; background: #3a3a3a; }
#corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#topo { display: flex; align-items: center; gap: 12px; background: #fff; padding: 8px 20px; box-shadow: 0 1px 4px rgba(0,0,0,.08); position: sticky; top: 0; z-index: 5; }
#quem { color: var(--suave); }
#conteudo { padding: 16px; }
body.menu-fechado #lateral { display: none; }

/* Cartão de listagem */
.pagina { background: var(--cartao); border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.pagina-topo { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--borda); }
.pagina-topo h2 { margin: 0; font-size: 19px; font-weight: 600; flex: 1; }
.filtros { display: flex; gap: 8px; padding: 14px 20px; flex-wrap: wrap; }
.filtros select { max-width: 150px; } .filtros input { max-width: 420px; }
.tabela { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--borda); font-size: 12px; }
th { font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.acoes, th.acoes { text-align: center; white-space: nowrap; }
td.acoes .material-icons { cursor: pointer; font-size: 19px; margin: 0 3px; }
.ic-editar { color: var(--azul); } .ic-ver { color: var(--cor); }
tr.filtro td { padding: 6px 12px; }
tr.filtro input { padding: 5px 8px; font-size: 12px; }
a.codigo { color: var(--cor); text-decoration: none; cursor: pointer; white-space: nowrap; }
a.codigo::before { content: ''; display: inline-block; width: 3px; height: 16px; background: var(--perigo); border-radius: 2px; margin-right: 8px; vertical-align: middle; transform: rotate(10deg); }
.etiqueta { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 11px; font-weight: 500; background: #e7f6fb; border: 1px solid #9ad7ea; }
.paginacao { display: flex; gap: 12px; justify-content: flex-end; align-items: center; padding: 10px 20px; color: var(--suave); }
.paginacao select { width: auto; }
.vazio { padding: 28px; text-align: center; color: var(--suave); }
.sigilo { color: #8a5a00; }

/* Abas por etapa */
.abas { display: flex; border-bottom: 1px solid var(--borda); padding: 0 12px; overflow-x: auto; }
.abas button { flex: 1; min-width: 110px; background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; color: var(--texto); font-weight: 400; padding: 12px 8px; white-space: nowrap; }
.abas button:hover { background: #f7f5fd; }
.abas button.ativa { color: var(--cor); border-bottom-color: var(--cor); font-weight: 500; }

/* Formulários em seções */
.form { padding: 16px 20px; }
.secao { display: flex; align-items: center; gap: 12px; color: var(--link); font-size: 15px; font-weight: 500; margin: 18px 0 12px; }
.secao::after { content: ''; flex: 1; border-top: 1px solid var(--borda); }
.grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.acoes-form { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 20px; }
.acoes-form button { min-width: 130px; }
.foto { width: 140px; height: 130px; border: 1px solid var(--borda); border-radius: 4px; display: grid; place-items: center; color: var(--cor); background: #fff center/contain no-repeat; }
.foto .material-icons { font-size: 38px; }

/* Acordeão (proposta) */
.painel { background: #fff; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.15); margin-bottom: 10px; }
.painel-topo { display: flex; align-items: center; padding: 14px 20px; color: var(--link); font-size: 17px; font-weight: 500; cursor: pointer; }
.painel-topo .material-icons { margin-left: auto; color: #555; }
.painel-corpo { padding: 4px 20px 18px; }
.painel:not(.aberto) .painel-corpo { display: none; }
.tabela-itens { margin-bottom: 14px; }
.tabela-itens h4 { color: var(--link); font-weight: 500; font-size: 15px; margin: 10px 0 6px; }
.tabela-itens .ambiente { background: #e4e4e4; font-weight: 500; padding: 5px 10px; }
.tabela-itens th { background: var(--cor); color: #fff; }
.tabela-itens td { border: 1px solid var(--borda); }
.total td { background: var(--cor); color: #fff; font-weight: 600; }
.memorial { border: 1px solid var(--borda); padding: 12px; white-space: pre-wrap; min-height: 120px; font-family: Georgia, serif; background: #fff; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal .cartao { background: #fff; border-radius: 8px; padding: 20px; width: 100%; max-width: 480px; display: grid; gap: 10px; }
.chave { display: flex; gap: 6px; align-items: center; font-weight: 400; }
.chave input { width: auto; }
td select { width: auto; min-width: 110px; }

@media (max-width: 800px) {
  .login-tela { grid-template-columns: 1fr; } .login-dir { display: none; }
  #lateral { position: fixed; z-index: 10; }
  body:not(.menu-aberto) #lateral { display: none; }
}
@media print { #lateral, #topo, .filtros, .pagina-topo button, .nao-imprime { display: none !important; } body { background: #fff; } .pagina { box-shadow: none; } }

/* Ajustes para ficar igual ao anterior */
#lateral { width: 288px; background: #222; }
#lateral .marca { padding: 14px 24px 22px; } #lateral .marca img { width: 150px; }
#menu { padding-bottom: 24px; }
#menu a, #menu .grupo { padding: 11px 28px; gap: 16px; font-size: 13.5px; }
#menu .material-icons { font-size: 18px; color: #bdbdbd; }
#menu .seta { color: #bdbdbd; }
#menu .sub .n1 { padding-left: 62px; font-size: 13px; }
#menu .sub .n2 { padding-left: 78px; font-size: 12.5px; color: #aaa; }
#topo { padding: 10px 20px; min-height: 50px; }
#topo .logo-topo { height: 34px; filter: drop-shadow(0 0 .6px #456); }
#topo .avatar { width: 32px; height: 32px; border-radius: 50%; background: #8fb4dd; color: #fff; display: grid; place-items: center; }
#topo .avatar .material-icons { font-size: 24px; }
#topo .sino { position: relative; color: #aaa; }
.ic-apagar { color: var(--perigo); }
td.acoes a { cursor: pointer; }
.filtros select { max-width: 140px; }
.pagina-topo .icone { color: var(--azul); }


/* Proposta */
.prop-topo { margin-bottom: 12px; }
.grade-2 { grid-template-columns: 1fr 1fr; }
.linha-add { display: flex; gap: 12px; justify-content: flex-end; align-items: end; margin: 12px 0; flex-wrap: wrap; }
.linha-add label { width: 170px; } .linha-add label:has(select) { width: 240px; flex: 1; }
.cond-grade { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 12px 14px; }
.par { display: grid; gap: 6px; align-content: start; }
.par label { font-weight: 600; font-size: 12px; }
.pct { position: relative; } .pct input { padding-right: 24px; } .pct span { position: absolute; right: 8px; top: 8px; color: #444; }
.painel hr { border: 0; border-top: 1px solid var(--borda); margin: 16px 0; }
.barra-mem { display: flex; gap: 4px; padding: 6px; border: 1px solid var(--borda); border-bottom: 0; }
.barra-mem .icone { color: #333; }
.memorial { min-height: 240px; } .memorial:focus { outline: 1px solid var(--cor); }
.memorial[contenteditable] { white-space: normal; }
td.acoes .material-icons[data-mais], td.acoes [data-ed-item], td.acoes [data-del-item], td.acoes [data-del-mo], [data-del-cond] { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 800px) { .cond-grade { grid-template-columns: repeat(2, 1fr); } .grade-2 { grid-template-columns: 1fr; } }
