/* =====================================================
   Portal Im��veis - Tema Moderno
   Laranja #E85D04 | Azul #023E8A | Creme #FFF8F0
   ===================================================== */
:root {
    --primary: #E85D04;
    --primary-dark: #D00000;
    --secondary: #023E8A;
    --secondary-light: #0077B6;
    --bg: #FFF8F0;
    --bg-card: #FFFFFF;
    --accent: #FFB703;
    --text: #1A1A1A;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --success: #10B981;
    --danger: #EF4444;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(232,93,4,0.15);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--secondary); text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* HEADER */
.header {
    background: var(--bg-card);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 70px;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    text-decoration: none;
}

.logo span { color: var(--secondary); }

.nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-left: auto;
}

.nav a {
    font-weight: 500;
    color: var(--text);
    transition: color 0.2s;
}

.nav a:hover { color: var(--primary); }

/* Bot�0�0o menu mobile: ESCONDIDO no desktop */
.nav-toggle {
    display: none !important;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text);
    padding: 8px 10px;
    margin-left: auto;
    border-radius: 8px;
}

.nav-toggle:hover {
    background: #f3f4f6;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; transform: translateY(-1px); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-light); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

/* HERO */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #0077B6 100%);
    color: white;
    padding: 60px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(232,93,4,0.15);
    border-radius: 50%;
}

.hero-content { position: relative; z-index: 1; max-width: 700px; }
.hero h1 { font-size: 2.6rem; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.hero p { font-size: 1.15rem; opacity: 0.9; margin-bottom: 28px; }

.search-box {
    background: white;
    border-radius: var(--radius);
    padding: 8px;
    display: flex;
    gap: 8px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.search-box input,
.search-box select {
    flex: 1;
    min-width: 120px;
    border: none;
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: 8px;
    outline: none;
    color: var(--text);
}

.search-box button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.search-box button:hover { background: var(--primary-dark); }

.stats { display: flex; gap: 36px; margin-top: 36px; flex-wrap: wrap; }
.stat-item strong { display: block; font-size: 1.7rem; font-weight: 800; }
.stat-item span { font-size: 0.9rem; opacity: 0.8; }

/* SECTION */
.section { padding: 50px 0; }
.section-title { font-size: 1.7rem; font-weight: 800; margin-bottom: 6px; }
.section-subtitle { color: var(--text-muted); margin-bottom: 28px; }

/* PROPERTY GRID */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 22px;
}

.property-card {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.property-card .badge-highlight {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent);
    color: #1A1A1A;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 2;
}
.property-card .badge-super {
    background: linear-gradient(135deg, #7C3AED, #DB2777);
    color: #fff;
}

.property-card .img-wrap {
    height: 200px;
    background: #eceff3;
    overflow: hidden;
}

.property-card .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
    content-visibility: auto;
}

.property-card:hover .img-wrap img { transform: scale(1.05); }
.property-card .body { padding: 16px; }
.property-card .price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}
.property-card .price { font-size: 1.3rem; font-weight: 800; color: var(--primary); margin: 0; }
.property-card .area {
    margin-left: auto;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.property-card .title {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.property-card .meta {
    display: flex;
    gap: 12px;
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.property-card .location {
    font-size: 0.84rem;
    color: var(--text-muted);
}

/* FORMS */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    max-width: 460px;
    margin: 40px auto;
}

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,93,4,0.12);
}

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-weight: 500;
}

.alert-success { background: #D1FAE5; color: #065F46; }
.alert-error { background: #FEE2E2; color: #991B1B; }
.alert-info { background: #DBEAFE; color: #1E40AF; }

/* DASHBOARD */
.dashboard {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 70px);
}

.sidebar {
    background: var(--secondary);
    color: white;
    padding: 24px 0;
}

.sidebar .user-info {
    padding: 0 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 12px;
}

.sidebar .user-info strong { display: block; font-size: 1.05rem; }
.sidebar .user-info span { font-size: 0.82rem; opacity: 0.7; }

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(255,255,255,0.12);
    color: white;
}

.main-content {
    padding: 28px;
    background: var(--bg);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 { font-size: 1.5rem; font-weight: 800; }

.cards-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-card .label { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 4px; }
.stat-card .value { font-size: 1.6rem; font-weight: 800; color: var(--secondary); }

/* TABLE */
.table-wrap {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }

th {
    background: #F9FAFB;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

tr:hover td { background: #FFF8F0; }

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.73rem;
    font-weight: 600;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }

/* FOOTER */
.footer {
    background: var(--secondary);
    color: white;
    padding: 40px 0 24px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer h4 { font-size: 1.05rem; margin-bottom: 12px; }
.footer a { color: rgba(255,255,255,0.75); display: block; margin-bottom: 6px; }
.footer a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.88rem;
    opacity: 0.7;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state h3 { font-size: 1.2rem; margin-bottom: 6px; color: var(--text); }

/* v3 extras */
.no-photo {
    width: 100%;
    height: 100%;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
    color: #9ca3af;
    font-size: 0.9rem;
}

.property-card-wrap {
    position: relative;
    display: block;
}

.fav-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #9ca3af;
    font-size: 1.1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.fav-btn.on { color: #E85D04; }

.filters-panel {
    background: #fff;
    padding: 12px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 8px;
    align-items: center;
}

.filters-panel .form-control,
.filters-panel .nice-select-btn {
    padding: 8px 10px;
    font-size: 0.84rem;
    border-radius: 10px;
    border: 1.5px solid #CBD5E1;
    background: #fff;
    color: #111827;
    height: 38px;
    text-align: left;
    font-weight: 500;
}

.filters-panel .form-control:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,93,4,0.10);
}

.filters-panel .btn {
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
}
.filters-panel select.nice-field {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 26px;
}
.suggest-wrap { position: relative; }
.suggest-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 40;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,.10);
    max-height: 220px;
    overflow: auto;
    padding: 6px;
}
.suggest-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: .84rem;
    cursor: pointer;
    color: #1f2937;
}
.suggest-item:hover { background: #FFF4EC; color: #E85D04; }
.suggest-item.on { background: #FFF4EC; color: #E85D04; font-weight: 700; }
.nice-select-btn {
    width: 100%;
    display: block;
    text-align: left !important;
    justify-content: flex-start;
    cursor: pointer;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 26px;
}

@media (max-width: 768px) {
    .filters-grid { grid-template-columns: 1fr 1fr; }
    .filters-panel .btn-primary, .filters-panel .btn-outline { grid-column: span 1; }
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 28px;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.mobile-contact-bar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateY(110%);
    transition: transform .3s ease;
}

.mobile-contact-bar.visible { transform: translateY(0); }

.mobile-contact-inner { display: flex; align-items: center; gap: 12px; }
.mobile-contact-info { flex: 1; min-width: 0; }
.mobile-contact-info strong { display: block; color: var(--primary); font-size: 1.05rem; }
.mobile-contact-info span {
    display: block;
    font-size: .78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-contact-btn {
    background: #25D366;
    color: #fff !important;
    font-weight: 700;
    padding: 12px 16px;
    border-radius: 10px;
    text-decoration: none !important;
    white-space: nowrap;
}

.gallery-main img {
    content-visibility: auto;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .header-inner {
        height: auto;
        min-height: 60px;
        padding: 10px 0;
        flex-wrap: wrap;
    }

    /* S�� no celular o bot�0�0o do menu aparece */
    .nav-toggle {
        display: block !important;
    }

    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        margin-left: 0;
        gap: 10px;
        padding: 8px 0 12px;
    }

    .nav.open {
        display: flex;
    }

    .hero h1 { font-size: 1.9rem; }
    .search-box { flex-direction: column; }
    .dashboard { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .property-grid { grid-template-columns: 1fr; }
    .property-card .img-wrap { height: 220px; }

    .mobile-contact-bar { display: block; }
    body.has-contact-bar { padding-bottom: 84px; }
}
.listing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 280px;
}
.listing-actions .btn {
    padding: 5px 9px;
    font-size: 0.78rem;
    min-width: 0;
}
.table-wrap td img {
    width: 88px !important;
    height: 64px !important;
    object-fit: cover;
    max-width: 88px;
}


#pwaBar{position:fixed!important;top:12px!important;bottom:auto!important;left:0;right:0;z-index:2147483647!important;display:flex;justify-content:center;pointer-events:none;opacity:0;transform:translateY(-10px);transition:opacity .25s,transform .25s;}
#pwaBar.on{opacity:1;transform:none;}
#pwaCard,.pwa-bar{cursor:pointer;}.pwa-bar{pointer-events:auto;display:flex;align-items:center;gap:10px;max-width:560px;width:calc(100% - 24px);background:#fff;border:1px solid #eadfd4;box-shadow:0 10px 28px rgba(0,0,0,.14);border-radius:14px;padding:8px 10px 8px 8px;}
.pwa-bar-icon{width:36px;height:36px;border-radius:9px;object-fit:cover;flex-shrink:0;}
.pwa-bar-copy{flex:1;min-width:0;}
.pwa-bar-copy strong{display:block;font-size:.86rem;color:#111827;line-height:1.2;}
.pwa-bar-copy span{display:block;font-size:.74rem;color:#6b7280;line-height:1.25;}
.pwa-bar-install{border:0;background:#E85D04;color:#fff;font-weight:700;font-size:.8rem;border-radius:999px;padding:7px 12px;cursor:pointer;white-space:nowrap;}
.pwa-bar-close{border:0;background:transparent;color:#9ca3af;font-size:22px;line-height:1;cursor:pointer;padding:0 4px;}
@media(max-width:480px){.pwa-bar{width:calc(100% - 16px);} }

.bill-banner{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;padding:10px 16px;background:#FFF4EC;border-bottom:1px solid #F6C7A8;color:#9A3412;font-weight:600;font-size:.92rem;}
.bill-banner-urgent{background:#FEF2F2;border-bottom-color:#FECACA;color:#991B1B;}
