/* Rentings · zeist — mesmo visual do MRO Cockpit (~/MRO Site/funil).
   Gestão de arrendamentos: processo mensal primeiro, fichas completas atrás. */

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #14181f;
  --ink-soft: #5b6472;
  --line: #e4e7ec;
  --brand: #1a2b4a;
  --brand-soft: #eef1f7;
  --green: #1f9d57;
  --green-bg: #e7f6ee;
  --amber: #c9820a;
  --amber-bg: #fbf1de;
  --red: #d23b3b;
  --red-bg: #fbe8e8;
  --blue: #2b6cb0;
  --blue-bg: #e7f0f9;
  --purple: #6b46c1;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.45;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
a { color: var(--blue); }
button { font-family: inherit; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  background: var(--panel); border-radius: 16px; box-shadow: var(--shadow);
  padding: 32px; width: 100%; max-width: 360px; text-align: center;
}
.login-card .logo { font-size: 13px; letter-spacing: .18em; color: var(--ink-soft); text-transform: uppercase; }
.login-card h1 { font-size: 24px; margin: 6px 0 2px; }
.login-card p { color: var(--ink-soft); font-size: 13px; margin: 0 0 20px; }
.login-card input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; margin-bottom: 12px;
}
.login-card button {
  width: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--brand);
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.login-err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ---------- Shell ---------- */
.app { display: none; }
.app.visible { display: block; }
header.top {
  position: sticky; top: 0; z-index: 20; background: var(--brand); color: #fff;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
}
header.top .marca-mro { height: 20px; width: auto; fill: #fff; flex: 0 0 auto; }
header.top .brand { font-weight: 700; letter-spacing: -.01em; font-size: 16px; }
header.top .brand small { display: block; font-weight: 400; font-size: 11px; opacity: .7; letter-spacing: .04em; }
header.top button.logout {
  background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff;
  border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer;
  text-decoration: none; line-height: 1.5; white-space: nowrap;
}
/* O arquivo dos contratos terminados: vermelho a meio-gás, ao lado do Sair. */
header.top button.logout.ended { background: rgba(210, 59, 59, .5); border-color: transparent; }
header.top button.logout.ended:hover { background: rgba(210, 59, 59, .65); }

/* End Contract na ficha: vermelho a 50%, entre o Guardar e o Apagar. */
.modal .m-foot .btn.endct {
  flex: 1; color: #fff; background: rgba(210, 59, 59, .55); border-color: transparent;
}
.modal .m-foot .btn.endct:hover { background: rgba(210, 59, 59, .7); }

nav.tabs {
  position: sticky; top: 49px; z-index: 15; background: var(--panel);
  border-bottom: 1px solid var(--line); display: flex; gap: 2px; overflow-x: auto;
  padding: 0 8px; scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button {
  border: 0; background: transparent; padding: 13px 14px; font-size: 14px; font-weight: 550;
  color: var(--ink-soft); cursor: pointer; border-bottom: 2.5px solid transparent; white-space: nowrap;
}
nav.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs-spacer { flex: 1; }

/* Botão azul na fila dos separadores — o padrão Tarefas/Agenda do cockpit. */
nav.tabs button.tab-azul {
  align-self: center; background: var(--brand); color: #fff;
  border-radius: 8px; padding: 7px 13px; font-size: 13px; font-weight: 600;
  margin: 0 3px; border-bottom: 0;
}
nav.tabs button.tab-azul:hover { opacity: .9; }
nav.tabs button.tab-azul.active { color: #fff; border-bottom: 0; outline: 2px solid var(--brand-soft); }

main { padding: 16px; max-width: 1080px; margin: 0 auto; }
/* A vista Contratos alarga: leva o quadro de datas completo. */
main.larga { max-width: 1440px; }
.view { display: none; }
.view.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin: 4px 0 10px; }
.section-title .conta { color: var(--ink-soft); font-weight: 400; }
.muted { color: var(--ink-soft); }
.hint { font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Lists ---------- */
.list { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 18px; }
.list .row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.list .row:last-child { border-bottom: 0; }
.list .row .main { flex: 1; min-width: 0; }
.list .row .main .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .row .main .s { font-size: 12.5px; color: var(--ink-soft); }
.list .row .actions { display: flex; gap: 6px; flex: 0 0 auto; align-items: center; }
.empty { text-align: center; color: var(--ink-soft); padding: 26px 14px; font-size: 14px; }

.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.pill.grey { background: var(--brand-soft); color: var(--ink-soft); }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }

/* ---------- Buttons ---------- */
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 9px; padding: 7px 12px; font-size: 13px; font-weight: 550; cursor: pointer; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { opacity: .92; }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn.mini { padding: 3px 8px; font-size: 11.5px; border-radius: 7px; }
.btn.ghost { border-color: transparent; background: var(--brand-soft); }
.btn.danger { color: var(--red); border-color: var(--red-bg); }
.btn.verde { background: var(--green); border-color: var(--green); color: #fff; }
.btn.verde:hover { opacity: .92; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input.search { flex: 1; min-width: 160px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; }
.toolbar select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; background: var(--panel); }

/* Ações (✓ etc.) sempre juntas, à esquerda da linha — regra do cockpit. */
.acoes-esq { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(16,24,40,.42); display: none; align-items: flex-end; justify-content: center; z-index: 40; }
.modal-back.open { display: flex; }
.modal {
  background: var(--panel); width: 100%; max-width: 880px; border-radius: 16px 16px 0 0;
  max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow); animation: up .2s ease;
}
@keyframes up { from { transform: translateY(20px); } to { transform: none; } }
.modal .m-head { position: sticky; top: 0; background: var(--panel); padding: 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; z-index: 2; }
.modal .m-head h3 { font-size: 17px; }
.modal .m-head button.fechar { margin-left: auto; border: 0; background: var(--bg); width: 30px; height: 30px; border-radius: 50%; font-size: 17px; cursor: pointer; color: var(--ink-soft); }
.modal .m-body { padding: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
.modal .m-body > .field:has(textarea),
.modal .m-body > .field.larga,
.modal .m-body > .m-sep,
.modal .m-body > .m-liga { grid-column: 1 / -1; }
.modal .m-foot { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; position: sticky; bottom: 0; background: var(--panel); }
.modal .m-foot .btn { justify-content: center; text-align: center; }
/* Guardar manda: 75% para o guardar, 25% para o apagar. */
.modal .m-foot .btn.primary { flex: 3; }
.modal .m-foot .btn.danger { flex: 1; }

/* Separador de secção dentro da ficha. */
.m-sep {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); font-weight: 600;
  border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; margin-bottom: 8px;
}
.m-sep:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
/* Bloco de ligações (contratos do imóvel, etc.) no fundo da ficha. */
.m-liga { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13.5px; }
.m-liga .li { padding: 3px 0; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 15px; font-family: inherit; background: var(--panel);
}
.field textarea { min-height: 66px; resize: vertical; }
.field.inline-check label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.field.inline-check input { width: auto; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .grid2, .modal .m-body { grid-template-columns: 1fr; } }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { background: var(--red); }

.loading { text-align: center; padding: 40px; color: var(--ink-soft); }
.date-crit { font-size: 12.5px; color: var(--red); font-weight: 600; white-space: nowrap; }
.date-ok { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }

/* ---------- Tabelas (grelha por colunas, ordenável) ---------- */
.tabela-wrap { overflow-x: auto; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.tabela { min-width: 680px; }
.tabela .thead, .tabela .trow {
  display: grid;
  grid-template-columns: var(--grelha);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}
.tabela .thead {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-soft); font-weight: 600;
  border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 1;
}
.tabela .trow { border-bottom: 1px solid var(--line); font-size: 14px; }
.tabela .trow:last-child { border-bottom: 0; }
.tabela .trow:hover { background: var(--bg); }
.tabela .c-nome { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabela .c-soft { color: var(--ink-soft); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabela .c-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabela .c-centro { text-align: center; }
.tabela .vazio { color: var(--ink-soft); opacity: .6; }
.tabela .thead .ord { cursor: pointer; user-select: none; }
.tabela .thead .ord:hover { color: var(--brand); }

/* Imóvel devoluto: linha sombreada a vermelho — dinheiro parado salta à vista. */
.tabela .trow.devoluto { background: var(--red-bg); }
.tabela .trow.devoluto:hover { background: #f6dbdb; }
.devoluto-txt { color: var(--red); font-weight: 600; font-size: 13px; }

/* Tabela compacta (Contratos): fonte menor e células justas para caber tudo. */
.tabela.compacta { min-width: 1180px; }
.tabela.compacta .thead, .tabela.compacta .trow { gap: 8px; padding: 8px 10px; }
.tabela.compacta .thead { font-size: 10.5px; letter-spacing: .03em; }
.tabela.compacta .trow { font-size: 12.5px; }
.tabela.compacta .c-soft { font-size: 12px; }
.tabela.compacta .pill-sel { width: 64px; font-size: 10.5px; padding: 3px 6px; }
.tabela.compacta .wa-ico { width: 22px; height: 22px; border-radius: 6px; }
.tabela.compacta .wa-ico svg { width: 13px; height: 13px; }
/* Pills de data mais justas na tabela compacta. */
.tabela.compacta .pill.mes { min-width: 0; padding: 2px 6px; font-size: 10.5px; }

/* Data editável na célula: o input date invisível cobre-a e o clique abre o
   calendário nativo; a escolha grava logo. */
.cel-data { position: relative; display: inline-block; cursor: pointer; }
.cel-data input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; border: 0; padding: 0; margin: 0;
}
.cel-data:hover { filter: brightness(.92); }

/* O nome abre a ficha. */
.nome-link { cursor: pointer; color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.nome-link:hover { border-bottom-color: var(--ink-soft); }

/* Situação como bola de cor. O nome vai no title/aria-label. */
.bola {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.bola.ok { background: #1f9d57; }
.bola.aviso { background: #e0a83a; }
.bola.mau { background: #d23b3b; }
.bola.nd { background: #c3c9d2; }

/* Botões WhatsApp: logo + verde, sempre — regra do cockpit. */
.btn-wa {
  display: inline-flex; align-items: center; gap: 6px;
  background: #25d366; color: #fff !important; border: 0; border-radius: 8px;
  padding: 5px 10px; font-size: 12.5px; font-weight: 650; text-decoration: none; cursor: pointer;
}
.btn-wa svg { width: 15px; height: 15px; fill: currentColor; }
.btn-wa:hover { filter: brightness(.95); }

/* Nas tabelas o WhatsApp é só o logo, em coluna própria de largura fixa —
   botões colados a nomes de larguras diferentes nunca alinham. */
.wa-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; background: #25d366;
}
.wa-ico svg { width: 15px; height: 15px; fill: #fff; }
.wa-ico:hover { filter: brightness(.95); }
/* Slot fixo: com ou sem WhatsApp, o que vem a seguir começa no mesmo sítio. */
.wa-slot { display: inline-flex; width: 26px; margin-right: 6px; vertical-align: middle; }

/* Pills de mês (Pago/Recibo/Últ. pago) com largura uniforme — "ND" e "MAR 26"
   ocupam o mesmo espaço e a coluna lê-se a direito. */
.pill.mes { min-width: 56px; text-align: center; display: inline-block; }

/* Owner: o senhorio é que trata — preto, texto branco. */
.pill.owner { background: var(--ink); color: #fff; }

/* Select disfarçado de pill nas colunas Pago/Recibo: escolher grava logo. */
.pill-sel {
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer;
  width: 72px; border-radius: 999px; padding: 3px 8px; text-align: center;
  font-size: 11px; font-weight: 600; font-family: inherit;
}
.pill-sel:hover { filter: brightness(.95); }
.pill-sel.green { background: var(--green-bg); color: var(--green); }
.pill-sel.amber { background: var(--amber-bg); color: var(--amber); }
.pill-sel.red { background: var(--red-bg); color: var(--red); }
.pill-sel.grey { background: var(--brand-soft); color: var(--ink-soft); }
.pill-sel.owner { background: var(--ink); color: #fff; }
.pill-sel.vazia { background: var(--bg); color: var(--ink-soft); border: 1px dashed var(--line); }
.pill-sel option { background: var(--panel); color: var(--ink); font-size: 13px; }
/* Estados das leads têm nomes longos — pill mais larga, texto à esquerda. */
.pill-sel.lead { width: 142px; text-align: left; padding-left: 10px; }

/* Seleção múltipla nas tabelas. */
.tick-sel { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); margin: 0; }
.tabela .trow.sel { background: var(--blue-bg); }
.tabela .trow.sel:hover { background: #dbe9f7; }

/* Cabeçalho de grupo (agrupar por imóvel ou por estado) — colapsável. */
.tgrupo {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--bg); border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--brand); cursor: pointer; user-select: none; list-style: none;
}
.tgrupo::-webkit-details-marker { display: none; }
.tgrupo::before { content: '▸'; font-size: 11px; transition: transform .12s ease; }
details[open] > .tgrupo::before { transform: rotate(90deg); }
.tgrupo .conta { color: var(--ink-soft); font-weight: 400; text-transform: none; letter-spacing: 0; }
/* Grupos por estado herdam a cor do funil; OUT fica sombreado a vermelho. */
.tgrupo.g-red { background: var(--red-bg); color: var(--red); }
.tgrupo.g-green { background: var(--green-bg); color: var(--green); }
.tgrupo.g-amber { background: var(--amber-bg); color: var(--amber); }
.tgrupo.g-blue { background: var(--blue-bg); color: var(--blue); }
.tgrupo.g-owner { background: var(--ink); color: #fff; }

/* NEW: primeiro contacto com a mensagem pronta.
   Verde = por contactar · cinzento = já saiu de 0 - Lead · vermelho = sem
   número a funcionar (tick S/№ marcado à mão). */
.btn-new {
  display: inline-block; background: var(--green); color: #fff !important;
  border-radius: 7px; padding: 3px 9px; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-decoration: none;
}
.btn-new:hover { filter: brightness(.94); }
.btn-new.done { background: #b6bdc7; }
.btn-new.mau { background: var(--red); }

/* Tick S/№ — vermelho quando marcado. */
.tick-sel.semwa { accent-color: var(--red); }

/* Primeiro contacto: mensagem pronta + botão do WhatsApp Web. */
.primeiro-contacto {
  grid-column: 1 / -1; background: #e3f6ec; border-radius: 10px;
  padding: 12px; margin-bottom: 14px; display: grid; gap: 10px; justify-items: start;
}
.primeiro-contacto .msg-previa {
  background: #fff; border-radius: 8px; padding: 10px 12px;
  font-size: 13px; line-height: 1.55; white-space: pre-wrap; width: 100%;
}
.btn-wa.grande { padding: 9px 16px; font-size: 14px; }
.btn-wa.grande svg { width: 17px; height: 17px; }

/* Documentos na ficha do imóvel: uma linha por tipo, vários anexos por tipo. */
.docs-grid { grid-column: 1 / -1; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.doc-linha {
  display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; background: var(--panel);
}
.doc-linha:last-child { border-bottom: 0; }
.doc-linha:nth-child(odd) { background: var(--bg); }
.doc-linha b { font-size: 12.5px; }
.doc-linha .doc-lista { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }

/* Pesquisa curta nas toolbars apertadas (Leads) — para caber tudo numa linha. */
.toolbar input.search.curta { flex: 0 1 170px; min-width: 110px; }

/* Perfil declarado no Idealista e conversa, na ficha da lead. */
.perfil-idealista {
  grid-column: 1 / -1; background: var(--brand-soft); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; line-height: 1.55; margin-bottom: 14px;
}
textarea.conversa { min-height: 190px; font-size: 13px; line-height: 1.5; }

/* Passos da recolha do Idealista. */
.passos { margin: 16px 0 0; display: grid; gap: 14px; font-size: 14px; }
.passos > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.atalho-drag { cursor: grab; text-decoration: none; display: inline-block; }
.atalho-drag:active { cursor: grabbing; }

/* Aviso no painel de import: anunciados que a Inbox ainda não tem. */
.aviso-inbox {
  background: var(--amber-bg); color: #7a5205; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; line-height: 1.5; margin-bottom: 14px;
}

/* Painel de import: uma linha por imóvel da Inbox. */
.cod-linha {
  display: grid; grid-template-columns: 20px 100px 120px 1fr; gap: 10px; align-items: center;
  padding: 9px 8px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.5px;
}
.cod-linha:last-child { border-bottom: 0; }
.cod-linha:hover { background: var(--bg); }
.cod-linha input { width: 15px; height: 15px; accent-color: var(--brand); }
.cod-linha .cod-nome { font-weight: 650; }
.cod-linha .cod-conta { font-size: 12.5px; white-space: nowrap; }
.cod-linha .cod-ex { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Apagar em lote: vermelho, apagado enquanto não há seleção. */
.btn.apagar-lote { background: var(--red); border-color: var(--red); color: #fff; }
.btn.apagar-lote:hover { filter: brightness(.94); background: var(--red); }
.btn.apagar-lote[disabled] { opacity: .35; cursor: default; filter: none; }

/* Telefone acionável. */
.acao-tel {
  text-decoration: none; font-weight: 600; white-space: nowrap;
  padding: 1px 7px; border-radius: 6px; color: var(--blue); background: var(--blue-bg);
}
.acao-tel:hover { filter: brightness(.96); }

/* IBAN com botão de copiar ao lado. */
.iban { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Calendário mensal ---------- */
.cal-wrap { overflow-x: auto; }
.cal {
  min-width: 700px; background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.cal-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.cal-head div {
  padding: 8px 10px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-soft); font-weight: 600;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dia {
  min-height: 92px; padding: 6px 6px 8px; border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px;
}
.cal-dia:nth-child(7n) { border-right: 0; }
.cal-dia.fora { background: var(--bg); }
.cal-dia .n { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.cal-dia.fora .n { opacity: .45; }
.cal-dia.hoje { background: var(--brand-soft); }
.cal-dia.hoje .n {
  color: #fff; background: var(--brand); width: 22px; height: 22px;
  border-radius: 50%; display: grid; place-items: center;
}
.cal-ev {
  font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 5px;
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-ev:hover { filter: brightness(.95); }
.cal-ev.carta { background: var(--blue-bg); color: var(--blue); }
.cal-ev.aumento { background: var(--green-bg); color: var(--green); }
.cal-ev.norenew { background: var(--amber-bg); color: var(--amber); }
.cal-ev.fim { background: var(--red-bg); color: var(--red); }
.cal-ev.saida { background: rgba(107, 70, 193, .12); color: var(--purple); }
.cal-ev.ce { background: var(--brand-soft); color: var(--ink-soft); }
.cal-ev.visita { background: #d7f3e3; color: #0d6b41; font-weight: 700; }
.cal-mes-titulo { font-size: 16px; font-weight: 650; min-width: 150px; text-align: center; }
.cal-legenda { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* Cartões dos proprietários. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 18px; }
.cardp { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.cardp h3 { font-size: 16px; margin-bottom: 2px; }
.cardp .sub { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 10px; }
.cardp .contactos { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cardp .li { font-size: 13.5px; padding: 4px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 8px; }
.cardp .li:last-child { border-bottom: 0; }
.cardp .li .lado { color: var(--ink-soft); white-space: nowrap; }
