:root {
    --brand: #6c63ff;
    --brand-dark: #4b3fd6;
    --bg: #f5f6fa;
    --sidebar-bg: #1c1b2e;
    --sidebar-text: #c7c5e0;
}

body {
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    padding: 1.25rem 1.25rem 1rem;
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: .65rem 1.25rem;
    border-left: 3px solid transparent;
    font-size: .92rem;
}

.sidebar .nav-link:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.sidebar .nav-link.active {
    background: rgba(108,99,255,.18);
    color: #fff;
    border-left-color: var(--brand);
    font-weight: 600;
}

.sidebar .nav-section {
    padding: .5rem;
}

.sidebar .footer-user {
    margin-top: auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: .85rem;
}

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-body {
    padding: 1.5rem;
}

.card-stat {
    background: #fff;
    border-radius: .6rem;
    padding: 1.1rem 1.3rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    border: 1px solid #eef0f4;
}

.card-stat .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
}

.card-stat .stat-label {
    color: #6b7280;
    font-size: .82rem;
}

.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn-brand:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

/* Kanban */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    align-items: flex-start;
}

.kanban-column {
    background: #eef0f6;
    border-radius: .6rem;
    width: 270px;
    flex-shrink: 0;
    padding: .6rem;
    min-height: 200px;
}

.kanban-column-header {
    font-weight: 600;
    font-size: .85rem;
    padding: .4rem .3rem .6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-card {
    background: #fff;
    border-radius: .5rem;
    padding: .65rem .75rem;
    margin-bottom: .55rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
    cursor: grab;
    border: 1px solid #e5e7eb;
    font-size: .85rem;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: .4;
}

.kanban-card .deal-value {
    font-weight: 700;
    color: var(--brand-dark);
}

.kanban-column.drag-over {
    background: #e0e2f5;
}

.table-hover-link tbody tr {
    cursor: pointer;
}

.badge-stage {
    font-size: .72rem;
}

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -230px; top: 0; bottom: 0; z-index: 1040; transition: left .2s; }
    .sidebar.open { left: 0; }
    .app-wrapper { flex-direction: column; }
}
