/* Sistema Terrazze — identidade: verde oliva, dourado e papel creme */
:root {
  --olive-950: #22271a;
  --olive-900: #2d3322;
  --olive-800: #3d4429;
  --olive-700: #4f5734;
  --olive-500: #747e4f;
  --olive-200: #d9dcc8;
  --gold: #b8893b;
  --gold-600: #9c7230;
  --gold-soft: #f0e4cc;
  --cream: #f5f0e6;
  --paper: #fffdf8;
  --ink: #2a2a24;
  --muted: #77736a;
  --line: #e6dece;
  --line-strong: #d6cbb4;
  --ok: #3f7d4e;
  --ok-bg: #e6f1e6;
  --warn: #9a6a12;
  --warn-bg: #fbf0d9;
  --bad: #a83a32;
  --bad-bg: #f8e3df;
  --info: #3a6593;
  --info-bg: #e3ecf6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(45, 51, 34, .06), 0 4px 16px rgba(45, 51, 34, .06);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--cream); }
a { color: var(--olive-700); }
a:hover { color: var(--gold-600); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--olive-900); line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: 26px; }
h3 { font-size: 21px; display: flex; align-items: center; gap: 8px; }
p { margin: 0 0 .8em; }
code { background: var(--gold-soft); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.ico { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; }
.hidden { display: none !important; }
.mt { margin-top: 16px; }
.mb0 { margin-bottom: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .32em; font-size: 11px; color: var(--gold); margin: 0 0 6px; }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--olive-800); color: #e9e6d9; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 22px 14px 14px; }
.brand { display: block; padding: 0 10px; }
.brand img { width: 168px; filter: brightness(0) invert(1); opacity: .95; }
.brand-sub { color: var(--gold-soft); opacity: .7; font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase; padding: 8px 10px 14px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 8px; }
.nav { flex: 1; }
.nav-group { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: rgba(240,228,204,.5); padding: 16px 12px 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 9px; color: #e9e6d9; text-decoration: none; font-size: 13.5px; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active { background: var(--gold); color: #fff; }
.nav-link .ico { opacity: .85; }
.nav-count { margin-left: auto; background: var(--gold); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.nav-link.active .nav-count { background: #fff; color: var(--gold-600); }
.side-user { display: flex; align-items: center; gap: 9px; border-top: 1px solid rgba(255,255,255,.1); padding: 14px 6px 4px; margin-top: 12px; }
.side-user .who { flex: 1; min-width: 0; }
.side-user strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { color: rgba(233,230,217,.6); font-size: 11.5px; }
.side-user a { color: #e9e6d9; padding: 4px; border-radius: 6px; display: inline-flex; }
.side-user a:hover { background: rgba(255,255,255,.1); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #fff; display: grid; place-items: center; font-weight: 600; flex: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 32px; border-bottom: 1px solid var(--line); background: rgba(245,240,230,.92); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.topbar-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.topbar h1 { font-size: 30px; margin: 0; }
.topbar .back { display: inline-flex; padding: 6px; border-radius: 8px; color: var(--olive-700); }
.topbar .back:hover { background: var(--gold-soft); }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; color: var(--olive-800); cursor: pointer; }
.menu-btn .ico { width: 24px; height: 24px; }
.content { padding: 26px 32px 40px; flex: 1; }
.foot { padding: 16px 32px 24px; color: var(--muted); font-size: 12px; }
.overlay { display: none; }

/* ---------- Cartões e grades ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; min-width: 0; }
.card > h3:first-child, .card > h2:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .ico { width: 40px; height: 40px; color: var(--gold); margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.grid-2 + *, .grid-3 + * { margin-top: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split > .col > .card:last-child { margin-bottom: 0; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }
.kpi strong { display: block; font-family: var(--serif); font-size: 25px; color: var(--olive-900); line-height: 1.2; margin-top: 4px; font-variant-numeric: lining-nums; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi.gold { background: var(--olive-800); border-color: var(--olive-800); }
.kpi.gold small, .kpi.gold span { color: rgba(240,228,204,.75); }
.kpi.gold strong { color: #fff; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--olive-800); color: #fff; border: 1px solid var(--olive-800); border-radius: 9px; padding: 9px 16px; font: 500 13.5px var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--olive-900); color: #fff; }
.btn .ico { width: 16px; height: 16px; }
.btn-gold { background: var(--gold); border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-600); border-color: var(--gold-600); }
.btn-ghost { background: transparent; color: var(--olive-800); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--gold-soft); color: var(--olive-900); }
.btn-danger { background: transparent; color: var(--bad); border-color: #e3b8b2; }
.btn-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { background: none; border: 0; padding: 5px; border-radius: 6px; color: var(--muted); cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--bad-bg); color: var(--bad); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; color: var(--olive-700); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- Formulários ---------- */
.form .field, .field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; font-weight: 500; color: var(--olive-700); margin-bottom: 5px; }
.field small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 4px; }
input, select, textarea { font: 14px var(--sans); color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(184,137,59,.35); border-color: var(--gold); }
input[disabled] { background: var(--cream); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--olive-700); }
textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.form-grid.g3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; }
.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 16px 16px 4px; margin-bottom: 16px; }
.fieldset legend { font-family: var(--serif); font-size: 18px; font-weight: 600; padding: 0 6px; color: var(--olive-800); }
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }
.input-sm { padding: 6px 8px; font-size: 13px; }
.mini { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
details.collapse { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); margin-bottom: 20px; }
details.collapse > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--olive-800); list-style: none; display: flex; align-items: center; gap: 8px; }
details.collapse > summary::-webkit-details-marker { display: none; }
details.collapse > summary::before { content: "+"; color: var(--gold); font-size: 18px; width: 16px; }
details.collapse[open] > summary::before { content: "–"; }
details.collapse > .inner { padding: 0 18px 18px; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -2px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: #fbf8f1; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 600; border-bottom: 0; border-top: 2px solid var(--line-strong); }
.table input, .table select { padding: 6px 8px; font-size: 13px; }
.table .w-qtd { width: 70px; }
.table tr.muted td { color: #a7a196; }
.table tr.row-sold td { color: #9a9488; background: #f7f3eb; }
.table.compact td, .table.compact th { padding: 7px 8px; }
.table-head-dark th { background: var(--olive-800); color: #f0e4cc; border-bottom: 0; }

/* ---------- Selos ---------- */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 20px; padding: 2px 10px; background: var(--gold-soft); color: var(--gold-600); white-space: nowrap; }
.badge.gold { background: var(--gold); color: #fff; }
.badge.ok, .st-disponivel.badge, .pc-paga, .pr-aprovada, .pr-convertida { background: var(--ok-bg); color: var(--ok); }
.badge.warn, .st-reservada.badge, .pr-em_analise, .pr-contraproposta { background: var(--warn-bg); color: var(--warn); }
.badge.bad, .st-vendida.badge, .pc-vencida, .pr-recusada { background: var(--bad-bg); color: var(--bad); }
.badge.info, .pr-enviada, .pc-aberta { background: var(--info-bg); color: var(--info); }
.st-bloqueada.badge, .pr-cancelada, .badge.grey { background: #ebe8e1; color: #6e6a60; }

/* ---------- Alertas ---------- */
.alert { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid; font-size: 13.5px; }
.alert-ok { background: var(--ok-bg); border-color: #bfdcc2; color: #24502f; }
.alert-bad { background: var(--bad-bg); border-color: #ecc0b9; color: #7c241d; }
.alert-warn { background: var(--warn-bg); border-color: #ecd49e; color: #6d4b0c; }
.alert-info { background: var(--info-bg); border-color: #bfd2e8; color: #284a70; }
.alert a { color: inherit; font-weight: 600; }
.alert-list { display: grid; gap: 10px; margin-bottom: 20px; }
.alert-list .alert { margin: 0; display: flex; align-items: center; gap: 10px; }

/* ---------- Barras ---------- */
.bar { height: 8px; background: #ece5d6; border-radius: 8px; overflow: hidden; }
.bar.lg { height: 14px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--olive-700), var(--gold)); border-radius: 8px; }
.big-pct { font-family: var(--serif); font-size: 64px; line-height: 1; color: var(--olive-800); margin-bottom: 10px; }
.big-pct small { font-size: 30px; color: var(--gold); }
.etapas { display: grid; gap: 12px; }
.etapa-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }

/* ---------- Espelho de vendas ---------- */
.espelho-legenda { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-bottom: 16px; }
.leg { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.leg i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
.leg.st-disponivel i { background: var(--ok); }
.leg.st-reservada i { background: #d39b2a; }
.leg.st-vendida i { background: var(--bad); }
.leg.st-bloqueada i { background: #9a958a; }
.espelho { display: grid; gap: 10px; }
.esp-andar { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: stretch; }
.esp-label { background: var(--olive-800); color: var(--gold-soft); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; display: flex; align-items: center; letter-spacing: .03em; }
.esp-unidades { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.esp-card { background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--ok); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.esp-card.st-reservada { border-left-color: #d39b2a; }
.esp-card.st-vendida { border-left-color: var(--bad); background: #faf6f0; }
.esp-card.st-bloqueada { border-left-color: #9a958a; opacity: .75; }
.esp-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.esp-top strong { font-family: var(--serif); font-size: 22px; color: var(--olive-900); }
.esp-meta { font-size: 12px; color: var(--muted); }
.esp-preco { font-weight: 600; color: var(--olive-800); }
.esp-info { font-size: 12.5px; color: var(--muted); }
.esp-acoes { display: flex; gap: 12px; font-size: 12.5px; margin-top: 4px; }

/* ---------- Galeria, fotos, documentos ---------- */
.fotos, .galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 8px; }
.galeria { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 26px; }
.fotos a, .galeria a, .foto-item { position: relative; display: block; border-radius: 10px; overflow: hidden; background: #e9e3d6; aspect-ratio: 4 / 3; text-decoration: none; }
.fotos img, .galeria img, .foto-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.fotos a:hover img, .galeria a:hover img { transform: scale(1.03); }
.fotos span, .galeria span, .foto-item span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.foto-item form { position: absolute; top: 6px; right: 6px; }
.foto-item .icon-btn { background: rgba(255,255,255,.9); }
.obra-mes-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.obra-mes-head h3 { margin: 0; }
.docs { display: grid; gap: 10px; margin-bottom: 24px; }
.doc { display: flex; align-items: center; gap: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.doc-ico { width: 44px; height: 44px; border-radius: 8px; background: var(--gold-soft); color: var(--gold-600); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.doc-txt { flex: 1; min-width: 0; }
.doc-txt strong { display: block; }
.doc-txt small { color: var(--muted); }
.section-title { margin-top: 10px; font-size: 24px; }

/* ---------- Empreendimento ---------- */
.hero { position: relative; border-radius: 16px; overflow: hidden; min-height: 300px; background: var(--hero) center/cover no-repeat; display: flex; align-items: flex-end; margin-bottom: 18px; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(34,39,26,0) 30%, rgba(34,39,26,.82)); }
.hero-txt { position: relative; padding: 28px; color: #fff; }
.hero-txt h2 { color: #fff; font-size: 42px; margin: 0 0 4px; }
.hero-txt p { margin: 0; opacity: .9; }
.numeros { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.numeros div { text-align: center; padding: 16px 8px; border-right: 1px solid var(--line); }
.numeros div:last-child { border-right: 0; }
.numeros b { display: block; font-family: var(--serif); font-size: 38px; color: var(--olive-800); line-height: 1; }
.numeros span { font-size: 12px; color: var(--muted); }
.prose p { font-size: 15px; line-height: 1.7; }
.diferenciais { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 26px; }
.dif { display: flex; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.dif .ico { width: 26px; height: 26px; color: var(--gold); margin-top: 2px; }
.dif strong { display: block; color: var(--olive-900); }
.dif p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.mapa iframe { width: 100%; height: 340px; border: 0; border-radius: 10px; }
.mapa p { display: flex; gap: 8px; align-items: center; }
.contato .btn { margin: 4px 0 12px; }
.contato p { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.avisos { display: grid; gap: 12px; }
.aviso { border-left: 3px solid var(--gold); padding: 2px 0 2px 12px; }
.aviso small { color: var(--muted); }
.aviso strong { display: block; }
.aviso p { margin: 4px 0 0; font-size: 13.5px; }

/* ---------- Plano de pagamento ---------- */
.plano-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.plano-table td { padding: 6px; }
.plano-table select, .plano-table input { min-width: 90px; }
.plano-table input[data-pl=desc] { min-width: 140px; }
.dif-ok { color: var(--ok); }
.dif-bad { color: var(--bad); }

/* ---------- Simulador / resumo ---------- */
.resumo-valores { display: grid; gap: 10px; }
.resumo-valores div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.resumo-valores div:last-child { border: 0; }
.resumo-valores b { font-variant-numeric: tabular-nums; }
.destaque { background: var(--olive-800); color: #fff; border-radius: var(--radius); padding: 20px; }
.destaque h3, .destaque strong { color: #fff; }
.destaque .muted { color: rgba(240,228,204,.75); }
.destaque .big { font-family: var(--serif); font-size: 40px; line-height: 1.1; }

/* ---------- Tabela de preços estilo planilha ---------- */
.cond-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.cond { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; }
.cond small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.cond b { font-size: 18px; color: var(--olive-800); }
.tab-mes-select { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tab-mes-select select { width: auto; min-width: 220px; }

/* ---------- Login ---------- */
body.simple { background: var(--cream); }
.login { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }
.login-art { background: #efe9dc left center/cover no-repeat; }
.login-side { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 34px 30px; box-shadow: 0 10px 40px rgba(45,51,34,.1); }
.auth-card.wide { max-width: 560px; }
.auth-card h1 { text-align: center; font-size: 34px; margin-bottom: 6px; }
.auth-logo { display: block; width: 190px; margin: 0 auto 14px; }
.auth-links { display: grid; gap: 6px; text-align: center; margin-top: 18px; font-size: 13px; }
.login-foot { color: var(--muted); font-size: 12px; margin-top: 18px; }
.checks { list-style: none; padding: 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 8px; align-items: center; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--bad); }
.checks .warn { color: var(--warn); }
.steps li { margin-bottom: 6px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(20,22,15,.94); z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 60px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 6px; }
.lightbox p { color: #eee; margin-top: 12px; font-size: 13.5px; text-align: center; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 22px; }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 12px; top: 50%; }
.lightbox .lb-next { right: 12px; top: 50%; }

/* ---------- Abas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a.active { color: var(--olive-900); border-bottom-color: var(--gold); }

.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filtros .field { margin: 0; }
.filtros select, .filtros input { width: auto; min-width: 150px; }

.contrato-editor { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; min-height: 520px; line-height: 1.55; }
.pendencias { background: #fffbe0; border: 1px solid #efe08a; border-radius: 10px; padding: 12px 16px; }
.pendencias mark { background: #fff176; padding: 0 4px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform .25s; }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 24px; }
  .content { padding: 18px 16px 30px; }
  .foot { padding: 12px 16px 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 220px; }
  .numeros { grid-template-columns: repeat(3, 1fr); }
  .numeros div:nth-child(3) { border-right: 0; }
  .esp-andar { grid-template-columns: 1fr; gap: 6px; }
  .esp-label { padding: 8px 12px; }
  .hero-txt h2 { font-size: 32px; }
  .card { padding: 16px; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi strong { font-size: 22px; }
  .numeros { grid-template-columns: 1fr 1fr; }
  .doc { flex-wrap: wrap; }
  .lightbox { padding: 20px 10px; }
}

/* ---------- Impressão ---------- */
@media print {
  .sidebar, .topbar, .foot, .no-print, .menu-btn, .btn, .alert { display: none !important; }
  .app { display: block; }
  body { background: #fff; font-size: 11px; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .print-only { display: block !important; }
  .table th, .table td { padding: 5px 6px; }
  .table-head-dark th { background: #3d4429 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { text-decoration: none; color: inherit; }
}
.print-only { display: none; }
.print-head { align-items: center; justify-content: space-between; margin-bottom: 14px; border-bottom: 2px solid var(--gold); padding-bottom: 10px; }
.print-head img { width: 160px; }

/* ---------- Menu suspenso de ações em tabelas ---------- */
.inline-details { position: relative; display: inline-block; }
.inline-details > summary { list-style: none; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 330px; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 12px 40px rgba(45,51,34,.18); padding: 16px; white-space: normal; text-align: left; }
.inline-details .pop b { display: block; margin-bottom: 8px; color: var(--olive-800); }
@media (max-width: 600px) { .inline-details .pop { position: fixed; left: 12px; right: 12px; top: 80px; width: auto; max-height: 75vh; overflow: auto; } }

/* ---------- Fluxo mensal ---------- */
.fluxo { display: grid; grid-template-columns: repeat(14, minmax(28px, 1fr)); gap: 6px; align-items: end; height: 170px; margin-bottom: 10px; }
.fluxo-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; text-decoration: none; border-radius: 6px; padding: 2px; }
.fluxo-col:hover, .fluxo-col.on { background: var(--gold-soft); }
.fluxo-bars { flex: 1; width: 100%; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.fluxo-bars i { display: block; width: 42%; min-height: 2px; border-radius: 3px 3px 0 0; }
.fluxo-bars .prev { background: var(--olive-200); }
.fluxo-bars .rec { background: var(--gold); }
.fluxo-col span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 700px) { .fluxo { grid-template-columns: repeat(14, 34px); overflow-x: auto; } }
.tabela-precos { font-size: 12.5px; }
.tabela-precos th { font-size: 10px; letter-spacing: .04em; }
.tabela-precos td, .tabela-precos th { padding: 7px 6px; }
.split > *, .grid-2 > *, .grid-3 > *, .col { min-width: 0; }
@media (max-width: 520px) { .kpi strong { font-size: 19px; white-space: nowrap; } .kpi { padding: 12px 14px; } }
