/* ============================================================
   Imóvel na Bio — estilo base (mobile-first)
   Cores do corretor entram via --brand / --brand-2 inline.
   ============================================================ */
:root {
    --brand: #1f6feb;
    --brand-2: #0b1220;
    --bg: #f5f6f8;
    --surface: #ffffff;
    --text: #1a1f29;
    --muted: #6b7280;
    --line: #e6e8ee;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 6px 24px rgba(18, 24, 40, .08);
    --shadow-lg: 0 12px 40px rgba(18, 24, 40, .14);
    --ok: #16a34a;
    --warn: #d97706;
    --danger: #dc2626;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 720px; }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; cursor: pointer; font: inherit; font-weight: 600;
    padding: 12px 18px; border-radius: var(--radius-sm);
    background: var(--brand); color: #fff; transition: transform .06s, filter .15s;
    text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn:hover { filter: brightness(.95); }
.btn svg, .btn .lp-icon { width: 1.15em; height: 1.15em; flex: 0 0 auto; fill: currentColor; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 22px; font-size: 1.05rem; border-radius: 12px; }
.btn-wa { background: #25d366; color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost { background: rgba(255,255,255,.15); color: #fff; }
.btn-danger { background: var(--danger); }
.btn-muted { background: #eef0f4; color: var(--text); }
.btn-sm { padding: 8px 12px; font-size: .85rem; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.card-pad { padding: 18px; }

/* ---------- Badges / selos ---------- */
.badge {
    display: inline-block; padding: 4px 10px; border-radius: 999px;
    font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.badge-disponivel { background: #e7f6ed; color: var(--ok); }
.badge-reservado  { background: #fef3e2; color: var(--warn); }
.badge-vendido    { background: #fde8e8; color: var(--danger); }
.badge-alugado    { background: #e8eefe; color: var(--brand); }
.badge-inativo    { background: #eef0f4; color: var(--muted); }
.badge-plan       { background: #f0ecff; color: #6d28d9; }
/* status de leads */
.badge-novo       { background: #e8eefe; color: var(--brand); }
.badge-em_contato { background: #fef3e2; color: var(--warn); }
.badge-visita     { background: #f0ecff; color: #6d28d9; }
.badge-proposta   { background: #e0f2fe; color: #0369a1; }
.badge-fechado    { background: #e7f6ed; color: var(--ok); }
.badge-perdido    { background: #eef0f4; color: var(--muted); }

/* selo de contagem no menu lateral (leads novos) */
.nav-badge {
    display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 4px;
    background: var(--danger); color: #fff; border-radius: 999px;
    font-size: .72rem; font-weight: 700; text-align: center; vertical-align: middle;
}

/* selo sobreposto na foto */
.sold-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(15, 18, 28, .45);
}
.sold-overlay span {
    background: #fff; color: var(--danger); font-weight: 800; text-transform: uppercase;
    padding: 8px 20px; border-radius: 8px; letter-spacing: .05em; transform: rotate(-6deg);
    box-shadow: var(--shadow);
}

/* ============================================================
   PÁGINA PÚBLICA
   ============================================================ */
.bio-header {
    background: linear-gradient(160deg, var(--brand) 0%, var(--brand-2) 130%);
    color: #fff; padding: 32px 16px 28px; text-align: center;
}
.bio-avatar {
    width: 104px; height: 104px; border-radius: 50%; object-fit: cover;
    border: 4px solid rgba(255,255,255,.35); margin: 0 auto 12px; background:#fff;
}
.bio-name { font-size: 1.5rem; font-weight: 800; margin: 0 0 2px; }
.bio-meta { opacity: .92; font-size: .9rem; margin: 2px 0; }
.bio-desc { max-width: 560px; margin: 12px auto 0; opacity: .95; }
.bio-actions {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
    max-width: 560px; margin: 18px auto 0;
}
.bio-actions .btn { flex: 1 1 140px; }

.section-title { font-size: 1.15rem; font-weight: 800; margin: 26px 0 14px; }

/* filtros */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.chip {
    white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: var(--surface);
    border: 1px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--muted);
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.searchbar { display: flex; gap: 8px; margin: 6px 0 4px; }
.searchbar input {
    flex: 1; padding: 12px 14px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); font: inherit;
}

/* grid de imóveis */
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-featured { gap: 16px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.prop-card { position: relative; display: flex; flex-direction: column; }
.prop-card .thumb { position: relative; aspect-ratio: 4/3; background: #e9ebf0; }
.prop-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.prop-card .badge { position: absolute; top: 10px; left: 10px; }
.prop-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.prop-price { font-size: 1.2rem; font-weight: 800; color: var(--brand); }
.prop-title { font-weight: 700; font-size: .98rem; }
.prop-loc { color: var(--muted); font-size: .85rem; }
.prop-features { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.prop-features span { display: inline-flex; align-items: center; gap: 4px; }
.prop-actions { margin-top: auto; display: flex; gap: 8px; padding-top: 8px; }
.prop-actions .btn { flex: 1; }
.featured-flag { background: linear-gradient(90deg,#f59e0b,#f97316); color:#fff; }

/* página individual do imóvel */
.gallery { display: grid; gap: 4px; }
.gallery-main { aspect-ratio: 16/10; background:#e9ebf0; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.gallery-main img { width:100%; height:100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; }
.gallery-thumbs img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img.active { border-color: var(--brand); }
.spec-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
@media (min-width: 560px){ .spec-grid { grid-template-columns: repeat(4,1fr);} }
.spec { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; text-align:center; }
.spec b { display:block; font-size: 1.1rem; }
.spec small { color: var(--muted); }

.sticky-wa {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    box-shadow: 0 -4px 20px rgba(18,24,40,.08);
}
.sticky-wa-inner { display:flex; align-items:center; gap:12px; max-width:640px; margin:0 auto; }
.sticky-wa-price { flex:1; min-width:0; }
.sticky-wa-amount { font-size:1.15rem; font-weight:800; color:var(--brand); line-height:1.2; }
.sticky-wa-amount small { font-size:.7em; color:var(--muted); font-weight:600; }
.sticky-old-price { font-size:.75rem; font-weight:600; color:var(--muted); text-decoration:line-through; line-height:1; }
.sticky-wa .btn-wa { white-space:nowrap; flex-shrink:0; }
.with-sticky { padding-bottom: 96px; }

.empty-state { text-align:center; color: var(--muted); padding: 50px 16px; }
.unavailable { min-height: 70vh; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding: 40px; }

.site-footer { text-align:center; color: var(--muted); font-size:.8rem; padding: 30px 16px 40px; }
.site-footer a { color: var(--brand); font-weight:600; }

/* ============================================================
   PAINÉIS (admin / corretor)
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px; background: #0b1220; color: #cdd3e0; flex-shrink: 0;
    padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { color:#fff; font-weight: 800; font-size: 1.1rem; padding: 6px 10px 18px; }
.sidebar a {
    display: flex; align-items:center; gap: 10px; padding: 11px 12px; border-radius: 10px;
    color: #cdd3e0; font-weight: 500; margin-bottom: 2px;
}
.sidebar a:hover { background: rgba(255,255,255,.06); color:#fff; }
.sidebar a.active { background: var(--brand); color:#fff; }
.sidebar .sep { border-top:1px solid rgba(255,255,255,.1); margin: 12px 6px; }
.main { flex: 1; min-width: 0; }
.topbar {
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 14px 20px; display:flex; align-items:center; justify-content: space-between;
    position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 1.1rem; margin: 0; }
.topbar-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; }
.content { padding: 20px; }

.stats-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
@media (min-width: 720px){ .stats-grid { grid-template-columns: repeat(4,1fr);} }
.stat { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat .num { font-size: 1.8rem; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: .85rem; }

table.tbl { width:100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow:hidden; box-shadow: var(--shadow); }
table.tbl th, table.tbl td { padding: 12px 14px; text-align:left; border-bottom: 1px solid var(--line); font-size:.9rem; }
table.tbl th { background:#f8f9fb; font-size:.78rem; text-transform:uppercase; color:var(--muted); letter-spacing:.03em; }
.table-wrap { overflow-x:auto; }

/* formulários */
.form-grid { display:grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px){ .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px){ .form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }
.field label { display:block; font-weight:600; font-size:.85rem; margin-bottom:6px; }
.field input, .field select, .field textarea {
    width:100%; padding: 11px 12px; border:1px solid var(--line); border-radius: var(--radius-sm);
    font: inherit; background:#fff;
}
.field textarea { min-height: 110px; resize: vertical; }
.field .hint { color: var(--muted); font-size:.78rem; margin-top: 4px; }
.form-actions { display:flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size:.9rem; }
.alert-error { background:#fde8e8; color:#991b1b; }
.alert-ok { background:#e7f6ed; color:#166534; }

.inline-form { display:inline; }
.muted { color: var(--muted); }
.flex { display:flex; gap:10px; align-items:center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.copy-box { display:flex; gap:8px; align-items:center; background:#f8f9fb; border:1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; }
.copy-box code { font-size:.85rem; word-break: break-all; }

/* ---- App-like: barra de navegação inferior (celular) ---- */
.mobile-tabbar { display: none; }
.mobile-only { display: none; }
.topbar-icon-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px; color: var(--muted);
    border: 1px solid var(--line); background: #fff;
}
.topbar-icon-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topbar-icon-link:hover { color: var(--brand); border-color: var(--brand); }

/* Busca global no topo do painel */
.topbar-search input {
    width: 220px; max-width: 40vw;
    padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
    background: #f8f9fb; font-size: .88rem;
}
.topbar-search input:focus { outline: none; border-color: var(--brand); background: #fff; }

@media (max-width: 760px) {
    /* Admin (e demais que usam sidebar): vira tira rolável no topo */
    .app-shell { flex-direction: column; }
    .sidebar {
        width: 100%; height: auto; position: static;
        display: flex; gap: 6px; overflow-x: auto; padding: 10px;
    }
    .sidebar .brand, .sidebar .sep { display: none; }
    .sidebar a { white-space: nowrap; margin: 0; padding: 9px 12px; }

    /* Painel do corretor: esconde a sidebar e usa a barra inferior (app) */
    .panel-body .app-shell { flex-direction: row; }
    .panel-body .sidebar { display: none; }
    .topbar { position: sticky; top: 0; padding: 12px 16px; }
    .topbar h1 { font-size: 1.05rem; }
    .topbar-name { display: none; }
    .topbar-search { display: none; } /* no celular a busca é o ícone de lupa */
    .panel-body .mobile-only { display: inline-flex; }

    /* espaço para a barra inferior não cobrir o conteúdo */
    .panel-body .content { padding: 16px 14px calc(86px + env(safe-area-inset-bottom)); }

    .mobile-tabbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
        background: #fff; border-top: 1px solid var(--line);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        box-shadow: 0 -6px 20px -10px rgba(8,12,24,.25);
    }
    .mobile-tabbar a {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
        padding: 4px 2px; color: var(--muted); font-weight: 600; text-decoration: none;
        border-radius: 10px; min-width: 0;
    }
    .mobile-tabbar a.active { color: var(--brand); }
    .mt-ico { position: relative; display: inline-flex; }
    .mobile-tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .mt-lbl { font-size: .66rem; letter-spacing: .01em; white-space: nowrap; }
    .mt-badge {
        position: absolute; top: -5px; right: -8px; min-width: 16px; height: 16px;
        padding: 0 4px; border-radius: 999px; background: #dc2626; color: #fff;
        font-size: .62rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
    }
    .mobile-tabbar .mt-more {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
        padding: 4px 2px; color: var(--muted); font-weight: 600; background: none; border: 0;
        cursor: pointer; border-radius: 10px; min-width: 0; font: inherit;
    }
    .mobile-tabbar .mt-more.active { color: var(--brand); }
    .mobile-tabbar .mt-more svg circle { fill: currentColor; stroke: none; }
}

/* Menu "Mais" da tabbar (mobile) */
.mobile-more-sheet[hidden], .mobile-more-backdrop[hidden] { display: none; }
.mobile-more-backdrop { position: fixed; inset: 0; background: rgba(8,12,24,.4); z-index: 60; }
.mobile-more-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
    background: #fff; border-radius: 18px 18px 0 0;
    padding: 8px 12px calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 40px -12px rgba(8,12,24,.4);
    display: flex; flex-direction: column; gap: 2px;
}
.mobile-more-sheet .mms-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 6px auto 10px; }
.mobile-more-sheet a {
    display: block; padding: 14px; border-radius: 10px; text-decoration: none;
    color: #1a1f29; font-weight: 600; font-size: 1rem;
}
.mobile-more-sheet a.active { background: #eef4ff; color: var(--brand); }
.mobile-more-sheet a.mms-exit { color: #b91c1c; }
.mobile-more-sheet a:active { background: #f1f5f9; }

/* Painel: barra de busca/filtros dos imóveis */
.prop-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.prop-filters .pf-search { flex: 1 1 220px; min-width: 0; padding: 9px 13px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; font-size: .92rem; }
.prop-filters .pf-sel { padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; font-size: .9rem; background: #fff; }
.prop-filters .pf-count { align-self: center; font-size: .85rem; white-space: nowrap; }
.pcard-status { margin: 8px 0 0; }
.pcard-status .act-select { width: 100%; }
.pcard-archived { opacity: .62; }
.pcard-archived .pcard-media img { filter: grayscale(.4); }

.photos-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap:10px; }
.photo-item { position:relative; border-radius: var(--radius-sm); overflow:hidden; border:1px solid var(--line); }
.photo-item.dragging { opacity:.55; outline:2px solid var(--brand); }
.photo-item img { aspect-ratio: 4/3; object-fit: cover; width:100%; }
.photo-item .photo-tools { position:absolute; top:6px; right:6px; display:flex; gap:6px; }
.photo-item .main-tag { position:absolute; bottom:6px; left:6px; background: var(--brand); color:#fff; font-size:.7rem; padding:2px 8px; border-radius:999px; }
.photo-item .drag-handle { position:absolute; top:6px; left:6px; background:rgba(0,0,0,.55); color:#fff; font-size:.7rem; padding:3px 8px; border-radius:999px; cursor:grab; }
.icon-btn { border:0; background: rgba(0,0,0,.55); color:#fff; border-radius:8px; padding:5px 8px; cursor:pointer; font-size:.75rem; display:inline-flex; align-items:center; justify-content:center; }
.icon-btn svg { width:14px; height:14px; fill:currentColor; }

/* infraestrutura (cadastro de imóvel) */
.amenities-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(180px,1fr)); gap:8px; }
.amenity-check { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--line); border-radius:var(--radius-sm); cursor:pointer; font-size:.9rem; }
.amenity-check:hover { background:#f8f9fb; }
.amenity-check input { width:auto; margin:0; }

/* ---------- Pagamentos ---------- */
.pay-banner { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:14px 16px; border-radius:var(--radius-sm); margin-bottom:18px; font-weight:500; }
.pay-banner-ok    { background:#e7f6ed; color:#166534; }
.pay-banner-warn  { background:#fef3e2; color:#92400e; }
.pay-banner-error { background:#fde8e8; color:#991b1b; }
.pay-badge { display:inline-block; padding:4px 10px; border-radius:999px; font-size:.72rem; font-weight:800; text-transform:uppercase; letter-spacing:.02em; }
.pay-badge-active    { background:#e7f6ed; color:#16a34a; }
.pay-badge-pending   { background:#fef3e2; color:#d97706; }
.pay-badge-overdue   { background:#fde8e8; color:#dc2626; }
.pay-badge-cancelled { background:#eef0f4; color:#6b7280; }
.pay-badge-blocked   { background:#fde8e8; color:#991b1b; }

/* ── Dropdown "Registrar pago" no admin de pagamentos ── */
#pay-table details summary { list-style:none; }
#pay-table details summary::-webkit-details-marker { display:none; }

.pay-price { font-size:2rem; font-weight:800; color:var(--brand); }
.pay-price small { font-size:.5em; color:var(--muted); font-weight:600; }
.pay-benefits { list-style:none; padding:0; margin:0 0 16px; display:flex; flex-direction:column; gap:9px; }
.pay-benefits li { display:flex; align-items:flex-start; gap:9px; color:#374151; font-size:.92rem; }
.pay-benefits svg { width:18px; height:18px; flex:0 0 auto; fill:var(--ok); margin-top:1px; }
.pay-summary { width:100%; border-collapse:collapse; }
.pay-summary td { padding:9px 0; border-bottom:1px solid var(--line); font-size:.9rem; vertical-align:top; }
.pay-summary td:first-child { color:var(--muted); width:42%; }

/* depoimentos no painel */
.testi-admin-list { display:flex; flex-direction:column; gap:12px; }
.testi-admin-item { display:flex; align-items:flex-start; gap:12px; border:1px solid var(--line); border-radius:var(--radius-sm); padding:12px; }
.testi-admin-avatar { width:44px; height:44px; border-radius:50%; object-fit:cover; flex:0 0 auto; }
.testi-admin-body { flex:1; min-width:0; }
.testi-stars { color:#f59e0b; margin-left:6px; letter-spacing:1px; }

/* FAQ no painel */
.faq-admin-list { display:flex; flex-direction:column; gap:0; margin:0 0 4px; border:1px solid var(--line); border-radius:var(--radius-sm); overflow:hidden; }
.faq-admin-item {
    display:flex; align-items:flex-start; gap:14px; padding:14px 16px;
    border-bottom:1px solid var(--line); background:#fff; transition:background .15s;
}
.faq-admin-item:last-child { border-bottom:none; }
.faq-admin-item:hover { background:#fafbfc; }
.faq-admin-num {
    width:26px; height:26px; border-radius:50%; background:var(--brand); color:#fff;
    font-size:.78rem; font-weight:800; display:flex; align-items:center; justify-content:center; flex:0 0 auto; margin-top:1px;
}
.faq-admin-body { flex:1; min-width:0; }
.faq-admin-q { font-weight:700; font-size:.95rem; color:var(--text); line-height:1.4; }
.faq-admin-a { color:var(--muted); font-size:.88rem; margin-top:5px; line-height:1.55; }
.faq-remove-btn {
    border:0; background:transparent; color:var(--muted); cursor:pointer; padding:4px;
    border-radius:8px; display:flex; align-items:center; justify-content:center; flex:0 0 auto;
    transition:background .15s, color .15s; margin-top:1px;
}
.faq-remove-btn:hover { background:#fde8e8; color:var(--danger); }
.faq-remove-btn svg { width:17px; height:17px; fill:currentColor; }
.faq-admin-form {
    margin-top:20px; padding-top:18px; border-top:1px solid var(--line);
}

/* ============================================================
   PAINEL DO CORRETOR — camada de design "app" (alta usabilidade)
   ============================================================ */

/* Cabeçalho de página com ação à direita */
.page-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.page-head .ph-info { min-width:0; }
.page-head .ph-title { font-size:1.1rem; font-weight:800; margin:0; line-height:1.2; }
.page-head .ph-sub { color:var(--muted); font-size:.85rem; margin-top:2px; }

/* Lista de itens em cartões (imóveis, leads) — funciona em desktop e mobile */
.list { display:flex; flex-direction:column; gap:12px; }
.list-card {
    background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
    box-shadow:var(--shadow); padding:14px; display:flex; gap:14px; align-items:flex-start;
}
.lc-thumb-wrap { position:relative; flex:0 0 auto; }
.lc-thumb { width:104px; height:78px; border-radius:12px; object-fit:cover; background:#eef0f4; display:block; }
.lc-thumb-wrap .lc-thumb-badge { position:absolute; left:6px; top:6px; }
.lc-thumb-wrap .lc-fav { position:absolute; right:6px; top:6px; width:24px; height:24px; border-radius:50%; background:rgba(0,0,0,.5); display:flex; align-items:center; justify-content:center; }
.lc-thumb-wrap .lc-fav svg { width:14px; height:14px; fill:#f59e0b; }
.lc-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:5px; }
.lc-title { font-weight:700; font-size:1rem; line-height:1.3; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.lc-meta { color:var(--muted); font-size:.83rem; }
.lc-price { font-weight:800; color:var(--text); font-size:1.05rem; }
.lc-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.lc-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }

/* Botão de ação compacto estilo app (44px de alvo no toque) */
.act {
    display:inline-flex; align-items:center; justify-content:center; gap:6px;
    padding:10px 13px; min-height:42px; border-radius:11px; border:1px solid var(--line);
    background:#fff; color:var(--text); font:inherit; font-size:.87rem; font-weight:600; cursor:pointer;
    transition:filter .15s, background .15s, border-color .15s;
}
.act:active { transform:translateY(1px); }
.act svg, .act .lp-icon { width:17px; height:17px; flex:0 0 auto; fill:currentColor; }
.act-primary { background:var(--brand); color:#fff; border-color:var(--brand); }
.act-wa { background:#25d366; color:#fff; border-color:#25d366; }
.act-danger { color:var(--danger); border-color:#f1c9c9; }
.act-danger:hover { background:#fde8e8; }
.act-select { -webkit-appearance:none; appearance:none; padding-right:30px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 8px center; background-size:18px; }

/* Filtro segmentado rolável (chips) */
.seg { display:flex; gap:8px; overflow-x:auto; padding-bottom:6px; margin-bottom:16px; -webkit-overflow-scrolling:touch; }
.seg::-webkit-scrollbar { display:none; }
.seg a { white-space:nowrap; padding:10px 15px; border-radius:999px; border:1px solid var(--line); background:#fff; color:var(--muted); font-weight:600; font-size:.86rem; }
.seg a.active { background:var(--brand); color:#fff; border-color:var(--brand); }

/* Cartão de imóvel (foto no topo) — grid responsivo, app-like */
.plist { display:grid; grid-template-columns:1fr; gap:14px; }
@media (min-width:680px) { .plist { grid-template-columns:repeat(2,1fr); } }
@media (min-width:1040px) { .plist { grid-template-columns:repeat(3,1fr); } }
.pcard { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; display:flex; flex-direction:column; }
.pcard-media { position:relative; aspect-ratio:16/10; background:#eef0f4; }
.pcard-media img { width:100%; height:100%; object-fit:cover; display:block; }
.pcard-media .badge { position:absolute; left:10px; top:10px; box-shadow:0 2px 6px rgba(0,0,0,.18); }
.pcard-fav { position:absolute; right:10px; top:10px; width:30px; height:30px; border-radius:50%; background:rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; }
.pcard-fav svg { width:17px; height:17px; fill:#f59e0b; }
.pcard-body { padding:13px 14px 14px; display:flex; flex-direction:column; gap:5px; }
.pcard-title { font-weight:700; font-size:1rem; line-height:1.3; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pcard-meta { color:var(--muted); font-size:.83rem; }
.pcard-price { font-weight:800; font-size:1.12rem; margin-top:2px; }
.pcard-actions { display:flex; gap:8px; margin-top:10px; }
.pcard-actions .act { flex:1; }
.pcard-more { margin-top:8px; }
.pcard-more > summary { list-style:none; cursor:pointer; width:100%; }
.pcard-more > summary::-webkit-details-marker { display:none; }
.pcard-more[open] > summary { background:#f3f5f9; }
.pcard-menu { display:flex; flex-direction:column; gap:8px; margin-top:10px; padding-top:12px; border-top:1px solid var(--line); }
.pcard-menu .act, .pcard-menu form { width:100%; }
.pcard-menu .act { justify-content:flex-start; }

/* ---------- CRM: funil (Kanban) ---------- */
.crm-tabs { display:flex; gap:8px; margin-bottom:14px; }
.crm-tabs a { padding:8px 16px; border-radius:999px; border:1px solid var(--line); background:#fff; font-weight:600; font-size:.88rem; color:var(--muted); }
.crm-tabs a.active { background:var(--brand); color:#fff; border-color:var(--brand); }

.kanban { display:flex; gap:12px; overflow-x:auto; padding:2px 2px 12px; -webkit-overflow-scrolling:touch; }
.kanban::-webkit-scrollbar { height:8px; }
.kanban::-webkit-scrollbar-thumb { background:#d3d8e2; border-radius:999px; }
.kcol { flex:0 0 270px; background:#eff1f6; border-radius:14px; padding:10px; display:flex; flex-direction:column; gap:10px; align-self:flex-start; }
.kcol.drop-hover { outline:2px dashed var(--brand); outline-offset:-2px; background:#e7eeff; }
.kcol-head { display:flex; justify-content:space-between; align-items:center; font-weight:800; font-size:.86rem; padding:4px 6px; color:var(--text); }
.kcol-count { background:#fff; border-radius:999px; padding:1px 9px; font-size:.76rem; color:var(--muted); font-weight:700; }
.kcol-empty { color:var(--muted); font-size:.8rem; text-align:center; padding:14px 6px; border:1px dashed #cfd5e0; border-radius:10px; }
.kcard { background:#fff; border:1px solid var(--line); border-radius:12px; padding:11px 12px; box-shadow:var(--shadow); display:block; color:var(--text); cursor:grab; }
.kcard.dragging { opacity:.45; }
.kcard-name { font-weight:700; font-size:.92rem; line-height:1.25; }
.kcard-meta { color:var(--muted); font-size:.79rem; margin-top:3px; line-height:1.4; }
.kcard-foot { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; align-items:center; }
.kchip { font-size:.7rem; font-weight:700; padding:2px 8px; border-radius:999px; background:#eef0f4; color:var(--muted); }
.kchip-due  { background:#fde8e8; color:#b91c1c; }
.kchip-soon { background:#fef3e2; color:#92400e; }
.kchip-story{ background:#f0ecff; color:#6d28d9; }
.kcard-move { margin-top:8px; display:none; }   /* select de mover etapa (mobile) */

/* lembrete de follow-up (banner topo) */
.fup { background:#fff7ed; border:1px solid #fed7aa; border-radius:14px; padding:12px 14px; margin-bottom:16px; }
.fup-title { font-weight:800; color:#9a3412; display:flex; align-items:center; gap:8px; }
.fup-list { display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.fup-row { display:flex; justify-content:space-between; gap:10px; align-items:center; font-size:.88rem; }
.fup-row a { color:var(--brand); font-weight:600; }
.fup-when { font-size:.78rem; font-weight:700; white-space:nowrap; }
.fup-when.due { color:#b91c1c; } .fup-when.soon { color:#92400e; } .fup-when.future { color:var(--muted); }

/* ---------- CRM: linha do tempo ---------- */
.tl { display:flex; flex-direction:column; }
.tl-item { display:flex; gap:12px; padding:11px 0; border-bottom:1px solid var(--line); }
.tl-item:last-child { border-bottom:0; }
.tl-ico { width:34px; height:34px; border-radius:50%; background:#eef2ff; display:flex; align-items:center; justify-content:center; font-size:1rem; flex:0 0 auto; }
.tl-body { flex:1; min-width:0; }
.tl-when { color:var(--muted); font-size:.76rem; }
.tl-text { font-size:.9rem; margin-top:2px; line-height:1.5; word-wrap:break-word; }

/* botões de tipo de registro (nota/ligação/visita) */
.evt-types { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.evt-types label { cursor:pointer; }
.evt-types input { position:absolute; opacity:0; }
.evt-types span { display:inline-flex; align-items:center; gap:6px; padding:8px 13px; border:1px solid var(--line); border-radius:999px; font-size:.85rem; font-weight:600; background:#fff; }
.evt-types input:checked + span { background:var(--brand); color:#fff; border-color:var(--brand); }

/* modelos de mensagem (WhatsApp) */
.tpl-list { display:flex; flex-direction:column; gap:8px; }
.tpl-btn { text-align:left; justify-content:flex-start; }

@media (max-width:760px) {
    .kcol { flex:0 0 84vw; }
    .kcard { cursor:default; }
    .kcard-move { display:block; }   /* no celular, mover por seletor */
}

/* Botão flutuante (FAB) — só no mobile */
.fab { display:none; }

@media (max-width: 760px) {
    .panel-body .content { padding: 14px 12px calc(92px + env(safe-area-inset-bottom)); }
    .card-pad { padding:16px; }
    .card { border-radius:14px; }

    /* botões e alvos de toque maiores */
    .panel-body .btn { padding:13px 16px; min-height:48px; border-radius:12px; font-size:1rem; }
    .panel-body .btn-sm { min-height:42px; padding:10px 14px; font-size:.9rem; }
    .panel-body .btn-lg { min-height:54px; }

    /* stat cards mais enxutos, 2 colunas */
    .stat { padding:14px 12px; }
    .stat .num { font-size:1.5rem; }
    .stat .lbl { font-size:.78rem; }

    /* formulários: input grande e 16px (evita zoom automático do iOS) */
    .field input, .field select, .field textarea { font-size:16px; padding:13px 14px; border-radius:12px; min-height:48px; }
    .field textarea { min-height:120px; }
    .field label { font-size:.9rem; }

    /* tabelas que sobram viram scroll suave com dica visual */
    .table-wrap { margin:0 -2px; -webkit-overflow-scrolling:touch; }

    /* cartões de lista compactos */
    .list-card { padding:12px; gap:12px; }
    .lc-thumb { width:88px; height:66px; }
    .lc-title { font-size:.95rem; }
    .lc-actions .act { flex:1 1 auto; }   /* botões dividem a largura */
    .lc-actions .act-full { flex:1 1 100%; }

    /* FAB visível e ancorado acima da tab bar */
    .fab {
        display:inline-flex; align-items:center; justify-content:center; gap:8px;
        position:fixed; right:16px; bottom:calc(82px + env(safe-area-inset-bottom)); z-index:55;
        height:54px; padding:0 22px; border-radius:999px; background:var(--brand); color:#fff;
        font-weight:700; font-size:1rem; border:0; box-shadow:0 12px 26px -6px rgba(31,111,235,.55);
    }
    .fab svg { width:22px; height:22px; fill:currentColor; }
    .ph-add-desktop { display:none; }  /* no mobile, ação vai pro FAB */
}
