/* Modal "Gerar relatório" (qualquer página). Computador: janela no centro. Celular: folha que sobe de baixo. */
.rr-gr { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px; font-family: inherit; }
.rr-gr[hidden] { display: none; }
html.rr-gr-aberto { overflow: hidden; }
.rr-gr__fundo { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); }
.rr-gr__painel { position: relative; width: min(560px, 100%); max-height: min(88vh, 860px); overflow: auto; background: #fff; border-radius: 18px; box-shadow: 0 24px 64px rgba(0, 0, 0, .28); color: #111827; }
.rr-gr__painel.is-largo { width: min(820px, 100%); }
.rr-gr__painel.is-grande { width: min(900px, 100%); }
.rr-gr__alca { display: none; }
.rr-gr__topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 8px; position: sticky; top: 0; background: #fff; z-index: 1; }
.rr-gr__topo h2 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.rr-gr__imovel { margin: 2px 0 0; font-size: .84rem; color: #6b7280; }
.rr-gr__x { display: grid; place-items: center; flex: none; border: 0; background: transparent; font-size: 1.6rem; line-height: 1; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; color: #6b7280; }
.rr-gr__x:hover { background: #f3f4f6; }
.rr-gr__corpo { padding: 4px 20px 20px; display: grid; gap: 10px; }
.rr-gr__h { margin: 8px 0 0; font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #6b7280; }
.rr-gr__lista { display: grid; gap: 6px; }
.rr-gr__mod { display: grid; grid-template-columns: 44px minmax(0, 1fr) 16px; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 10px 12px; cursor: pointer; color: inherit; min-height: 56px; }
.rr-gr__mod:hover { border-color: #111827; }
.rr-gr__mod > .ri { color: #9ca3af; width: 16px; height: 16px; }
.rr-gr__sw--sec .ri { width: 16px; height: 16px; }
.rr-gr__btn .ri { width: 16px; height: 16px; margin-right: 2px; }
.rr-gr__sw { width: 44px; height: 32px; border-radius: 8px; overflow: hidden; display: flex; border: 1px solid #e5e7eb; }
.rr-gr__sw i { flex: 1; }
.rr-gr__sw i:first-child { flex: 2; }
.rr-gr__sw--sec { align-items: center; justify-content: center; background: #f3f4f6; color: #374151; }
.rr-gr__mod-txt b { display: block; font-size: .92rem; }
.rr-gr__mod-txt span { display: block; font-size: .78rem; color: #6b7280; }
.rr-gr__mod--sec { margin-top: 4px; border-style: dashed; }
.rr-gr__antigos { margin-top: 6px; border-top: 1px solid #e5e7eb; padding-top: 8px; }
.rr-gr__antigos > summary { cursor: pointer; font-size: .86rem; font-weight: 600; color: #4b5563; padding: 4px 0; }
.rr-gr__antigos .rr-gr__lista { margin-top: 6px; }
.rr-gr__nota { margin: 0; font-size: .78rem; color: #6b7280; }
.rr-gr__rodape { margin: 8px 0 0; font-size: .82rem; color: #6b7280; }
.rr-gr__rodape a { color: #111827; font-weight: 600; }
.rr-gr__resumo { display: grid; gap: 3px; background: #f3f4f6; border-radius: 12px; padding: 10px 12px; }
.rr-gr__resumo b { font-size: .95rem; }
.rr-gr__resumo span { font-size: .8rem; color: #4b5563; }
.rr-gr__label { font-size: .84rem; font-weight: 600; }
.rr-gr__texto { width: 100%; font: inherit; font-size: .9rem; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 12px; resize: vertical; }
.rr-gr__cota { display: grid; gap: 6px; }
.rr-gr__cota > div { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; }
.rr-gr__tot { border-top: 1px solid #e5e7eb; padding-top: 8px; font-weight: 700; }
.rr-gr__acoes { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.rr-gr__btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: .9rem; font-weight: 600; padding: 10px 16px; min-height: 44px; border-radius: 999px; border: 1px solid #e5e7eb; background: #fff; color: #111827; cursor: pointer; text-decoration: none; }
.rr-gr__btn--pri { background: #16a34a; border-color: #16a34a; color: #fff; }
.rr-gr__btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.rr-gr__prog { display: flex; align-items: center; gap: 10px; font-size: .9rem; padding: 18px 0; }
.rr-gr__spin { width: 18px; height: 18px; border: 2px solid #e5e7eb; border-top-color: #16a34a; border-radius: 50%; animation: rr-gr-gira 1s linear infinite; flex: none; }
@keyframes rr-gr-gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rr-gr__spin { animation: none; } }
.rr-gr__erro { margin: 0; color: #b91c1c; font-size: .88rem; }
.rr-gr__ok { margin: 0; font-size: .92rem; }
.rr-gr__ok .ri { color: #16a34a; }
.rr-gr__pdf { width: 100%; height: 62vh; border: 1px solid #e5e7eb; border-radius: 10px; background: #525659; }
@media (max-width: 640px) {
    .rr-gr { place-items: end stretch; padding: 0; }
    .rr-gr__painel, .rr-gr__painel.is-grande, .rr-gr__painel.is-largo { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
    .rr-gr__alca { display: block; width: 44px; height: 5px; border-radius: 3px; background: #d1d5db; margin: 8px auto 0; }
    .rr-gr__topo { padding-top: 10px; }
    .rr-gr__acoes { position: sticky; bottom: 0; background: #fff; padding-top: 8px; }
    .rr-gr__acoes .rr-gr__btn { flex: 1; }
}
.rr-gr__parecer { display: grid; gap: 8px; justify-items: start; border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px; background: #fafafa; }
.rr-gr__titulo { min-height: 40px; }
.rr-gr__acoes--parecer { justify-content: space-between; }
@media (max-width: 640px) { .rr-gr__acoes--parecer { position: static; background: transparent; } }

/* ── Galeria de modelos ─────────────────────────────────────────────── */
.rr-gr__x .ri { width: 20px; height: 20px; }
.rr-gr__busca { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 1px solid #e5e7eb; border-radius: 12px; color: #6b7280; margin: 2px 0 0; }
.rr-gr__busca input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: .9rem; background: transparent; color: #111827; }
.rr-gr__busca:focus-within { border-color: #111827; }
.rr-gr__galeria { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.rr-gr__card { position: relative; display: flex; flex-direction: column; border: 1px solid #e5e7eb; border-radius: 16px; overflow: hidden; background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; }
.rr-gr__card[hidden] { display: none; }
.rr-gr__card:hover { border-color: color-mix(in srgb, var(--gc-pri) 50%, #e5e7eb); box-shadow: 0 10px 28px -18px rgba(17, 24, 39, .4); transform: translateY(-1px); }
.rr-gr__card-main { display: flex; flex-direction: column; flex: 1; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.rr-gr__card-main:focus-visible { outline: 3px solid var(--gc-acc); outline-offset: -3px; border-radius: 16px; }
.rr-gr__capa { position: relative; display: grid; place-items: end center; height: 124px; overflow: hidden;
  background: linear-gradient(160deg, var(--gc-fundo) 0%, color-mix(in srgb, var(--gc-fundo) 55%, var(--gc-acc)) 100%); }
.rr-gr__capa img { width: 86px; height: auto; border-radius: 3px 3px 0 0; transform: translateY(8px); box-shadow: 0 10px 22px -8px rgba(17, 24, 39, .45); transition: transform .2s; }
.rr-gr__card:hover .rr-gr__capa img { transform: translateY(2px); }
.rr-gr__estilo { display: inline-block; padding: .1rem .5rem; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--gc-pri, #1f4035); font-size: .68rem; font-weight: 700; }
.rr-gr__capa .rr-gr__estilo { position: absolute; top: 8px; left: 8px; }
.rr-gr__card-txt { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; }
.rr-gr__card-txt b { font-size: .9rem; line-height: 1.25; }
.rr-gr__card-meta { font-size: .76rem; color: #6b7280; }
.rr-gr__custo { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: .8rem; font-weight: 600; color: #9ca3af; }
.rr-gr__custo.is-ok { color: #0f6e5c; }
.rr-gr__spin--p { width: 12px; height: 12px; border-width: 2px; }
.rr-gr__card-edit { position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: #111827; font-size: .72rem; font-weight: 600; text-decoration: none; opacity: 0; transition: opacity .15s; }
.rr-gr__card:hover .rr-gr__card-edit, .rr-gr__card-edit:focus-visible { opacity: 1; }
.rr-gr__card-edit .ri { width: 13px; height: 13px; }
.rr-gr__vazio { margin: 0; font-size: .86rem; color: #6b7280; }
.rr-gr__rodape { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.rr-gr__rodape a { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.rr-gr__rodape a:hover { text-decoration: underline; }
@media (hover: none) { .rr-gr__card-edit { opacity: 1; width: 30px; height: 30px; padding: 0; justify-content: center; } .rr-gr__card-edit span { display: none; } }
@media (max-width: 640px) { .rr-gr__galeria { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .rr-gr__capa { height: 104px; } .rr-gr__capa img { width: 72px; } }

/* Modelo escolhido */
.rr-gr__escolhido { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px; border-radius: 14px;
  background: linear-gradient(160deg, var(--gc-fundo) 0%, #fff 90%); }
.rr-gr__escolhido img { width: 84px; height: auto; border-radius: 4px; box-shadow: 0 8px 18px -8px rgba(17, 24, 39, .45); }
.rr-gr__escolhido > div { display: grid; gap: 6px; justify-items: start; }
.rr-gr__blocos { font-size: .82rem; color: #374151; line-height: 1.45; }
.rr-gr__link { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 600; color: #111827; }

/* Andamento */
.rr-gr__andamento { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 18px 4px 4px; }
.rr-gr__andamento-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: #e3f1ee; color: #0f6e5c; }
.rr-gr__andamento-ic .ri { width: 26px; height: 26px; }
.rr-gr__andamento > b { font-size: 1rem; }
.rr-gr__barra { width: min(320px, 100%); height: 6px; border-radius: 3px; background: #e5e7eb; overflow: hidden; margin: 6px 0; }
.rr-gr__barra i { display: block; width: 40%; height: 100%; border-radius: 3px; background: #16a34a; animation: rr-gr-barra 1.4s ease-in-out infinite; }
@keyframes rr-gr-barra { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .rr-gr__barra i { animation: none; width: 100%; opacity: .5; } }
.rr-gr__andamento .rr-gr__acoes { justify-content: center; position: static; }

/* Pronto */
.rr-gr__ok { display: flex; align-items: center; gap: 8px; }
.rr-gr__ok .ri { width: 20px; height: 20px; flex: none; }
.rr-gr__acoes--pronto { justify-content: flex-start; margin-top: 0; }
.rr-gr__menu { position: relative; }
.rr-gr__menu > summary { list-style: none; }
.rr-gr__menu > summary::-webkit-details-marker { display: none; }
.rr-gr__menu-lista { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; min-width: 260px; padding: 6px; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 18px 40px -16px rgba(17, 24, 39, .35); display: grid; gap: 2px; }
.rr-gr__menu-lista > a, .rr-gr__menu-lista > span { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; color: #111827; text-decoration: none; font-size: .88rem; }
.rr-gr__menu-lista > a:hover { background: #f3f4f6; }
.rr-gr__menu-lista .ri { width: 18px; height: 18px; margin-top: 1px; color: #0f6e5c; }
.rr-gr__menu-lista b { display: block; font-weight: 600; }
.rr-gr__menu-lista small { display: block; color: #6b7280; font-size: .76rem; }
.rr-gr__menu-lista .is-off { opacity: .5; }
@media (max-width: 640px) {
  .rr-gr__acoes--pronto { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .rr-gr__acoes--pronto > .rr-gr__btn--pri { grid-column: 1 / -1; }
  .rr-gr__acoes--pronto .rr-gr__menu > summary { width: 100%; }
  .rr-gr__menu-lista { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; z-index: 3200; }
}

/* Aviso no canto: PDF pronto com a janela fechada */
.rr-gr-aviso { position: fixed; z-index: 3050; right: 20px; bottom: 20px; display: flex; align-items: center; gap: 12px; max-width: min(420px, calc(100vw - 24px)); padding: 12px 12px 12px 14px;
  background: #111827; color: #fff; border-radius: 16px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .45); transform: translateY(16px); opacity: 0; transition: transform .2s, opacity .2s; }
.rr-gr-aviso.is-visivel { transform: none; opacity: 1; }
.rr-gr-aviso__ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #16a34a; flex: none; }
.rr-gr-aviso.is-erro .rr-gr-aviso__ic { background: #b91c1c; }
.rr-gr-aviso__txt { flex: 1; min-width: 0; }
.rr-gr-aviso__txt b { display: block; font-size: .92rem; }
.rr-gr-aviso__txt small { display: block; font-size: .78rem; color: #d1d5db; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-gr-aviso__abrir { height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: #fff; color: #111827; font: inherit; font-weight: 700; font-size: .86rem; cursor: pointer; }
.rr-gr-aviso__x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #9ca3af; cursor: pointer; }
@media (max-width: 640px) { .rr-gr-aviso { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); max-width: none; } }

/* ── "Relatórios deste imóvel" (lateral da página do imóvel) ─────────── */
.rr-ri { display: grid; gap: 8px; }
.rr-ri:empty::before { content: ''; display: block; height: 64px; border-radius: 14px; background: #f3f4f6; }
.rr-ri__gerar { display: grid; grid-template-columns: 36px minmax(0, 1fr) 16px; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid #0f6e5c; border-radius: 14px;
  background: #f0f8f5; color: #0b3b2e; font: inherit; text-align: left; cursor: pointer; }
.rr-ri__gerar:hover { background: #e3f1ee; }
.rr-ri__gerar b { display: block; font-size: .9rem; }
.rr-ri__gerar small { display: block; font-size: .76rem; color: #4b5563; }
.rr-ri__gerar-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #0f6e5c; color: #fff; }
.rr-ri__gerar-ic .ri { width: 18px; height: 18px; }
.rr-ri__h { margin: 6px 0 0; font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #6b7280; }
.rr-ri__lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rr-ri__item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; }
.rr-ri__item:hover { background: #f9fafb; }
.rr-ri__capa { width: 30px; height: 42px; object-fit: cover; object-position: top; border-radius: 3px; border: 1px solid #e5e7eb; }
.rr-ri__capa--ic { display: grid; place-items: center; background: #f3f4f6; color: #6b7280; }
.rr-ri__txt { min-width: 0; }
.rr-ri__txt b { display: block; font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-ri__txt small { display: block; font-size: .74rem; color: #6b7280; }
.rr-ri__acoes { display: flex; gap: 2px; }
.rr-ri__bt { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #374151; cursor: pointer; text-decoration: none; }
.rr-ri__bt:hover, .rr-ri__menu[open] > .rr-ri__bt { background: #eef2f0; color: #0f6e5c; }
.rr-ri__menu .rr-gr__menu-lista { left: auto; right: 0; min-width: 190px; }
.rr-ri__n { position: absolute; top: 0; right: 0; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: #dcfce7; color: #166534; font-size: .62rem; font-style: normal; font-weight: 800; line-height: 15px; text-align: center; }
.rr-ri__vazio { margin: 0; font-size: .8rem; color: #6b7280; }
.rr-ri__todos { font-size: .82rem; font-weight: 600; color: #0f6e5c; }

/* Botão "Gerar relatório" das páginas do imóvel e o atalho fixo no celular */
.rr-gr-botao { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: #16a34a; color: #fff;
  font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none; }
.rr-gr-botao:hover { background: #15803d; color: #fff; }
.rr-gr-botao .ri { width: 18px; height: 18px; }
.rr-gr-botao--p { height: 34px; padding: 0 12px; font-size: .82rem; margin-right: 6px; }
.rr-gr-botao--p .ri { width: 16px; height: 16px; }
@media (max-width: 640px) { .rr-gr-botao--p { width: 34px; padding: 0; justify-content: center; } .rr-gr-botao--p span { display: none; } }
.rr-pn-files-sheet__rel { margin-bottom: 14px; }
.rr-gr-fab { display: none; }
@media (max-width: 767.98px) {
  .rr-gr-fab { position: fixed; z-index: 1040; left: 16px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); display: inline-flex; height: 48px; padding: 0 20px;
    box-shadow: 0 12px 28px -10px rgba(22, 163, 74, .6); }
  html.rr-gr-aberto .rr-gr-fab { display: none; }
}

/* Titularidade: o que entra no relatório, com o custo de liberar cada papel */
.rr-gr__tit { margin: 4px 0 12px; padding: 12px 14px; border: 1px solid #e4e8ef; border-radius: 14px; display: grid; gap: 6px; }
.rr-gr__tit legend { padding: 0 6px; font-size: .78rem; font-weight: 700; color: #4a5470; }
.rr-gr__tit-item { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; cursor: pointer; font-size: .9rem; color: #07143f; }
.rr-gr__tit-item:hover { background: #f8f9fb; }
.rr-gr__tit-item input { width: 18px; height: 18px; accent-color: #00a538; flex: none; }
.rr-gr__tit-item span { flex: 1; }
.rr-gr__tit-item small { font-size: .8rem; font-weight: 600; color: #4a5470; white-space: nowrap; }
.rr-gr__tit-item.is-ok { cursor: default; }
.rr-gr__tit-item.is-ok small { color: #007a2e; }
.rr-gr__tit .rr-gr__nota { margin: 2px 4px 0; }
