@import 'variables.css';
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- Layout Grid --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    z-index: 50;
    transition: transform 0.3s ease;
}

.brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.brand span {
    color: var(--primary);
    margin-left: 4px;
}

.nav-menu {
    padding: 24px 16px;
    flex: 1;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link i {
    margin-right: 12px;
    font-size: 1.25rem;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(59, 130, 246, 0.1);
    /* Primary tint */
    color: var(--primary);
}

.user-profile {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.user-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevent overflow issues */
}

.top-header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.8);
    /* Glass effect */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 16px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* --- Dashboard Grid --- */
.content-padding {
    padding: 32px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 24px;
    transition: transform 0.2s;
}

/* KPI Specifics */
.kpi-card {
    position: relative;
    overflow: hidden;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.kpi-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.kpi-icon.purple {
    background: rgba(217, 70, 239, 0.1);
    color: var(--purple);
}

.kpi-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.kpi-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.kpi-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 8px;
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

/* --- Sections --- */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Pipeline Visual --- */
.pipeline-wrapper {
    display: flex;
    gap: 20px;
    height: 200px;
    align-items: flex-end;
    margin-top: 30px;
}

.pipeline-col {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.pipeline-bar {
    width: 60%;
    margin: 0 auto;
    background: var(--primary);
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: height 1s ease;
    box-shadow: 0 0 15px var(--primary-glow);
}

.pipeline-label {
    text-align: center;
    padding-top: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-light);
    width: 100%;
    margin-top: 0;
}

/* --- Lists (Calls/Leads) --- */
.list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.list-item:last-child {
    border-bottom: none;
}

.list-avatar {
    margin-right: 16px;
}

.list-content {
    flex: 1;
}

.list-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.list-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.list-meta {
    text-align: right;
}

.list-time {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.list-status {
    font-size: 0.75rem;
}

.status-overdue {
    color: var(--danger);
}

.status-upcoming {
    color: var(--text-muted);
}

/* --- Mobile Nav Trigger --- */
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .content-padding {
        padding: 20px;
    }

    .top-header {
        padding: 0 20px;
    }

    .pipeline-wrapper {
        gap: 10px;
    }
}