/* Minification failed. Returning unminified contents.
(3,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(4,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(5,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(6,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(7,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(8,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(9,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(10,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(11,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(12,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(13,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(14,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(17,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(18,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(19,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(23,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(24,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(25,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(26,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(30,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(31,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(32,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(33,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(45,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(46,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(47,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(60,21): run-time error CSS1039: Token not allowed after unary operator: '-sandbox-primary'
(80,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(81,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(82,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(97,22): run-time error CSS1039: Token not allowed after unary operator: '-bg'
(98,17): run-time error CSS1039: Token not allowed after unary operator: '-text'
(135,17): run-time error CSS1039: Token not allowed after unary operator: '-sidebar-width'
(136,21): run-time error CSS1039: Token not allowed after unary operator: '-sidebar-width'
(137,21): run-time error CSS1039: Token not allowed after unary operator: '-sidebar-width'
(138,22): run-time error CSS1039: Token not allowed after unary operator: '-nav-bg'
(143,32): run-time error CSS1039: Token not allowed after unary operator: '-shadow'
(195,17): run-time error CSS1039: Token not allowed after unary operator: '-sidebar-collapsed'
(294,17): run-time error CSS1039: Token not allowed after unary operator: '-text'
(316,17): run-time error CSS1039: Token not allowed after unary operator: '-text'
(322,22): run-time error CSS1039: Token not allowed after unary operator: '-card-bg'
(325,32): run-time error CSS1039: Token not allowed after unary operator: '-shadow'
(341,17): run-time error CSS1039: Token not allowed after unary operator: '-text'
(346,17): run-time error CSS1039: Token not allowed after unary operator: '-text'
(363,28): run-time error CSS1039: Token not allowed after unary operator: '-card-bg'
(364,17): run-time error CSS1039: Token not allowed after unary operator: '-text'
(382,17): run-time error CSS1039: Token not allowed after unary operator: '-text'
(499,22): run-time error CSS1039: Token not allowed after unary operator: '-card-bg'
(500,32): run-time error CSS1039: Token not allowed after unary operator: '-shadow'
(533,22): run-time error CSS1039: Token not allowed after unary operator: '-primary'
(545,17): run-time error CSS1039: Token not allowed after unary operator: '-text-dark'
(552,22): run-time error CSS1039: Token not allowed after unary operator: '-card-bg'
(553,32): run-time error CSS1039: Token not allowed after unary operator: '-shadow'
(568,21): run-time error CSS1039: Token not allowed after unary operator: '-text'
(586,22): run-time error CSS1039: Token not allowed after unary operator: '-bg'
(604,22): run-time error CSS1039: Token not allowed after unary operator: '-card-bg'
(607,32): run-time error CSS1039: Token not allowed after unary operator: '-shadow'
(645,17): run-time error CSS1039: Token not allowed after unary operator: '-text'
(666,28): run-time error CSS1039: Token not allowed after unary operator: '-primary'
(667,24): run-time error CSS1039: Token not allowed after unary operator: '-primary'
(677,28): run-time error CSS1039: Token not allowed after unary operator: '-card-dark'
(678,24): run-time error CSS1039: Token not allowed after unary operator: '-card-dark'
(679,17): run-time error CSS1039: Token not allowed after unary operator: '-text-dark'
(904,22): run-time error CSS1039: Token not allowed after unary operator: '-card-dark'
(905,17): run-time error CSS1039: Token not allowed after unary operator: '-text-dark'
(910,17): run-time error CSS1039: Token not allowed after unary operator: '-text-dark'
(947,22): run-time error CSS1039: Token not allowed after unary operator: '-card-dark'
(948,17): run-time error CSS1039: Token not allowed after unary operator: '-text-dark'
(954,21): run-time error CSS1039: Token not allowed after unary operator: '-text-dark'
(1107,22): run-time error CSS1039: Token not allowed after unary operator: '-card-bg'
(1175,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(1176,17): run-time error CSS1039: Token not allowed after unary operator: '-size'
(1177,18): run-time error CSS1039: Token not allowed after unary operator: '-size'
(1184,28): run-time error CSS1039: Token not allowed after unary operator: '-notif-border'
(1185,22): run-time error CSS1039: Token not allowed after unary operator: '-notif-bg'
(1186,17): run-time error CSS1039: Token not allowed after unary operator: '-notif-color'
(1197,26): run-time error CSS1039: Token not allowed after unary operator: '-notif-bg-hover'
(1224,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(1225,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(1226,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(1227,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(1231,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(1232,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(1233,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(1234,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(1246,28): run-time error CSS1039: Token not allowed after unary operator: '-card-bg'
(1250,17): run-time error CSS1039: Token not allowed after unary operator: '-text-dark'
(1254,17): run-time error CSS1039: Token not allowed after unary operator: '-primary'
(1269,21): run-time error CSS1039: Token not allowed after unary operator: '-sidebar-width'
(1273,26): run-time error CSS1039: Token not allowed after unary operator: '-nav-bg'
(1274,36): run-time error CSS1039: Token not allowed after unary operator: '-shadow'
 */
:root {
    /* Theme colors */
    --bg-light: #01A8D5;
    --nav-light: #003B5C;
    --primary: #003B5C;
    --bg-dark: #1e1e2f;
    --card-light: #fff;
    --card-dark: #2a2a3f;
    --text-light: #333;
    --text-dark: #e0e0e0;
    --nav-dark: #121421;
    --shadow: rgba(0, 0, 0, 0.05);
    --sidebar-width: 260px;
    --sidebar-collapsed: 60px;


    --sandbox-bg-light: #D58701; /* Orange */
    --sandbox-nav-light: #5C3000; /* Dark orange-brown */
    --sandbox-primary: #5C3000; /* Dark orange-brown */
}

html[data-bs-theme="light"] {
    --bg: var(--bg-light);
    --card-bg: var(--card-light);
    --text: var(--text-light);
    --nav-bg: var(--nav-light);
}

html[data-bs-theme="dark"] {
    --bg: var(--bg-dark);
    --card-bg: var(--card-dark);
    --text: var(--text-dark);
    --nav-bg: var(--nav-dark);
}

/* Reset & base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Apply sandbox colors when in sandbox environment */
html.sandbox-environment {
    --bg-light: var(--sandbox-bg-light);
    --nav-light: var(--sandbox-nav-light);
    --primary: var(--sandbox-primary);
}

    /* Visual indicator in header for sandbox */
    html.sandbox-environment .header::after {
        content: "SANDBOX ENVIRONMENT";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        text-align: center;
        background-color: rgba(213, 135, 1, 0.2);
        color: var(--sandbox-primary);
        padding: 2px 0;
        font-size: 0.7rem;
        font-weight: bold;
        z-index: 2;
    }

    html.sandbox-environment .header {
        padding-top: 18px; /* Add space for the sandbox banner */
    }

    /* Make sure the avatar and user info don't overlap with the banner */
    html.sandbox-environment .header-right,
    html.sandbox-environment .header-left {
        position: relative;
        z-index: 3;
    }

/* Dark theme sandbox adjustments */
html[data-bs-theme="dark"].sandbox-environment {
    --bg-dark: #2f2820; /* Darker version of orange theme */
    --card-dark: #362e25; /* Slightly lighter than bg-dark */
    --nav-dark: #241a10; /* Dark orange-brown for nav */
}

/*body {
    font-family: 'Inter', sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    transition: background .3s, color .3s;
}*/
body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    transition: background .3s, color .3s;
    display: flex;
    flex-direction: row;
    overflow: auto; /* Allow scrolling! */
}

a {
    text-decoration: none;
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 5;
}

body.sidebar-open .overlay {
    display: block;
}

/* Sidebar */
/*.sidebar {
    width: var(--sidebar-width);
    background: var(--nav-bg);
    padding: 2rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    transition: width .3s, left .3s;
    box-shadow: 2px 0 8px var(--shadow);
    overflow-x: hidden;
    z-index: 10;
}*/
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--nav-bg);
    padding: 2rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    transition: width .3s, left .3s;
    box-shadow: 2px 0 8px var(--shadow);
    overflow-x: hidden;
    z-index: 10;
    position: relative; /* Default: relative for desktop */
    height: 100vh;
    flex-shrink: 0 !important;
}
.sidebar-nav, .submenu, .has-submenu {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}
    .sidebar-nav a, .has-submenu > .submenu-toggle, .sidebar-bottom a {
        white-space: normal !important;
    }

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        height: 100vh;
    }

    body.sidebar-open .sidebar {
        left: 0;
    }

    #notificationsDropdown + .dropdown-menu {
        position: fixed !important;
        top: 60px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        min-width: 90vw !important;
        max-width: 90vw !important;
        margin: 0 !important;
    }
}

.logo-sidebar {
    width: 120px;
    margin: 0 auto 1rem;
}

body.collapsed .logo-sidebar {
    display: none;
}

body.collapsed .sidebar {
    width: var(--sidebar-collapsed);
}

body.collapsed .sidebar-nav span,
body.collapsed .arrow,
body.collapsed .submenu {
    display: none;
}

body.collapsed .sidebar-nav a,
body.collapsed .has-submenu > .submenu-toggle {
    display: inline-flex;
    width: fit-content;
    margin: .25rem auto;
    padding: .75rem;
    justify-content: center;
}

body.collapsed .sidebar-nav i {
    margin: 0;
}

.sidebar-nav {
    flex: 1;
}

    /* Sidebar links & buttons */
    .sidebar-nav a,
    .has-submenu > .submenu-toggle,
    .sidebar-bottom a {
        display: flex;
        align-items: center;
        padding: .75rem 1rem;
        margin: .25rem 0;
        border-radius: .5rem;
        color: #fff;
        cursor: pointer;
        transition: background .2s, transform .1s;
    }

        .sidebar-nav a:hover,
        .has-submenu > .submenu-toggle:hover,
        .sidebar-bottom a:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: translateY(-2px);
        }

        .sidebar-nav i,
        .has-submenu > .submenu-toggle .arrow,
        .sidebar-bottom i {
            width: 1.25rem;
            text-align: center;
            margin-right: .75rem;
            color: #fff;
        }

.arrow {
    margin-left: auto;
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s;
    margin-left: 2rem;
}

.has-submenu.expanded .submenu {
    max-height: 500px;
}

.has-submenu.expanded .arrow {
    transform: rotate(180deg);
}

.submenu a {
    color: rgba(255, 255, 255, 0.8);
    padding: .5rem 1.25rem;
    background: transparent;
    transition: color .2s;
    font-size: .875rem;
}

    .submenu a:hover {
        color: #fff;
    }

.sidebar-bottom {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Toggle buttons */
#mobileToggle,
#sidebarCollapse {
    font-size: 1.2rem;
    cursor: pointer;
    margin-right: 1rem;
    color: var(--text);
}

/* Hide hamburger except on mobile */
#mobileToggle {
    display: none;
}
@media (max-width: 768px) {
    #mobileToggle {
        display: inline-block;
        margin-right: 1rem;
        font-size: 1.4rem;
    }
}

/* Site title styling */
.site-title {
    font-size: 1.25rem;   /* Smaller, more professional */
    font-weight: 500;
    margin-left: 0.5rem;
    vertical-align: middle;
    letter-spacing: 0.01em;
    color: var(--text);
    line-height: 1.2;
}

/* Card wrapper */
.box-primary {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: .75rem;
    box-shadow: 0 2px 6px var(--shadow);
    margin: 1.5rem 0;
}

    .box-primary .dataTables_wrapper {
        background: transparent;
    }

/* DataTables dark-mode tweaks */
html[data-bs-theme="dark"] table.dataTable tbody tr.selected,
html[data-bs-theme="dark"] table.dataTable tbody tr.selected > *,
html[data-bs-theme="dark"] .custom-selected,
html[data-bs-theme="dark"] .custom-selected > th,
html[data-bs-theme="dark"] .custom-selected > td {
    background-color: rgba(255, 255, 255, 0.1) !important;
    background-image: none !important;
    color: var(--text) !important;
}

html[data-bs-theme="dark"] .dataTables_wrapper .dt-button {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--text) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: none !important;
}

    html[data-bs-theme="dark"] .dataTables_wrapper .dt-button:hover {
        background-color: rgba(255, 255, 255, 0.15) !important;
    }

html[data-bs-theme="dark"] table.dataTable,
html[data-bs-theme="dark"] table.dataTable th,
html[data-bs-theme="dark"] table.dataTable td {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-bs-theme="dark"] .dataTables_filter input,
html[data-bs-theme="dark"] .dataTables_length select {
    background-color: var(--card-bg) !important;
    color: var(--text) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: none !important;
}

    html[data-bs-theme="dark"] .dataTables_filter input::placeholder,
    html[data-bs-theme="dark"] .dataTables_length select::-webkit-input-placeholder {
        color: rgba(255, 255, 255, 0.5) !important;
    }

 DataTables light-mode selected row 
html[data-bs-theme="light"] table.dataTable.select tbody tr.selected,
html[data-bs-theme="light"] table.dataTable.select tbody tr.selected > *,
html[data-bs-theme="light"] table.dataTable tbody tr.selected,
html[data-bs-theme="light"] table.dataTable tbody tr.selected > th,
html[data-bs-theme="light"] table.dataTable tbody tr.selected > td {
    background: #f5f5f5 !important;
    background-image: none !important;
    color: var(--text) !important;
}

/* Responsive */
@media (max-width: 768px) {
    #mobileToggle {
        display: inline-block;
    }

    #sidebarCollapse {
        display: none;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
    }

    body.sidebar-open .sidebar {
        left: 0;
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 0;
        max-width: 100vw;
        height: 100vh;
        display: flex;
        align-items: center;
    }
    .modal-content {
        width: 100vw;
        max-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    .modal-body {
        overflow-y: auto;
        overflow-x: auto;
        flex: 1 1 auto;
    }
    .slim-toolbar {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    .slim-toolbar > nav,
    .slim-toolbar > .d-flex {
        width: 100%;
        margin-bottom: 0 !important;
    }
    .slim-toolbar .breadcrumb {
        width: 100%;
        margin-bottom: 0.5rem;
        background: #fff;
        border-radius: 0.25rem;
        padding: 0.5rem 0.75rem;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }
    .slim-toolbar .btn,
    .slim-toolbar .btn-custom,
    .slim-toolbar .dropdown,
    .slim-toolbar .dropdown .btn {
        width: 100%;
        margin: 0 !important;
        box-sizing: border-box;
        display: block;
    }
    .slim-toolbar .dropdown-menu {
        min-width: 100%;
        width: 100%;
        left: 0 !important;
        right: 0 !important;
        position: static !important;
    }
    .slim-toolbar .d-flex {
        flex-direction: column !important;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .dt-buttons {
        display: none !important;
    }

    .slim-toolbar .breadcrumb {
        font-size: 0.8rem;
    }
}

/* Layout */
/*.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}*/
.main {
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    overflow: auto;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 64px;
    background: var(--card-bg);
    box-shadow: 0 1px 4px var(--shadow);
    z-index: 1200;
    position: relative;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
}

.user-toggle {
    cursor: pointer;
}
/* ensure the dropdown is positioned relative to its header container */
.header-right {
    position: relative;
}

/* restore the flex container around your avatar+name so it's all clickable */
.user-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
}


.avatar,
.avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: .5rem;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    object-fit: cover;
}

.user-text .user-group {
    font-size: .85rem;
    color: var(--text-dark);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    box-shadow: 0 2px 6px var(--shadow);
    border-radius: .5rem;
    display: none;
    flex-direction: column;
    padding: .5rem;
    min-width: 200px;
    z-index: 1150;
}

    .user-dropdown.show {
        display: flex;
    }

    .user-dropdown a,
    .user-dropdown label {
        color: var(--text);
        padding: .5rem;
    }

        .user-dropdown a:hover {
            background: rgba(0, 0, 0, 0.05);
        }



/*.content {
    padding: 1.5rem;
    overflow-y: auto;
    background: var(--bg);
}*/
.content {
    padding: 1.5rem;
    overflow-x: auto;
    background: var(--bg);
    flex: 1 1 auto;
}

@media (max-width: 768px) {
    .content {
        padding: 0.5rem;
    }
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.card {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: .75rem;
    box-shadow: 0 2px 6px var(--shadow);
}

    .card h4 {
        margin-bottom: .75rem;
        font-weight: 500;
    }

    .card p {
        font-size: 1.5rem;
        font-weight: bold;
    }

    @media (max-width: 576px) {
    .user-toggle {
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    .avatar,
    .avatar-img {
        margin-right: 0.5rem !important;
        margin-bottom: 0 !important;
    }
    .user-text {
        text-align: left !important;
        margin-left: 0 !important;
    }
}

/* Light-mode selected rows */
/* Light-mode custom-selection (single/ctrl/shift-click) */
html[data-bs-theme="light"] .custom-selected,
html[data-bs-theme="light"] .custom-selected > th,
html[data-bs-theme="light"] .custom-selected > td {
    /* Use a visible tint—your nav color at 10% works great */
    background-color: rgba(0, 59, 92, 0.1) !important;
    background-image: none !important;
    color: var(--text) !important;
}

/* put this after your DataTables CSS */
table.dataTable tbody td,
table.dataTable tbody tr {
    /* standard */
    user-select: none;
    /* webkit/blink */
    -webkit-user-select: none;
    /* IE10+ */
    -ms-user-select: none;
}

.btn-custom {
    font-weight: 500;
    transition: background-color .2s, border-color .2s;
}

/* light theme */
html[data-bs-theme="light"] .btn-custom {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

    html[data-bs-theme="light"] .btn-custom:hover {
        filter: brightness(0.9);
    }

/* dark theme */
html[data-bs-theme="dark"] .btn-custom {
    background-color: var(--card-dark);
    border-color: var(--card-dark);
    color: var(--text-dark);
}

    html[data-bs-theme="dark"] .btn-custom:hover {
        filter: brightness(1.1);
    }


.modal-dialog {
    margin: 1.75rem auto !important;
}
    /* Custom widths */
    .modal-dialog.modal-sm {
        max-width: 500px;
    }

    .modal-dialog.modal-md {
        max-width: 800px;
    }

    .modal-dialog.modal-lg {
        max-width: 1100px;
    }

    .modal-dialog.modal-xl {
        max-width: 1400px;
    }

    .system-settings-modal #settings-nav {
    min-width: 200px;
    max-width: 260px;
    width: 220px;
    margin-top: 1.5rem;
    font-size: 0.97rem;
    gap: 2px;
}

    .system-settings-modal #settings-nav .nav-link {
        color: #444 !important;
        background: none !important;
        border-radius: 6px;
        margin-bottom: 2px;
        padding: 10px 16px;
        font-weight: 500;
        transition: background 0.15s, color 0.15s;
    }

        .system-settings-modal #settings-nav .nav-link.active,
        .system-settings-modal #settings-nav .nav-link:focus {
            background: #f5f5f5 !important;
            color: #222 !important;
            box-shadow: 0 1px 4px rgba(0,0,0,0.04);
        }

        .system-settings-modal #settings-nav .nav-link i {
            color: #888 !important;
            font-size: 1.1em;
            margin-right: 8px;
        }

        .system-settings-modal #settings-nav .nav-link.active i {
            color: #1976d2 !important;
        }

        .system-settings-modal #settings-nav .nav-link:hover:not(.active) {
            background: #f0f0f0 !important;
            color: #222 !important;
        }

.system-settings-modal #systemSettingsForm {
    margin-left: 32px;
    margin-top: 1.5rem;
}

@media (max-width: 900px) {
    .system-settings-modal #settings-nav {
        min-width: 140px;
        width: 140px;
        font-size: 0.93rem;
    }

    .system-settings-modal #systemSettingsForm {
        margin-left: 12px;
    }
}

/*.table-responsive-custom {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}*/

.box-primary {
    width: 100%;
    max-width: 100%;
    overflow-x: visible; /* or auto, but not hidden */
    padding: 1rem;
    box-sizing: border-box;
}

@media (max-width: 576px) {
    .slim-toolbar .dropdown-menu {
        min-width: 100%;
        width: 100%;
        box-sizing: border-box;
        left: 0 !important;
        right: 0 !important;
    }
}

/* --- SLIM TOOLBAR DESKTOP --- */
.slim-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 0 1rem;
    background-color: #fff;
    border-radius: .25rem;
    margin-bottom: .5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    gap: 0; /* Remove gap for desktop */
}
.slim-toolbar .breadcrumb {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    font-size: .875rem;
    line-height: 1;
}
.slim-toolbar .btn-sm {
    padding: .25rem .5rem;
    font-size: .8125rem;
}
.slim-toolbar .btn, .slim-toolbar .btn-custom {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

/* --- SLIM TOOLBAR MOBILE --- */
@media (max-width: 576px) {
    .slim-toolbar {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    .slim-toolbar > nav,
    .slim-toolbar > .d-flex {
        width: 100%;
        margin-bottom: 0 !important;
    }
    .slim-toolbar .breadcrumb {
        width: 100%;
        margin-bottom: 0.5rem;
        background: #fff;
        border-radius: 0.25rem;
        padding: 0.5rem 0.75rem;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
        font-size: 0.8rem;
    }
    .slim-toolbar .btn,
    .slim-toolbar .btn-custom,
    .slim-toolbar .dropdown,
    .slim-toolbar .dropdown .btn {
        width: 100%;
        margin: 0 !important;
        box-sizing: border-box;
        display: block;
    }
    .slim-toolbar .dropdown-menu {
        min-width: 100%;
        width: 100%;
        left: 0 !important;
        right: 0 !important;
        position: static !important;
    }
    .slim-toolbar .d-flex {
        flex-direction: column !important;
        gap: 0.5rem;
    }
}

.slim-toolbar {
    position: relative;
    z-index: 1050; /* higher than Bootstrap modal/dataTable defaults */
}

.slim-toolbar .dropdown-menu {
    z-index: 1100;
    background: #fff !important;
    /* Optional: add a border and shadow for clarity */
    border: 1px solid #ddd !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

@media (max-width: 576px) {
    .header {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        padding: 0.5rem 0.75rem;
    }
    .header-left {
        width: 100%;
        flex-direction: row;
        align-items: center;
        margin-bottom: 0.15rem;
        display: flex;
    }
    .header-right {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        align-items: flex-start;
        margin-top: 0;
        margin-bottom: 0;
    }
    .user-toggle {
        margin-top: 0;
    }
}

html[data-bs-theme="dark"] .slim-toolbar .dropdown-menu {
    background: var(--card-dark) !important;
    color: var(--text-dark) !important;
    border: 1px solid #333 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25) !important;
}
html[data-bs-theme="dark"] .slim-toolbar .dropdown-menu .dropdown-item {
    color: var(--text-dark) !important;
}
html[data-bs-theme="dark"] .slim-toolbar .dropdown-menu .dropdown-item:active,
html[data-bs-theme="dark"] .slim-toolbar .dropdown-menu .dropdown-item:hover {
    background: #23233a !important;
    color: #fff !important;
}

/* Sidebar: ensure it always sits above the toolbar when open */
.sidebar {
    z-index: 1200; /* higher than .slim-toolbar (1050) */
}

/* On mobile, sidebar should be fixed and above everything */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 1200;
    }
}
@media (max-width: 576px) {
    .site-title {
        font-size: 0.95rem !important;
        font-weight: 500 !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 40vw !important; /* even less width */
        margin-left: 0.25rem !important;
        padding: 0 !important;
        display: inline-block !important;
        vertical-align: middle !important;
    }
}

html[data-bs-theme="dark"] .breadcrumb {
    background: var(--card-dark) !important;
    color: var(--text-dark) !important;
    border-radius: 0.25rem;
}

    html[data-bs-theme="dark"] .breadcrumb .breadcrumb-item,
    html[data-bs-theme="dark"] .breadcrumb .breadcrumb-item a {
        color: var(--text-dark) !important;
        opacity: 0.85;
    }

        html[data-bs-theme="dark"] .breadcrumb .breadcrumb-item.active {
            color: #fff !important;
            opacity: 1;
        }

/* Tighter mobile header and avatar alignment */
@media (max-width: 576px) {
    .header {
        flex-direction: row !important;
        align-items: center !important;
        height: 56px !important; /* or less */
        padding: 0 0.75rem !important;
        min-height: 0 !important;
    }

    .header-left {
        margin-bottom: 0 !important;
        flex: 1 1 0%;
        min-width: 0;
    }

    .header-right {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        align-items: center !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .user-toggle {
        margin-top: 0 !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }

    .avatar, .avatar-img {
        margin-right: 0.5rem !important;
        margin-bottom: 0 !important;
    }

    .user-text {
        margin-left: 0 !important;
        text-align: left !important;
        align-items: flex-start !important;
        line-height: 1.1 !important;
    }
    .site-title {
        font-size: 0.95rem !important;
        font-weight: 500 !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 55vw !important; /* wider than before! */
        margin-left: 0.25rem !important;
        padding: 0 !important;
        display: inline-block !important;
        vertical-align: middle !important;
    }

    .header-left {
        min-width: 0 !important; /* Allow shrinking */
        flex-shrink: 1 !important;
        flex-basis: auto !important;
    }
}

/* Ensure modals are always above the sidebar */
.modal,
.modal-backdrop {
    z-index: 1300 !important;
}

/* Ensure modal is above sidebar, and backdrop is below modal but above sidebar */
.modal-backdrop {
    z-index: 1250 !important;
}

.modal {
    z-index: 1300 !important;
}

.impersonation-alert {
    display: flex;
    align-items: center;
}

/* Add responsive handling for smaller screens */
@media (max-width: 576px) {
    .impersonation-alert {
        margin-top: 10px;
    }

        .impersonation-alert .btn {
            padding: 0.25rem 0.5rem;
            font-size: 0.75rem;
        }
}
.header-right .notification-dropdown {
    position: relative;
    display: inline-block;
}

.header-right .notification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f5f7fa;
    color: #1976d2;
    font-size: 1.35em;
    margin: 0 8px 0 8px;
    box-shadow: 0 1px 4px rgba(25, 118, 210, 0.08);
    border: 1px solid #e3e8ee;
    cursor: pointer;
    position: relative;
    transition: background 0.18s, color 0.18s;
}

    .header-right .notification-icon:hover,
    .header-right .notification-icon:focus {
        background: #e3f2fd;
        color: #0d47a1;
    }

.header-right .notification-badge {
    position: absolute;
    top: 6px;
    right: 7px;
    background: #d32f2f;
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75em;
    font-weight: bold;
    box-shadow: 0 1px 4px rgba(211,47,47,0.11);
    pointer-events: none;
}

/* Notification Dropdown Menu */
.notification-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 48px;
    min-width: 340px;
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.13);
    border-radius: 12px;
    z-index: 50;
    padding: 0.75rem 0.5rem;
}

.notification-dropdown.open .notification-menu {
    display: block;
}

.notification-menu-header {
    font-weight: 600;
    padding: 0.5rem 1rem 0.25rem;
    color: #1976d2;
    border-bottom: 1px solid #e3e8ee;
    margin-bottom: 0.5rem;
}

.notification-menu ul {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem 0;
}

    .notification-menu ul li {
        padding: 0.5rem 1rem;
        border-bottom: 1px solid #f0f0f0;
        color: #444;
        display: flex;
        align-items: center;
        font-size: 0.98em;
    }

        .notification-menu ul li:last-child {
            border-bottom: none;
        }

        .notification-menu ul li i {
            margin-right: 7px;
            font-size: 1.1em;
        }

.notification-menu .notification-time {
    margin-left: auto;
    font-size: 0.8em;
    color: #999;
}

.notification-menu .notification-viewall {
    display: block;
    text-align: right;
    color: #1976d2;
    font-size: 0.92em;
    text-decoration: none;
    padding: 0.5rem 1rem 0 0;
}

    .notification-menu .notification-viewall:hover {
        text-decoration: underline;
    }

#notificationsDropdown + .dropdown-menu {
    min-width: 400px !important;
}

/* Circular notification icon button (light + dark) */
.notif-btn {
    --size: 38px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    border: 1px solid var(--notif-border);
    background: var(--notif-bg);
    color: var(--notif-color);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: background .18s, color .18s, transform .06s, box-shadow .18s;
}

    .notif-btn i {
        font-size: 1.1rem;
        line-height: 1;
    }

    .notif-btn:hover {
        background: var(--notif-bg-hover);
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .notif-btn:active {
        transform: translateY(0);
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }

    .notif-btn:focus-visible {
        outline: 0;
        box-shadow: 0 0 0 3px rgba(25,118,210,0.25);
    }

    .notif-btn.dropdown-toggle::after {
        display: none;
    }
    /* no caret */
    .notif-btn .badge {
        font-weight: 700;
        font-size: 0.7rem;
        padding: .25em .45em;
    }

/* Theme-aware colors */
html[data-bs-theme="light"] {
    --notif-bg: #ffffff;
    --notif-bg-hover: #f2f6ff;
    --notif-border: #e5e7eb;
    --notif-color: var(--primary);
}

html[data-bs-theme="dark"] {
    --notif-bg: var(--card-dark);
    --notif-bg-hover: #23233a;
    --notif-border: rgba(255,255,255,0.15);
    --notif-color: var(--text-dark);
}
#notificationsDropdown:hover {
    background: rgba(0,0,0,0.04);
}

html[data-bs-theme="dark"] #notificationsDropdown:hover {
    background: rgba(255,255,255,0.08);
}

#notificationsDropdown .badge {
    /* light/dark ring that blends with header */
    border: 1px solid var(--card-bg);
}

html[data-bs-theme="dark"] #notificationsDropdown i {
    color: var(--text-dark) !important; /* strong contrast in dark mode */
}

html[data-bs-theme="light"] #notificationsDropdown i {
    color: var(--primary) !important;
}
.sf-feedback-balloon {
    pointer-events: none;
}

.sf-feedback-balloon-caret {
    pointer-events: none;
}
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: var(--sidebar-width);
        height: 100vh;
        z-index: 1300; /* Above header, overlay, dropdown */
        overflow-y: auto;
        background: var(--nav-bg);
        box-shadow: 2px 0 8px var(--shadow);
        transition: left 0.3s;
    }

    body.sidebar-open .sidebar {
        left: 0;
    }

    .overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1250; /* Below sidebar, above header */
    }

    body.sidebar-open .overlay {
        display: block;
    }

    .header {
        z-index: 1200 !important; /* Below overlay/sidebar */
        position: relative;
    }

    .user-dropdown {
        z-index: 1350 !important; /* Always above everything */
        position: absolute;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}
