/* =========================================================
   TABELÃO — página própria · identidade HOM Brokers
   preto · off-white · dourado champagne
   (arquivo independente: não altera o tabelao.css do index)
   ========================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --preto: #111111;
    --grafite: #1b1b1b;
    --cinza: #5c5c5c;
    --ouro: #c9a961;
    --ouro-esc: #a3823f;
    --ouro-claro: #f6eed8;
    --fundo: #f5f4f0;
    --branco: #ffffff;
    --borda: #e3ded2;
    --borda-forte: #cfc8b8;
    --sombra: 0 6px 22px rgba(17, 17, 17, 0.07);
    --h-header: 64px;
}

html { scroll-behavior: smooth; }

body.page-tabelao {
    font-family: 'DM Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--fundo);
    color: var(--preto);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------------- CABEÇALHO (vidro fosco, igual à barra fixa do site) ---------------- */
.tb-header {
    position: fixed; inset: 0 0 auto 0; z-index: 100;
    height: var(--h-header);
    display: flex; align-items: center; gap: 14px;
    padding: 0 32px;
    background: rgba(17, 17, 17, 0.78);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid rgba(201, 169, 97, 0.28);
}
.tb-logo { display: inline-flex; align-items: center; }
.tb-logo img { height: 38px; width: auto; display: block; transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.tb-logo:hover img { transform: scale(1.06); }

.tb-nav { display: flex; gap: 4px; margin-left: auto; }
.tb-nav-link {
    color: rgba(255,255,255,.78); font-size: .86rem; font-weight: 500;
    padding: 8px 14px; border-radius: 50px;
    transition: color .25s, background .25s;
}
.tb-nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.tb-nav-link.is-current { color: var(--ouro); }

.tb-header-cta {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ouro); color: var(--preto);
    font-weight: 700; font-size: .82rem;
    padding: 9px 16px; border-radius: 50px;
    box-shadow: 0 4px 16px rgba(201,169,97,.35);
    transition: transform .25s, background .25s, box-shadow .25s;
}
.tb-header-cta .fa { font-size: 1.1rem; }
.tb-header-cta:hover { background: #dcc283; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(201,169,97,.45); }

.tb-voltar {
    display: inline-flex; align-items: center; gap: 8px;
    color: #fff; font-size: .84rem; font-weight: 500;
    padding: 8px 18px; border-radius: 50px;
    border: 1px solid rgba(255,255,255,.25);
    transition: all .3s;
}
.tb-voltar:hover { background: var(--ouro); border-color: var(--ouro); color: var(--preto); transform: translateX(-3px); }

/* ---------------- estrutura ---------------- */
.tb-page { padding-top: var(--h-header); min-height: 100vh; }
.tb-wrap { width: 100%; max-width: 1480px; margin: 0 auto; padding: 0 24px; }

/* ---------------- barra de título ---------------- */
.tb-bar {
    position: relative; overflow: hidden;
    background: linear-gradient(145deg, #1b1b1b 0%, #0a0a0a 100%);
    color: #fff; padding: 28px 0;
    border-bottom: 1px solid rgba(201,169,97,.35);
}
.tb-bar::before {
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .08;
    background-image:
        linear-gradient(rgba(201,169,97,1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201,169,97,1) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: linear-gradient(90deg, #000, transparent 75%);
    mask-image: linear-gradient(90deg, #000, transparent 75%);
}
.tb-bar-inner { position: relative; display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; }

.tb-title small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ouro); }
.tb-title strong { display: block; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 2.2rem; line-height: 1.1; margin-top: 4px; }
.tb-title em { display: block; font-style: normal; font-size: .76rem; color: rgba(255,255,255,.55); margin-top: 6px; }

.tb-avisos { display: contents; }
.tb-chip {
    display: inline-flex; align-items: center; gap: 8px;
    font-weight: 600; font-size: .76rem;
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.22); color: #fff;
}
.tb-chip .fa { color: var(--ouro); }
.tb-chip.warn { border-color: var(--ouro); background: rgba(201,169,97,.14); }

.tb-actions { margin-left: auto; display: flex; gap: 10px; }
.tb-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-weight: 700; font-size: .82rem;
    padding: 11px 18px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,.28); background: transparent; color: #fff;
    cursor: pointer; transition: background .25s, color .25s, border-color .25s, transform .25s, box-shadow .25s;
}
.tb-btn:hover { border-color: var(--ouro); color: var(--ouro); transform: translateY(-2px); }
.tb-btn.primary { background: var(--ouro); border-color: var(--ouro); color: var(--preto); box-shadow: 0 6px 20px rgba(201,169,97,.3); }
.tb-btn.primary:hover { background: #dcc283; border-color: #dcc283; color: var(--preto); box-shadow: 0 10px 26px rgba(201,169,97,.45); }
.tb-btn[disabled] { opacity: .6; cursor: wait; transform: none; }

.tb-banner {
    background: var(--ouro); color: var(--preto); text-align: center;
    padding: 12px 18px; font-weight: 700; font-size: .86rem; letter-spacing: .02em;
}
.tb-banner .fa { margin-right: 6px; }

/* ---------------- abas ---------------- */
.tb-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--borda-forte); margin: 20px 0 18px; overflow-x: auto; scrollbar-width: none; }
.tb-tabs::-webkit-scrollbar { display: none; }
.tb-tab {
    background: none; border: none; cursor: pointer; padding: 12px 2px;
    font-weight: 700; font-size: .92rem; color: var(--cinza);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
    transition: color .25s, border-color .25s;
}
.tb-tab:hover { color: var(--preto); }
.tb-tab.is-active { color: var(--preto); border-color: var(--ouro); }
.tb-tab.legado { color: var(--ouro-esc); }
.tb-tab.legado.is-active { color: var(--preto); }
.tb-count { background: var(--preto); color: var(--ouro); font-size: .68rem; padding: 2px 9px; border-radius: 999px; }

/* ---------------- filtros ---------------- */
.tb-filters {
    background: var(--branco); border: 1px solid var(--borda); border-radius: 18px;
    padding: 20px; box-shadow: var(--sombra);
    display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px 16px;
}
.tb-filters-top, .tb-filters-more { display: contents; }
.tb-filters-toggle { display: none; }

.tb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tb-field > label, .tb-field > .lbl { font-weight: 700; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--cinza); }
.tb-field input, .tb-field select {
    font-family: inherit; font-size: .9rem; padding: 11px 13px;
    border: 1px solid var(--borda); border-radius: 10px;
    background: #fff; color: var(--preto); width: 100%; min-width: 0;
    transition: border-color .25s, box-shadow .25s;
}
.tb-field input:focus, .tb-field select:focus { outline: none; border-color: var(--ouro); box-shadow: 0 0 0 3px rgba(201,169,97,.2); }

.f-busca { grid-column: span 4; } .f-regiao { grid-column: span 3; } .f-bairro { grid-column: span 3; } .f-status { grid-column: span 2; }
.f-desc { grid-column: span 3; } .f-tipo { grid-column: span 3; } .f-met { grid-column: span 3; } .f-ord { grid-column: span 3; }
.f-dorms { grid-column: span 12; }
.tb-met { display: flex; gap: 8px; }
.tb-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.tb-pill {
    font-weight: 700; font-size: .8rem; padding: 8px 17px; border-radius: 999px;
    border: 1px solid var(--borda-forte); background: #fff; cursor: pointer; color: var(--preto);
    transition: all .25s;
}
.tb-pill:hover { border-color: var(--ouro); }
.tb-pill.is-active { background: var(--preto); color: var(--ouro); border-color: var(--preto); }

/* ---------------- resumo ---------------- */
.tb-summary { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin: 18px 0 14px; font-size: .84rem; color: var(--cinza); }
.tb-summary b { color: var(--preto); }
.tb-summary .push { margin-left: auto; display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap; }
.tb-check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; accent-color: var(--ouro-esc); }
.tb-clear {
    font-weight: 700; font-size: .8rem; background: #fff; border: 1px solid var(--borda-forte);
    border-radius: 10px; padding: 8px 15px; cursor: pointer; transition: all .25s;
}
.tb-clear:hover { border-color: var(--ouro); color: var(--ouro-esc); }
.tb-toggle { display: inline-flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--preto); }
.tb-toggle button { font-weight: 700; font-size: .8rem; padding: 8px 17px; border: none; background: #fff; cursor: pointer; transition: background .25s, color .25s; }
.tb-toggle button.is-active { background: var(--preto); color: var(--ouro); }

/* ---------------- tabela (computador) ---------------- */
.tb-region { margin-bottom: 28px; border: 1px solid var(--borda-forte); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: var(--sombra); }
.tb-region-title {
    background: var(--preto); color: var(--ouro); text-align: center;
    font-family: 'Playfair Display', serif; font-weight: 700; font-size: .95rem; letter-spacing: .06em; text-transform: uppercase;
    padding: 12px; border-bottom: 1px solid rgba(201,169,97,.4);
}
.tb-scroll { overflow-x: auto; }
.tb-table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: .76rem; }
.tb-table th {
    background: #1b1b1b; color: #fff; font-weight: 700; font-size: .62rem; letter-spacing: .05em; text-transform: uppercase;
    padding: 10px 6px; border: 1px solid #2c2c2c;
}
.tb-table th.gold { background: var(--ouro); color: var(--preto); border-color: #b99955; }
.tb-table td { border: 1px solid var(--borda); padding: 7px 6px; text-align: center; vertical-align: middle; color: var(--preto); overflow-wrap: anywhere; }
.tb-table tr.alt td { background: #faf9f5; }
.tb-table tbody tr:hover td { background: #f6f1e2; }
.tb-table td.emp { font-weight: 800; text-transform: uppercase; text-align: left; letter-spacing: .01em; }
.tb-table td.left { text-align: left; }
.tb-table td.money { text-align: right; white-space: nowrap; }
.tb-table td.desc { font-weight: 800; text-align: right; white-space: nowrap; }
.tb-table td.desc.legado { background: var(--ouro-claro); color: #7a5a14; }
.tb-table td.note { background: #fff4cc; font-style: italic; font-size: .72rem; color: #7a5a14; }
.tb-table td.muted { background: #f1f0ec; font-style: italic; color: #6f6c6e; font-size: .74rem; }
.tb-table td.futuro { background: #f1f0ec; font-style: italic; color: var(--cinza); letter-spacing: .08em; }
.tb-table td.status { text-align: left; font-weight: 700; }

.tb-badge {
    display: inline-block; font-weight: 800; font-size: .55rem; letter-spacing: .06em;
    padding: 2px 7px; border-radius: 4px; background: var(--preto); color: var(--ouro); margin-top: 3px;
}
.tb-badge.warn { background: #fff4cc; color: #7a5a14; border: 1px solid #e7cf86; }

.tb-wa {
    width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--preto); color: var(--ouro); font-size: 1.05rem;
    transition: background .25s, color .25s, transform .25s;
}
.tb-wa:hover { background: var(--ouro); color: var(--preto); transform: scale(1.08); }
.tb-empty { text-align: center; padding: 56px 0; font-weight: 700; color: var(--cinza); }

/* ---------------- cards (celular, ou opção no computador) ---------------- */
.tb-region-h {
    font-family: 'Playfair Display', serif; font-weight: 700; font-size: .9rem; letter-spacing: .06em; text-transform: uppercase;
    text-align: center; background: var(--preto); color: var(--ouro); border-radius: 10px; padding: 11px 12px; margin: 24px 0 14px;
}
.tb-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.tb-card { background: #fff; border: 1px solid var(--borda); border-radius: 16px; box-shadow: var(--sombra); overflow: hidden; }
.tb-card-head { background: linear-gradient(145deg, #1b1b1b, #0a0a0a); color: #fff; padding: 15px 16px; border-bottom: 2px solid var(--ouro); }
.tb-card-head h3 { color: #fff; font-size: .98rem; font-weight: 800; letter-spacing: .02em; margin: 0 0 2px; text-transform: uppercase; overflow-wrap: anywhere; }
.tb-card-head p { margin: 0; color: rgba(255,255,255,.7); font-size: .8rem; }
.tb-card-head .st { display: inline-block; margin-top: 8px; font-weight: 700; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; background: var(--ouro); color: var(--preto); padding: 3px 10px; border-radius: 999px; }
.tb-u { padding: 14px 16px; border-top: 1px solid var(--borda); display: flex; flex-direction: column; gap: 10px; }
.tb-u:first-of-type { border-top: none; }
.tb-u-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-u-top strong { font-weight: 800; font-size: 1rem; }
.tb-u-top .badges { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.tb-u-top .badges .tb-badge { margin: 0; }
.tb-u-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px 14px; margin: 0; }
.tb-u-grid div { min-width: 0; }
.tb-u-grid dt { font-weight: 700; font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cinza); }
.tb-u-grid dd { margin: 0; font-size: .88rem; font-weight: 600; overflow-wrap: anywhere; }
.tb-u-grid dd.big { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.05rem; }
.tb-u-grid dd.legado { color: var(--ouro-esc); }
.tb-u-note { font-size: .82rem; font-style: italic; padding: 10px 12px; border-radius: 8px; background: #fff4cc; color: #7a5a14; }
.tb-u-note.grey { background: #f1f0ec; color: #5a5658; }
.tb-send {
    display: inline-flex; justify-content: center; align-items: center; gap: 9px;
    background: var(--ouro); color: var(--preto); border-radius: 12px; padding: 12px;
    font-weight: 700; font-size: .86rem; box-shadow: 0 6px 18px rgba(201,169,97,.28);
    transition: background .25s, transform .25s;
}
.tb-send .fa { font-size: 1.15rem; }
.tb-send:hover { background: #dcc283; transform: translateY(-2px); }

/* ---------------- rodapé e botão topo ---------------- */
.tb-footer { background: var(--preto); color: #fff; padding: 34px 0; text-align: center; margin-top: 56px; border-top: 1px solid rgba(201,169,97,.3); }
.tb-footer-logo { height: 34px; width: auto; margin-bottom: 14px; }
.tb-footer p { color: rgba(255,255,255,.72); font-size: .86rem; letter-spacing: .3px; }
.tb-footer .tb-footer-note { color: rgba(255,255,255,.45); font-size: .78rem; margin-top: 4px; }

.tb-top {
    position: fixed; bottom: 28px; right: 24px; width: 46px; height: 46px; border-radius: 50%;
    background: var(--preto); color: #fff; border: 1px solid rgba(201,169,97,.4); font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; z-index: 90;
    opacity: 0; transform: translateY(16px); pointer-events: none;
    transition: opacity .35s, transform .35s, background .25s, color .25s;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.tb-top.visivel { opacity: 1; transform: none; pointer-events: auto; }
.tb-top:hover { background: var(--ouro); color: var(--preto); }

/* ---------------- responsivo ---------------- */
@media (max-width: 1100px) {
    .tb-toggle { display: none; }
    .tb-cards { grid-template-columns: repeat(2, 1fr); }
    .f-busca, .f-regiao, .f-bairro, .f-status, .f-desc, .f-tipo, .f-met, .f-ord { grid-column: span 6; }
    .f-busca { grid-column: span 12; }
}
@media (max-width: 900px) {
    .tb-nav { display: none; }
    .tb-header-cta { margin-left: auto; }
    .tb-header { padding: 0 18px; }
}
@media (max-width: 700px) {
    :root { --h-header: 58px; }
    .tb-wrap { padding: 0 14px; }
    .tb-logo img { height: 32px; }
    .tb-header-cta span { display: none; }
    .tb-header-cta { padding: 9px 12px; }
    .tb-voltar { padding: 8px 14px; }

    .tb-bar { padding: 22px 0; }
    .tb-title strong { font-size: 1.7rem; }
    .tb-actions { margin-left: 0; width: 100%; }
    .tb-actions .tb-btn { flex: 1; }
    .tb-banner { font-size: .76rem; padding: 11px 14px; }

    .tb-cards { grid-template-columns: 1fr; }
    .tb-summary .push { margin-left: 0; }
    .tb-summary { font-size: .8rem; }

    /* filtros recolhíveis no celular */
    .tb-filters { display: block; padding: 14px; border-radius: 16px; }
    .tb-filters-top { display: flex; align-items: flex-end; gap: 10px; }
    .tb-filters-top .f-busca { flex: 1; }
    .tb-filters-toggle {
        display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
        height: 46px; padding: 0 16px; border-radius: 10px; cursor: pointer;
        background: var(--preto); color: var(--ouro); border: none; font-weight: 700; font-size: .85rem;
    }
    .tb-n { background: var(--ouro); color: var(--preto); border-radius: 999px; font-size: .68rem; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }
    .tb-filters-more { display: none; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--borda); }
    .tb-filters.is-open .tb-filters-more { display: grid; }
    .f-busca, .f-regiao, .f-bairro, .f-status, .f-desc, .f-tipo, .f-met, .f-ord, .f-dorms { grid-column: auto; }
    .tb-field input, .tb-field select { font-size: 16px; }
    .tb-top { bottom: 18px; right: 16px; }
}

/* ---------------- impressão ---------------- */
@page { size: A4 landscape; margin: 10mm; }
@media print {
    .tb-header, .tb-filters, .tb-tabs, .tb-actions, .tb-toggle, .tb-clear, .tb-check, .tb-top, .tb-footer, .tb-wa, .tb-send { display: none !important; }
    .tb-page { padding-top: 0; }
    body.page-tabelao { background: #fff; }
    .tb-bar, .tb-table th, .tb-banner, .tb-region-title, .tb-region-h, .tb-card-head, .tb-badge, .tb-table td.desc.legado {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .tb-region { box-shadow: none; break-inside: auto; }
    .tb-table { min-width: 0; }
    .tb-table tr { break-inside: avoid; }
}

.tb-table td.mt { white-space: nowrap; min-width: 56px; }
.tb-n[hidden] { display: none; }
