:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --neon-blue: #0ea5e9;
    --neon-purple: #a855f7;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
}

/* Sidebar */
aside {
    width: 260px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--neon-blue), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 3rem;
}

nav ul {
    list-style: none;
}

nav li {
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    color: var(--text-muted);
}

nav li.active,
nav li:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-main);
    border-left: 3px solid var(--primary);
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
}

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.card .value {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Listings Table */
.listings-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease forwards;
}

/* SPA State */
.hidden {
    display: none !important;
}

/* Properties Grid (Meus Imóveis) */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.property-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s;
}

.property-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.property-img-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(45deg, #1e293b, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--glass-border);
}

.property-content {
    padding: 1.2rem;
}

.property-content h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    text-transform: capitalize;
}

.property-content .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4ade80;
    margin-bottom: 1rem;
}

.property-content .features {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.property-content .codigo {
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Megaphone Button */
.megaphone-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(99, 102, 241, 0.9);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    z-index: 10;
}

.megaphone-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.property-card {
    position: relative;
}

/* Para o botão absoluto */

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #0f172a;
    /* var(--bg-dark) */
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* var(--glass-border) */
    width: 90%;
    max-width: 600px;
    border-radius: 20px;
    padding: 2rem;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: #94a3b8;
    /* var(--text-muted) */
    font-size: 1.5rem;
    cursor: pointer;
}

.ad-option {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.ad-option h5 {
    color: #6366f1;
    /* var(--primary) */
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.ad-text {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: pre-wrap;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.btn-copy {
    background: #6366f1;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-copy:hover {
    background: #4f46e5;
}

/* ============================================================
   BOTÃO DE CONFIGURAÇÃO DE API KEY NO HEADER
   ============================================================ */
.btn-config-key {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 8px;
    color: #a5b4fc;
    font-size: 0.8rem;
    padding: 5px 12px;
    cursor: pointer;
    transition: 0.2s;
    margin-right: 8px;
}

.btn-config-key:hover {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

/* ============================================================
   MELHORIAS — Toolbar de busca e filtro
   ============================================================ */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.toolbar-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-input {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 7px 12px;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
    min-width: 200px;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--primary);
}

.filter-btns {
    display: flex;
    gap: 6px;
}

.filter-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 5px 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================================
   PAGINAÇÃO
   ============================================================ */
.paginacao {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.page-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 5px 14px;
    color: var(--text-main);
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.page-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================================
   BADGES DE STATUS COLORIDOS
   ============================================================ */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-verde   { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.badge-amarelo { background: rgba(250, 204, 21, 0.15); color: #facc15; border: 1px solid rgba(250,204,21,0.3); }
.badge-vermelho{ background: rgba(239, 68, 68, 0.15);  color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-cinza   { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); border: 1px solid var(--glass-border); }

/* ============================================================
   SPINNER DE LOADING
   ============================================================ */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   BADGE NO MENU SIDEBAR
   ============================================================ */
.menu-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
}