:root {
    --sidebar-width: 260px;
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fc;
}

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

/* Sidebar */
.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: linear-gradient(180deg, #4e73df 10%, #224abe 100%);
    min-height: 100vh;
    transition: all 0.3s;
}

.sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-header h3 {
    color: white;
    margin: 0;
    font-size: 1.2rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-left: 4px solid white;
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Content */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
}

/* Cards */
.stat-card {
    border: none;
    border-radius: 0.35rem;
    border-left: 4px solid;
}

.stat-card.primary { border-left-color: var(--primary-color); }
.stat-card.success { border-left-color: var(--success-color); }
.stat-card.info { border-left-color: var(--info-color); }
.stat-card.warning { border-left-color: var(--warning-color); }
.stat-card.danger { border-left-color: var(--danger-color); }

.stat-card .card-body {
    padding: 1.25rem;
}

.stat-card .stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #5a5c69;
}

.stat-card .stat-icon {
    font-size: 2rem;
    color: #dddfeb;
}

/* Pipeline */
.pipeline-stage {
    padding: 15px;
    border-radius: 0.35rem;
    text-align: center;
    color: white;
    margin-bottom: 10px;
}

.pipeline-stage .stage-name {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.pipeline-stage .stage-count {
    font-size: 1.5rem;
    font-weight: 700;
}

.pipeline-stage .stage-value {
    font-size: 0.9rem;
}

/* Table */
.data-table th {
    background-color: #f8f9fc;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--secondary-color);
}

/* Status badges */
.badge-status {
    padding: 0.4em 0.8em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
}

.badge-new { background-color: #36b9cc; color: white; }
.badge-contacted { background-color: #4e73df; color: white; }
.badge-qualified { background-color: #1cc88a; color: white; }
.badge-proposal { background-color: #f6c23e; color: #333; }
.badge-negotiation { background-color: #fd7e14; color: white; }
.badge-won { background-color: #1cc88a; color: white; }
.badge-lost { background-color: #e74a3b; color: white; }
.badge-active { background-color: #1cc88a; color: white; }
.badge-inactive { background-color: #858796; color: white; }

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #5a5c69;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

/* Quick actions */
.quick-action-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Lead rating */
.rating-hot { color: #e74a3b; }
.rating-warm { color: #f6c23e; }
.rating-cold { color: #36b9cc; }

/* Activity timeline */
.activity-timeline {
    position: relative;
    padding-left: 30px;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e3e6f0;
}

.activity-item {
    position: relative;
    padding-bottom: 20px;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
}

.activity-item.completed::before {
    background: var(--success-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    .sidebar.active {
        margin-left: 0;
    }
}

/* Form styling */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #5a5c69;
}

/* Kanban board for opportunities */
.kanban-board {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.kanban-column {
    min-width: 280px;
    background: #f8f9fc;
    border-radius: 0.5rem;
    padding: 15px;
}

.kanban-column-header {
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #e3e6f0;
    margin-bottom: 10px;
}

.kanban-card {
    background: white;
    border-radius: 0.35rem;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.15);
}

.kanban-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.kanban-card-amount {
    color: var(--success-color);
    font-weight: 600;
}

.kanban-card-customer {
    font-size: 0.8rem;
    color: var(--secondary-color);
}
