/* Identidade ImobiControl: azul da marca, grafite e azul-claro. */
:root {
  --blue: #2955a6;
  --navy: #252d40;
  --ink: #2d3546;
  --muted: #66748a;
  --line: #e3e8f2;
  --bg: #f4f6fb;
  --accent: #edf2fc;
  --radius: 17px;
}
body { background: radial-gradient(ellipse at 95% 0, #e7edf9, transparent 50%), var(--bg); }
button, a, input, select, textarea { transition: background .2s, border-color .2s, color .2s, box-shadow .2s, transform .2s; }
button:focus-visible, a:focus-visible { outline: 3px solid #91aecf; outline-offset: 4px; }
::selection { background: #d6e3ff; color: #233963; }
.primary { background: linear-gradient(120deg, #2955a6, #4870b6); box-shadow: 0 5px 13px #2955a623; border: 1px solid #ffffff15; border-radius: 10px; }
.primary:hover { background: linear-gradient(120deg, #24498f, #3b64ad); box-shadow: 0 8px 20px #2955a638; transform: translateY(-2px); }
.primary:active, .secondary:active { transform: translateY(0); }
.secondary, .danger { border-radius: 10px; }
.secondary:hover { border-color: #b5c7e5; background: #f1f5fc; transform: translateY(-1px); }
button:disabled { transform: none; box-shadow: none; }
input, select, textarea { border-radius: 10px; background: #fbfcff; min-height: 44px; }
input:hover, select:hover, textarea:hover { border-color: #b3c1d8; }
input:focus, select:focus, textarea:focus { background: white; border-color: #5a80bd; box-shadow: 0 0 0 4px #2955a612, 0 4px 12px #25324d08; }
input[readonly] { background: #eff2f7; }
label:focus-within { color: var(--blue); }
.password-wrap { background: #fbfcff; border-radius: 10px; transition: box-shadow .2s, border-color .2s; }
.password-wrap:focus-within { border-color: #5a80bd; box-shadow: 0 0 0 4px #2955a612; }
.password-wrap input:focus { box-shadow: none; background: transparent; }
.check-label { transition: border-color .2s, background .2s, box-shadow .2s; }
.form-grid .check-label:has(input:checked) { background: #edf3ff; border-color: #b7c9e8; color: #2955a6; }
.check-label input { appearance: none; width: 34px; height: 20px; min-height: 20px; padding: 0; flex: 0 0 34px; border: 0; border-radius: 20px; background: #bfc8d7; position: relative; cursor: pointer; }
.check-label input::after { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: white; border-radius: 50%; box-shadow: 0 1px 3px #0002; transition: transform .2s; }
.check-label input:checked { background: #3d66aa; }
.check-label input:checked::after { transform: translateX(14px); }

/* Acesso */
.login-screen { grid-template-columns: 1.08fr 1fr; background: #f8faff; }
.login-art { padding: 38px 9% 34px; isolation: isolate; background: radial-gradient(ellipse at 0 0, #526c9c66, transparent 55%), radial-gradient(ellipse at 100% 95%, #568ba64a, transparent 58%), linear-gradient(145deg, #242936, #283b61 75%, #354e73); }
.login-art::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(#ffffff04 1px, transparent 1px), linear-gradient(90deg, #ffffff04 1px, transparent 1px); background-size: 65px 65px; mask-image: linear-gradient(to bottom, transparent, black); }
.login-art::after { content: ''; position: absolute; width: 470px; height: 470px; top: 25%; left: 35%; border: 1px solid #ffffff0c; border-radius: 50%; box-shadow: 0 0 0 80px #ffffff02, 0 0 0 160px #ffffff02; z-index: -1; }
.login-brand { align-self: flex-start; margin: 0; }
.login-brand img { width: 155px; height: auto; display: block; object-fit: contain; }
.login-message { margin: 48px 0 60px; position: relative; z-index: 1; }
.login-message .eyebrow { color: #afc9df; font-size: 10px; letter-spacing: 2.5px; }
.login-message h1 { font-size: clamp(30px, 3.1vw, 51px); line-height: 1.2; letter-spacing: -1.7px; font-weight: 600; }
.login-message h1 em { font-style: normal; color: #a9c9e0; }
.login-message p { color: #b7c4d8; max-width: 365px; font-size: 14px; line-height: 1.85; }
.login-features { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 30px; }
.login-features span { border: 1px solid #b7cce32b; background: #ffffff06; border-radius: 30px; padding: 8px 15px; font-size: 10px; color: #cedbeb; backdrop-filter: blur(8px); }
.login-art-footer { display: flex; align-items: center; gap: 12px; color: #b6c6db; font-size: 11px; z-index: 1; }
.brand-line { width: 28px; height: 2px; background: #a6c1da; }
.login-watermark { position: absolute; width: 340px; height: auto; right: -65px; bottom: -20px; opacity: .065; z-index: -1; pointer-events: none; }
.login-form-wrap { padding: 42px 12%; background: radial-gradient(ellipse at 100% 0, #e8eefb, transparent 65%); }
.login-form-wrap form { max-width: 385px; animation: enter-screen .55s ease both; }
.form-logo { width: 148px; height: auto; display: block; object-fit: contain; margin: 0 0 36px; }
.login-form-wrap .eyebrow { font-size: 9px; letter-spacing: 1.9px; }
.login-form-wrap h2 { font-size: 28px; letter-spacing: -.9px; margin-bottom: 10px; }
.login-form-wrap .muted { font-size: 12px; }
.login-form-wrap label { margin-top: 23px; }
.login-form-wrap input { min-height: 49px; background: #ffffffa6; }
.login-form-wrap .password-wrap input { background: transparent; }
.login-submit { margin-top: 25px; min-height: 49px; align-items: center; }
.login-submit span { font-size: 18px; transition: transform .2s; }
.login-submit:hover span { transform: translateX(4px); }
.login-help { font-size: 11px; }
/* Tela de login: download do aplicativo para Windows (só quando o ZIP está no servidor). */
.login-download-box { display: grid; gap: 6px; margin-top: 12px; }
.login-download-box[hidden] { display: none; }
.login-download-zip { justify-self: center; font-size: 11px; color: var(--muted); }
.login-download-zip:hover { color: var(--blue); }
.login-download { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid #d6e2f7; border-radius: 12px; background: linear-gradient(135deg, #f5f8fe, #eaf1fc); color: var(--blue); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.login-download[hidden] { display: none; }
.login-download:hover { border-color: #9fbbe9; box-shadow: 0 6px 16px -8px #2955a680; transform: translateY(-1px); }
.login-download:focus-visible { outline: 3px solid #2955a64d; outline-offset: 2px; }
.login-download svg { flex: 0 0 auto; }
.login-download span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.login-download strong { font-size: 13px; }
.login-download small { font-size: 11px; color: var(--muted); }
/* Manter conectado: interruptor com trilho cinza que fica azul quando ligado. */
.login-form-wrap label.keep-signed { position: relative; flex-direction: row; align-items: center; gap: 10px; margin-top: 18px; width: fit-content; cursor: pointer; user-select: none; }
:is(.keep-signed, .permission-row) input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; border: 0; opacity: 0; }
.switch-track { position: relative; flex: none; width: 42px; height: 24px; border-radius: 999px; background: #8a8f98; transition: background .2s; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #e9ecf1; box-shadow: 0 1px 3px #0003; transition: transform .2s, background .2s; }
:is(.keep-signed, .permission-row) input:checked + .switch-track { background: var(--blue); }
:is(.keep-signed, .permission-row) input:checked + .switch-track::after { transform: translateX(18px); background: #fff; }
:is(.keep-signed, .permission-row) input:focus-visible + .switch-track { box-shadow: 0 0 0 4px #2955a633; }
/* Usuários e acessos, aba Permissões: um quadro por tela (acesso à tela e, recuadas, as ações), em duas colunas. */
.permissions-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.permissions-head p { margin: 0; flex: 1 1 320px; }
.permissions-head div { display: flex; gap: 14px; }
.permissions-admin-note { margin: 0 0 12px; padding: 10px 14px; border: 1px solid #c9d7ef; border-radius: 10px; background: #eef4ff; font-size: 13px; color: var(--ink); }
.permissions-list { column-count: 2; column-gap: 14px; }
.permission-screen { display: grid; gap: 6px; margin: 0 0 14px; padding: 12px; border: 1px solid #e3e8f2; border-radius: 12px; break-inside: avoid; }
.permission-screen h4 { margin: 0 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); }
label.permission-row { position: relative; flex-direction: row; align-items: center; gap: 12px; margin: 0; padding: 9px 12px; border: 1px solid #e3e8f2; border-radius: 10px; background: #fbfcff; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; user-select: none; }
label.permission-row:hover { border-color: #c9d7ef; background: #f5f8fe; }
label.permission-row.permission-action { margin-left: 18px; font-weight: 500; }
label.permission-row.inactive { opacity: .5; cursor: not-allowed; }
@media (max-width: 760px) { .permissions-list { column-count: 1; } }
.login-form-wrap footer { margin-top: 35px; }

/* Área de trabalho */
#sidebar { background: radial-gradient(ellipse at 0 0, #45639350, transparent 65%), linear-gradient(170deg, #252c3d, #263650); padding-top: 24px; border-right: 1px solid #354768; }
#sidebar .sidebar-brand { margin: 0 auto 25px; justify-content: center; }
.sidebar-brand img { width: 132px; height: auto; display: block; }
/* Menu compacto: itens mais baixos e grupos separados por uma linha (sem títulos), para caber mais menus. */
nav a { color: #bfcbe0; padding: 7px 14px; margin-bottom: 2px; position: relative; font-size: 13.5px; }
nav .nav-separator { height: 1px; margin: 9px 12px; background: linear-gradient(90deg, #ffffff00, #ffffff2e 18%, #ffffff2e 82%, #ffffff00); }
nav a.active, nav a.active:hover { background: linear-gradient(110deg, #436bb259, #587fba29); box-shadow: inset 0 0 0 1px #8cabe326; color: #fff; }
nav a.active::before { content: ''; position: absolute; left: 0; top: 27%; height: 46%; width: 3px; background: #a4c6df; border-radius: 4px; }
nav a:hover { background: #ffffff09; transform: translateX(3px); }
/* Ícones de traço fino do menu e dos quadros da Visão geral (na cor do texto; brancos no item ativo). */
nav .nav-icon { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; }
nav .nav-icon svg { width: 19px; height: 19px; }
nav a:not(.active) .nav-icon { color: #c9d5ea; }
.stat-icon svg { width: 20px; height: 20px; }
.topbar { background: #ffffffbf; backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; border-bottom-color: #dde4ef99; }
.avatar { background: linear-gradient(135deg, #e0e9f8, #d7e8ed); border: 2px solid white; box-shadow: 0 2px 8px #23396614; width: 38px; height: 38px; }
.user-menu strong { font-size: 12px; }
.page-heading { animation: enter-screen .35s ease both; }
.page-heading h1 { letter-spacing: -.85px; }
.panel, .stat { border-color: #e3e8f1; box-shadow: 0 3px 12px #26375a04; }
.panel { animation: enter-screen .4s ease both; }
.stat { transition: transform .25s, box-shadow .25s, border-color .25s; animation: enter-screen .45s ease both; position: relative; overflow: hidden; }
.stat:nth-child(2) { animation-delay: .05s; }
.stat:nth-child(3) { animation-delay: .1s; }
.stat:nth-child(4) { animation-delay: .15s; }
.stat:hover { transform: translateY(-4px); border-color: #bacce9; box-shadow: 0 13px 25px #293e6510; }
.stat strong { color: #303f59; }
.stat-icon { background: linear-gradient(135deg, #ecf0fa, #e7f1f6); color: #466ba8; border: 1px solid #e0e8f7; border-radius: 11px; width: 37px; height: 37px; }
.welcome-card { background: radial-gradient(ellipse at 90% 50%, #6893b33b, transparent 50%), linear-gradient(115deg, #2c3548, #354f7c); color: white; border: 1px solid #4a6488; border-radius: 19px; box-shadow: 0 10px 25px #253e6110; position: relative; overflow: hidden; padding: 30px 33px; }
.welcome-card .eyebrow { color: #b1cadf; font-size: 9px; }
.welcome-card h2 { color: #f3f7ff; font-size: 24px; }
.welcome-card p { color: #c5d1e3; }
.welcome-card .primary { display: inline-block; background: #f4f7ff; border-color: #fff; color: #31528a; box-shadow: 0 4px 12px #152b4b20; }
.welcome-card .primary:hover { background: #e2ebfa; }
.welcome-graphic { margin: 0 10px 0 35px; opacity: .85; flex: 0 0 135px; }
.welcome-graphic img { display: block; width: 135px; height: auto; filter: drop-shadow(0 12px 22px #17233830); }
.quick-link { border-radius: 8px; transition: background .2s, padding .2s; }
.quick-link:hover { background: #f5f7fc; padding-left: 8px; padding-right: 8px; }
.quick-link .arrow { transition: transform .2s; }
.quick-link:hover .arrow { transform: translateX(3px); color: var(--blue); }
.panel-heading { background: linear-gradient(110deg, #fff, #fbfcff); }
th { background: #f7f9fd; color: #64738c; }
tbody tr { transition: background .18s; }
tbody tr:hover { background: #f1f5fc; }
/* Linha selecionada com um clique: azul, com marca à esquerda. */
tbody tr.row-selected, tbody tr.row-selected:hover { background: #d4e3fb; }
tbody tr.row-selected > td:first-child { box-shadow: inset 4px 0 0 var(--blue); }
.tag { background: #edf2fa; color: #456597; border: 1px solid #dbe5f4; border-radius: 20px; }
.toolbar .search-wrap input { background: #f7f9fd; }
.count-badge { background: #edf2fc; color: #476aa3; font-size: 13px; font-weight: 700; padding: 8px 14px; }
#lookup-pagination > span { font-size: 13px; font-weight: 700; color: #476aa3; }
.detail-field { padding: 12px 14px; background: #f8faff; border: 1px solid #eaf0f7; border-radius: 10px; }
dialog { border-radius: 19px; border-color: #ffffffa3; box-shadow: 0 32px 100px #18264050; }
dialog[open] { animation: enter-dialog .25s ease both; }
dialog::backdrop { background: #1c294666; backdrop-filter: blur(6px); }
.dialog-header { background: linear-gradient(100deg, #fff, #eff4fc); }
.tabs button { border-radius: 8px; }
.tabs button:hover { background: #f2f5fb; color: var(--blue); }
.tabs button.active { background: #eaf0fc; box-shadow: inset 0 -2px #4d74b7; }
.dialog-footer { background: #f9fbfdef; backdrop-filter: blur(12px); }
#toast { background: linear-gradient(120deg, #293750, #3d5d8b); border: 1px solid #5b7396; animation: enter-screen .25s ease; }
.loading::before { content: ''; display: block; width: 26px; height: 26px; margin: 0 auto 17px; border: 3px solid #dce5f5; border-top-color: #436caf; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes enter-screen { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes enter-dialog { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 1500px) { .login-art { padding: 50px 10% 40px; } .login-brand img { width: 180px; } }
@media (max-width: 1100px) { .login-art { padding: 35px; } .login-form-wrap { padding: 40px 10%; } .login-message h1 { font-size: 36px; } }
@media (max-width: 760px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-art { padding: 25px 28px; }
  .login-brand img { width: 100px; }
  .login-message { margin: 24px 0 6px; }
  .login-message h1 { font-size: 28px; letter-spacing: -.8px; }
  .login-message .eyebrow { font-size: 8px; letter-spacing: 1.5px; }
  .login-message p, .login-features, .login-art-footer { display: none; }
  .login-watermark { width: 230px; right: -35px; bottom: -70px; }
  .login-form-wrap { padding: 30px 26px; }
  .form-logo { display: none; }
  .login-form-wrap h2 { font-size: 25px; }
  .welcome-card { padding: 24px; }
  .welcome-card h2 { font-size: 21px; }
  .welcome-graphic { display: none; }
  .topbar { padding: 0 16px; }
  .sidebar-brand img { width: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: white; }
  .panel, .stat, .document { box-shadow: none; animation: none; }
  .topbar { display: none; }
}

/* Evita composição de blur e animação de grandes superfícies ao editar. */
dialog::backdrop { backdrop-filter: none; background: #1c294666; }
dialog[open] { animation: none; }
.dialog-footer { backdrop-filter: none; background: #f9fbfd; }
.topbar { backdrop-filter: none; background: #fff; }
input, select, textarea, .password-wrap { transition: none; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 2px #2955a619; }
.lookup-row { align-items: center; min-width: 0; }
.lookup-row input { min-width: 0; text-overflow: ellipsis; cursor: default; background: white; }
.lookup-trigger { display: grid; place-items: center; flex: 0 0 42px; min-height: 42px; }
#lookup-dialog { width: min(900px,95vw); }
#lookup-filter { align-items: end; }
#lookup-filter label { flex: 1; }
#lookup-results { max-height: 45vh; min-height: 130px; padding: 0; }
#lookup-results td { white-space: normal; overflow-wrap: anywhere; }
#lookup-results td:last-child { white-space: nowrap; }
.lookup-city { display: block; color: var(--muted); margin-top: 4px; }
#lookup-title { margin: 0; font-size: 20px; }
@media (prefers-reduced-motion: reduce) { .lookup-trigger { transition: none; } }

/* Navegacao dos modulos do novo banco. */
#sidebar nav { overflow-y: auto; min-height: 0; flex: 1; }
.document .detail-grid { padding: 12px 0; }

/* Abas de sócios, filiação e cônjuge no editor de cadastros. */
.person-links { display: flex; flex-direction: column; gap: 14px; }
.person-links-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.person-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; }
.person-card { display: flex; gap: 16px; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fbfcff; }
.person-photo { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--accent); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-body { flex: 1; min-width: 0; }
.person-title strong { display: block; font-size: 14px; }
.person-title small { color: var(--muted); font-size: 11px; }
.person-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 12px 0; }
.person-card dl .wide { grid-column: 1 / -1; }
.person-card dt { font-size: 10px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.person-card dd { margin: 2px 0 0; font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 440px) { .person-card { flex-direction: column; } .person-card dl { grid-template-columns: 1fr; } }

/* Listagens de cadastros e imóveis com fonte maior e coluna de proprietários. */
.table-large th { font-size: 11px; }
.table-large td { font-size: 13.5px; }
.table-large td a { color: var(--blue); text-decoration: none; }
.table-large td a:hover { text-decoration: underline; }
.table-large td a.secondary { display: inline-block; padding: 7px 12px; font-size: 12px; text-decoration: none; }
.owners-more { margin-left: 6px; border: 1px solid #c9d7ef; background: var(--accent); color: var(--blue); border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 700; cursor: pointer; }
.owners-more:hover { background: #dfe8f9; }
#owners-subtitle { margin: 6px 0 0; }

/* Cartões de pessoas vinculadas: abrir cadastro (azul) e excluir (lixeira vermelha). */
.add-link-primary { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; }
.person-card { position: relative; }
.person-card.has-actions .person-title { padding-right: 84px; }
.card-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.trash-button, .open-person-button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
.trash-button { color: #d23c3c; }
.trash-button:hover { background: #fdecec; border-color: #f3c4c4; transform: translateY(-1px); }
.trash-button:focus-visible { outline: 3px solid #f0a3a3; outline-offset: 2px; }
.open-person-button { color: #2955a6; }
.open-person-button:hover { background: #eaf0fc; border-color: #c9d7ef; transform: translateY(-1px); }
.open-person-button:focus-visible { outline: 3px solid #91aecf; outline-offset: 2px; }

/* Mensagens das telas de edição. */
dialog.message-info { width: min(440px, 92vw); padding: 28px 28px 24px; text-align: center; background: #eef4ff; border: 1.5px solid #4d74b7; border-radius: 20px; box-shadow: 0 25px 80px #2955a633; }
.message-info::backdrop { background: #102c4540; backdrop-filter: blur(2px); }
.message-icon { width: 58px; height: 58px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: #dce7fb; color: #2955a6; }
.message-info h2 { margin: 0 0 10px; font-size: 19px; color: #1f3f7a; }
.message-info p { margin: 0; font-size: 13.5px; line-height: 1.6; color: #34486b; white-space: pre-line; }
.message-actions { display: flex; justify-content: center; margin-top: 22px; }
.message-actions .primary { min-width: 130px; }

/* Tela sem permissão de acesso (usuario_permissao.valor = 0). */
dialog.access-denied { width: min(440px, 92vw); padding: 28px 28px 24px; text-align: center; background: #fffaf0; border: 1.5px solid #e0a13a; border-radius: 20px; box-shadow: 0 25px 80px #7a4f1f33; }
.access-denied::backdrop { background: #102c4540; backdrop-filter: blur(2px); }
.access-icon { width: 58px; height: 58px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: #fdecc8; color: #c27c0e; }
.access-denied h2 { margin: 0 0 10px; font-size: 19px; color: #7a4a06; }
.access-denied p { margin: 0; font-size: 13.5px; line-height: 1.6; color: #6b5134; white-space: pre-line; }
nav a.nav-locked { opacity: .55; }
nav a.nav-locked .nav-lock { margin-left: auto; display: inline-flex; }

/* Confirmação de exclusão. */
dialog.confirm-danger { width: min(440px, 92vw); padding: 30px 28px 26px; text-align: center; background: #fff5f5; border: 1.5px solid #e05252; border-radius: 20px; box-shadow: 0 25px 80px #7a1f1f33; }
.confirm-icon { width: 58px; height: 58px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: #fde3e3; color: #d23c3c; }
.confirm-danger h2 { margin: 0 0 10px; font-size: 19px; color: #8f2525; }
.confirm-danger p { margin: 0; font-size: 13.5px; line-height: 1.6; color: #6e3a3a; }
.confirm-danger p strong { color: #8f2525; }
.confirm-danger p span { display: block; margin-top: 8px; font-size: 12px; color: #946262; }
.confirm-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.confirm-actions button { min-width: 130px; }
#confirm-accept { border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 600; font-size: 12px; color: #fff; background: #d23c3c; box-shadow: 0 5px 13px #d23c3c33; cursor: pointer; }
#confirm-accept:hover { background: #b92f2f; }

/* Aba Contato do editor de cadastros. */
.contact-add { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; }
.contact-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: #fbfcff; overflow: hidden; }
.contact-item { display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.contact-item:last-child { border-bottom: 0; }
.contact-type { flex: 0 0 82px; text-align: center; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.contact-phone { background: var(--accent); color: var(--blue); }
.contact-mobile { background: #e8f6ef; color: #23784b; }
.contact-email { background: #f3edfb; color: #6a3fa6; }
.contact-value { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.contact-value:hover { color: var(--blue); text-decoration: underline; }
.contact-item .trash-button { position: static; flex: 0 0 36px; }
@media (max-width: 560px) { .contact-add { grid-template-columns: 1fr; } }

/* Abas do editor: largura total, degradê e fonte maior. */
#form-tabs { display: flex; flex-wrap: nowrap; gap: 6px; padding: 14px 28px; overflow-x: auto; background: linear-gradient(180deg, #f8faff, #f1f5fc); border-bottom: 1px solid var(--line); }
#form-tabs button { flex: 1 1 0; min-width: max-content; padding: 12px 18px; font-size: 13.5px; font-weight: 600; color: #5d6b82; background: linear-gradient(180deg, #ffffff, #eef2f9); border: 1px solid #dfe6f2; border-radius: 12px; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s, transform .2s; }
#form-tabs button:hover { color: var(--blue); background: linear-gradient(180deg, #ffffff, #e3ebf9); border-color: #c5d4ee; transform: translateY(-1px); }
#form-tabs button.active { color: #fff; background: linear-gradient(120deg, #2955a6, #4870b6); border-color: transparent; box-shadow: 0 6px 16px #2955a633, inset 0 -2px #ffffff26; }
#form-tabs button:focus-visible { outline: 3px solid #91aecf; outline-offset: 2px; }
@media (max-width: 760px) { #form-tabs { padding: 12px 16px; } #form-tabs button { padding: 10px 14px; font-size: 12.5px; } }

/* Editor de imóveis: carrossel de fotos. */
.editor-gallery { padding: 18px 28px 12px; border-bottom: 1px solid var(--line); background: radial-gradient(ellipse at 50% 0, #edf2fc, transparent 70%), #fbfcff; }
.gallery-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.gallery-head strong { font-size: 14px; }
.gallery-count { margin-left: 10px; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--blue); font-size: 11.5px; font-weight: 700; }
.gallery-tools { display: flex; align-items: center; gap: 12px; }
.gallery-tools .muted { font-size: 12px; }
#gallery-add.disabled { opacity: .45; cursor: not-allowed; }
.gallery-carousel { display: flex; align-items: center; gap: 8px; }
.gallery-nav { flex: 0 0 38px; height: 38px; border: 1px solid #d6e0f1; border-radius: 50%; background: #fff; color: var(--blue); font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 4px 12px #2955a614; }
.gallery-nav:hover { background: #eaf0fc; }
.gallery-track { flex: 1; min-width: 0; display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; scroll-behavior: smooth; cursor: grab; user-select: none; scrollbar-width: thin; }
.gallery-track.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.gallery-slide { position: relative; flex: 0 0 220px; margin: 0; scroll-snap-align: start; }
.gallery-open { display: block; width: 100%; height: 150px; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: var(--accent); cursor: zoom-in; box-shadow: 0 0 0 1px #d6e0f1, 0 8px 18px #2955a61a; }
.gallery-track.dragging .gallery-open { cursor: grabbing; }
.gallery-open img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; pointer-events: none; }
.gallery-open:hover img { transform: scale(1.04); }
.gallery-slide figcaption { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: #0f1b2fb3; color: #fff; font-size: 11px; font-weight: 700; }
.gallery-remove { position: absolute; top: 8px; right: 8px; background: #fffffff0; box-shadow: 0 2px 8px #0000001f; }
.gallery-empty { flex: 1; min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px dashed #c5d4ee; border-radius: 14px; color: #8fa3c5; font-size: 13px; }
.gallery-hint { margin: 0; font-size: 11.5px; }
@media (max-width: 560px) { .editor-gallery { padding: 16px; } .gallery-nav { display: none; } .gallery-slide { flex-basis: 78%; } }
/* Documentos do cadastro: mesmo carrossel das fotos; nome e tamanho abaixo do cartão, ações no canto. */
.documents-tools { display: flex; align-items: center; gap: 12px; }
.documents-track { margin-top: 10px; }
.document-slide .gallery-open { cursor: pointer; }
.document-icon { width: 100%; height: 100%; display: grid; place-items: center; font-size: 26px; font-weight: 800; letter-spacing: .06em; color: #fff; background: linear-gradient(140deg, #5d7394, #3f5373); }
.document-icon.document-pdf { background: linear-gradient(140deg, #e05252, #b22d2d); }
.document-icon.document-doc, .document-icon.document-docx { background: linear-gradient(140deg, #3f7de0, #2955a6); }
.document-icon.document-xls, .document-icon.document-xlsx { background: linear-gradient(140deg, #2fa66a, #1d7a4b); }
.document-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.document-actions > * { background: #fffffff0; box-shadow: 0 2px 8px #0000001f; }
.document-slide figcaption { position: static; display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; padding: 0 2px; border-radius: 0; background: none; color: var(--ink); font-size: 12px; font-weight: 600; }
.document-slide figcaption .document-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-slide figcaption small { flex: none; color: var(--muted); font-weight: 500; }

/* Visualizador de fotos com zoom. */
dialog.photo-viewer { width: min(1180px, 96vw); height: min(860px, 94vh); max-height: none; display: none; flex-direction: column; padding: 0; background: linear-gradient(180deg, #f3f7ff, #e4edfc); border: 1px solid #c9d7ef; border-radius: 18px; color: var(--ink); overflow: hidden; box-shadow: 0 25px 80px #2955a633; }
dialog.photo-viewer[open] { display: flex; }
.photo-viewer::backdrop { background: #d6e3f8d9; backdrop-filter: blur(3px); }
.viewer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; }
.viewer-head h2 { margin: 0; font-size: 15px; font-weight: 700; color: #1f3f7a; }
.viewer-head .icon-button { color: #1f4488; }
.viewer-body { flex: 1; min-height: 0; display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.viewer-stage { flex: 1; height: 100%; min-width: 0; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: #dbe6f8; box-shadow: inset 0 0 0 1px #c9d7ef; touch-action: none; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .15s ease-out; user-select: none; }
.viewer-stage.zoomed { cursor: grab; }
.viewer-stage.panning { cursor: grabbing; }
.viewer-stage.panning img { transition: none; }
.viewer-nav { flex: 0 0 46px; height: 46px; border: 0; border-radius: 50%; background: linear-gradient(120deg, #1f4488, #2955a6); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; box-shadow: 0 6px 16px #1f448840; }
.viewer-nav:hover:not(:disabled) { background: linear-gradient(120deg, #173770, #1f4a96); transform: scale(1.05); }
.viewer-nav:disabled { opacity: .3; cursor: default; box-shadow: none; }
.viewer-zoom { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px 20px 20px; }
.zoom-button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #2955a6; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 4px 12px #2955a633; }
.zoom-button:hover:not(:disabled) { background: #1f4488; }
.zoom-button:disabled { opacity: .35; cursor: default; box-shadow: none; }
#zoom-range { width: min(360px, 50vw); min-height: 0; padding: 0; border: 0; background: transparent; accent-color: #2955a6; box-shadow: none; }
#zoom-value { min-width: 48px; font-size: 13px; font-weight: 700; text-align: right; color: #1f3f7a; }
@media (max-width: 560px) { .viewer-nav { flex-basis: 36px; height: 36px; font-size: 24px; } .viewer-body { padding: 0 6px; gap: 4px; } }

/* Editor de imóveis: quadro de valores. */
.values-box { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; min-width: 0; margin: 0; padding: 16px 20px 20px; border: 0; border-radius: 16px; background: linear-gradient(180deg, #eef4ff, #e5edfb); box-shadow: inset 0 0 0 1px #d6e2f7; }
.values-box legend { float: left; width: 100%; padding: 0; margin-bottom: 2px; font-size: 12px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: #2955a6; }
.values-box label { font-size: 13px; }
.values-box input { font-size: 15px; font-weight: 600; background: #fff; text-align: right; font-variant-numeric: tabular-nums; }
.values-box .value-rent, .values-box .value-property { font-size: 14px; font-weight: 700; }
.values-box .value-rent { color: #c62828; }
.values-box .value-rent input { color: #c62828; font-size: 19px; font-weight: 800; }
.values-box .value-property { color: #2955a6; }
.values-box .value-property input { color: #2955a6; font-size: 19px; font-weight: 800; }
@media (max-width: 760px) { .values-box { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .values-box { grid-template-columns: 1fr; } }

/* Listagem de imóveis: aluguel em negrito e selos de situação e tipo. */
.table-large th.col-situacao_imovel, .table-large td.col-situacao_imovel { text-align: center; }
.table-large td.col-valor_aluguel { font-weight: 700; color: #c62828; }
/* Valor do aluguel alinhado à direita nas listas de imóveis, contratos e administração. */
.table-large th.col-valor_aluguel, .table-large td.col-valor_aluguel { text-align: right; font-variant-numeric: tabular-nums; }
.table-large th.col-tipo_de_imovel, .table-large td.col-tipo_de_imovel { text-align: center; }
/* Valores em R$ (0,00): sempre alinhados à direita nas listas, nas fichas e nos campos de edição. */
th.money-col, td.money-col { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.detail-field.money-field > div { text-align: right; font-variant-numeric: tabular-nums; }
.money-field input { text-align: right; font-variant-numeric: tabular-nums; }
/* Editar Adendo: Valor (R$) em destaque, com fonte maior e em negrito. */
.money-featured { font-size: 14.5px !important; font-weight: 700; color: var(--blue); }
.money-featured input { font-size: 21px !important; font-weight: 800; color: var(--navy); background: linear-gradient(180deg, #f5f8ff, #edf2fc); border-color: #b9cbeb; }
/* Código ocupa só o espaço de 6 dígitos (000000). */
.table-large th.col-codigo, .table-large td.col-codigo { width: 1%; white-space: nowrap; padding-left: 16px; padding-right: 12px; font-variant-numeric: tabular-nums; }

/* Filtros avançados (lista de contratos). */
.advanced-filter { padding: 18px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #f8faff, #f1f5fc); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 14px 16px; align-items: end; }
.filter-grid label { font-size: 12px; }
.filter-grid input { background: #fff; }
.filter-range { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; margin: 0; padding: 10px 12px 12px; border: 1px solid #d6e2f7; border-radius: 12px; background: #fff; }
.filter-range legend { padding: 0 6px; font-size: 12px; font-weight: 700; color: #2955a6; }
.filter-range label { font-weight: 500; }
.filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.filter-actions .count-badge { margin-right: auto; }
@media (max-width: 560px) { .filter-range { grid-column: 1 / -1; } }

/* Abas Locador, Locatário e Imóvel do contrato. */
.relation-panel { display: flex; flex-direction: column; gap: 14px; }
.relation-card .person-card { max-width: 760px; }
/* Recibos: campos e cartões com fonte maior para leitura. */
#edit-form.editor-recibos input, #edit-form.editor-recibos textarea, #edit-form.editor-recibos select { font-size: 16px; }
#edit-form.editor-recibos .relation-card .person-title strong { font-size: 20px; line-height: 1.4; }
#edit-form.editor-recibos .relation-card .person-title small { font-size: 14px; }
#edit-form.editor-recibos .relation-card .person-card dt { font-size: 13px; }
#edit-form.editor-recibos .relation-card .person-card dd { font-size: 16px; line-height: 1.5; }
#edit-form.editor-recibos .relation-card .badge { font-size: 14px; }
.property-icon { color: var(--blue); }
.rent-value { color: #c62828; }

/* Aba Vistorias do contrato: formulário de inclusão e lista de cômodos com a descrição. */
.inspection-form { display: grid; gap: 10px; margin: 12px 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--accent); }
.inspection-form textarea { min-height: 96px; resize: vertical; }
.inspection-actions { display: flex; justify-content: flex-end; gap: 10px; }
.inspection-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.inspection-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.inspection-item .inspection-form { margin: 0; }
.inspection-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inspection-head strong { color: var(--blue); letter-spacing: .02em; }
.inspection-head .card-actions { position: static; display: flex; gap: 6px; }
.inspection-text { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.5; color: var(--ink); }

/* Lista de administração: código do contrato de locação em negrito. */
.list-administracao td.col-codigo_contrato { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Editores de contratos e de administração: fonte maior; os campos ocupam a largura da grade. */
:is(.editor-contratos, .editor-administracao, .editor-adendos) .form-grid label { font-size: 13.5px; }
:is(.editor-contratos, .editor-administracao, .editor-adendos) .form-grid input, :is(.editor-contratos, .editor-administracao, .editor-adendos) .form-grid select, :is(.editor-contratos, .editor-administracao, .editor-adendos) .form-grid textarea { font-size: 15px; }
:is(.editor-contratos, .editor-administracao, .editor-adendos) .form-grid input[name="codigo_legado"] { text-align: center; font-variant-numeric: tabular-nums; }
:is(.editor-contratos, .editor-administracao, .editor-adendos) .form-grid input[name="codigo"] { text-align: center; color: var(--blue); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Administração: código do contrato de locação que preenche a tela; demais locadores abaixo do principal. */
:is(.editor-administracao, .editor-adendos) .contract-code input { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
/* Adendo: contrato de locação em negrito, centralizado (000000). */
.editor-adendos .contract-code input { font-weight: 700; text-align: center; }
:is(.editor-contratos, .editor-administracao, .editor-adendos) .extra-people { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* Lista de contratos. */
.table-large td.col-data_inicio_contrato { color: #2955a6; font-weight: 600; }
.due-soon { color: #d9730d; font-weight: 700; }
.due-urgent { color: #c62828; font-weight: 700; }
/* Visão geral: contratos com vencimento nos próximos 30 dias (fonte maior, código 000000, valor em azul). */
.expiring-table td { font-size: 15px; }
.expiring-table th { font-size: 12.5px; }
.expiring-table .col-codigo { width: 1%; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.expiring-table .expiring-value { color: var(--blue); font-weight: 700; }
/* Lista de adendos: valor em azul e negrito. */
.list-adendos td.col-valor { color: var(--blue); font-weight: 700; }
/* Editar cadastro: nome / razão social do registro no título. */
.editor-title-name { color: var(--blue); }
.doc-cell { color: #2955a6; font-weight: 600; font-variant-numeric: tabular-nums; }
.badge-residencial { background: #e1f5e8; color: #1f7a45; }
.badge-comercial { background: #eee6fb; color: #6a3fa6; }

/* Tabelas arrastáveis com o mouse (as barras de rolagem continuam disponíveis). */
.table-scroll { cursor: grab; }
.table-scroll.dragging { cursor: grabbing; user-select: none; }
.table-scroll.dragging * { cursor: grabbing; }
.table-scroll button, .table-scroll a { cursor: pointer; }
.list-scroll { max-height: min(68vh, 760px); overflow: auto; scrollbar-width: thin; }
.list-scroll thead th { position: sticky; top: 0; z-index: 1; box-shadow: inset 0 -1px var(--line); }

/* Botão Novo cadastro das listagens. */
.new-record-button { display: inline-flex; align-items: center; gap: 10px; padding: 8px 20px 8px 8px; border: 0; border-radius: 999px; background: linear-gradient(120deg, #1f4488, #2955a6 55%, #4d7cc9); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .2px; cursor: pointer; box-shadow: 0 8px 20px #2955a640, inset 0 1px #ffffff2e; transition: transform .2s, box-shadow .2s, filter .2s; }
.new-record-button:hover { transform: translateY(-2px); box-shadow: 0 12px 26px #2955a655, inset 0 1px #ffffff2e; filter: brightness(1.05); }
.new-record-button:active { transform: translateY(0); }
.new-record-button:focus-visible { outline: 3px solid #91aecf; outline-offset: 3px; }
.new-record-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #ffffff40, #ffffff14); box-shadow: inset 0 0 0 1px #ffffff55, 0 2px 6px #0f22452e; transition: transform .3s; }
.new-record-button:hover .new-record-icon { transform: rotate(90deg); }

/* Barra de título fixa nas janelas: o conteúdo rola por baixo dela (o rodapé já é fixo embaixo). */
dialog .dialog-header { position: sticky; top: 0; z-index: 20; background: linear-gradient(100deg, #fff, #eff4fc); box-shadow: 0 6px 14px -10px #1f3f7a40; }

/* Botão fechar das telas de edição: círculo em degradê azul com X branco. */
.icon-button.close-circle { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: linear-gradient(135deg, #3f6fc0, #1f3f7a); color: #fff; cursor: pointer; box-shadow: 0 6px 14px #1f3f7a40; transition: transform .2s, box-shadow .2s, filter .2s; }
.icon-button.close-circle:hover { transform: rotate(90deg); filter: brightness(1.08); box-shadow: 0 8px 18px #1f3f7a55; }
.icon-button.close-circle:focus-visible { outline: 3px solid #91aecf; outline-offset: 3px; }
.viewer-head .icon-button.close-circle { color: #fff; }
.badge { display: inline-block; padding: 5px 12px; border: 0; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.2; background: #eef0f4; color: #5d6b82; }
.badge-disponivel { background: #e1f5e8; color: #1f7a45; }
.badge-alugado { background: #e4ecfc; color: #2955a6; }
.badge-vendido { background: #eee6fb; color: #6a3fa6; }
.badge-em-negociacao { background: #fdf0d9; color: #a15c00; }
.badge-retirado { background: #eceef2; color: #5d6b82; }
.badge-casa { background: #eaf8f6; color: #16766b; }
.badge-apartamento { background: #f0effd; color: #4b44b3; }
.badge-loja { background: #fdeff5; color: #b0346a; }
.badge-lote { background: #f2f7e8; color: #5b7a1e; }
.badge-comercio { background: #fdf2ea; color: #b3541e; }
.badge-galpao { background: #f6f1eb; color: #7a5a3a; }

/* Ações padronizadas das listagens. */
.row-actions { display: flex; align-items: center; gap: 6px; }
.row-action { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
.row-action:hover { transform: translateY(-1px); }
.row-action:focus-visible { outline: 3px solid #91aecf; outline-offset: 2px; }
.row-edit { color: #2955a6; }
.row-edit:hover { background: #eaf0fc; border-color: #c9d7ef; }
.row-delete { color: #d23c3c; }
.row-delete:hover { background: #fdecec; border-color: #f3c4c4; }
.row-view { color: #0b8bb5; }
.row-view:hover { background: #e4f5fb; border-color: #b7e2f0; }
.row-print { color: #5d6b82; }
.row-print:hover { background: #eef1f6; border-color: #d4dbe6; }

/* Foto do cadastro no topo do editor e na ficha. */
.editor-photo { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 22px 28px; text-align: center; border-bottom: 1px solid var(--line); background: radial-gradient(ellipse at 50% 0, #edf2fc, transparent 70%), #fbfcff; }
.photo-frame { width: 180px; height: 216px; border-radius: 20px; overflow: hidden; border: 4px solid #fff; box-shadow: 0 0 0 1px #d6e0f1, 0 12px 28px #2955a624; background: var(--accent); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-info { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.photo-info strong { font-size: 14px; }
.photo-info .muted { font-size: 12px; }
.photo-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.photo-pick { display: inline-flex; flex-direction: row; font-size: 12px; cursor: pointer; }
.document-photo { float: right; width: 120px; height: 144px; border-radius: 16px; object-fit: cover; border: 1px solid var(--line); margin: 0 0 12px 16px; }
@media (max-width: 560px) { .editor-photo { padding: 16px; } .photo-frame { width: 150px; height: 180px; } }
/* Foto de perfil do usuário: círculo com borda em degradê azul e preto. */
.editor-photo.photo-user .photo-frame { width: 168px; height: 168px; padding: 5px; border: 0; border-radius: 50%; background: linear-gradient(135deg, #2955a6, #0f1b2f 70%); box-shadow: 0 12px 28px #2955a633; }
.editor-photo.photo-user .photo-frame img { border-radius: 50%; border: 3px solid #fff; background: var(--accent); }
/* Logomarca da empresa: quadrado com cantos arredondados, imagem inteira sem corte. */
.editor-photo.photo-logo .photo-frame { width: 190px; height: 190px; border-radius: 26px; background: #fff; }
.editor-photo.photo-logo .photo-frame img { object-fit: contain; padding: 10px; box-sizing: border-box; }
.document-photo.photo-user { border-radius: 50%; padding: 4px; background: linear-gradient(135deg, #2955a6, #0f1b2f 70%); }
.document-photo.photo-logo { border-radius: 22px; object-fit: contain; background: #fff; }
/* Editar Modelos: página do editor dentro do painel; com um modelo aberto, ocupa a janela inteira. */
.modelos-frame { display: block; width: 100%; height: calc(100vh - 140px); min-height: 520px; border: 0; background: transparent; }
body.modelos-fullscreen .modelos-frame { position: fixed; inset: 0; z-index: 200; width: 100vw; height: 100vh; background: #fff; }
/* Visualizador de documentos (contrato de locação, autorização de administração): PDF do modelo escolhido. */
.document-viewer { width: min(1180px, 96vw); height: 94vh; max-height: 94vh; padding: 0; border: 0; border-radius: 18px; overflow: hidden; }
.document-viewer[open] { display: flex; flex-direction: column; }
.document-viewer-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, #edf2fc, #fff); }
.document-viewer-head > div { flex: 1; min-width: 0; }
.document-viewer-head h2 { margin: 0; font-size: 17px; color: var(--navy); }
.document-viewer-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-viewer-model { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.document-viewer-model select { min-width: 220px; max-width: 320px; font-size: 13px; font-weight: 600; color: var(--blue); }
.document-viewer-model[hidden] { display: none; }
/* Páginas em canvas (PDF.js), no padrão do visualizador de certificados do ProSEG. */
.document-viewer-body { position: relative; display: flex; flex: 1; min-height: 0; overflow: auto; padding: 16px; background: #dfe5ef; }
.pdf-preview { position: relative; margin: auto; flex-shrink: 0; background: #fff; box-shadow: 0 6px 22px #1f2a3d33; }
.pdf-preview[hidden] { display: none; }
.pdf-preview canvas { display: block; width: 100%; height: 100%; }
.document-viewer-status { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; background: #f4f6fb; color: var(--muted); font-size: 14px; text-align: center; }
.document-viewer-status[hidden] { display: none; }
.signed-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #e6f6ee; border: 1px solid #b9e3cb; color: #1d6b43; font-size: 12px; font-weight: 700; }
.signed-badge::before { content: '✓'; }
.signed-badge[hidden] { display: none; }
/* Assinatura digital: opções, quadro arrastável e ajuda do assinador. */
.pdf-sign-options { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--line); background: #f8faff; font-size: 12px; font-weight: 600; color: var(--muted); }
.pdf-sign-options[hidden] { display: none; }
.pdf-sign-options > label { display: flex; flex-direction: row; align-items: center; gap: 7px; margin: 0; }
.pdf-sign-options input[type=number] { width: 80px; min-height: 32px; height: 32px; padding: 4px 8px; }
.pdf-sign-options input[type=checkbox] { width: 16px; height: 16px; min-height: 0; accent-color: var(--blue); }
.pdf-sign-options > span { font-weight: 500; color: #7c889b; }
.pdf-sign-options .text-button { margin-left: auto; }
.pdf-sign-position { position: absolute; display: grid; place-items: center; box-sizing: border-box; border: 2px dashed var(--blue); border-radius: 4px; background: #2955a61a; color: #1f3f7d; cursor: move; touch-action: none; user-select: none; }
.pdf-sign-position[hidden] { display: none; }
.pdf-sign-position.locked { cursor: default; border-style: solid; }
.signature-position-label { display: flex; flex-direction: column; align-items: center; padding: 2px 6px; font-size: 11px; font-weight: 700; text-align: center; line-height: 1.25; pointer-events: none; }
.signature-position-label small { font-size: 9px; font-weight: 500; }
.signature-position-label small[hidden] { display: none; }
/* Selo de documento assinado na prévia do quadro (à esquerda; sozinho, sem o fundo do quadro). */
.pdf-sign-position:has(.signature-seal:not([hidden])) { grid-template-columns: auto 1fr; justify-items: start; gap: 4px; padding-left: 4px; }
.pdf-sign-position.seal-only { background: #2955a60d; }
.signature-seal { display: block; height: calc(100% - 8px); max-width: 40%; aspect-ratio: 400 / 480; object-fit: contain; pointer-events: none; user-select: none; }
.pdf-sign-position.seal-only .signature-seal { max-width: calc(100% - 8px); }
.signature-seal[hidden] { display: none; }
.pdf-sign-options > label[hidden] { display: none; }
.signature-resize-handle { position: absolute; right: -9px; bottom: -9px; width: 20px; height: 20px; min-height: 0; display: grid; place-items: center; padding: 1px; border: 1px solid var(--blue); border-radius: 5px; background: #fff; color: var(--blue); cursor: nwse-resize; touch-action: none; }
.signature-resize-handle svg { width: 14px; height: 14px; }
.signer-help { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 8px 18px; border-top: 1px solid var(--line); background: #fbfcff; font-size: 12px; color: var(--muted); }
.signer-help[hidden], .signer-help [hidden] { display: none; }
.signer-help a { font-weight: 700; color: var(--blue); }
.signer-help p { width: 100%; margin: 2px 0 0; font-weight: 700; color: var(--blue); }
.signer-help .secondary { padding: 6px 12px; min-height: 0; font-size: 12px; }
.viewer-message { margin: 0; padding: 8px 18px; font-size: 13px; background: #eef4ff; color: #274a8a; }
.viewer-message.is-error { background: #fdecec; color: #a32b2b; }
.viewer-message[hidden] { display: none; }
/* Barra inferior: páginas, zoom e ações. */
.pdf-bottom-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); background: #fff; }
.pdf-pagination { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 12px; color: var(--muted); }
.pdf-pagination button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; min-height: 0; padding: 0; border: 1px solid #d6e0f1; border-radius: 9px; background: var(--accent); color: var(--blue); cursor: pointer; }
.pdf-pagination button[hidden] { display: none; }
.pdf-pagination button:hover:not(:disabled) { background: #dfe8f8; }
.pdf-pagination button:disabled { opacity: .35; cursor: default; }
.pdf-pagination svg { width: 19px; height: 19px; }
.pdf-pagination strong { display: inline-block; padding: 5px 9px; border-radius: 6px; background: var(--accent); color: var(--navy); }
.pdf-page-total { color: #8a95a8; }
.pdf-zoom { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pdf-zoom button { width: 28px; height: 28px; min-height: 0; padding: 0; border: 1px solid #d6e0f1; border-radius: 8px; background: #fff; color: var(--blue); font-size: 16px; cursor: pointer; }
.pdf-zoom button:disabled { opacity: .4; cursor: default; }
.pdf-zoom input[type=range] { width: 150px; min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; accent-color: var(--blue); }
.pdf-zoom output { min-width: 40px; color: var(--navy); }
.pdf-viewer-actions { display: flex; align-items: center; gap: 8px; }
.pdf-viewer-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.pdf-viewer-actions button[hidden] { display: none; }
.pdf-viewer-actions svg { width: 20px; height: 20px; }
.pdf-export-button { color: #c34550 !important; }
.pdf-export-button:hover { background: #fff1f2 !important; border-color: #efc3c6 !important; }
/* Ações da lista de contratos: assinar digitalmente e selo de contrato assinado. */
.row-sign { color: #1d7a4c; }
.row-sign:hover { background: #e6f6ee; border-color: #b9e3cb; }
.row-signed { color: #1d7a4c; background: #e6f6ee; }
.row-signed:hover { border-color: #b9e3cb; }
.row-action:disabled { opacity: .35; cursor: not-allowed; transform: none; }
@media (max-width: 1000px) { .pdf-bottom-bar { flex-wrap: wrap; gap: 8px; } .pdf-viewer-actions { margin-left: auto; } .pdf-zoom input[type=range] { width: 110px; } .pdf-sign-options > span { display: none; } }
@media (max-width: 760px) { .document-viewer-head { flex-wrap: wrap; } .document-viewer-model select { min-width: 0; max-width: 60vw; } .pdf-viewer-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; } .pdf-viewer-actions button { padding: 8px; } }
/* Master: empresa em exibição, compacta, no topo à esquerda da foto do usuário. */
.company-picker { display: flex; flex-direction: column; gap: 2px; margin-right: 6px; padding: 5px 10px 6px; border: 1px solid #c9d7ef; border-radius: 12px; background: linear-gradient(120deg, #edf2fc, #fff); box-shadow: 0 3px 10px #2955a612; }
.company-picker[hidden] { display: none; }
.company-picker label { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.company-picker select { max-width: 240px; padding: 2px 4px; border: 0; background: transparent; font-size: 12.5px; font-weight: 700; color: var(--blue); cursor: pointer; }
.company-picker select:focus-visible { outline: 2px solid #91aecf; border-radius: 6px; }
@media (max-width: 760px) { .company-picker label { display: none; } .company-picker select { max-width: 130px; } }
/* Avatar do topo: círculo com borda em degradê azul e preto; foto de perfil ou iniciais. */
#user-avatar { width: 54px; height: 54px; padding: 3px; border: 0; border-radius: 50%; background: linear-gradient(135deg, #2955a6, #0f1b2f 75%); box-shadow: 0 3px 10px #2955a633; display: grid; place-items: center; overflow: hidden; box-sizing: border-box; flex: none; }
#user-avatar img, #user-avatar .avatar-initials { width: 100%; height: 100%; border-radius: 50%; border: 2px solid #fff; box-sizing: border-box; display: block; }
#user-avatar img { object-fit: cover; background: var(--accent); }
#user-avatar .avatar-initials { display: grid; place-items: center; background: linear-gradient(135deg, #e0e9f8, #d7e8ed); color: var(--blue); font-size: 16px; font-weight: 800; }
.user-menu { gap: 12px; }
.user-menu strong { font-size: 13.5px; }
.user-menu small { font-size: 11px; }
/* Botão Sair: seta dentro de um círculo em degradê azul e preto. */
.logout-button { display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; padding: 4px 12px 4px 4px; border: 1px solid #d6e0f1; border-radius: 999px; background: #fff; color: var(--navy); font-size: 12.5px; font-weight: 700; cursor: pointer; transition: box-shadow .2s, transform .2s, border-color .2s; }
.logout-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #2955a6, #0f1b2f 75%); box-shadow: 0 4px 12px #2955a640; transition: transform .25s; }
.logout-button:hover { border-color: #9db3d8; box-shadow: 0 6px 16px #2955a622; transform: translateY(-1px); }
.logout-button:hover .logout-icon { transform: translateX(2px); }
.logout-button:focus-visible { outline: 3px solid #91aecf; outline-offset: 3px; }
@media (max-width: 560px) { .logout-text { display: none; } .logout-button { padding: 3px; } #user-avatar { width: 46px; height: 46px; } }
/* Editar cadastro: a barra de abas fica fixa logo abaixo da barra de título ao rolar a janela. */
#editor #form-tabs { position: sticky; top: var(--editor-header-height, 0px); z-index: 19; background: #fff; box-shadow: 0 6px 12px -10px #1f3f7a33; }
#editor #form-tabs:empty { display: none; }
/* Cadastro: idade calculada ao lado da data de nascimento. */
.age-row { display: flex; align-items: center; gap: 8px; }
.age-row input { flex: 1; min-width: 0; }
.age-badge { flex: none; padding: 7px 11px; border: 1px solid #c9d7ef; border-radius: 999px; background: var(--accent); color: var(--blue); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
/* Janela de impressão: pré-visualização da folha e opções antes do diálogo do sistema (escolha da impressora). */
.print-dialog { width: min(1180px, 96vw); height: 94vh; max-height: 94vh; padding: 0; border: 0; border-radius: 18px; overflow: hidden; }
.print-dialog[open] { display: flex; flex-direction: column; }
.print-body { display: flex; flex: 1; min-height: 0; }
.print-preview-area { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; background: #dfe5ef; }
.print-stage { position: relative; display: flex; flex: 1; min-height: 0; overflow: auto; padding: 20px; }
.print-sheet { position: relative; margin: auto; flex-shrink: 0; overflow: hidden; background: #fff; box-shadow: 0 6px 22px #1f2a3d33; }
.print-sheet canvas { display: block; width: 100%; height: 100%; }
.print-sheet iframe { position: absolute; left: 0; top: 0; border: 0; background: #fff; transform-origin: 0 0; }
.print-nav { justify-content: center; padding: 8px; border-top: 1px solid #cfd8e6; background: #eef2f8; }
.print-nav[hidden] { display: none; }
.print-options { flex: none; width: 330px; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; overflow-y: auto; border-left: 1px solid var(--line); background: #fbfcff; }
.print-options fieldset { display: grid; gap: 8px; margin: 0; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--line); min-width: 0; }
.print-options fieldset[hidden] { display: none; }
.print-options legend { padding: 0; margin-bottom: 8px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--blue); }
.print-options select, .print-options input[type=number], .print-options input:not([type]) { width: 100%; min-width: 0; font-size: 13px; }
.print-inline { display: flex; align-items: center; gap: 12px; }
.print-inline input[type=number] { width: 80px; flex: none; }
.print-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.print-check[hidden] { display: none; }
.print-check input { width: auto; min-height: 0; margin: 0; accent-color: var(--blue); }
.print-radios { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.print-zoom { flex-wrap: nowrap; }
.print-zoom input[type=range] { flex: 1; width: auto; min-width: 60px; }
.print-zoom input[type=number] { width: 64px !important; flex: none; }
.print-zoom.is-disabled { opacity: .5; }
.print-options .field-help { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.print-options .text-button { align-self: flex-start; }
.print-summary { font-size: 12px; font-weight: 600; color: var(--muted); }
/* Zoom da pré-visualização na barra inferior (não altera a impressão). */
.print-view-zoom { flex: none; margin: 0 auto; padding: 4px 10px; border: 1px solid #d6e0f1; border-radius: 12px; background: #f7f9fd; }
.print-view-zoom output { text-align: right; font-variant-numeric: tabular-nums; }
.print-view-zoom .print-view-fit { width: auto; padding: 0 10px; font-size: 12px; font-weight: 700; }
@media (max-width: 1000px) { .print-view-zoom { order: 3; width: 100%; justify-content: center; } }
.print-dialog .viewer-message { margin: 0; }
@media (max-width: 860px) { .print-body { flex-direction: column; } .print-options { width: auto; max-height: 45%; border-left: 0; border-top: 1px solid var(--line); } }

/* Financeiro > Recibos: aba Aluguéis e janela "Dados do recibo selecionado" (como a tela do legado). */
.receipt-rents-table td.rent-total-cell { color: var(--blue); font-weight: 700; }
.receipt-rents-table td, .receipt-rents-table th { white-space: nowrap; }
dialog.rent-dialog { width: min(760px, 95vw); }
/* Recibos > Aluguéis do recibo: janela com a tabela dos aluguéis (fonte das listas; vencido em vermelho, a vencer em laranja). */
dialog.receipt-rents-dialog { width: min(1180px, 96vw); max-height: 90vh; border-radius: 22px; overflow: hidden; display: none; flex-direction: column; padding: 0; }
dialog.receipt-rents-dialog[open] { display: flex; }
dialog.receipt-rents-dialog .dialog-header { border-radius: 22px 22px 0 0; }
.receipt-rents-body { padding: 16px 22px 22px; overflow: auto; }
.receipt-rents-body .table-scroll { max-height: calc(90vh - 190px); overflow: auto; }
.receipt-rents-body { display: flex; flex-direction: column; min-height: 0; }
.receipt-rents-body .person-links-head, .receipt-rents-body .table-selection { flex-shrink: 0; }
.receipt-rents-body .table-scroll { min-height: 0; }
.receipt-rents-table tfoot th, .receipt-rents-table tfoot td { position: sticky; bottom: 0; z-index: 2; background: #edf3f8; border-top: 2px solid #b8c9d8; font-weight: 700; padding: 16px 18px; }
.receipt-rents-table tfoot .rent-sum-valor_aluguel { color: #c62828; }
.receipt-rents-table tfoot .rent-sum-total { color: #2955a6; }
.receipt-rents-summary { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 16px 28px; flex-shrink: 0; padding: 16px 18px; border-top: 1px solid #c9d7e5; background: #f5f8fc; border-radius: 0 0 12px 12px; }
.receipt-rents-summary > strong { margin-right: auto; color: #233a4b; }
.receipt-rents-summary > span { display: flex; flex-direction: column; gap: 5px; color: #52647a; font-size: 12px; text-align: right; }
.receipt-rents-summary output { color: #233a4b; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.receipt-rents-summary output.rent-paid-total { color: #2955a6; }
.receipt-rents-table tr.rent-overdue > td:not(:last-child) { color: #c62828; }
.receipt-rents-table tr.rent-soon > td:not(:last-child) { color: #d9730d; }
.rent-body { display: flex; gap: 24px; align-items: stretch; padding: 24px 28px; }
.rent-fields { flex: 1; display: grid; grid-template-columns: auto minmax(120px, 150px) 18px auto minmax(110px, 140px); gap: 10px 10px; align-items: center; padding: 18px; border: 1px solid #e3e8f2; border-radius: 12px; background: #fbfcff; }
.rent-fields label { margin: 0; text-align: right; font-size: 13px; color: var(--ink); }
.rent-fields input { margin: 0; min-height: 36px; }
.rent-fields input[data-mask="moeda"] { text-align: right; font-variant-numeric: tabular-nums; }
.rent-fields label[for="rent-valor_aluguel"], .rent-fields #rent-valor_aluguel { color: #c62828; font-weight: 700; }
.rent-fields label[for="rent-juros"], .rent-fields label[for="rent-juros_real"], .rent-fields #rent-juros, .rent-fields #rent-juros_real { color: #c62828; }
.rent-fields label[for="rent-taxa"], .rent-fields label[for="rent-taxa_adm_real"], .rent-fields #rent-taxa, .rent-fields #rent-taxa_adm_real { color: #2955a6; }
.rent-sign { font-size: 16px; text-align: center; }
.rent-sign.plus { color: #2f8a57; }
.rent-sign.minus { color: #c24848; }
.rent-total { flex: 0 0 190px; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 18px; border-radius: 12px; background: linear-gradient(160deg, #eef4ff, #e3ecfb); border: 1px solid #c9d7ef; text-align: right; }
.rent-total span { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5a6a86; }
.rent-total output { font-size: 28px; font-weight: 800; color: var(--blue); font-variant-numeric: tabular-nums; }
.rent-total output.negative { color: #c24848; }
.rent-total small { font-size: 11px; color: #6b7a93; line-height: 1.4; }
.rent-actions { display: flex; gap: 10px; }
.rent-confirm { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 760px) {
  .rent-body { flex-direction: column; padding: 16px; }
  .rent-fields { grid-template-columns: 1fr minmax(110px, 1fr) 18px; }
  .rent-fields label { text-align: left; }
  .rent-fields > label { grid-column: 1; }
  .rent-fields > span:empty { display: none; }
  .rent-total { flex-basis: auto; }
}

/* Controle de Aluguel > Vencimentos: texto da linha em vermelho (vencido em aberto) ou laranja (vence em até 5 dias); fundo normal. */
.list-vencimentos tr.rent-overdue > td, .list-vencimentos tr.rent-overdue > td:first-child,
.list-recibosalugueis tr.rent-overdue > td, .list-recibosalugueis tr.rent-overdue > td:first-child { color: #c62828; }
.list-vencimentos tr.rent-soon > td, .list-vencimentos tr.rent-soon > td:first-child,
.list-recibosalugueis tr.rent-soon > td, .list-recibosalugueis tr.rent-soon > td:first-child { color: #d9730d; }
/* Aluguéis do recibo: mesma fonte das demais listas (table-large), sem o destaque vermelho do aluguel dos imóveis. */
.table-large.list-recibosalugueis td.col-valor_aluguel { color: inherit; font-weight: 600; }
/* Recibos: botão Aluguéis do recibo na coluna Ações. */
.row-rents { color: #2f5fa7; }
.row-rents:hover { background: #eaf1fb; border-color: #c9d8ee; }
.list-vencimentos tr.rent-overdue > td.col-locatario_nome, .list-vencimentos tr.rent-soon > td.col-locatario_nome { font-weight: 700; }
.due-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 22px 12px; font-size: 12px; }
.badge-baixa-sim { background: #e6f4ea; color: #2f7a4b; }
.badge-baixa-nao { background: #fff1e0; color: #b55d0c; }

/* Vencimentos > Baixar recibo: janela com cantos arredondados (data, baixa SIM/NÃO e valor do recibo). */
.row-settle { color: #1d7a4c; }
dialog.settle-dialog { width: min(460px, 94vw); border-radius: 22px; overflow: hidden; }
dialog.settle-dialog .dialog-header { border-radius: 22px 22px 0 0; }
dialog.settle-dialog .dialog-footer { border-radius: 0 0 22px 22px; }
.settle-body { display: grid; gap: 14px; padding: 22px 28px 8px; }
.settle-body label { margin: 0; }
.settle-body input, .settle-body select { border-radius: 12px; }
.settle-value input { text-align: right; font-size: 20px; font-weight: 800; color: var(--blue); background: var(--accent); font-variant-numeric: tabular-nums; }
.settle-help { min-height: 1em; margin: 0; font-size: 12px; color: #b55d0c; }
/* Visão geral: contratos a vencer e gráficos (barras e rosca) com degradê nas cores do sistema. */
.dashboard-overview { display: grid; gap: 18px; }
.dashboard-overview > .panel { margin: 0; }
.dashboard-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.chart-card { margin: 0; padding: 18px 20px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chart-card.chart-wide { grid-column: 1 / -1; }
.chart-card.chart-danger { border-top: 3px solid #c62828; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.chart-head h3 { margin: 0; font-size: 16px; color: var(--navy); }
.chart-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.chart-total { font-size: 19px; color: var(--navy); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: #e9edf4; stroke-width: 1; }
.chart-grid.chart-base { stroke: #c9d2e0; }
.chart-axis { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-hit { cursor: default; }
.chart-hit path { transition: opacity .15s, filter .15s; }
.chart-svg:hover .chart-hit path { opacity: .55; }
.chart-svg:hover .chart-hit.active path { opacity: 1; filter: drop-shadow(0 3px 6px #2955a640); }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-svg { width: 190px; height: 190px; flex: 0 0 auto; }
.donut-slice { stroke: #fff; stroke-width: 2; transition: opacity .15s, transform .15s; transform-origin: 110px 110px; }
.donut-svg:hover .donut-slice { opacity: .6; }
.donut-svg:hover .donut-slice.active { opacity: 1; transform: scale(1.03); }
.donut-center { font-size: 26px; font-weight: 800; fill: var(--navy); }
.donut-center-label { font-size: 11.5px; fill: var(--muted); }
.chart-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; flex: 1; min-width: 190px; }
.chart-legend li { display: grid; grid-template-columns: 14px 1fr auto; column-gap: 9px; align-items: center; font-size: 13px; color: var(--ink); }
.chart-legend strong { font-variant-numeric: tabular-nums; color: var(--navy); }
.chart-legend small { grid-column: 2 / -1; color: var(--muted); font-size: 11.5px; }
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; }
.chart-note { margin: 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: #c62828; font-weight: 600; }
.chart-tip { position: fixed; z-index: 1000; pointer-events: none; padding: 7px 11px; border-radius: 9px; background: #161b27; color: #fff; font-size: 12.5px; font-weight: 600; box-shadow: 0 8px 22px #0003; white-space: nowrap; }
@media (max-width: 1100px) { .dashboard-charts { grid-template-columns: 1fr; } }
/* Gestão Fiscal (NFS-e Nacional): ícone nas Ações dos aluguéis, janela de emissão, situações e configurações. */
.row-nfse { color: #6b4fc7; }
.row-nfse:disabled { color: #b9c2d3; cursor: not-allowed; }
.row-nfse.done { color: #1d7a4c; }
.row-nfse.pending { color: #b55d0c; }
.nfse-row-emit { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; font-size: 12.5px; }
/* Janela de emissão larga, com cabeçalho compacto (título e subtítulo na mesma linha). */
dialog.nfse-dialog { width: min(900px, 96vw); }
dialog.nfse-dialog .dialog-header { padding: 12px 22px; }
dialog.nfse-dialog .dialog-header > div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; }
dialog.nfse-dialog .dialog-header .eyebrow { flex-basis: 100%; margin-bottom: 2px; }
dialog.nfse-dialog .dialog-header h2 { font-size: 19px; }
dialog.nfse-dialog .dialog-header p { margin: 0; font-size: 13px; }
dialog.nfse-dialog .icon-button.close-circle { width: 32px; height: 32px; }
dialog.nfse-dialog .dialog-footer { padding: 12px 22px; }
dialog.nfse-dialog .dialog-footer button { white-space: nowrap; }
.nfse-body { display: grid; gap: 12px; padding: 16px 22px 12px; }
.nfse-env { margin: 0; padding: 8px 12px; border-radius: 10px; background: #fff4e5; color: #8a4a09; font-size: 12.5px; }
.nfse-preview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafd; }
.nfse-preview > .wide { grid-column: span 2; }
.nfse-preview dt { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.nfse-preview dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.nfse-value { font-size: 18px; color: var(--blue); }
.nfse-list-highlight { color: #2855a6; font-weight: 700; }
.nfse-description { display: grid; gap: 4px; margin: 0; }
.nfse-description textarea { resize: vertical; line-height: 1.5; }
.nfse-problems { padding: 10px 14px; border: 1px solid #f3c7c7; border-radius: 10px; background: #fdf1f1; color: #9b1c1c; font-size: 13px; }
.nfse-problems ul { margin: 6px 0 0; padding-left: 18px; }
.nfse-problems:is(p) { margin: 0; }
.row-nfse-cancel { color: #b42318; }
.row-nfse-history { color: #b55d0c; font-weight: 800; }
.nfse-row-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.nfse-row-cancel { color: #b42318; border-color: #f3c4c4; white-space: nowrap; }
.nfse-row-cancel:hover:not(:disabled) { background: #fdecec; }
.nfse-row-cancel:disabled { color: #98a2b3; border-color: #e4e7ec; cursor: not-allowed; }
.nfse-row-buttons { align-items: center; }
.nfse-action-img { display: block; width: 22px; height: 22px; pointer-events: none; user-select: none; }
.row-action:has(.nfse-action-img):hover:not(:disabled) { background: #eef3fb; border-color: #d6e2f3; }
.nfse-cancelled-at { font-size: 12.5px; white-space: nowrap; }
.nfse-row-history { color: #b55d0c; }
.nfse-history table { width: 100%; font-size: 12.5px; }
.nfse-history td { vertical-align: top; }
.nfse-history-message { min-width: 260px; max-width: 460px; white-space: normal; overflow-wrap: anywhere; }
.nfse-cancel-form { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 12px 18px; align-items: start; }
.nfse-cancel-form label { display: grid; gap: 4px; }
@media (max-width: 620px) { .nfse-cancel-form { grid-template-columns: 1fr; } }
dialog.nfse-dialog #nfse-emit.danger { background: #b42318; border-color: #b42318; }
.nfse-result { display: grid; gap: 6px; padding: 14px 16px; border-radius: 12px; font-size: 13px; overflow-wrap: anywhere; }
.nfse-result b { font-size: 15px; }
.nfse-result.ok { background: #e8f6ee; color: #14532d; }
.nfse-result.wait { background: #fff4e5; color: #8a4a09; }
.nfse-result.error { background: #fdf1f1; color: #9b1c1c; }
.nfse-result button { justify-self: start; margin-top: 4px; }
/* NFS-e autorizada: imprimir, salvar o PDF ou visualizar o DANFSe. */
.nfse-danfse-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.nfse-danfse-actions button { margin-top: 0; display: inline-flex; align-items: center; gap: 6px; }
/* Configurações NFSe: brasão da prefeitura no cabeçalho do DANFSe. */
.nfse-brasao { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nfse-brasao-preview { width: 84px; height: 84px; display: grid; place-items: center; border: 1px dashed var(--line, #cfd6e1); border-radius: 10px; background: #fff; color: var(--muted); font-size: 11px; text-align: center; overflow: hidden; }
.nfse-brasao-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.nfse-brasao-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge.nfse-autorizada { background: #e6f4ea; color: #2f7a4b; }
.badge.nfse-processando { background: #fff1e0; color: #b55d0c; }
.badge.nfse-rejeitada { background: #fdecec; color: #b42318; }
.badge.nfse-cancelada { background: #eef1f6; color: #66748a; }
.nfse-config { padding: 20px 24px; display: grid; gap: 12px; }
.nfse-config h3 { margin: 6px 0 0; font-size: 15px; color: var(--navy); }
.nfse-config > p { margin: 0; }
.nfse-hint { margin: 0; font-size: 12px; }
.nfse-warning { padding: 14px 18px; background: #fff4e5; color: #8a4a09; }
.nfse-cert { display: grid; gap: 2px; padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.nfse-cert.ok { background: #e8f6ee; color: #14532d; }
.nfse-cert.missing { background: #f4f6fa; color: var(--muted); }
/* Emitir NFS-e (emissão manual): cabeçalho com ambiente e ações; área principal (~70%) e lateral (~30%) com o resumo. */
.nfsem-heading { align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.nfsem-sticky-header { position: sticky; top: var(--nfsem-topbar-height, 82px); z-index: 9; background: var(--bg); padding-top: 14px; padding-bottom: 1px; margin-top: -14px; box-shadow: 0 12px 18px -18px #233a4b66; }
.nfsem-grid :is(.nfsem-card, [data-f]) { scroll-margin-top: calc(var(--nfsem-topbar-height, 82px) + var(--nfsem-header-height, 200px) + 16px); }
@media print { .nfsem-sticky-header { position: static; padding: 0; margin: 0; box-shadow: none; } }
.nfsem-crumb { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.nfsem-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-left: auto; }
.nfsem-actions button { white-space: nowrap; }
.nfsem-actions :is(#nfm-danfse, #nfm-back, #nfm-continue) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.nfsem-action-icon { width: 18px; height: 18px; flex: 0 0 18px; display: block; }
.nfsem-env { display: grid; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.nfsem-env select { min-width: 190px; }
.nfsem-status { margin: 0 0 12px; padding: 9px 14px; border-radius: 10px; background: #eef3fb; color: #1f3f7a; font-size: 13px; }
.nfsem-status.nfse-rejeitada { background: #fdf1f1; color: #9b1c1c; }
.nfsem-status.nfse-autorizada { background: #e8f6ee; color: #14532d; }
.nfsem-status .link-button { margin-left: 6px; }
.nfsem-pending { margin-bottom: 12px; }
.nfsem-env { margin: 0 0 12px; padding: 10px 14px; font-size: 13px; border: 1px solid #f6d4a8; }
.nfsem-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr); gap: 16px; align-items: start; }
.nfsem-main, .nfsem-side { display: grid; gap: 14px; min-width: 0; }
.nfsem-card { margin: 0; padding: 0; overflow: hidden; }
.nfsem-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.nfsem-card-head h2 { margin: 0; font-size: 15.5px; color: var(--navy); flex: 1; }
.nfsem-card-head h2 small { font-size: 12px; font-weight: 500; color: var(--muted); }
.nfsem-card.is-collapsible .nfsem-card-head { cursor: pointer; user-select: none; }
.nfsem-card.is-collapsible .nfsem-card-head:focus-visible { outline: 3px solid #91aecf; outline-offset: -3px; }
.nfsem-chevron { display: grid; color: var(--blue); transition: transform .15s; }
.nfsem-card.is-collapsed .nfsem-chevron { transform: rotate(-90deg); }
.nfsem-card.is-collapsed .nfsem-card-body { display: none; }
.nfsem-card.is-collapsed .nfsem-card-head { border-bottom: 0; }
.nfsem-num { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--blue); color: #fff; font-size: 12.5px; font-weight: 800; }
.nfsem-card-body { display: grid; gap: 12px; padding: 14px 16px 16px; }
.nfsem-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; align-items: end; }
.nfsem-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nfsem-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nfsem-row.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nfsem-row.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.nfsem-row.cols-addr { grid-template-columns: minmax(130px, 1fr) minmax(0, 2.4fr) minmax(80px, .7fr) minmax(0, 1.2fr); }
.nfsem-row.cols-addr2 { grid-template-columns: minmax(0, 1.3fr) minmax(76px, .5fr) minmax(0, 1.7fr) minmax(90px, .8fr) minmax(80px, .6fr); }
.nfsem-row.cols-serv { grid-template-columns: minmax(0, 2.6fr) repeat(4, minmax(0, 1fr)); }
.nfsem-row .wide { grid-column: 1 / -1; }
.nfsem-row.cols-serv .wide, .nfsem-row.cols-addr .wide { grid-column: auto; }
.nfsem-card label, .nfsem-mini label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: #3c4a60; min-width: 0; }
.nfsem-card label em, .nfsem-mini label em, .nfse-config label em { color: #c0392b; font-style: normal; }
.nfsem-card input, .nfsem-card select, .nfsem-card textarea { width: 100%; min-width: 0; font-weight: 500; }
.nfsem-card input[readonly] { background: #f2f5f9; color: #3c4a60; }
.nfsem-money { text-align: right; }
.nfsem-strong { font-weight: 800 !important; color: var(--blue) !important; background: #eaf2ff !important; }
.nfsem-card .is-disabled { opacity: .55; }
.nfsem-card .is-invalid, .nfsem-card [data-group].is-invalid { border-color: #c0392b !important; box-shadow: 0 0 0 3px #c0392b22; }
.nfsem-with-button { display: flex; min-width: 0; }
.nfsem-with-button input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.nfsem-icon-button { flex: none; display: grid; place-items: center; width: 40px; padding: 0; border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0; background: #f5f8fc; color: var(--blue); cursor: pointer; }
.nfsem-icon-button:hover:not(:disabled) { background: #e8f0fb; }
.nfsem-service .nfsem-item { flex: 0 0 72px; border-radius: 10px 0 0 10px; border-right: 0; }
.nfsem-service input:not(.nfsem-item) { border-radius: 0; }
.nfsem-pair { display: flex; gap: 6px; }
.nfsem-issuer { display: grid; gap: 2px; padding: 9px 12px; border-radius: 10px; background: #f2f5f9; font-size: 13px; }
.nfsem-issuer span { font-size: 12px; font-weight: 700; color: #3c4a60; }
.nfsem-issuer small { color: var(--muted); }
.nfsem-radios { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; min-height: 34px; border-radius: 10px; }
.nfsem-radios label { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 7px; font-size: 13px; font-weight: 600 !important; cursor: pointer; }
.nfsem-radios input { width: auto !important; margin: 0; }
.nfsem-textarea small { justify-self: end; font-weight: 500; }
.nfsem-sub { padding: 10px 12px; border-radius: 10px; background: #f7f9fc; border: 1px dashed var(--line); }
.nfsem-taxes { width: 100%; font-size: 12.5px; border-collapse: separate; border-spacing: 0 5px; }
.nfsem-taxes th { text-align: left; font-size: 11.5px; color: #3c4a60; white-space: nowrap; }
.nfsem-taxes td input { text-align: right; min-width: 70px; }
.nfsem-summary-card { position: sticky; top: 12px; margin: 0; padding: 14px 16px; border: 1px solid #cfe8d6; background: linear-gradient(180deg, #f3fbf6, #fff); }
.nfsem-summary-card h2 { margin: 0 0 8px; font-size: 15px; color: #14532d; }
.nfsem-summary { display: grid; gap: 4px; font-size: 13px; }
.nfsem-summary div { display: flex; justify-content: space-between; gap: 10px; }
.nfsem-summary div b { font-variant-numeric: tabular-nums; }
.nfsem-total { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: #eaf2ff; color: var(--blue); font-size: 14.5px; }
.nfsem-mini { display: grid; gap: 12px; }
.nfsem-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.nfsem-results { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.nfsem-result { display: grid; gap: 2px; text-align: left; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.nfsem-result:hover, .nfsem-result:focus-visible { border-color: var(--blue); background: #f3f7fd; }
.nfsem-result span { font-size: 12px; color: var(--muted); }
.nfsem-preview-title { margin: 6px 0 0; font-size: 13px; color: var(--navy); }
.nfsem-preview-text { margin: 0; padding: 10px 12px; border-radius: 10px; background: #f7f9fc; white-space: pre-wrap; font-size: 13px; }
@media (max-width: 1280px) { .nfsem-row.cols-5, .nfsem-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .nfsem-row.cols-serv { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nfsem-row.cols-serv .wide { grid-column: 1 / -1; } }
@media (max-width: 1080px) { .nfsem-grid { grid-template-columns: 1fr; } .nfsem-summary-card { position: static; } .nfsem-row.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nfsem-row.cols-addr, .nfsem-row.cols-addr2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nfsem-row.cols-addr .wide { grid-column: 1 / -1; } }
@media (max-width: 620px) { .nfsem-row, .nfsem-row.cols-2, .nfsem-row.cols-3, .nfsem-row.cols-4, .nfsem-row.cols-5, .nfsem-row.cols-addr, .nfsem-row.cols-addr2, .nfsem-row.cols-serv { grid-template-columns: 1fr; } .nfsem-actions { width: 100%; } .nfsem-actions button { flex: 1; } .nfsem-env { flex-basis: 100%; } }
@media (max-width: 720px) { .nfse-preview { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .nfse-preview { grid-template-columns: 1fr; } .nfse-preview > .wide { grid-column: auto; } }
/* Mapa de Imóveis: página /mapa/ ocupando a área de conteúdo. */
.map-panel { margin: 0; padding: 0; overflow: hidden; }
.map-frame { display: block; width: 100%; height: calc(100vh - 210px); min-height: 460px; border: 0; }
/* Visão geral: indicadores do topo em cartões com degradê (recebidos, contratos, pendentes e a vencer). */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.kpi-card { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 18px 20px 16px; border-radius: 18px; color: #fff; text-decoration: none; box-shadow: 0 10px 24px -12px var(--kpi-shadow); transition: transform .18s, box-shadow .18s; }
.kpi-card::before, .kpi-card::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; background: #ffffff1f; pointer-events: none; }
.kpi-card::before { width: 170px; height: 170px; right: -52px; top: -64px; }
.kpi-card::after { width: 120px; height: 120px; right: 38px; bottom: -78px; background: #ffffff14; }
a.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -12px var(--kpi-shadow); }
a.kpi-card:focus-visible { outline: 3px solid var(--kpi-shadow); outline-offset: 3px; }
.kpi-green { background: linear-gradient(135deg, #22a878 0%, #0d6e5a 100%); --kpi-shadow: #0d6e5acc; }
.kpi-blue { background: linear-gradient(135deg, #4f86e0 0%, #1f4796 100%); --kpi-shadow: #1f4796cc; }
.kpi-orange { background: linear-gradient(135deg, #f08a34 0%, #c2410c 100%); --kpi-shadow: #c2410ccc; }
.kpi-violet { background: linear-gradient(135deg, #8161ee 0%, #4b2fb0 100%); --kpi-shadow: #4b2fb0cc; }
.kpi-gold { background: linear-gradient(135deg, #d99a1e 0%, #9a5a07 100%); --kpi-shadow: #9a5a07cc; }
.kpi-teal { background: linear-gradient(135deg, #1aa6b7 0%, #0b5f78 100%); --kpi-shadow: #0b5f78cc; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kpi-title { font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; opacity: .92; }
.kpi-icon { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #ffffff2e; box-shadow: inset 0 0 0 1px #ffffff38; }
.kpi-icon svg { width: 24px; height: 24px; }
.kpi-value { font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; font-size: 12.5px; }
.kpi-count { padding: 3px 10px; border-radius: 999px; background: #ffffff2e; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-period { opacity: .88; }
@media (max-width: 620px) { .kpi-grid { grid-template-columns: 1fr; } .kpi-value { font-size: 23px; } }
