/* Tabela digital do imóvel — botão em "Documentos e materiais" + modal (<dialog>) */
#documentos button.documento-btn { border: 0; cursor: pointer; font: inherit; font-size: .85rem; font-weight: 600; }

.td-modal {
  width: min(1040px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 0; border-radius: var(--radius, 18px); background: #fff; color: #2b2b2b;
  box-shadow: 0 24px 60px rgba(60, 0, 79, .25); overflow: hidden;
}
.td-modal[open] { display: flex; flex-direction: column; }
/* o reset global (* { margin: 0 }) anula o margin:auto nativo do <dialog> — centraliza explicitamente */
.td-modal { position: fixed; inset: 0; margin: auto; height: fit-content; }
.td-modal::backdrop { background: rgba(42, 5, 47, .55); }

.td-cabecalho {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.4rem; border-bottom: 1px solid #ece6f2; background: #faf8fc;
}
.td-cabecalho h2 { margin: 0; font-size: 1.25rem; color: var(--roxo, #3c004f); }
.td-sub { margin: .15rem 0 0; font-size: .88rem; color: #8a7c96; }
.td-fechar {
  flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: #fff; color: var(--roxo, #3c004f); cursor: pointer;
  box-shadow: 0 1px 4px rgba(60, 0, 79, .15);
}
.td-fechar:hover { background: #f1ebf6; }
.td-fechar svg { width: 18px; height: 18px; }

.td-corpo { padding: 1.1rem 1.4rem 1.4rem; overflow-y: auto; }
.td-corpo h3 { margin: 1.2rem 0 .6rem; font-size: 1rem; color: var(--roxo, #3c004f); display: flex; align-items: center; gap: .5rem; }
.td-data { margin: 0; padding: .7rem .9rem; border-radius: 12px; background: #f4f0f8; font-size: .9rem; color: #4a4a4a; }
.td-data--antiga { background: #fff4e5; color: #8a4b00; }
.td-contagem { font-size: .75rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; background: var(--laranja, #ff6633); color: #fff; }

.td-unidades-topo { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1.2rem; }
.td-unidades-topo h3 { margin: 0; }
.td-filtros { display: flex; flex-wrap: wrap; gap: .4rem; }
.td-filtro {
  border: 1px solid #ddd2e6; background: #fff; color: var(--roxo, #3c004f); border-radius: 999px;
  padding: .3rem .8rem; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer;
}
.td-filtro.ativo, .td-filtro:hover { background: var(--roxo, #3c004f); border-color: var(--roxo, #3c004f); color: #fff; }

.td-rolagem { overflow-x: auto; margin-top: .6rem; border: 1px solid #ece6f2; border-radius: 12px; }
.td-tabela { width: 100%; border-collapse: collapse; font-size: .88rem; }
.td-tabela th {
  position: sticky; top: 0; text-align: left; white-space: nowrap; padding: .6rem .75rem;
  background: #faf8fc; color: #8a7c96; font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 600;
}
.td-tabela td { padding: .55rem .75rem; border-top: 1px solid #f1ebf6; white-space: nowrap; }
.td-tabela tbody tr:hover { background: #fcfaff; }
.td-tabela small { color: #8a7c96; }
.td-preco { font-weight: 600; color: var(--roxo, #3c004f); }
.td-status { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.td-status--available { background: #e7f6ec; color: #17733a; }
.td-status--reserved { background: #fff4e5; color: #8a4b00; }
.td-status--negotiating { background: #eef1ff; color: #3442a8; }
.td-aviso { margin: 1rem 0 0; font-size: .78rem; color: #8a7c96; line-height: 1.5; }

body.td-aberta { overflow: hidden; }

@media (max-width: 640px) {
  .td-modal { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .td-cabecalho, .td-corpo { padding-left: 16px; padding-right: 16px; }
  .td-rolagem { border: 0; overflow: visible; }
  .td-tabela thead { display: none; }
  .td-tabela, .td-tabela tbody, .td-tabela tr, .td-tabela td { display: block; width: 100%; }
  .td-tabela tr { border: 1px solid #ece6f2; border-radius: 12px; padding: .4rem .2rem; margin-bottom: .6rem; }
  .td-tabela td { border: 0; padding: .25rem .75rem; display: flex; justify-content: space-between; gap: 1rem; white-space: normal; }
  .td-tabela td::before { content: attr(data-rotulo); color: #8a7c96; font-size: .78rem; }
}
