:root {
    --c360-sidebar-w: 256px;
    --c360-primary: #0d6efd;
}
* { box-sizing: border-box; }
body { background: var(--bs-body-bg); }

/* ===== Layout ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--c360-sidebar-w);
    background: #0f172a;
    color: #cbd5e1;
    position: fixed; inset: 0 auto 0 0;
    display: flex; flex-direction: column;
    transition: transform .25s ease;
    z-index: 1040;
}
[data-bs-theme="dark"] .sidebar { background: #020617; }
.sidebar-brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 1.1rem 1.25rem; font-size: 1.2rem; color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .bi { color: var(--c360-primary); font-size: 1.5rem; }
.sidebar .nav-section {
    padding: 1rem 1.25rem .35rem; font-size: .7rem; text-transform: uppercase;
    letter-spacing: .08em; color: #64748b;
}
.sidebar .nav-link {
    display: flex; align-items: center; gap: .75rem;
    color: #cbd5e1; padding: .6rem 1.25rem; border-radius: 0;
    font-size: .92rem;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(13,110,253,.25), transparent);
    color: #fff; box-shadow: inset 3px 0 0 var(--c360-primary);
}
.sidebar .nav-link .bi { font-size: 1.1rem; width: 20px; }

.main { flex: 1; margin-left: var(--c360-sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex; align-items: center; gap: 1rem;
    padding: .75rem 1.25rem; background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color); position: sticky; top: 0; z-index: 1030;
}
.topbar-title { font-size: 1.15rem; margin: 0; font-weight: 600; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.content { padding: 1.5rem; }

.layout.collapsed .sidebar { transform: translateX(-100%); }
.layout.collapsed .main { margin-left: 0; }

@media (max-width: 992px) {
    .main { margin-left: 0; }
    .sidebar { transform: translateX(-100%); }
    .layout.show-sidebar .sidebar { transform: translateX(0); }
}

/* ===== Cards de métrica ===== */
.metric-card { border: none; border-radius: .9rem; overflow: hidden; }
.metric-card .metric-value { font-size: 1.8rem; font-weight: 700; }
.metric-card .metric-icon { font-size: 2rem; opacity: .25; }

/* ===== Kanban ===== */
.kanban { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; }
.kanban-col {
    flex: 0 0 290px; background: var(--bs-tertiary-bg);
    border-radius: .75rem; display: flex; flex-direction: column; max-height: 78vh;
}
.kanban-col-head {
    padding: .75rem 1rem; font-weight: 600; display: flex;
    justify-content: space-between; align-items: center;
    border-top: 3px solid var(--col-color, #888); border-radius: .75rem .75rem 0 0;
}
.kanban-col-body { padding: .5rem; overflow-y: auto; flex: 1; min-height: 60px; }
.kanban-card {
    background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
    border-radius: .6rem; padding: .7rem .8rem; margin-bottom: .55rem; cursor: grab;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .5; }
.kanban-col-body.drag-over { background: rgba(13,110,253,.08); border-radius: .5rem; }
.kanban-card .lead-name { font-weight: 600; font-size: .9rem; }
.kanban-card .lead-meta { font-size: .78rem; color: var(--bs-secondary-color); }
.score-badge { font-size: .7rem; padding: .15rem .4rem; }

/* ===== Mapa de unidades ===== */
.mapa-grid { display: grid; grid-template-columns: repeat(auto-fill, 70px); gap: 8px; }
.lote {
    width: 70px; height: 56px; border-radius: .5rem; display: flex; align-items: center;
    justify-content: center; font-size: .72rem; font-weight: 600; color: #fff; cursor: pointer;
    text-align: center; padding: 2px;
}
.lote.disponivel  { background: #198754; }
.lote.reservado   { background: #ffc107; color: #000; }
.lote.proposta    { background: #fd7e14; }
.lote.vendido     { background: #dc3545; }
.lote.bloqueado,
.lote.indisponivel{ background: #6c757d; }

/* ===== Login ===== */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
}
.login-card { width: 100%; max-width: 400px; border-radius: 1rem; }
