:root {
    --primary-blue: #007bff;
    /* Vibrant Blue */
    --primary-dark: #0056b3;
    --secondary-bg: #f8f9fa;
    --text-color: #333;
    --text-muted: #6c757d;
    --sidebar-width: 250px;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

body {
    background-color: #f4f6f9;
    /* Light Grey Background */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    font-size: 17px;
    /* Increased base font size for better readability */
}

/* Sidebar Styling */
#sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background-color: #fff;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Allow sidebar to scroll if content overflows */
}

#sidebar .brand {
    padding: 19px;
    font-size: 1.4rem;
    /* Increased */
    font-weight: bold;
    color: var(--text-color);
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

#sidebar .brand i {
    color: var(--primary-blue);
}

#sidebar .nav-links {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex-grow: 1;
}

#sidebar .nav-links li {
    margin-bottom: 5px;
}

#sidebar .nav-links a {
    display: flex;
    align-items: center;
    padding: 16px 22px;
    /* Further increased padding */
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-weight: 600;
    font-size: 1.05rem;
    /* Increased font size as requested */
}

#sidebar .nav-links a:hover,
#sidebar .nav-links a.active {
    background-color: #eff6ff;
    color: var(--primary-blue);
    border-left-color: var(--primary-blue);
}

#sidebar .nav-links a i {
    margin-right: 16px;
    width: 28px;
    text-align: center;
    font-size: 1.3rem;
    /* Larger icons */
}

/* Main Content Area */
#main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    overflow-y: auto;
    /* Added to enable vertical scrolling for main content */
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title {
    font-size: 1.6rem;
    /* Increased */
    font-weight: 600;
    color: var(--text-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: bold;
    font-size: 1.15rem;
    /* Increased */
    display: block;
}

.user-role {
    font-size: 0.9rem;
    /* Increased */
    color: var(--text-muted);
}

/* Dashboard Cards */
.stat-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 25px;
    /* Increased padding */
    box-shadow: var(--card-shadow);
    border: none;
    height: 100%;
    transition: transform 0.2s;
}

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

.stat-title {
    color: var(--text-muted);
    font-size: 0.95rem;
    /* Increased from 1rem */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.9rem;
    /* Increased significantly */
    font-weight: bold;
    color: var(--primary-blue);
    margin-bottom: 5px;
}

.stat-subtitle {
    font-size: 0.85rem;
    /* Increased from 1rem */
    color: #888;
}

/* Charts Section */
.chart-container {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Submenu Styling */
#sidebar .sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

#sidebar .sub-menu a {
    padding-left: 52px;
    /* Indent submodules */
    font-size: 0.95rem;
    /* Increased as requested */
    padding-top: 13px;
    padding-bottom: 13px;
    font-weight: 500;
}

#sidebar .nav-links .dropdown-toggle::after {
    margin-left: auto;
    transition: transform 0.2s;
}

#sidebar .nav-links .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(90deg);
}

/* Modern Bootstrap Compatibility Layers */
.card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: none;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.card-body {
    padding: 25px;
    flex: 1 1 auto;
}

.card-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Utilities */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, .075) !important;
}

.border-0 {
    border: 0 !important;
}

.bg-white {
    background-color: #fff !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

.text-primary {
    color: var(--primary-blue) !important;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-muted {
    color: #6c757d !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.py-3 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.p-4 {
    padding: 1.5rem !important;
}

.px-5 {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
}

.g-3 {
    margin-top: 0;
}

.g-3>.col-md-3,
.g-3>.col-md-6,
.g-3>.col-12 {
    padding-top: 15px;
    padding-bottom: 15px;
}

.text-end {
    text-align: right !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

/* Added */
.align-items-center {
    align-items: center !important;
}

/* Form overrides for BS3 */
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.input-group-text {
    display: table-cell;
    vertical-align: middle;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    color: #555;
    text-align: center;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .form-control {
    display: table-cell;
}