:root {
    --primary-color: #4F46E5;
    --secondary-color: #6B7280;
    --background-color: #F3F4F6;
    --sidebar-background: #111827;
    --card-background: #FFFFFF;
    --text-color: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
}

#main-content {
    transition: margin-left .3s;
}

.card {
    border: none;
    border-radius: 0.75rem;
}
.fab {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: var(--primary-color);
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

.fab:hover {
    background-color: #4338CA; /* A slightly darker primary color */
    color: #FFF;
    transform: scale(1.05);
}
#sidebar {
    background-color: var(--sidebar-background);
    color: #fff;
}

#sidebar .nav-link {
    color: var(--text-muted);
    transition: all 0.2s ease-in-out;
    border-radius: 0.5rem;
}

#sidebar .nav-link:hover {
    background-color: #374151;
    color: #fff;
}

#sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 500;
}

#sidebar .nav-link-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#sidebar hr {
    border-color: #374151;
}

.dropdown-menu {
    border-radius: 0.75rem;
}
.project-card {
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

.project-card .card-footer {
    border-top: 1px solid var(--border-color);
}

.badge.bg-info-soft {
    background-color: rgba(23, 162, 184, 0.1);
    color: #0c8599 !important;
}
.list-group-item-action {
    transition: background-color 0.2s ease-in-out;
}

.list-group-item-action:hover {
    background-color: #f8f9fa; /* A very light grey for hover */
}
#users-table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.object-fit-cover {
    object-fit: cover;
}

.badge.bg-success-soft {
    background-color: rgba(25, 135, 84, 0.1);
    color: #146c43 !important;
}

.badge.bg-secondary-soft {
    background-color: rgba(108, 117, 125, 0.1);
    color: #565e64 !important;
}
#notification-count {
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
    border: 2px solid var(--sidebar-background);
}
/* --- FIX: Hide sidebar on auth pages --- */
.auth-layout #sidebar {
    display: none !important;
}

.plan-card {
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

.plan-card.current-plan {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0.5rem 1.5rem rgba(79, 70, 229, 0.15) !important;
}

.plan-card ul li {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.plan-card ul li i {
    color: var(--primary-color);
}

/* --- STYLES FOR MOBILE HEADER & LAYOUT --- */
.main-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

#main-content {
    flex-grow: 1;
    overflow-y: auto;
}

#sidebar .sidebar-brand {
    transition: all 0.3s ease-in-out;
}

.sidebar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- RESPONSIVE SIDEBAR (MULTI-STAGE) --- */

/* Medium devices (tablets, less than 1200px) - ICON-ONLY SIDEBAR */
@media (max-width: 1199.98px) {
    #sidebar {
        width: 90px !important;
        transition: width 0.3s ease-in-out;
    }

    #sidebar .sidebar-brand {
        width: 100%;
        justify-content: center;
    }

    #sidebar .sidebar-brand i {
        margin-right: 0 !important;
        font-size: 1.8rem;
    }

    .main-wrapper {
        margin-left: 90px;
        width: calc(100% - 90px);
    }

    .sidebar-text, #sidebar .nav-link-header {
        display: none;
    }
    
    #sidebar .nav-link {
        justify-content: center;
    }

    #sidebar .nav-link i {
        margin-right: 0 !important;
        font-size: 1.25rem;
    }
    
    #sidebar .sidebar-footer {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    #sidebar .sidebar-footer .dropdown-toggle::after {
        display: none;
    }
}

/* Small devices (phones, less than 768px) - OFF-CANVAS SIDEBAR */
@media (max-width: 767.98px) {
    #sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        width: 280px !important;
    }

    #sidebar.open {
        transform: translateX(0);
    }
    
    #sidebar.open .sidebar-text, #sidebar.open .nav-link-header {
        display: inline;
    }
    
    #sidebar.open .nav-link {
        justify-content: flex-start;
    }
    
    #sidebar.open .nav-link i {
       margin-right: 0.5rem !important;
       font-size: 1rem;
    }

    #sidebar.open .sidebar-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    #sidebar.open .sidebar-footer .dropdown-toggle::after {
        display: inline-block;
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
        padding-top: 65px; /* Height of the mobile header */
    }

    #main-content {
        padding: 1rem !important;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1049;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1020;
    }
    
    .table th, .table td {
        white-space: nowrap;
        padding: 0.75rem;
    }
}

/* --- RESPONSIVE CONTENT STYLES (MULTI-STAGE) --- */

/* Medium devices (tablets, from 768px to 1199.98px) */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .dashboard-header h1 {
        font-size: 1.75rem;
    }

    #main-content .container-fluid {
        max-width: 100%;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Small devices (phones, less than 768px) */
@media (max-width: 767.98px) {
    /* Dashboard Header */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .dashboard-header h1 {
        font-size: 1.75rem;
    }
    
    /* Stats Cards */
    .stats-card .fs-2 {
        font-size: 1.5rem !important;
    }

    /* Recent Projects Table */
    .recent-projects-card {
        border: none !important;
        box-shadow: none !important;
        background-color: transparent !important;
    }
    .recent-projects-card .card-header {
        background-color: transparent !important;
        padding-left: 0;
        padding-right: 0;
    }
    .recent-projects-card .card-body {
        padding: 0;
    }

    .recent-projects-card .table {
        background-color: var(--card-background);
        border-radius: 0.75rem;
        box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075) !important;
    }
    
    .recent-projects-card .project-actions,
    .recent-projects-card .project-actions-header {
        display: none; /* Hide the actions column */
    }
    /* Projects Page Header */
    .project-list-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .project-list-header .btn {
        width: 100%; /* Make button full width on mobile */
    }
    /* Admin Page Header */
    .admin-header h1 {
        font-size: 1.75rem;
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .admin-header .btn {
        width: 100%;
    }
    .card-body {
        /* This prevents the card's padding from interfering with the scrollable table */
        padding: 0.5rem;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch; /* Provides smooth scrolling on iOS devices */
    }
}