:root {
    --sidebar-width: 250px;
    --topnav-height: 60px;
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --text-color: #3a3b45;
    --sidebar-bg: #fff;
    --content-bg: #f8f9fc;
    
    /* Consistent Typography */
    --page-title-size: 1.75rem;
    --page-title-weight: 600;
    --section-title-size: 1.25rem;
    --section-title-weight: 600;
    
    /* Consistent Spacing */
    --page-header-margin: 1.5rem;
    --section-margin: 1rem;
    --card-padding: 1.25rem;
    
    /* Consistent Button Sizing */
    --btn-padding-y: 0.5rem;
    --btn-padding-x: 1rem;
    --btn-sm-padding-y: 0.25rem;
    --btn-sm-padding-x: 0.5rem;
}

/* Page Title Styling - Consistent across all pages */
.page-title {
    font-size: var(--page-title-size);
    font-weight: var(--page-title-weight);
    color: var(--text-color);
    margin-bottom: 0;
}

/* Page Header - Consistent layout for page headers with actions */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--page-header-margin);
}

/* Section Title - For subsections within pages */
.section-title {
    font-size: var(--section-title-size);
    font-weight: var(--section-title-weight);
    color: var(--text-color);
    margin-bottom: var(--section-margin);
}

/* Consistent Card Styling */
.content-card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
}

.content-card .card-body {
    padding: var(--card-padding);
}

/* Consistent Table Styling */
.data-table {
    margin-bottom: 0;
}

.data-table thead th {
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid #dee2e6;
}

/* Consistent Form Actions */
.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* Consistent Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

html {
    font-size: 14px;
    height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
}

/* Layout Structure */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(0,0,0,.1);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1rem;
    text-align: center;
}

.organisation-name {
    margin-top: -0.5rem;
    padding-bottom: 0.5rem;
    color: var(--secondary-color);
    border-bottom: 1px solid rgba(0,0,0,.05);
}

.sidebar .nav-link {
    padding: 0.8rem 1.25rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

    .sidebar .nav-link:hover {
        color: var(--primary-color);
        background-color: var(--content-bg);
    }

    .sidebar .nav-link i {
        min-width: 1.75rem;
        font-size: 0.85rem;
        line-height: 1;
    }

.sidebar .sub-menu {
    padding-left: 2.5rem;
}

    .sidebar .sub-menu .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--content-bg);
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
.top-navbar {
    height: var(--topnav-height);
    background: #fff;
    padding: 0 1.5rem;
}

.navbar-brand {
  margin-right: 0 !important;
}

#sidebarToggle {
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    color: var(--text-color);
    border: none;
    background: transparent;
    display: none;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Footer */
footer.sticky-footer {
    padding: 2rem 0;
    flex-shrink: 0;
}

    footer.sticky-footer .copyright {
        line-height: 1;
        font-size: 0.8rem;
    }

body.sidebar-toggled footer.sticky-footer {
    width: 100%;
}

.footer {
    padding: 1rem 0;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,.1);
    margin-top: auto;
}

    .footer a {
        color: var(--primary-color);
        text-decoration: none;
    }

        .footer a:hover {
            text-decoration: underline;
        }

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .layout-wrapper.sidebar-open .main-content {
        margin-left: var(--sidebar-width);
    }

    #sidebarToggle {
        display: block;
    }

    /* Hide toggle button when sidebar is visible */
    .sidebar.show ~ .main-content #sidebarToggle {
        display: none;
    }
}
