/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    margin: 0;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    height: 100vh;
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #1a237e;
    /* Deep Blue */
    color: white;
    padding-top: 20px;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar h4 {
    text-align: center;
    font-weight: bold;
    margin-bottom: 30px;
    color: #fff;
}

.sidebar a {
    padding: 15px 25px;
    text-decoration: none;
    font-size: 16px;
    color: #cfd8dc;
    display: block;
    transition: 0.3s;
}

.sidebar a:hover,
.sidebar a.active {
    color: white;
    background-color: #283593;
    border-left: 4px solid #fff;
}

.sidebar i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 20px;
    transition: all 0.3s;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    border-radius: 10px 10px 0 0 !important;
    padding: 15px 20px;
}

/* Login Page */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.login-card h3 {
    text-align: center;
    color: #1a237e;
    margin-bottom: 25px;
}

.form-control {
    border-radius: 5px;
    padding: 10px;
}

.btn-primary {
    background-color: #1a237e;
    border-color: #1a237e;
    padding: 10px;
    font-weight: bold;
    width: 100%;
}

.btn-primary:hover {
    background-color: #0d47a1;
    border-color: #0d47a1;
}

/* Status Badges */
/* Status Badges - General */
.badge[class*="badge-"] {
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    background-color: #6c757d;
    /* Default Gray */
}

/* Specific Status Colors */
.badge-new {
    background-color: #2196f3;
}

.badge-contacted {
    background-color: #ff9800;
}

.badge-interested {
    background-color: #4caf50;
}

.badge-converted {
    background-color: #1b5e20;
}

.badge-lost {
    background-color: #f44336;
}

.badge-followup {
    background-color: #9c27b0;
}

/* Example for other statuses */

/* Status Colors (Text) */
.text-new {
    color: #2196f3;
}

.text-contacted {
    color: #ff9800;
}

.text-interested {
    color: #4caf50;
}

.text-converted {
    color: #1b5e20;
}

.text-lost {
    color: #f44336;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 50% !important;
        /* Global mobile font size */
    }

    .card-title-small {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }

    .card-value-small {
        font-size: 1.2rem;
        margin-bottom: 0;
    }

    .card {
        margin-bottom: 5px !important;
    }

    .card-body {
        padding: 8px !important;
    }

    .filter-section {
        font-size: 0.75rem !important;
        /* ~30% smaller than base */
    }

    .filter-section .card-body {
        padding: 5px !important;
    }

    /* Global Header Refinement */
    .page-header {
        background: #0d6efd !important;
        /* Blue background */
        margin: -15px -15px 15px -15px !important;
        /* Negative margin to span full width */
        padding: 15px 15px !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        border-radius: 0 !important;
        width: calc(100% + 30px) !important;
        /* Force edge-to-edge calculation */
    }

    /* Target the container-fluid around page-header to remove its side padding on mobile */
    .main-content {
        padding: 15px 15px !important;
        /* Base padding */
    }

    /* Remove top margin from container on mobile to let header hit the very top */
    .container-fluid.mt-4,
    .container-fluid {
        margin-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Give padding back to actual content that isn't the header */
    .main-content>*:not(.page-header):not(.container-fluid) {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Fix cards after removing container padding */
    .main-content .card {
        margin-left: 10px !important;
        margin-right: 10px !important;
    }

    .page-header h2,
    .page-header .fs-4,
    .page-header .text-muted {
        color: white !important;
        font-size: 1rem !important;
        margin-bottom: 0 !important;
    }

    .page-header .btn-outline-primary {
        color: white !important;
        border-color: rgba(255, 255, 255, 0.5) !important;
    }

    .page-header .btn-primary {
        background: white !important;
        color: #0d6efd !important;
        border: none !important;
    }

    h2,
    .fs-4 {
        font-size: 1.1rem !important;
        /* Approx 20% reduction from standard 1.4-1.5rem */
    }

    .filter-section .form-control,
    .filter-section .form-select,
    .filter-section .btn {
        font-size: 0.75rem !important;
        padding: 4px 8px !important;
    }

    .sidebar {
        margin-left: -250px;
        position: fixed;
        height: 100vh;
        z-index: 1050;
    }

    .sidebar.active {
        margin-left: 0;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }

    /* Overlay effect when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Table Fix */
    .table-responsive {
        overflow-x: auto;
    }
}