/*Following is part of Colvis DataTables, to have a scrollable column dropdown */
div.dt-button-collection {
    max-height: 200px;
    overflow-y: auto;
}
.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: start;
    width: 50px;
    height: 24px;
    background-color: #343a40;
    border-radius: 15px;
    cursor: pointer;
    position: relative;
}
.toggle-switch .switch {
    width: 18px;
    height: 18px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s;
}
.toggle-switch.toggle-on .switch {
    transform: translateX(30px);
}
.toggle-switch.toggle-on {
    background-color: #007bff;
}
a.disabled {
  pointer-events: none;
  cursor: default;
}

/* todo, add a table-first-column-fixed-striped rather than single color*/
.table-first-column-fixed tbody td:first-child,
.table-first-column-fixed thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 1050;
    background-color: var(--bs-table-striped-bg);
}


.warning-message {
        margin-top: 20px;
        padding: 10px;
        background-color: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
        border-radius: 4px;
    }

.square-25px{
    width: 25px;
    height: 25px;
}

.square-20px{
    width: 20px;
    height: 20px;
}

.overflow-y-scroll{
        overflow-y: scroll !important;
}

.overflow-x-scroll{
        overflow-x: scroll !important;
}

.hide-scrollbar{
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.hide-scrollbar::-webkit-scrollbar {
        display: none;
    }

.text-xs{
    font-size:.65rem;
}

.text-xxs{
    font-size:.5rem;
}

td .data-bar-container {
    position: relative;
    width: 100%;
    height: 20px;
}

td .data-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 100%;
    background-color: #1E90FF;
    transition: width 0.2s;
}

td .data-bar-text {
    position: relative;
    padding-left: 10px;
    color: white;
    font-size: 14px;
    white-space: nowrap;
}

.desktop-nav {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.desktop-nav-container {
    max-width: 100%;
}

.desktop-nav-menu {
    gap: 0;
}

.desktop-nav-link {
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.2s ease;
}

.desktop-nav-link:hover,
.desktop-nav-link:focus,
.desktop-nav-item.show > .desktop-nav-link {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.desktop-nav-item.show > .desktop-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #fff;
}

.desktop-nav-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.desktop-nav-item.show > .desktop-nav-link .desktop-nav-chevron,
.desktop-nav-item:hover > .desktop-nav-link .desktop-nav-chevron {
    transform: rotate(180deg);
}

.mega-menu {
    top: 100%;
    width: 100vw;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 1050;
    display: none;
}

.desktop-nav-item.show .mega-menu {
    display: block;
}

.mega-menu-content {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    max-height: 500px;
}

.mega-menu-column {
    min-width: 180px;
}

.mega-menu-title {
    color: #fff;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mega-menu-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.375rem 0;
    font-size: 0.875rem;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.mega-menu-link:hover,
.mega-menu-link:focus {
    color: #fff;
    padding-left: 0.5rem;
    background-color: rgba(255, 255, 255, 0.05);
}

.mega-menu-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    padding: 0.5rem 0 0.25rem 0;
}

.mega-menu-sublist {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.mega-menu-sublist .mega-menu-link {
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
    margin-left: -0.5rem;
}

@media (hover: none) and (pointer: coarse) {
    .desktop-nav-link:hover {
        background-color: transparent;
    }

    .desktop-nav-item.show .mega-menu {
        display: block;
    }
}

@media (hover: hover) and (pointer: fine) {
    .desktop-nav-item:hover .mega-menu {
        display: block;
    }

    .desktop-nav-item:hover .desktop-nav-link {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.1);
    }
}

@media (min-width: 992px) and (max-width: 1200px) {
    .mega-menu {
        width: 100vw;
    }

    .mega-menu-content {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .desktop-nav-link {
        padding: 1rem !important;
    }
}

:root {
    --sidebar-bg: #0f172a;
    --sidebar-card: #111827;
    --sidebar-muted: #9ca3af;
    --sidebar-accent: #60a5fa;
    --sidebar-accent-2: #34d399;
    --sidebar-danger: #f87171;
    --sidebar-warning: #fbbf24;
    --sidebar-text: #e5e7eb;
    --sidebar-text-dim: #cbd5e1;
    --sidebar-border: #1f2937;
    --sidebar-radius: 16px;
}

.filter-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--sidebar-card);
    border-left: 1px solid var(--sidebar-border);
    z-index: 1050;
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
}

.filter-sidebar.show {
    right: 0;
}

.filter-sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.filter-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--sidebar-card);
    position: sticky;
    top: 0;
    z-index: 10;
}

.btn-close-filter {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-close-filter:hover {
    background: var(--sidebar-border);
}

.filter-sidebar-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.filter-search input {
    background: var(--bg);
    border: 1px solid var(--sidebar-border);
    color: var(--sidebar-text);
    border-radius: 8px;
    padding: 10px 12px;
}

.filter-search input:focus {
    outline: none;
    border-color: var(--sidebar-accent);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.1);
}

.filter-summary {
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    padding: 12px;
}

.filter-bulk-actions {
    border-bottom: 1px solid var(--sidebar-border);
    padding-bottom: 15px;
}

.filter-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-group {
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    overflow: hidden;
}

.filter-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--sidebar-card);
    border-bottom: 1px solid var(--border);
}

.filter-group-header h6 {
    margin: 0;
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 600;
}

.filter-group-items {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
}

.filter-group-items::-webkit-scrollbar {
    width: 6px;
}

.filter-group-items::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
    border-radius: 3px;
}

.filter-group-items::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 3px;
}

.filter-group-items::-webkit-scrollbar-thumb:hover {
    background: var(--sidebar-muted);
}

/* Multi-select dropdown panel: wraps search, actions, and filter-group-items (checkbox list). */
.filter-item-group {
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    overflow: hidden;
}

.filter-item-group .filter-group-items {
    max-height: 240px;
    padding-top: 4px;
}

.multiple-choice-dropdown-root .dropdown-menu {
    max-height: min(70vh, 420px);
    overflow: hidden;
}

.multiple-choice-dropdown-root .dropdown-toggle::after {
    margin-left: auto;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--sidebar-text);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.filter-item:hover {
    background: rgba(96, 165, 250, 0.1);
}

.filter-item input[type="checkbox"] {
    margin: 0;
    accent-color: var(--sidebar-accent);
}

.filter-item label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    font-size: 12px;
}

.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.filter-overlay.show {
    opacity: 1;
    visibility: visible;
}

.filter-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}
/* Single source for sidebar scroll content text colour – change --sidebar-text in :root above */
.filter-sidebar-inner .filter-sidebar-scroll,
.filter-sidebar-inner .filter-sidebar-scroll *,
.filter-sidebar-inner .filter-sidebar-scroll .btn-link,
.filter-sidebar-inner .filter-sidebar-scroll a {
    color: var(--sidebar-text) !important;
}
.filter-sidebar-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}
.filter-sidebar-footer {
    flex-shrink: 0;
    margin: 20px -20px -20px -20px;
    padding: 16px 20px;
    background: var(--sidebar-card);
    border-top: 1px solid var(--sidebar-border);
}
.filter-sidebar-footer a {
    color: var(--sidebar-accent);
    text-decoration: none;
}
.filter-sidebar-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .filter-sidebar {
        width: 100%;
        right: -100%;
    }

    .filter-sidebar.show {
        right: 0;
    }
}


.table-first-column-fixed tbody td:first-child,
.table-first-column-fixed thead th:first-child,
.table-first-column-color tbody td:first-child,
.table-first-column-color thead th:first-child{
    background-color: var(--bs-table-striped-bg);

}
/* Filter active state: accordion row (non-default value). Pinned rounded blocks have no accordion button. */
.filter-active > .accordion-button {
    border-left: 3px solid var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.08) !important;
}

/* Accordion: same active look on the expanded panel button (e.g. requester “Notes per scout”). */
.accordion-highlight-expanded .accordion-button:not(.collapsed) {
    border-left: 3px solid var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.08) !important;
}

