:root {
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 70px;
    --sidebar-bg: #1e1e2d;
    --sidebar-hover: #2a2a3c;
    --transition-speed: 0.3s;
}

/* Remove unnecessary custom styles */

/* Body and Typography */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fc;
    min-height: 100vh;
    margin: 0;
}

/* Sidebar Styles */
.wrapper {
    display: flex;
    width: 100%;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: white;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    overflow: hidden;
    width: 100%;
}

.sidebar-header .logo {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    transition: all var(--transition-speed) ease;
}

.logo-icon {
    display: none;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto;
}

.sidebar.collapsed .logo {
    display: none;
}

.sidebar.collapsed .logo-icon {
    display: block;
}

.sidebar-menu {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    position: relative;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 20px;
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover, 
.sidebar-menu a.active {
    color: white;
    background-color: var(--sidebar-hover);
    border-left: 3px solid var(--primary-color);
}

.sidebar-menu a i {
    margin-right: 10px;
    font-size: 1.1rem;
    min-width: 30px;
    display: flex;
    justify-content: center;
}

.sidebar.collapsed .sidebar-menu a span {
    display: none;
}

.sidebar.collapsed .sidebar-menu a {
    padding: 15px 0;
    justify-content: center;
}

.sidebar.collapsed .sidebar-menu a i {
    margin-right: 0;
    font-size: 1.2rem;
}

.sidebar-section {
    padding: 15px 20px 5px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .sidebar-section {
    height: 30px;
    padding: 15px 0 5px;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .sidebar-section-title {
    display: none;
}

.main-content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    transition: all var(--transition-speed) ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content.expanded {
    width: calc(100% - var(--sidebar-width-collapsed));
    margin-left: var(--sidebar-width-collapsed);
}

/* Main Content Adjustment */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

/* Top Bar Styles */
.top-bar {
    background-color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Menu Button for Mobile */
.menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
}

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

.user-menu {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-name {
    margin-right: 10px;
    font-weight: 500;
    color: var(--dark-color);
}

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

/* Content Area */
.content-area {
    padding: 2rem;
}

/* Button Styles */
.btn {
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.5rem 1.25rem;
    transition: all 0.15s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #3a5fc7;
    border-color: #3a5fc7;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Responsive Sidebar */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }
    
    .sidebar.active {
        width: var(--sidebar-width);
        z-index: 1050;
    }
    
    .main-content {
        width: 100%;
        margin-left: 0;
    }
    
    .main-content.expanded {
        width: 100%;
        margin-left: 0;
    }
    
    .sidebar.collapsed + .main-content {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

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

    .navbar-brand {
        font-size: 1.2rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .badge {
        font-size: 0.65rem;
    }
}

/* Additional Custom Styles (if necessary) */
/* You can add any additional custom styles here that are not covered by Bootstrap */

/* Add these styles to the existing CSS file */

.card {
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.table-responsive {
    border-radius: 0.5rem;
}

.progress {
    height: 10px;
    border-radius: 5px;
}

.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.5rem;
}

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
    border-radius: 0.5rem;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.bg-primary-subtle { background-color: rgba(13, 110, 253, 0.1); }
.bg-success-subtle { background-color: rgba(25, 135, 84, 0.1); }
.bg-warning-subtle { background-color: rgba(255, 193, 7, 0.1); }
.bg-danger-subtle { background-color: rgba(220, 53, 69, 0.1); }
.bg-info-subtle { background-color: rgba(54, 185, 204, 0.1); }

/* Dashboard Alignment Enhancements */

/* Center Summary Cards */
.container-fluid .row.justify-content-center {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

/* Ensure Cards have consistent height */
.card {
    display: flex;
    flex-direction: column;
}

/* Align Card Bodies */
.card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Responsive Adjustments for Tables */
.table-responsive {
    overflow-x: auto;
}

/* Ensure Progress Bars are Full Width */
.progress {
    width: 100%;
}

/* Responsive Adjustments */

/* Adjust card padding and margins for smaller screens */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }
}

/* Further adjust font sizes for better readability on smaller devices */
@media (max-width: 576px) {
    .card-title {
        font-size: 1rem;
    }

    .card-body h3 {
        font-size: 1.5rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.3em 0.6em;
    }

    .avatar {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .avatar-sm {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
}

/* Ensure tables are scrollable on overflow */
.table-responsive {
    overflow-x: auto;
}

/* Center loading spinners */
.text-center.py-4 {
    display: flex;
    justify-content: center;
    align-items: center;
}