/* Diagnostic: Ensure Trix toolbar and editor are always clickable and above other elements */
trix-toolbar, trix-editor {
    z-index: 99999 !important;
    position: relative !important;
    pointer-events: auto !important;
}
.panel, .container, .panel-body, .card, .row, .col-md-6, .col-md-12 {
    overflow: visible !important;
}
/* Ensure Trix toolbar is always clickable and above other elements */
trix-toolbar {
    z-index: 9999 !important;
    position: relative !important;
    pointer-events: auto !important;
}

/* Fix for Trix editor inside form-compact to prevent overflow issues */
.form-compact trix-editor,
.form-compact trix-toolbar {
    overflow: visible !important;
}

/* Additional fixes for Trix editor interactivity */
trix-editor {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1 !important;
}

trix-editor * {
    pointer-events: auto !important;
}
/* Search row input style for jobs table */
.search-row input {
    width: 100%;
    box-sizing: border-box;
    font-size: small; /* Match compact table font size */
    height: 24px; /* Consistent height for inputs */
}
/* Page main heading style */
.page-heading {
    font-size: 1.2em;
    font-weight: 600;
    color: white;
    margin-bottom: 18px;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-bottom: 2px solid #e3eafc;
    background-color: rgb(95, 99, 107);
    border-radius: 5px;
}
/* Section header style */
.section-heading {
    font-weight: bold;
    background: lightgray;
    color: black;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 1.08em;
    letter-spacing: 0.5px;
}
/* Wrapper for fixed breadcrumb bar */
.breadcrumb-bar-wrapper {
    top: 50px; /* Reduced to match new navbar height */
    left: 0;
    width: 100%;
    z-index: 1030;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    padding-left: 15px;
    margin-bottom: 0;
    height: 32px;
    display: flex;
    align-items: center;
    margin-top: 5px;
}

/* Fixed breadcrumb bar below navbar */
.fixed-breadcrumb {
    top: 50px; /* Height of navbar */
    left: 0;
    width: 100%;
    z-index: 1030;
    background: #f5f5f5;
    margin-bottom: 0;
    border-radius: 0;
    border-bottom: 1px solid #ddd;
    padding-left: 15px;
}
/* Breadcrumb extra extra small font size */
.breadcrumb-xxs {
    font-size: small !important;
    padding-top: 3px;
    padding-bottom: 3px;
    margin-bottom: 5px;
}
/* Make Select2 font size consistent with form controls */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    font-size: small;
}
/* Force Select2 dropdown list font size to match compact form font size */
.form-compact .select2-container--default .select2-dropdown,
.form-compact .select2-container--default .select2-results__option,
.form-compact .select2-container--default .select2-results__option[aria-selected],
.form-compact .select2-container--default .select2-results__option--highlighted {
    font-size: small !important;
}
/* Also target the dropdown globally for extra safety */
.select2-container .select2-dropdown,
.select2-container .select2-results__option {
    font-size: small !important;
}

.select2-container .select2-search--inline
 {
    float: left;
    font-size: small;
}


.table.compact-table>tbody>tr>th,
.table.compact-table>tbody>tr>td, 
.table.compact-table>tbody>tr>td>p {
    padding: 4px 4px;
    font-size:small ; /* Small font size */
    line-height:1.6;
    vertical-align: middle !important; /* This will force middle alignment */
    margin-bottom: 0 !important;
}

.table.compact-table>thead>tr>th {
        padding: 5px 8px; /* More compact padding */
        font-size: small;  /* Slightly smaller font */
        background-color: lightgrey;
    }


.table.compact-table {
    margin-bottom: 0 !important;
}

.action-buttons-row {
    margin-top: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center; /* Center buttons horizontally */
    gap: 10px; /* Space between buttons */
}

/* Add padding to the top of the body to offset the fixed navbar */
body {
    padding-top: 70px;
}

/* For compact forms with smaller fonts */

/* Compact form: ensure all labels and controls are small */
.form-compact label,
.form-compact .form-group > label,
.form-compact .control-label,
.form-compact .label {
    font-size: small !important;
    color: black !important;
}

.form-compact .form-control {
    font-size: small;
    color: black;
}

.form-compact .btn {
    font-size: small;
    color: white;
    height: 26px;
    padding-top: 0px;
    padding-bottom: 0px;
    
}

.form-compact .form-control {
    font-size: small;
    color: black;
    /* Adjust padding and height to match smaller font */
    padding: 4px 8px;
    height: auto;
    /* width: fit-content; */
}

/* Fix for date and time input height in compact forms */
.form-compact input[type="date"].form-control,
.form-compact input[type="time"].form-control {
    height: 26px !important;
    min-height: 26px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    font-size: small !important;
}

trix-toolbar .trix-button--icon {
    font-size: inherit;
    width: 1.5em !important;
    height: 1.5em !important;
    max-width: calc(0.8em + 3.5vw);
    text-indent: -9999px;
}

.job-detail-label {
    font-weight: bold;
    width: 15%;
    vertical-align: top !important;
}

.job-detail-value {
    width: 35%;
    vertical-align: top !important;
}

.panel-heading {
    padding: 3px 3px 3px 3px;
    border-bottom: 0;
    border-top-right-radius: 3px;
    border-top-left-radius: 3px;
    border-radius: 5px;
}

.panel-default>.panel-heading {
    color: #333;
    background-color: lightgrey;
    border-color: #d3e0e9;
    font-weight: bold;
    height: 3.5rem;
}


.panel-body {
    padding: 10px;
    border-width: 1px;
    border-color: lightgrey;
    border-radius: 5px;
    /* background-color: white; */
    border-style: solid;
    margin: 5px 0 0 0;
}

/* Styles for vertical label/content blocks in job details */
.job-detail-block {
    margin-bottom: 15px; /* Space between each detail block */
    border-style: solid;
    border-color: lightgrey;
    padding: 10px;;
    border-width: 1px;
    padding: 0;
}

.job-detail-label-top {
    display: block;
    font-weight: bold;
    font-size: small;
    margin-bottom: 4px;
    background-color: rgb(234, 227, 227);
    padding-left: 5px;
}

.job-detail-content {
    font-size: small;
}

.panel {
    margin-bottom: 22px;
    background-color: #fff;
    border: 0px solid transparent;
    border-radius: 0px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
}

/* --- Custom Navbar Styles --- */

/* --- Modern Dark Navbar Styles --- */

/* Main navbar background and border - Dark theme */
.navbar-default {
    background-color:#253f51;
    border-color: #253f51;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
    .container-fluid>.navbar-collapse, .container-fluid>.navbar-header, .container>.navbar-collapse, .container>.navbar-header {
        margin-right: 0;
        margin-left: 0;
        background-color: #253f51;
        border-radius: 5px;
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Navbar brand (app name) color */
.navbar-default .navbar-brand {
    color: #fff;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
    color: #f1f1f1;
}

/* Navbar links color for the top bar (user login) */
.navbar-default .navbar-nav.navbar-right > li > a {
    color: #fff;
}
.navbar-default .navbar-nav.navbar-right > li > a:hover,
.navbar-default .navbar-nav.navbar-right > li > a:focus {
    color: #fff;
    background-color: #3c5f7c;
}

/* Dropdown menu styling */
.navbar-default .navbar-nav > .dropdown > .dropdown-menu {
    background-color: #ffffff;
    border: 1px solid #e7e7e7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar-default .navbar-nav > .dropdown > .dropdown-menu > li > a {
    color: #333;
}

.navbar-default .navbar-nav > .dropdown > .dropdown-menu > li > a:hover {
    background-color: #f8f9fa;
    color: #2c4f63;
}

/* Hamburger menu icon bars for mobile view */
.navbar-default .navbar-toggle .icon-bar {
    background-color: #fff;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
    background-color: #3c5f7c;
}

/* Styles for the App Logo in the navbar */
.navbar-brand {
    /* Adjust padding to fit the image vertically */
    padding: 7px 15px !important;
    height: 50px !important; /* Match navbar height */
    line-height: 36px !important;
}

.navbar-brand > img {
    height: 36px !important; /* Make image fill the available height */
    width: auto !important;  /* Maintain aspect ratio */
    max-height: 36px !important;
    display: inline-block !important;
}

.navbar-brand > span {
    vertical-align: middle !important;
    line-height: 36px !important;
}


/*
 * Optimized single-line navigation bar for sidebar layout.
 */
@media (min-width: 768px) {
    /*
     * Simplified single line navbar with sidebar layout
     */
    .navbar-default {
        min-height: 50px; /* Reduced height */
        margin: 0; /* Remove margins for cleaner look */
        border-radius: 0; /* Square corners for modern look */
        /* border-bottom: 1px solid #e7e7e7;  Clean bottom border */
    }

    /*
     * Adjust top padding for the main content to account for
     * the optimized navbar (50px).
     */
    body {
        padding-top: 50px; /* Reduced from 70px */
    }
}


/* --- Select2 Customizations for Compact Forms --- */

/* Set the height of the Select2 single-select container */
.form-compact .select2-container--default .select2-selection--single {
    height: 26px; /* A more compact height */
    border-radius: 3px; /* Match other small inputs */
}

/* Adjust the rendered text to be vertically centered */
.form-compact .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #444;
    font-size: small !important; /* Keep the small font */
    padding-left: 8px; /* Match .form-compact .form-control padding */
    line-height: 24px; /* Vertically center text (container height - 2px border) */
}

/* Adjust the arrow's position */
.form-compact .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 24px; /* Match the inner height */
}

/* For multi-select fields */
.form-compact .select2-container--default .select2-selection--multiple {
    min-height: 26px;
    border-radius: 3px;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    box-sizing: border-box;
    list-style: none;
    margin: 0;
    padding: 0 5px;
    width: 100%;
    font-size: small;
}

.pagination-label{
    font-size: xx-small; /* Smaller font size for compactness */
}

.pagination-input {
    font-size: xx-small; /* Smaller font size for compactness */
    height: fit-content !important;
    width: fit-content !important;
}

.pagination-left-form {
    width:270px;
}

.pagination-right-form {
    width:270px;
}

/* 
.toggle.btn.toggle-sm {
    height: 2rem !important;
    min-height: 2rem !important;
    font-size: 1rem !important;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
}
.toggle-sm .toggle-group {
    height: 2rem !important;
    min-height: 2rem !important;
    font-size: 1rem !important;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
}
.toggle.btn.toggle-sm,
.toggle-sm .toggle-group,
.toggle-sm .toggle-on,
.toggle-sm .toggle-off {
    display: flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle !important;
    height: 2rem !important;
    min-height: 2rem !important;
    font-size: 1.4rem !important;
    line-height: 2rem !important;
}

.toggle-label-group {
    display: flex !important;
    align-items: left !important;
    gap: 0.5rem !important;
}

.toggle-label-group label {
    margin-bottom: 0 !important;
    display: flex;
    align-items: center;
}
.toggle-label-group input[type="checkbox"] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-self: center;
}
*/

.privileges-section {
    border: 2px solid #3097D1;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    margin-left: 5px;
    margin-right: 5px;
    background: #f8f9fa;

}

/* Override .btn-xs to restore normal Bootstrap small button size and prevent bootstrap4-toggle.min.css from making them too small */
.btn-xs {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    border-radius: 0.2rem !important;
}

/* ===============================================
   MOBILE TABLE OPTIMIZATIONS
   =============================================== */

/* Detail/Show page table responsiveness */
.client-details-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.client-details-table {
    margin-bottom: 0;
}

/* Mobile responsiveness for detail tables */
@media (max-width: 768px) {
    /* Convert 4-column table to 2-column stacked layout on mobile */
    .client-details-table tr {
        display: block;
        border: 1px solid #ddd;
        margin-bottom: 10px;
        border-radius: 4px;
        background: #fff;
    }
    
    .client-details-table td,
    .client-details-table th {
        display: block;
        border: none;
        padding: 8px 12px;
        text-align: left;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .client-details-table th {
        background-color: #f8f9fa;
        font-weight: bold;
        color: #495057;
        margin-bottom: 0;
    }
    
    .client-details-table td {
        background-color: #fff;
        padding-left: 20px;
        margin-bottom: 8px;
        color: #333;
    }
    
    /* Remove last border */
    .client-details-table td:last-child,
    .client-details-table th:last-child {
        border-bottom: none;
    }
    
    /* Stack each field pair vertically */
    .client-details-table tr:nth-child(odd) {
        margin-bottom: 5px;
    }
    
    .client-details-table tr:nth-child(even) {
        margin-bottom: 15px;
    }
}

/* Mobile table responsiveness for listing pages */
@media (max-width: 768px) {
    /* Ensure table responsiveness works properly */
    .table-responsive {
        border: none;
        margin-bottom: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    
    /* Compact table styling for mobile */
    .compact-table {
        font-size: 12px;
        margin-bottom: 0;
    }
    
    .compact-table th,
    .compact-table td {
        padding: 4px 6px !important;
        white-space: nowrap;
        min-width: 80px;
    }
    
    /* Actions column optimization */
    .compact-table td:last-child {
        min-width: 120px;
    }
    
    /* Search row inputs on mobile */
    .search-row input {
        min-width: 70px;
        font-size: 12px;
        padding: 2px 4px;
    }
    
    /* Button sizing for mobile */
    .btn-xs {
        padding: 2px 4px;
        font-size: 10px;
        margin: 1px;
    }
    
    .btn-sm {
        padding: 3px 6px;
        font-size: 11px;
    }
    
    /* Panel adjustments for mobile */
    .panel {
        margin-bottom: 10px;
    }
    
    .panel-heading {
        padding: 8px 10px;
    }
    
    .panel-body {
        padding: 10px;
    }
    
    /* Container padding adjustment for mobile with sidebar */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Ensure buttons in action columns don't break */
.table td form {
    margin: 0;
    display: inline-block;
}

/* ===============================================
   PERFORMANCE & ACCESSIBILITY OPTIMIZATIONS
   =============================================== */

/* Improve font rendering */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimize transitions for better performance */
.sidebar-nav,
.sidebar-dropdown-menu,
.sidebar-toggle {
    will-change: transform;
}

/* Focus states for accessibility */
.sidebar-nav a:focus,
.sidebar-nav button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ===============================================
   SIDEBAR NAVIGATION SYSTEM
   =============================================== */

/* Sidebar Container */
.sidebar-nav {
    position: fixed;
    top: 0;
    left: 0; /* Always visible */
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #3498db 0%, #2980b9 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    transition: width 0.3s ease;
    overflow: hidden; /* Hide content when collapsed */
}

/* Collapsed state - show only icons */
.sidebar-nav.collapsed {
    width: 60px;
}

/* Expanded state */
.sidebar-nav.expanded {
    width: 280px;
}

/* Sidebar Header */
.sidebar-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px; /* Reduced since no logo */
    transition: padding 0.3s ease;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Collapsed header */
.sidebar-nav.collapsed .sidebar-header {
    padding: 15px 5px;
    justify-content: center;
}

/* When collapsed, center the toggle button */
.sidebar-nav.collapsed .sidebar-toggle {
    margin: 0 auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
    flex: 1; /* Take available space */
}

/* Hide brand text when collapsed */
.sidebar-nav.collapsed .sidebar-brand {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Remove logo-specific styles since we removed the logo */
.sidebar-title {
    color: #fff;
    font-size: 1.1em;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px; /* Increased since no logo taking space */
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 3px;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Don't shrink the button */
}

/* Show toggle button even when collapsed */
.sidebar-nav.collapsed .sidebar-toggle {
    opacity: 1;
}

/* Hide close button when collapsed, show expand indicator */
.sidebar-nav.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-nav.expanded .sidebar-toggle i {
    transform: rotate(0deg);
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Sidebar Menu */
.sidebar-menu {
    padding: 20px 0;
    transition: padding 0.3s ease;
}

.sidebar-nav.collapsed .sidebar-menu {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-list > li > a {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

/* Collapsed menu items - center icons and hide text */
.sidebar-nav.collapsed .sidebar-nav-list > li > a {
    padding: 8px 12px;
    justify-content: center;
}

.sidebar-nav-list > li > a:hover,
.sidebar-nav-list > li > a:focus {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-left-color: #fff;
    text-decoration: none;
}

.sidebar-nav-list > li > a.active {
    background-color: rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
    border-left-color: #fff !important;
    font-weight: bold;
}

.sidebar-dropdown-menu li a.active {
    background-color: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
    font-weight: bold;
}

.sidebar-nav-list > li > a i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-nav-list > li > a:hover i,
.sidebar-nav-list > li > a.active i {
    color: #fff;
}

/* Hide text spans when collapsed */
.sidebar-nav.collapsed .sidebar-nav-list > li > a span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    margin-left: 0;
    transition: all 0.3s ease;
}

.sidebar-nav.collapsed .sidebar-nav-list > li > a i {
    margin-right: 0;
}

/* Tooltip for collapsed items - removed, using Bootstrap tooltips */

/* Sidebar Dropdown */
.sidebar-dropdown > a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

/* Collapsed dropdown items */
.sidebar-nav.collapsed .sidebar-dropdown > a {
    padding: 12px 18px;
    justify-content: center;
}

.sidebar-dropdown > a:hover,
.sidebar-dropdown > a:focus {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
}

.sidebar-dropdown > a i {
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-dropdown > a:hover i {
    color: #fff;
}

.sidebar-dropdown-arrow {
    margin-left: auto;
    transition: transform 0.2s ease;
    color: rgba(255, 255, 255, 0.8);
}

/* Hide dropdown arrow when collapsed */
.sidebar-nav.collapsed .sidebar-dropdown-arrow {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Hide text in collapsed dropdown */
.sidebar-nav.collapsed .sidebar-dropdown > a span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    margin-left: 0;
    transition: all 0.3s ease;
}

.sidebar-nav.collapsed .sidebar-dropdown > a i {
    margin-right: 0;
}

/* Tooltip for collapsed dropdown */
.sidebar-nav.collapsed .sidebar-dropdown > a:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 65px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    font-size: 12px;
}

.sidebar-dropdown.open .sidebar-dropdown-arrow {
    transform: rotate(90deg);
}

/* Hide dropdown menu when sidebar is collapsed */
.sidebar-nav.collapsed .sidebar-dropdown-menu {
    display: none !important;
}

.sidebar-dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-dropdown.open .sidebar-dropdown-menu {
    max-height: calc(100vh - 200px); /* Dynamic height based on viewport */
    overflow-y: auto; /* Add scrolling if needed */
    overflow-x: hidden;
    position: relative;
    z-index: 1051;
    /* Custom scrollbar for webkit browsers */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* Webkit scrollbar styling */
.sidebar-dropdown.open .sidebar-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-dropdown.open .sidebar-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-dropdown.open .sidebar-dropdown-menu::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-dropdown.open .sidebar-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.sidebar-dropdown-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 50px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.sidebar-dropdown-menu li a:hover,
.sidebar-dropdown-menu li a:focus {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
}

.sidebar-dropdown-menu li a i {
    width: 16px;
    margin-right: 8px;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-dropdown-menu li a:hover i {
    color: #fff;
}

.sidebar-dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-dropdown.open .sidebar-dropdown-menu {
    max-height: 500px;
}

.sidebar-dropdown-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 50px;
    color: #d0d0d0;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.sidebar-dropdown-menu li a:hover,
.sidebar-dropdown-menu li a:focus {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    text-decoration: none;
}

.sidebar-dropdown-menu li a i {
    width: 16px;
    margin-right: 8px;
    text-align: center;
    font-size: 14px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    cursor: pointer;
}

/* Sidebar Toggle Button in Navbar - Mobile Only */
.sidebar-toggle-btn.mobile-only {
    color: #fff !important;
    padding: 8px 12px !important;
    margin-right: 15px !important;
    margin-left: 0 !important;
    font-size: 18px;
    border: none !important;
    background: none !important;
    float: right !important;
    position: relative;
    z-index: 1001;
}

/* Hide mobile toggle on desktop */
@media (min-width: 769px) {
    .sidebar-toggle-btn.mobile-only {
        display: none !important;
    }
}

.sidebar-toggle-btn:hover,
.sidebar-toggle-btn:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* Remove extra margin from navbar brand since no hamburger on desktop */
.navbar-brand {
    margin-left: 15px !important; /* Reset to normal margin */
}

/* Fix navbar brand logo sizing */
.navbar-brand img {
    height: 35px !important; /* Ensure logo is visible */
    width: auto !important;
    max-height: 35px !important;
}

/* Brand container layout */
.brand-link {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.heading-container {
    display: flex;
    align-items: center;
}

.app-heading {
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
}

/* Desktop: Hide mobile user menu */
@media (min-width: 769px) {
    .mobile-user-menu {
        display: none !important;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar-nav {
        width: 100%;
        left: -100%;
        z-index: 1050; /* Ensure sidebar is above other elements */
        overflow-y: auto; /* Allow vertical scrolling on mobile */
        overflow-x: hidden;
    }
    
    .sidebar-nav.open {
        left: 0;
    }
    
    /* Hide Bootstrap's default navbar toggle - we use sidebar toggle instead */
    .navbar-toggle {
        display: none !important;
    }
    
    /* Ensure our sidebar toggle is visible and properly positioned */
    .sidebar-toggle-btn {
        display: block !important;
        margin-left: auto;
        color: #fff;
        font-size: 18px;
        padding: 8px 12px;
    }
    
    /* Show mobile user menu in sidebar at top */
    .mobile-user-menu {
        display: block !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    
    /* Hide desktop user menu in mobile */
    .navbar-right {
        display: none !important;
    }
    
    /* Compact menu items for mobile */
    .sidebar-nav .sidebar-nav-list > li > a {
        padding: 8px 20px !important; /* Reduced from 12px */
        font-size: 0.9em;
    }
    
    .sidebar-nav .sidebar-dropdown > a {
        padding: 8px 20px !important; /* Reduced from 12px */
        font-size: 0.9em;
    }
    
    .sidebar-nav .sidebar-dropdown-menu li a {
        padding: 6px 20px 6px 50px !important; /* Reduced from 10px */
        font-size: 0.85em;
    }
    
    /* Compact collapsed menu items */
    .sidebar-nav.collapsed .sidebar-nav-list > li > a {
        padding: 8px 18px !important;
    }
    
    .sidebar-nav.collapsed .sidebar-dropdown > a {
        padding: 8px 18px !important;
    }
    
    /* Reduce logo height for mobile */
    .navbar-brand img {
        height: 20px !important;
        max-height: 20px !important;
    }
    
    /* Stack logo and heading vertically on mobile */
    .brand-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .app-heading {
        font-size: 0.9em;
        line-height: 1;
    }
    
    /* Adjust navbar brand for mobile */
    .navbar-brand {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
    
    /* Ensure sidebar menu can scroll when content overflows */
    .sidebar-menu {
        height: calc(100vh - 60px); /* Account for header height */
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 20px; /* Add bottom padding for better UX */
    }
    
    /* Ensure dropdown menus work properly in mobile */
    .sidebar-nav .sidebar-dropdown-menu {
        display: block !important; /* Override collapsed state rule */
        position: relative;
        z-index: 1051;
        box-shadow: none; /* Remove shadow for mobile */
    }
    
    /* Ensure dropdown menus are hidden by default but can be opened */
    .sidebar-nav .sidebar-dropdown-menu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .sidebar-nav .sidebar-dropdown.open .sidebar-dropdown-menu {
        max-height: calc(100vh - 150px); /* Dynamic height for mobile */
        display: block !important;
        overflow-y: auto; /* Enable scrolling on mobile */
        overflow-x: hidden;
    }
    
    /* Improve touch targets for mobile */
    .sidebar-nav .sidebar-dropdown > a {
        min-height: 44px; /* iOS recommended touch target */
        display: flex;
        align-items: center;
    }
    
    .sidebar-nav .sidebar-dropdown-menu li a {
        min-height: 40px;
        display: flex;
        align-items: center;
    }
    
    /* Ensure proper spacing for dropdown items in mobile */
    .sidebar-nav .sidebar-dropdown-menu {
        margin-bottom: 5px;
    }
    
    /* Add webkit scrolling for smooth mobile experience */
    .sidebar-nav {
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar-menu {
        -webkit-overflow-scrolling: touch;
    }
}

/* Body shift when sidebar is open (for desktop) */
@media (min-width: 769px) {
    /* Default state - collapsed sidebar visible */
    body {
        margin-left: 60px; /* Account for collapsed sidebar */
        transition: margin-left 0.3s ease;
    }
    
    .navbar-fixed-top {
        left: 60px; /* Account for collapsed sidebar */
        right: 0;
        transition: left 0.3s ease;
        box-shadow: none;
    }
    
    /* When sidebar is expanded */
    body.sidebar-expanded {
        margin-left: 280px;
    }
    
    body.sidebar-expanded .navbar-fixed-top {
        left: 280px;
    }
}

/* Desktop specific sidebar dropdown fixes */
@media (min-width: 769px) {
    /* Allow sidebar to scroll on desktop when needed */
    .sidebar-nav {
        overflow-y: auto !important; /* Override the hidden overflow for desktop */
        overflow-x: hidden !important;
    }
    
    /* Ensure sidebar menu container allows scrolling */
    .sidebar-menu {
        height: calc(100vh - 80px); /* Account for header */
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    /* Ensure desktop dropdown menu has proper scrolling */
    .sidebar-dropdown.open .sidebar-dropdown-menu {
        max-height: calc(100vh - 250px) !important; /* Force override any mobile rules */
        overflow-y: auto !important;
        overflow-x: hidden !important;
        position: relative !important;
        z-index: 1051 !important;
    }
    
    /* Desktop scrollbar styling */
    .sidebar-dropdown.open .sidebar-dropdown-menu::-webkit-scrollbar {
        width: 8px; /* Slightly wider for desktop */
    }
    
    .sidebar-dropdown.open .sidebar-dropdown-menu::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .sidebar-dropdown.open .sidebar-dropdown-menu::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.4);
        border-radius: 4px;
    }
    
    .sidebar-dropdown.open .sidebar-dropdown-menu::-webkit-scrollbar-thumb:hover {
        background-color: rgba(255, 255, 255, 0.6);
    }
    
    /* Ensure dropdown menu items are properly sized */
    .sidebar-dropdown-menu li a {
        padding: 10px 20px 10px 50px !important;
        min-height: 40px; /* Ensure clickable area */
        display: flex !important;
        align-items: center !important;
    }
}

/* Quill Editor Customizations */
.ql-container {
    font-size: small;
    /* height: 150px; */
    min-height: 150px;
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.quill-editor {
    border: 1px solid #ced4da;
    border-radius: 4px;
    height: 150px;
}
