/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 280px;
    height: 100vh !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar.collapsed {
    transform: translateX(-280px);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-circle {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item i {
    width: 20px;
    margin-right: 12px;
}

.nav-dropdown {
    position: relative;
}

.dropdown-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    background: rgba(0, 0, 0, 0.2);
    margin-left: 20px;
}

.nav-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info i {
    font-size: 24px;
}

/* Main Content */
/* Removed - using stronger rule below */

.header {
    background: white;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    display: none;
}

.content {
    padding: 20px;
}

/* Dashboard Styles */
.dashboard-header {
    background: #e9ecef;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.dashboard-title {
    font-size: 24px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

.welcome-text {
    color: #6c757d;
    margin-bottom: 15px;
}

.stats-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-badge {
    display: inline-block;
    padding: 6px 12px;
    margin: 5px;
    border-radius: 12px;
    cursor: pointer;   /* 👈 shows pointer hand */
    font-weight: bold;
    background: #f1f1f1;
    transition: background 0.2s, transform 0.2s;
}

.stat-badge:hover {
    background: #ddd;   /* 👈 hover effect */
    transform: scale(1.05);  /* 👈 little pop effect */
}

.stat-badge.won {
    background: #28a745;
    color: white;
}

.stat-badge.lost {
    background: #dc3545;
    color: white;
}

.stat-badge.total {
    background:#5b88b8;
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card h5 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #495057;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #495057;
}

.daily-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.daily-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.daily-card.yesterday {
    border-left: 4px solid #6c757d;
}

.daily-card.today {
    border-left: 4px solid #ffc107;
}

.daily-card.total {
    border-left: 4px solid #28a745;
}

.daily-card h6 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #495057;
}

.daily-number {
    font-size: 32px;
    font-weight: bold;
    color: #495057;
}

.followup-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.followup-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.followup-card {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
}

.followup-number {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.followup-card.pending .followup-number {
    color: #dc3545;
}

.followup-card.today .followup-number {
    color: #ffc107;
}

.followup-card.future .followup-number {
    color: #28a745;
}

/* Leads List Styles */
.leads-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.leads-title {
    font-size: 24px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.leads-subtitle {
    color: #6c757d;
    margin-bottom: 20px;
}

.search-filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-section {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.filter-section.search {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.filter-section.date {
    background: #e8f5e8;
    border-left: 4px solid #4caf50;
}

.filter-section.pagination {
    background: #fce4ec;
    border-left: 4px solid #e91e63;
}

.leads-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table {
    margin-bottom: 0;
}

.table th {
    background: #f8f9fa;
    border-top: none;
    font-weight: 600;
    color: #495057;
}

.lead-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #6c757d;
}

.lead-actions button {
    min-width: 80px;
}

.lead-card .lead-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.lead-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.lead-name {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.lead-phone {
    color: #007bff;
    text-decoration: none;
}

.lead-phone:hover {
    text-decoration: underline;
}

.lead-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.lead-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 2px;
}

.detail-value {
    font-weight: 500;
    color: #495057;
}

.lead-actions {
    display: flex;
    gap: 10px;
}

/* Lead Detail Styles */
.lead-detail-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.lead-number {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.lead-contact-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.contact-name {
    font-size: 20px;
    font-weight: 500;
}

.contact-phone {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.lead-status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
}

.lead-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info-card h6 {
    color: #495057;
    margin-bottom: 15px;
    font-weight: 600;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #6c757d;
    font-weight: 500;
}

.info-value {
    color: #495057;
    font-weight: 500;
}

.followup-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.followup-item {
    padding: 15px;
    border-left: 4px solid #007bff;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 10px;
}

.followup-date {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.followup-desc {
    color: #6c757d;
}

/* Management Pages */
.management-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.management-title {
    font-size: 24px;
    font-weight: 600;
    color: #495057;
}

.management-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-280px);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .daily-stats {
        grid-template-columns: 1fr;
    }
    
    .lead-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .lead-contact-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .management-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Custom Form Styles */
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    color: #212529;
}

/* Pagination Styles */
.pagination {
    justify-content: center;
    margin-top: 20px;
}

.page-link {
    color: #667eea;
}

.page-link:hover {
    color: #5a6fd8;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    background-color: #667eea;
    border-color: #667eea;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Modal Enhancements */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 12px 12px;
}


/* Navigation Section Styles */
.nav-section {
    margin-bottom: 10px;
}

.nav-section-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 5px;
}

.nav-section-header i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.nav-section-items {
    padding-left: 20px;
}

.nav-subitem {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin-bottom: 2px;
    position: relative;
}

.nav-subitem:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.nav-subitem.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffc107;
    font-weight: 500;
}

.nav-subitem.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ffc107;
    border-radius: 0 3px 3px 0;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffc107;
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ffc107;
    border-radius: 0 3px 3px 0;
}


/* Footer Styles */
.footer {
    background: #343a40;
    color: #fff;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #dee2e6;
}

.footer h6 {
    color: #ffc107;
    margin-bottom: 10px;
}

.footer p {
    margin-bottom: 5px;
    font-size: 14px;
}

.footer i {
    margin-right: 8px;
    color: #ffc107;
}

.footer-copyright {
    color: #adb5bd;
}

.footer-copyright small {
    color: #6c757d;
}

/* User Info Styles */
.user-info {
    display: flex;
    align-items: center;
    color: #495057;
    font-weight: 500;
}

.user-info i {
    margin-right: 8px;
    color: #6c757d;
}

/* Followup Details Styles */
.followup-details-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.followup-details-title {
    color: #495057;
    margin: 0;
    flex-grow: 1;
}

.followup-details-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Clickable followup cards */
.followup-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.followup-card {
    transition: all 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .followup-details-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .user-info {
        font-size: 14px;
    }
    
    .footer {
        text-align: center;
    }
    
    .footer .text-md-end {
        text-align: center !important;
        margin-top: 15px;
    }
}


/* Sidebar Footer Styles */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.user-profile {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.user-profile i {
    margin-right: 10px;
    font-size: 18px;
    color: #ffc107;
}

/* Main content positioning - IMPORTANT */
.main-content {
    margin-left: 280px !important;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    padding: 0;
}

.main-content.expanded {
    margin-left: 0 !important;
}

/* Header Layout Improvements */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    color: #495057;
    font-weight: 500;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.user-info i {
    margin-right: 8px;
    color: #6c757d;
}

/* Sidebar positioning fix */
.sidebar {
    position: relative;
    padding-bottom: 80px; /* Space for footer */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
    }
    
    .header-center {
        order: -1;
        margin-bottom: 10px;
    }
    
    .sidebar-footer {
        position: relative;
        margin-top: 20px;
    }
}

