/* ============================================
   CRM PORTAL - MAIN STYLESHEET
   ============================================ */

:root {
    --primary: #1a237e;
    --primary-light: #283593;
    --secondary: #1565c0;
    --accent: #e53935;
    --success: #2e7d32;
    --warning: #f57f17;
    --info: #0277bd;
    --sidebar-width: 260px;
    --sidebar-bg: #1a237e;
    --navbar-height: 65px;
}

* { box-sizing: border-box; }
body {
     margin: 0;
     font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
}

/* ====== SIDEBAR ====== */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1a237e 0%, #283593 100%);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.sidebar-logo i {
    font-size: 28px;
    color: #ffd740;
    background: rgba(255,255,255,0.15);
    padding: 8px;
    border-radius: 10px;
}
.sidebar-logo span {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.1);
    padding: 12px;
    border-radius: 12px;
}
.user-avatar {
    width: 40px; height: 40px;
    background: #ffd740;
    color: #1a237e;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.user-name { color: white; font-weight: 600; font-size: 0.9rem; }
.user-role { color: rgba(255,255,255,0.6); font-size: 0.75rem; text-transform: capitalize; }

.sidebar-nav { flex: 1; padding: 15px 10px; }

.nav-section-title {
    color: rgba(255,255,255,0.4);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 15px 10px 5px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 3px;
    transition: all 0.2s;
    font-size: 0.9rem;
    position: relative;
}
.nav-item:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    transform: translateX(3px);
}
.nav-item.active {
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 600;
    border-left: 3px solid #ffd740;
}
.nav-item i { width: 18px; text-align: center; font-size: 0.9rem; }

.nav-badge {
    margin-left: auto;
    background: #ffd740;
    color: #1a237e;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 700;
}
.nav-badge.danger { background: #e53935; color: white; }

.sidebar-footer { padding: 15px 10px; border-top: 1px solid rgba(255,255,255,0.1); }

/* ====== MAIN CONTENT ====== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin 0.3s ease;
}

.top-navbar {
    height: var(--navbar-height);
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    padding: 0 25px;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-breadcrumb {
    flex: 1;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.navbar-right { display: flex; align-items: center; gap: 15px; }

.session-timer {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.session-timer.warning { background: #f8d7da; border-color: #f5c6cb; color: #721c24; }

.avatar-sm {
    width: 30px; height: 30px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    margin-right: 8px;
}

.user-btn { border: none; background: #f8f9fa; border-radius: 10px; }

.page-content { padding: 25px; }

/* ====== STAT CARDS ====== */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
    border-left: 4px solid var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.12); }
.stat-card.blue { border-left-color: #1565c0; }
.stat-card.red { border-left-color: #e53935; }
.stat-card.green { border-left-color: #2e7d32; }
.stat-card.orange { border-left-color: #f57f17; }
.stat-card.purple { border-left-color: #6a1b9a; }
.stat-card.teal { border-left-color: #00695c; }

.stat-icon {
    width: 55px; height: 55px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 15px;
}
.stat-icon.blue { background: #e3f2fd; color: #1565c0; }
.stat-icon.red { background: #ffebee; color: #e53935; }
.stat-icon.green { background: #e8f5e9; color: #2e7d32; }
.stat-icon.orange { background: #fff8e1; color: #f57f17; }
.stat-icon.purple { background: #f3e5f5; color: #6a1b9a; }
.stat-icon.teal { background: #e0f2f1; color: #00695c; }

.stat-number { font-size: 2rem; font-weight: 700; color: #333; line-height: 1; }
.stat-label { color: #666; font-size: 0.85rem; margin-top: 5px; }
.stat-change { font-size: 0.78rem; margin-top: 8px; }
.stat-change.up { color: #2e7d32; }
.stat-change.down { color: #e53935; }

/* ====== CARDS ====== */
.crm-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
    overflow: hidden;
}
.crm-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.crm-card-header h5 { margin: 0; font-weight: 700; color: #333; }
.crm-card-body { padding: 24px; }

/* ====== PROSPECT TABLE ====== */
.prospect-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    border: none;
    padding: 12px 15px;
}
.prospect-table td {
    padding: 14px 15px;
    vertical-align: middle;
    border-color: #f0f0f0;
}
.prospect-table tr:hover { background: #f8f9ff; }

.prospect-avatar {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1a237e, #1565c0);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 10px;
}

.prospect-name { font-weight: 600; color: #333; }
.prospect-company { font-size: 0.8rem; color: #888; }

/* ====== FOLLOWUP TIMELINE ====== */
.timeline { position: relative; padding-left: 40px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 15px; top: 0; bottom: 0;
    width: 2px;
    background: #e0e0e0;
}
.timeline-item { position: relative; margin-bottom: 25px; }
.timeline-dot {
    position: absolute;
    left: -32px; top: 5px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}
.timeline-dot.completed { background: #2e7d32; box-shadow: 0 0 0 2px #2e7d32; }
.timeline-dot.cancelled { background: #757575; box-shadow: 0 0 0 2px #757575; }
.timeline-content {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    border-left: 3px solid var(--primary);
}
.timeline-content.completed { border-left-color: #2e7d32; }
.timeline-content.cancelled { border-left-color: #757575; opacity: 0.7; }

/* ====== FILTERS BAR ====== */
.filters-bar {
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* ====== BUTTONS ====== */
.btn-crm-primary {
    background: linear-gradient(135deg, #1a237e, #1565c0);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 9px 20px;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-crm-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26,35,126,0.4);
    color: white;
}

/* ====== STATUS BADGES ====== */
.badge { border-radius: 8px; padding: 5px 10px; font-size: 0.75rem; font-weight: 600; }

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* ====== PRINT STYLES ====== */
@media print {
    .sidebar, .top-navbar, .filters-bar, .btn { display: none !important; }
    .main-content { margin-left: 0; }
}
