:root {
    --sidebar-width: 250px;
    --sidebar-bg: #212529;
    --sidebar-color: #adb5bd;
    --sidebar-active-color: #fff;
    --sidebar-hover-bg: #343a40;
    --content-bg: #f8f9fa;
    --primary-color: #0d6efd;
}

body {
    background-color: var(--content-bg);
    min-height: 100vh;
}

#wrapper {
    display: flex;
    width: 100%;
}

#sidebar-wrapper {
    min-height: 100vh;
    width: var(--sidebar-width);
    margin-left: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-color);
    transition: margin 0.25s ease-out;
    z-index: 1050; /* Higher than navbar */
    display: flex;
    flex-direction: column;
}

/* Ensure visibility when logged in */
body.user-logged-in #sidebar-wrapper {
    display: flex !important;
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: calc(-1 * var(--sidebar-width));
}

@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-left: calc(-1 * var(--sidebar-width));
        position: fixed;
    }
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }
    #page-content-wrapper {
        min-width: 100vw;
    }
    #menu-toggle {
        display: block !important;
    }
    #sidebar-wrapper .list-group {
        width: 100%;
    }
}

/* Ensure menu-toggle is visible on larger screens if we want to allow collapsing there too */
#menu-toggle {
    display: block;
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.5rem 1.25rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar-wrapper .list-group {
    width: var(--sidebar-width);
}

#sidebar-wrapper .list-group-item {
    background-color: transparent;
    color: var(--sidebar-color);
    border: none;
    padding: 0.75rem 1.25rem;
    transition: all 0.2s;
}

#sidebar-wrapper .list-group-item:hover {
    background-color: var(--sidebar-hover-bg);
    color: var(--sidebar-active-color);
}

#sidebar-wrapper .list-group-item.active {
    background-color: var(--primary-color);
    color: #fff;
}

#sidebar-wrapper .list-group-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

#page-content-wrapper {
    width: 100%;
    flex: 1;
}

.top-navbar {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1.5rem;
}

/* Dashboard Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

.stats-card {
    transition: transform 0.2s;
}

.stats-card:hover {
    transform: translateY(-5px);
}

/* Badges */
.bg-primary-soft { background-color: #e7f1ff; }
.bg-success-soft { background-color: #e6fcf5; }
.bg-warning-soft { background-color: #fff9db; }
.bg-danger-soft { background-color: #fff5f5; }
.bg-secondary-soft { background-color: #f8f9fa; }

.badge-soft-primary { background-color: #e7f1ff; color: #0d6efd; }
.badge-soft-success { background-color: #e6fcf5; color: #0ca678; }
.badge-soft-warning { background-color: #fff9db; color: #f08c00; }
.badge-soft-danger { background-color: #fff5f5; color: #fa5252; }

/* Timeline/Notes */
.notes-list .card {
    border-left: 4px solid #dee2e6;
}

.notes-list .card.border-primary {
    border-left-color: var(--primary-color);
}
