/* Gestão de Condomínio — visual limpo, cor base #7FB1A6 */
:root {
  --pri: #7FB1A6; --pri-esc: #3D7468; --pri-esc2: #2F5C53; --pri-clara: #E8F2EF; --pri-media: #CFE3DE;
  --txt: #1F2D2A; --txt2: #5B6B67; --borda: #DCE5E2; --fundo: #F4F7F6; --branco: #fff;
  --ok: #2E7D4F; --ok-f: #E3F4EA; --erro: #B3261E; --erro-f: #FBE9E7; --aviso: #8A5A00; --aviso-f: #FFF4DC;
  --info-f: #E8F0FB; --raio: 8px; --sombra: 0 1px 3px rgba(20,40,35,.08);
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--txt); background: var(--fundo); line-height: 1.45; }
a { color: var(--pri-esc); }
h1 { font-size: 1.35rem; margin: 0 0 .9rem; font-weight: 600; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 .6rem; font-weight: 600; color: var(--pri-esc2); }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; }
small, .muted { color: var(--txt2); }

/* Topo */
.topo { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .8rem; height: 54px; padding: 0 1rem;
  background: var(--pri); color: #fff; box-shadow: var(--sombra); }
.marca { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.marca-ico { display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center; background: rgba(255,255,255,.25); border-radius: 6px; margin-right: .3rem; }
.sel-cond { flex: 1; max-width: 360px; }
.sel-cond select { width: 100%; background: rgba(255,255,255,.95); border: 0; height: 34px; font-weight: 600; color: var(--pri-esc2); }
.usuario { margin-left: auto; display: flex; align-items: center; gap: .7rem; font-size: .88rem; }
.usuario form { margin: 0; }
.usuario-nome { display: flex; flex-direction: column; text-align: right; line-height: 1.15; }
.usuario-nome small { color: rgba(255,255,255,.85); font-size: .72rem; }
.topo .lnk { color: #fff; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }

/* Corpo */
.corpo { display: flex; min-height: calc(100vh - 54px); }
.lateral { width: 200px; flex-shrink: 0; background: var(--branco); border-right: 1px solid var(--borda); padding: .8rem .5rem; }
.lateral a { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; margin-bottom: 2px; border-radius: 6px; color: var(--txt); text-decoration: none; font-size: .93rem; }
.lateral a:hover { background: var(--pri-clara); }
.lateral a.ativo { background: var(--pri-media); color: var(--pri-esc2); font-weight: 600; }
.lateral svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.conteudo { flex: 1; min-width: 0; padding: 1.2rem 1.5rem 3rem; max-width: 1280px; }

/* Cabeçalho de página */
.cab { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.cab h1 { margin: 0; margin-right: auto; }
.acoes { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

/* Cartões e indicadores */
.cartao { background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1rem 1.1rem; box-shadow: var(--sombra); margin-bottom: 1rem; }
.cartao > h2:first-child { margin-top: 0; }
.ind { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.ind > div { background: var(--branco); border: 1px solid var(--borda); border-left: 4px solid var(--pri); border-radius: var(--raio); padding: .7rem .9rem; }
.ind span { display: block; font-size: .78rem; color: var(--txt2); text-transform: uppercase; letter-spacing: .02em; }
.ind strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.ind .neg { border-left-color: var(--erro); }
.ind a { text-decoration: none; color: inherit; }
.atalhos { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }

/* Botões */
.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .48rem .9rem; border-radius: 6px; border: 1px solid var(--pri-esc); background: var(--pri-esc); color: #fff;
  font: inherit; font-size: .9rem; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--pri-esc2); }
.btn-sec { background: var(--branco); color: var(--pri-esc2); border-color: var(--pri); }
.btn-sec:hover { background: var(--pri-clara); }
.btn-perigo { background: var(--branco); color: var(--erro); border-color: #e3b4b0; }
.btn-perigo:hover { background: var(--erro-f); }
.btn-p { padding: .25rem .55rem; font-size: .82rem; }
.btn-grande { padding: .7rem 1.2rem; font-size: 1rem; }
button:disabled, .btn[aria-disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; margin: 0; }

/* Tabelas */
.tabela-wrap { overflow-x: auto; background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .5rem .65rem; text-align: left; border-bottom: 1px solid var(--borda); vertical-align: middle; }
th { background: var(--pri-clara); color: var(--pri-esc2); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
tbody tr:hover { background: #FAFCFB; }
tfoot td { font-weight: 700; background: #F8FBFA; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.acoes-cel { white-space: nowrap; text-align: right; }
tr.inativo td { color: var(--txt2); }
.vazio { padding: 1.5rem; text-align: center; color: var(--txt2); }

/* Selos */
.selo { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.s-pago, .s-paga, .s-fechado, .s-ocupado, .s-ativo { background: var(--ok-f); color: var(--ok); }
.s-aberto, .s-pendente, .s-rascunho, .s-transicao { background: var(--aviso-f); color: var(--aviso); }
.s-parcial { background: var(--info-f); color: #1E4E8C; }
.s-vencido, .s-cancelado { background: var(--erro-f); color: var(--erro); }
.s-vazio, .s-inativo { background: #EEF0EF; color: var(--txt2); }

/* Formulários */
.form { display: grid; grid-template-columns: repeat(12, 1fr); gap: .75rem 1rem; }
.campo { grid-column: span 4; display: flex; flex-direction: column; gap: .25rem; }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c6 { grid-column: span 6; } .c8 { grid-column: span 8; } .c12 { grid-column: 1 / -1; }
label { font-size: .82rem; font-weight: 600; color: var(--txt2); }
input, select, textarea { font: inherit; font-size: .93rem; padding: .45rem .6rem; border: 1px solid #C9D6D2; border-radius: 6px; background: #fff; color: var(--txt); width: 100%; min-height: 36px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pri); outline-offset: 0; border-color: var(--pri); }
input.money { text-align: right; font-variant-numeric: tabular-nums; }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox] { width: auto; min-height: 0; }
.check { display: flex; align-items: center; gap: .45rem; font-weight: 500; color: var(--txt); font-size: .9rem; }
.ajuda { font-size: .78rem; color: var(--txt2); font-weight: 400; }
.form-acoes { grid-column: 1 / -1; display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .4rem; }
fieldset { grid-column: 1 / -1; border: 1px solid var(--borda); border-radius: var(--raio); padding: .8rem 1rem 1rem; margin: 0; }
fieldset .form { margin-top: .2rem; }
legend { font-weight: 600; font-size: .88rem; color: var(--pri-esc2); padding: 0 .3rem; }
.oculto { display: none !important; }
.filtros { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: .9rem; }
.filtros .campo { grid-column: auto; min-width: 140px; }

/* Alertas */
.alerta { padding: .65rem .9rem; border-radius: 6px; margin-bottom: .9rem; font-size: .92rem; border: 1px solid transparent; }
.alerta-ok { background: var(--ok-f); color: var(--ok); border-color: #bfe3cc; }
.alerta-erro { background: var(--erro-f); color: var(--erro); border-color: #f0c4bf; }
.alerta-aviso { background: var(--aviso-f); color: var(--aviso); border-color: #f1dca8; }
.alerta-info { background: var(--info-f); color: #1E4E8C; border-color: #c9d9f1; }

/* Rateio */
.memoria { font-size: .82rem; color: var(--txt2); }
.memoria li { margin: .1rem 0; }
details summary { cursor: pointer; color: var(--pri-esc); font-size: .85rem; }
.passos { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; padding: 0; list-style: none; counter-reset: p; }
.passos li { counter-increment: p; font-size: .82rem; padding: .3rem .7rem .3rem .4rem; background: #EEF3F1; border-radius: 99px; color: var(--txt2); }
.passos li::before { content: counter(p); display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 50%; background: #CBD8D4; color: #fff; margin-right: .35rem; font-size: .72rem; }
.passos li.feito { color: var(--pri-esc2); background: var(--pri-clara); } .passos li.feito::before { background: var(--pri); }
.passos li.atual { color: #fff; background: var(--pri-esc); } .passos li.atual::before { background: #fff; color: var(--pri-esc); }

/* Login */
body.simples { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(160deg, var(--pri-clara), var(--fundo)); }
.caixa-central { width: 100%; max-width: 380px; padding: 1rem; }
.login { padding: 1.6rem; }
.login h1 { text-align: center; color: var(--pri-esc2); }
.login .campo { margin-bottom: .8rem; }
.login .btn { width: 100%; justify-content: center; }
.erro-cod { font-size: 3rem; color: var(--pri); margin: 0; }
.centro { text-align: center; }

/* PIX */
.pix-codigo { font-family: ui-monospace, monospace; font-size: .75rem; word-break: break-all; background: #F6F8F7; padding: .5rem; border-radius: 6px; border: 1px dashed var(--borda); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .9rem; font-size: .92rem; margin: 0; }
.dl dt { color: var(--txt2); }
.dl dd { margin: 0; font-weight: 500; }

/* Celular */
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .lateral { position: fixed; top: 54px; left: 0; bottom: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: 2px 0 8px rgba(0,0,0,.1); }
  .lateral.aberto { transform: none; }
  .conteudo { padding: 1rem; }
  .usuario-nome, .marca { display: none; }
  .sel-cond { max-width: none; }
  .campo, .c2, .c3, .c6, .c8 { grid-column: 1 / -1; }
  .grid2 { grid-template-columns: 1fr; }
  .esconde-cel { display: none; }
}
@media (min-width: 861px) and (max-width: 1100px) {
  .campo.c2, .campo.c3 { grid-column: span 4; }
  .campo { grid-column: span 6; }
}
@media print {
  .topo, .lateral, .atalhos, .acoes, .filtros, .btn { display: none !important; }
  .conteudo { padding: 0; }
}
.estreito { max-width: 560px; }
