/* Reset and base styles */ 
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #e6eefd;
}

.wrapper {
    display: flex;
}

/* Sidebar styles */
.sidebar {
    width: 250px;
    background-color: #333;
    color: #fff;
    min-height: 100vh;
    position: fixed;
}

.sidebar-header {
    padding: 20px;
    background-color: #363d6b;
    text-align: center;
}

.sidebar-header h2 {
    margin: 0;
}

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

.sidebar-menu li {
    border-bottom: 1px solid #444;
}

.sidebar-menu li a {
    display: block;
    color: #ccc;
    padding: 15px 20px;
    text-decoration: none;
}

.sidebar-menu li a:hover {
    background-color: #575757;
    color: #fff;
}

.sidebar-menu li a i {
    margin-right: 10px;
}

/* Main content styles */
.main-content {
    margin-left: 0px;
    width: calc(100% - 250px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
}

.top-bar h1 {
    font-size: 24px;
}

.top-bar .user-info {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.top-bar .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.top-bar .user-name {
    margin-right: 5px;
    font-weight: bold;
}

.top-bar .user-role {
    margin-right: 10px;
    color: #666;
}

.top-bar .fa-chevron-down {
    color: #666;
}

.dropdown-menu {
    position: absolute;
    top: 60px;
    right: 0;
    background-color: #fff;
    list-style: none;
    border: 1px solid #ddd;
    display: none;
    width: 150px;
}

.dropdown-menu li {
    border-bottom: 1px solid #eee;
}

.dropdown-menu li a {
    display: block;
    padding: 10px;
    color: #333;
    text-decoration: none;
}

.dropdown-menu li a:hover {
    background-color: #f9f9f9;
}

.content {
    flex: 1;
    padding: 20px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-header h2 {
        font-size: 18px;
    }

    .sidebar-menu li a {
        padding: 15px;
        text-align: center;
    }

    .sidebar-menu li a i {
        margin-right: 0;
    }

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

    .main-content {
        margin-left: 60px;
        width: calc(100% - 60px);
    }
}

.summary-graphs {
    margin-bottom: 40px;
}

.building-tiles h2 {
    margin-bottom: 20px;
}

.filter-bar {
    margin-bottom: 20px;
}

.filter-bar input {
    padding: 10px;
    width: 100%;
    max-width: 300px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px;
 }

.tiles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.tile {
    width: calc(25% - 20px);
    background-color: #fff;
    border: 1px solid #dddddd;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.tile:hover {
    transform: scale(1.02);
}

.tile img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.tile-footer {
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

/* Responsive tiles */
@media (max-width: 992px) {
    .tile {
        width: calc(33.333% - 20px);
    }
}

@media (max-width: 768px) {
    .tile {
        width: calc(50% - 20px);
    }
}

@media (max-width: 576px) {
    .tile {
        width: 100%;
    }
}

/* Dashboard Widgets */
.dashboard-widgets {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
}

.widget {
    --widget-color: #000; /* Default color */
    flex: 1;
    min-width: 220px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-left: 7px solid var(--widget-color);
    border-radius: 10px;
    display: flex;
    padding: 20px;
    align-items: center;
}

.widget-icon {
    font-size: 40px;
    margin-right: 15px;
    color: var(--widget-color);
}

.widget-content h3 {
    margin: 0;
    font-size: 18px;
    color: #666;
}

.widget-content p {
    margin: 5px 0 0 0;
    font-size: 36px;
    font-weight: bold;
    color: rgb(81, 79, 79);
}

.widget-blue {
    --widget-color: #3855f9;
    border-color: rgb(165, 174, 253);
    border-left-color: #007bff;
    background-color: #c2d8fb;
}

.widget-amber {
    --widget-color: #ffb404;
    border-color: rgb(255, 219, 87);
    border-left-color: #ffc107;
    background-color: #fbf7b6;
}

.widget-green {
    --widget-color: #02a528;
    border-color: rgb(129, 221, 113);
    border-left-color: #28a745;
    background-color: #d0fcd0;
}

.widget-red {
    --widget-color: #dc3545;
    border-color: rgb(255, 162, 162);
    border-left-color: #dc3545;
    background-color: #f9dcdd;

}

/* Graphs Section */
.graphs-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
}

.graph-card {
    flex: 1;
    min-width: 300px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
}

.graph-card h3 {
    margin-bottom: 15px;
}

.graph-card canvas {
    width: 100%;
    height: 250px;
}

/* Building Tiles */
.building-tiles h2 {
    margin-bottom: 20px;
}

.tiles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.tile {
    width: calc(25% - 20px);
    background-color: #fff;
    border: 1px solid #96a7c3;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.tile:hover {
    transform: scale(1.02);
}

.tile img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.tile-footer {
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .tile {
        width: calc(33.333% - 20px);
    }
}

@media (max-width: 768px) {
    .tile {
        width: calc(50% - 20px);
    }

    .dashboard-widgets {
        flex-direction: column;
    }

    .graphs-section {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .tile {
        width: 100%;
    }
}

/* ------------------------------
   Additional Styles for Reports Page
   ------------------------------ */

/* Reports Overview */
.reports-overview {
    margin-bottom: 40px;
}

.reports-overview h2 {
    margin-bottom: 20px;
    color: #333;
}

.reports-overview p {
    color: #555;
    font-size: 16px;
    line-height: 1.6;
}

/* Filters Section */
.filters {
    margin-bottom: 40px;
}

.filters .row.g-3 {
    flex-direction: row;
}

.filters .col-md-4 {
    width: 100%;
}

.filters .form-label {
    font-weight: bold;
    margin-bottom: 5px;
}

.filters .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
}

.filters .btn-primary i {
    margin-right: 5px;
}

/* Summary Cards */
.row.mb-5 > .col-md-4 > .card {
    border: none;
    border-radius: 10px;
}

.card.text-white.bg-success,
.card.text-white.bg-warning,
.card.text-white.bg-danger {
    border-radius: 10px;
}

.card.text-white.bg-success .card-title,
.card.text-white.bg-warning .card-title,
.card.text-white.bg-danger .card-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.card.text-white .card-text {
    font-size: 28px;
    font-weight: bold;
}

/* Charts Section */
.charts-section {
    margin-bottom: 40px;
}

.charts-section .card {
    border: none;
    border-radius: 10px;
}

.charts-section .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0;
}

.charts-section .card-body {
    padding: 20px;
}

/* Data Tables Section */
.data-tables-section {
    margin-bottom: 40px;
}

.data-tables-section .table {
    border-collapse: collapse;
    width: 100%;
}

.data-tables-section th,
.data-tables-section td {
    text-align: center;
    vertical-align: middle;
}

.data-tables-section th {
    cursor: pointer;
    user-select: none;
}

.data-tables-section th.asc::after {
    content: " \2191";
}

.data-tables-section th.desc::after {
    content: " \2193";
}

.data-tables-section th,
.data-tables-section td {
    padding: 12px 15px;
    border: 1px solid #ddd;
}

.data-tables-section tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Export Options */
.export-options {
    margin-bottom: 40px;
}

.export-options h3 {
    margin-bottom: 20px;
    color: #333;
}

.export-options .btn {
    min-width: 150px;
    margin-right: 10px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.export-options .btn i {
    margin-right: 5px;
}

/* Dark Theme (Optional) */
.dark-theme {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-theme .sidebar {
    background-color: #1e272e;
}

.dark-theme .sidebar-menu li a {
    color: #e0e0e0;
}

.dark-theme .sidebar-menu li a:hover,
.dark-theme .sidebar-menu li a.active {
    background: #485460;
}

.dark-theme .top-bar {
    background-color: #1e272e;
    color: #e0e0e0;
}

.dark-theme .form-control,
.dark-theme .form-select,
.dark-theme .btn-primary,
.dark-theme .btn-success,
.dark-theme .btn-warning,
.dark-theme .btn-info,
.dark-theme .btn-danger,
.dark-theme .card-header,
.dark-theme .card-body,
.dark-theme .card-footer,
.dark-theme .table th,
.dark-theme .table td {
    background-color: #2d3436;
    color: #dfe6e9;
}

.dark-theme .charts-section .card-header {
    background-color: #2d3436;
    border-bottom: 1px solid #636e72;
}

.dark-theme .accordion-button {
    background-color: #636e72;
    color: #dfe6e9;
}

.dark-theme .accordion-button:not(.collapsed) {
    background-color: #b2bec3;
}

.dark-theme .accordion-body {
    background-color: #2d3436;
}

.dark-theme .data-tables-section .table th,
.dark-theme .data-tables-section .table td {
    border: 1px solid #636e72;
}

/* Pie Chart Container */
.pie-chart-container {
    height: 412px; /* Matches the canvas height */
    position: relative;
    
}

/* ------------------------------
   Additional Styles for Reports Page
   ------------------------------ */

/* Reports Overview */
.reports-overview {
    margin-bottom: 40px;
}

.reports-overview h2 {
    margin-bottom: 20px;
    color: #333;
}

.reports-overview p {
    color: #555;
    font-size: 16px;
    line-height: 1.6;
}

/* Filters Section */
.filters {
    margin-bottom: 40px;
}

.filters .row.g-3 {
    flex-direction: row;
}

.filters .form-label {
    font-weight: bold;
    margin-bottom: 5px;
}

.filters .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
}

.filters .btn-primary i {
    margin-right: 5px;
}

/* Summary Cards */
.row.mb-5 > .col-md-4 > .card {
    border: none;
    border-radius: 10px;
}

.card.text-white.bg-success,
.card.text-white.bg-warning,
.card.text-white.bg-danger {
    border-radius: 10px;
}

.card.text-white .card-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.card.text-white .card-text {
    font-size: 28px;
    font-weight: bold;
}

/* Charts Section */
.charts-section {
    margin-bottom: 40px;
}

.charts-section .card {
    border: none;
    border-radius: 10px;
}

.charts-section .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0;
}

.charts-section .card-body {
    padding: 20px;
}

/* Data Tables Section */
.data-tables-section {
    margin-bottom: 40px;
}

.data-tables-section .table {
    border-collapse: collapse;
    width: 100%;
}

.data-tables-section th,
.data-tables-section td {
    text-align: center;
    vertical-align: middle;
}

.data-tables-section th {
    cursor: pointer;
    user-select: none;
}

.data-tables-section th.asc::after {
    content: " \2191"; /* Up arrow */
}

.data-tables-section th.desc::after {
    content: " \2193"; /* Down arrow */
}

.data-tables-section th,
.data-tables-section td {
    padding: 12px 15px;
    border: 1px solid #ddd;
}

.data-tables-section tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Export Options */
.export-options {
    margin-bottom: 40px;
}

.export-options h3 {
    margin-bottom: 20px;
    color: #333;
}

.export-options .btn {
    min-width: 150px;
    margin-right: 10px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.export-options .btn i {
    margin-right: 5px;
}

/* Dark Theme */
.dark-theme {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-theme .sidebar {
    background-color: #1e272e;
}

.dark-theme .sidebar-menu li a {
    color: #e0e0e0;
}

.dark-theme .sidebar-menu li a:hover,
.dark-theme .sidebar-menu li a.active {
    background: #485460;
}

.dark-theme .top-bar {
    background-color: #1e272e;
    color: #e0e0e0;
}

.dark-theme .form-control,
.dark-theme .form-select,
.dark-theme .btn-primary,
.dark-theme .btn-success,
.dark-theme .btn-warning,
.dark-theme .btn-info,
.dark-theme .btn-danger,
.dark-theme .card-header,
.dark-theme .card-body,
.dark-theme .card-footer,
.dark-theme .table th,
.dark-theme .table td {
    background-color: #2d3436;
    color: #dfe6e9;
}

.dark-theme .charts-section .card-header {
    background-color: #2d3436;
    border-bottom: 1px solid #636e72;
}

.dark-theme .accordion-button {
    background-color: #636e72;
    color: #dfe6e9;
}

.dark-theme .accordion-button:not(.collapsed) {
    background-color: #b2bec3;
}

.dark-theme .accordion-body {
    background-color: #2d3436;
}

.dark-theme .data-tables-section .table th,
.dark-theme .data-tables-section .table td {
    border: 1px solid #636e72;
}
/* ------------------------------
   Additional Styles for Annual Compliance Trend
   ------------------------------ */

/* Annual Compliance Trend Chart Container */
.annual-compliance-trend-container {
    height: 400px; /* Reduced from 250px to 200px (20% reduction) */
    position: relative;
}

#annualComplianceTrendChart {
    height: 100%; /* Ensures the canvas fills the container's height */
}

/* ------------------------------
   Additional Styles for Buildings Page
   ------------------------------ */

/* Building Tiles */
.building-tile {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.building-tile img {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s;
}

.building-tile:hover img {
    transform: scale(1.1);
}

.building-tile .card-footer {
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 10px 15px;
    border-top: none;
    transition: background-color 0.3s;
}

.building-tile:hover .card-footer {
    background-color: rgba(0, 0, 0, 0.8);
}

.building-tile .card-title {
    font-size: 1.25rem;
    margin: 0;
}

.action-buttons .btn {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.action-buttons .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.action-buttons .btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
}

.action-buttons .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.action-buttons .btn:hover {
    opacity: 0.8;
}

/* Modal Image Styling */
#detailBuildingImage {
    max-height: 300px;
    object-fit: cover;
    border-radius: 10px;
}

/* Filter Bar */
.filter-bar input {
    max-width: 300px;
    margin-bottom: 20px;
}

/* ------------------------------
   Additional Styles for Assets Page
   ------------------------------ */

/* Dashboard Widgets */
.dashboard-widgets {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-widgets .widget-icon {
    font-size: 40px;
    margin-right: 15px;
    color: var(--widget-color);
}

.dashboard-widgets .widget-content h3 {
    margin: 0;
    font-size: 18px;
    color: #666;
}

.dashboard-widgets .widget-content p {
    margin: 5px 0 0 0;
    font-size: 36px;
    font-weight: bold;
    color: rgb(81, 79, 79);
}

.widget-blue {
    --widget-color: #007bff;
    border-left-color: #007bff;
}

.widget-amber {
    --widget-color: #ffc107;
    border-left-color: #ffc107;
}

.widget-green {
    --widget-color: #28a745;
    border-left-color: #28a745;
}

.widget-red {
    --widget-color: #dc3545;
    border-left-color: #dc3545;
}

/* Filters Section */
.filters .form-label {
    font-weight: bold;
    margin-bottom: 5px;
}

.filters .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
}

.filters .btn-primary i {
    margin-right: 5px;
}

/* Assets Table Section */
.assets-table-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.assets-table-section .btn-success {
    display: inline-flex;
    align-items: center;
}

.assets-table-section .btn-success i {
    margin-right: 5px;
}

.assets-table-section .table thead th {
    vertical-align: middle;
    text-align: center;
}

.assets-table-section .table tbody td {
    vertical-align: middle;
    text-align: center;
}

.assets-table-section .table tbody tr:hover {
    background-color: #f1f1f1;
}

/* Status Badges */
.badge-success {
    background-color: #28a745 !important;
}

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

.badge-warning {
    background-color: #ffc107 !important;
}

/* Charts Section */
.charts-section .card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.charts-section .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0;
}

.charts-section .card-body {
    padding: 20px;
}

/* Modals */
.modal-header {
    background-color: #007bff;
    color: #fff;
    border-bottom: none;
}

.modal-title {
    font-weight: bold;
}

.modal-body p {
    font-size: 1rem;
}

.modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.modal-footer {
    border-top: none;
}

/* Export Buttons */
#exportCsv, #exportPdf {
    display: inline-flex;
    align-items: center;
}

#exportCsv i, #exportPdf i {
    margin-right: 5px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .dashboard-widgets {
        flex-direction: column;
    }
}

/* ------------------------------
   Additional Styles for Assets Inspection Page
   ------------------------------ */

/* QR Scanner Section */
.qr-scanner h2 {
    text-align: center;
    margin-bottom: 20px;
}

#qr-reader {
    border: 2px dashed #007bff;
    border-radius: 10px;
    padding: 10px;
    background-color: #f8f9fa;
}

/* Asset Information Section */
.asset-info h3 {
    text-align: center;
    margin-bottom: 20px;
}

.asset-info .card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.asset-info .card img {
    height: 200px;
    object-fit: cover;
}

.asset-info .card-body {
    padding: 15px;
}

.asset-info .card-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.asset-info .card-text {
    font-size: 1rem;
    margin-bottom: 5px;
}

/* Inspection Questionnaire */
.inspection-questionnaire h3 {
    text-align: center;
    margin-bottom: 20px;
}

.inspection-questionnaire form {
    background-color: #fff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.inspection-questionnaire .accordion-button {
    font-weight: bold;
}

.inspection-questionnaire .form-label {
    font-weight: bold;
}

.inspection-questionnaire .form-check-label {
    margin-left: 10px;
}

.inspection-questionnaire .btn-success {
    width: 100%;
    padding: 10px;
    font-size: 1.1rem;
    border-radius: 10px;
}

.inspection-questionnaire .btn-success:hover {
    background-color: #28a745;
}

/* Recommended Parameters */
.text-muted {
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .asset-info .card img {
        height: 150px;
    }

    .inspection-questionnaire form {
        padding: 15px;
    }

    .inspection-questionnaire .btn-success {
        font-size: 1rem;
        padding: 8px;
    }
}

/* ------------------------------
   Additional Styles for Dashboard
   ------------------------------ */

/* Sidebar Styling */
.sidebar {
    min-height: 100vh;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 20px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 5px;
}

.sidebar-menu li a.active,
.sidebar-menu li a:hover {
    background-color: #495057;
    color: #fff;
    text-decoration: none;
}

.sidebar-menu li a i {
    margin-right: 10px;
}

/* Top Bar Styling */
.top-bar .user-info {
    cursor: pointer;
}

.top-bar .dropdown-menu {
    min-width: 150px;
}

/* Dashboard Cards */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* Chart Containers */
.card-body {
    position: relative;
}


/* Chart Containers */
.card-body-1 {
    position: relative;
    height: 150px;
    padding: 20px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sidebar {
        min-width: 200px;
    }

    .top-bar h1 {
        font-size: 1.25rem;
    }

    .card-body {
        height: 250px;
    }
}

@media (max-width: 576px) {
    .sidebar {
        min-width: 150px;
    }

    .sidebar-header h2 {
        font-size: 1.25rem;
    }

    .top-bar h1 {
        font-size: 1rem;
    }

    .card-body {
        height: 200px;
    }
}

/* Basic Layout (Adjust as needed - you might already have similar styles) */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.sidebar {
    min-width: 250px; /* Default sidebar width */
    max-width: 250px;
    background: #343a40; /* Example background */
    color: #fff;
    transition: all 0.3s; /* Smooth transition for collapsing */
    /* Add height, position etc. if needed based on your full layout */
    height: 100vh; /* Example: Full height */
    position: relative; /* Needed for absolute positioning on mobile */
    z-index: 1000; /* Ensure it's above content if overlapping */
}

.sidebar .sidebar-header {
    padding: 20px;
    background: #212529; /* Darker header */
}

.sidebar ul.sidebar-menu {
    padding: 20px 0;
    list-style: none;
    margin: 0;
}

.sidebar ul li a {
    padding: 10px 20px;
    display: block;
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide text overflow */
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    color: #fff;
    background: #495057;
}

.sidebar ul li a i {
    margin-right: 10px; /* Space between icon and text */
    width: 20px; /* Ensure icons align */
    text-align: center;
}

.main-content {
    flex-grow: 1; /* Take remaining space */
    transition: margin-left 0.3s; /* Smooth transition */
    width: calc(100% - 250px); /* Adjust width when sidebar is visible */
    overflow-y: auto; /* Allow content scrolling */
    height: 100vh; /* Example: Full height */
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #f8f9fa; /* Example background */
    border-bottom: 1px solid #dee2e6;
}

/* Ensure your h1 doesn't have excessive margins pushing things around */
.top-bar-left h1 {
    margin-top: 0;      /* Optional: Reset default margins if needed */
    margin-bottom: 0;   /* Optional: Reset default margins if needed */
    margin-left: 0.5rem; /* Optional: Add a little space if the button's margin isn't enough */
    font-size: 1.75rem; /* Optional: Adjust size as needed */
}

.top-bar-left {
    display: flex;
    align-items: center;
}

#sidebarToggle {
    /* Style the toggle button as needed */
    font-size: 1.25rem;
    border: none;
    background: none;
    padding: 0 0.5rem; /* Adjust padding */
}

/* --- Collapsed State (Applied via JS by adding .sidebar-collapsed to .wrapper) --- */

.wrapper.sidebar-collapsed .sidebar {
    min-width: 80px; /* Width when collapsed */
    max-width: 80px;
    text-align: center; /* Center icons */
}

.wrapper.sidebar-collapsed .sidebar .sidebar-header h2 {
    /* Optionally hide or replace header text when collapsed */
    font-size: 1.2rem; /* Make smaller or hide */
    /* display: none; */
}

.wrapper.sidebar-collapsed .sidebar ul.sidebar-menu li a {
    padding: 15px 10px; /* Adjust padding */
    text-align: center;
}

.wrapper.sidebar-collapsed .sidebar ul.sidebar-menu li a .sidebar-text {
    display: none; /* Hide the text */
}

.wrapper.sidebar-collapsed .sidebar ul li a i {
    margin-right: 0; /* Remove margin when text is hidden */
}

.wrapper.sidebar-collapsed .main-content {
    width: calc(100% - 80px); /* Adjust main content width */
    margin-left: 0; /* Reset margin if using width calculation */
    /* Or if using margin-based layout: */
    /* margin-left: 80px; */
}


/* --- Responsive Behavior (Small Screens) --- */
/* Adjust breakpoint (e.g., 768px) as needed */
@media (max-width: 768px) {
    .sidebar {
        position: absolute; /* Take out of flow */
        left: -250px; /* Hide off-screen by default */
        /* Ensure full width when shown */
        min-width: 250px;
        max-width: 250px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Optional shadow */
    }

    .main-content {
        width: 100%; /* Take full width */
        margin-left: 0 !important; /* Override any margin */
        transition: none; /* Disable transition for immediate shift */
    }

    /* When toggled *open* on small screens */
    .wrapper.sidebar-collapsed .sidebar {
        left: 0; /* Bring sidebar into view */
         /* Reset collapsed styles for mobile view if needed */
        min-width: 250px;
        max-width: 250px;
        text-align: left;
    }

    .wrapper.sidebar-collapsed .sidebar .sidebar-header h2 {
       /* Reset header styles */
        font-size: initial; /* Or whatever your default is */
        display: block;
    }

     .wrapper.sidebar-collapsed .sidebar ul.sidebar-menu li a {
        padding: 10px 20px; /* Reset padding */
        text-align: left; /* Reset text alignment */
    }

    .wrapper.sidebar-collapsed .sidebar ul.sidebar-menu li a .sidebar-text {
        display: inline; /* Show text again */
    }

     .wrapper.sidebar-collapsed .sidebar ul li a i {
        margin-right: 10px; /* Restore icon margin */
    }


    /* On small screens, the 'collapsed' class means 'shown' */
    /* Ensure the button is always visible */
    #sidebarToggle {
        display: inline-block !important; /* Ensure it shows */
    }

    /* Optional: Add an overlay when sidebar is open on mobile */
    /*
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999; // Below sidebar
    }
    .wrapper.sidebar-collapsed .sidebar-overlay {
        display: block;
    }
    */
}

/* Optional: Hide toggle button on larger screens if sidebar should always be shown initially */
/*
@media (min-width: 769px) {
    #sidebarToggle {
        display: none; // Hide toggle on large screens if you never want it collapsed there by default
    }
}
*/