:root {
    --dark-bg: #222;
    --dark-bg-secondary: #343a40;
    --dark-text: #f8f9fa;
    --dark-border: #495057;
    --dark-hover-bg: #495057;
    --dark-active: #6c757d;
    --dark-primary: #121212;
    --dark-secondary: #1c1c1c;
    --dark-text: #f8f9fa;
    --dark-border: #343a40;
    --dark-link: #17a2b8;
}

body {
    background-color: var(--dark-primary);
    color: var(--dark-text);
}

a {
    color: var(--dark-link);
}

    a:hover {
        color: var(--dark-link);
        text-decoration: underline;
    }

.navbar-light {
    color: var(--dark-link);
    background-color: var(--dark-bg);
    border-color: var(--dark-border);
}

    .navbar-light .navbar-brand,
    .navbar-light .navbar-nav .nav-link {
        color: var(--dark-text);
    }

        .navbar-light .navbar-nav .nav-link:hover,
        .navbar-light .navbar-nav .nav-link:focus,
        .navbar-light .navbar-nav .nav-link.active {
            color: var(--dark-active);
            background-color: transparent;
        }

    .navbar-light .navbar-nav .nav-item.dropdown .dropdown-menu {
        background-color: var(--dark-bg-secondary);
        border-color: var(--dark-border);
    }

        .navbar-light .navbar-nav .nav-item.dropdown .dropdown-menu .dropdown-item {
            color: var(--dark-text);
        }

            .navbar-light .navbar-nav .nav-item.dropdown .dropdown-menu .dropdown-item:hover,
            .navbar-light .navbar-nav .nav-item.dropdown .dropdown-menu .dropdown-item:focus {
                background-color: var(--dark-hover-bg);
                color: var(--dark-active);
            }

    .navbar-light .navbar-toggler {
        border-color: var(--dark-border);
    }

    .navbar-light .navbar-toggler-icon {
        background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
    }

    .navbar-light .navbar-nav .active > .nav-link, .navbar-light .navbar-nav .nav-link.active, .navbar-light .navbar-nav .nav-link.show, .navbar-light .navbar-nav .show > .nav-link {
        color: var(--dark-active);
    }

.card {
    background-color: var(--dark-secondary);
    border-color: var(--dark-border);
}

.card-header {
    background-color: var(--dark-primary);
    border-bottom: 1px solid var(--dark-border);
}

.card-footer {
    background-color: var(--dark-primary);
    border-top: 1px solid var(--dark-border);
}

.table {
    background-color: var(--dark-bg-secondary);
    color: var(--dark-text);
}

    .table thead th {
        color: var(--dark-text);
        background-color: var(--dark-secondary);
    }

.table-bordered th,
.table-bordered td {
    border-color: var(--dark-border);
}

.table-hover tbody tr:hover {
    color: var(--dark-text);
    background-color: var(--dark-bg);
}

.bg-light {
    background-color: var(--dark-secondary) !important;
}

.text-dark {
    color: var(--dark-text) !important;
}

.bg-white {
    background-color: var(--dark-primary) !important;
}

.footer {
    background-color: var(--dark-secondary);
    color: var(--dark-text);
}

.listbox {
    background-color: var(--dark-bg-secondary);
    color: var(--dark-text);
    border-color: var(--dark-border);
}

.list-overflow, .list-overflow-auto {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.list-report li {
    background-color: var(--dark-bg);
    color: var(--dark-text);
    border-bottom: solid 1px var(--dark-border);
}

.folder-panel {
    background-color: var(--dark-bg);
}

.folder-list li {
    background-color: var(--dark-bg-secondary);
    color: var(--dark-text);
    border: 1px solid var(--dark-bg);
}

    .folder-list li:hover {
        background-color: var(--dark-hover-bg);
    }

.modal-fullscreen .modal-dialog {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.modal-content {
    background-color: var(--dark-hover-bg);
    color: var(--dark-text);
    border-color: var(--dark-border);
}

.button-box {
    color: var(--dark-text);
    border: 2px solid var(--dark-border);
}

    .button-box:hover {
        background-color: var(--dark-hover-bg);
        color: var(--dark-active);
    }

    .button-box.active {
        background-color: transparent;
    }

.report-container, .report-outer, .report-canvas {
    background-color: var(--dark-bg);
}

.report-menubar {
    background-color: var(--dark-bg-secondary);
}

.material-switch > label::before {
    background-color: #fff;
}

.material-switch > label::after {
    background-color: #fff;
}

.material-switch > .label-primary {
    background-color: #fff !important;
}

.list-group {
    background-color: var(--dark-bg);
}

.list-group-item {
    background-color: var(--dark-bg);
    color: #e4e5e5;
    border-color: var(--dark-border);
}

    .list-group-item:hover, .list-group-item:focus {
        background-color: var(--dark-hover-bg);
        color: var(--dark-text);
    }

    .list-group-item.active {
        background-color: var(--dark-active);
        border-color: var(--dark-active);
        color: var(--dark-text);
    }

    .list-group-item.custom-class {
    }

.caption-top {
    caption-side: top;
}

.btn-primary {
    background-image: linear-gradient(#52565a, #3a3f44 60%, #353a3f);
    border-color: #52565a;
    filter: none;
}

    .btn-primary:not([disabled]):not(.disabled):hover {
        background-image: linear-gradient(#313539, #34393d 40%, #373b40);
        filter: none;
    }

    .btn-primary:not([disabled]):not(.disabled):active:hover, .btn-primary:not([disabled]):not(.disabled).active:hover {
        background-image: linear-gradient(#25282c, #292c30 40%, #2b2f32);
        filter: none;
    }

.btn-secondary {
    background-image: linear-gradient(#8a9196, #7a8288 60%, #70787d);
    filter: none;
}

    .btn-secondary:not([disabled]):not(.disabled):hover {
        background-image: linear-gradient(#666d72, #6e757a 40%, #737a80);
        filter: none;
    }

    .btn-secondary:not([disabled]):not(.disabled):active:hover, .btn-secondary:not([disabled]):not(.disabled).active:hover {
        background-image: linear-gradient(#4e5357, #555b5f 40%, #5a6065);
        filter: none;
    }

p {
    color: #6c757d;
}

.select2-container {
    background-color: var(--dark-bg-secondary);
    color: var(--dark-text);
    border: 1px solid var(--dark-border);
}

.select2-dropdown {
    background-color: var(--dark-bg-secondary);
    color: var(--dark-text);
    border-color: var(--dark-border);
}

.select2-results__option {
    background-color: var(--dark-bg-secondary);
    color: var(--dark-text);
}

.select2-results__option--highlighted {
    background-color: var(--dark-hover-bg);
    color: var(--dark-active);
}

.select2-search--dropdown .select2-search__field {
    background-color: var(--dark-bg);
    color: var(--dark-text);
    border: 1px solid var(--dark-border);
}

.select2-container--default .select2-selection--single {
    background-color: var(--dark-bg-secondary);
    color: var(--dark-text);
    border: 1px solid var(--dark-border);
}

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        color: var(--dark-text);
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow b {
        border-color: var(--dark-text) transparent transparent transparent;
    }

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--dark-active);
    color: var(--dark-text);
    border: 1px solid var(--dark-hover-bg);
}

.card {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.6);
    transition: 0.3s;
}

    .card:hover {
        box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.8);
    }

.list-group-item {
    box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.7);
    transition: 0.3s;
}

    .list-group-item:hover {
        box-shadow: 0 6px 12px 0 rgba(0, 0, 0, 0.9);
    }

.query-builder .rule-container, .query-builder .rule-placeholder, .query-builder .rules-group-container {
    position: relative;
    margin: 4px 0;
    border-radius: 5px;
    padding: 5px;
    border: 1px solid #444;
    background-color: #333;
    color: #f8f9fa;
    width: 100%;
}

.query-builder .rules-group-container {
    padding: 10px;
    padding-bottom: 6px;
    border: 1px solid #555;
    background-color: #2b2b2b;
}

.query-builder .rules-group-header {
    margin-bottom: 10px;
    background-color: #3a3a3a;
    color: #f8f9fa;
}

    .query-builder .rules-group-header .group-conditions .btn.readonly:not(.active),
    .query-builder .rules-group-header .group-conditions input[name$='_cond'] {
        border: 0;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
        white-space: nowrap;
    }

    .query-builder .rules-group-header .group-conditions .btn.readonly {
        border-radius: 3px;
    }

.query-builder .rules-list {
    list-style: none;
    padding: 0 0 0 15px;
    margin: 0;
}

    .query-builder .rules-list > ::after, .query-builder .rules-list > ::before {
        content: '';
        position: absolute;
        left: -10px;
        width: 10px;
        height: calc(50% + 4px);
        border-color: #666;
        border-style: solid;
    }

    .query-builder .rules-list > ::before {
        top: -4px;
        border-width: 0 0 2px 2px;
    }

    .query-builder .rules-list > ::after {
        top: 50%;
        border-width: 0 0 0 2px;
    }

    .query-builder .rules-list > :first-child::before {
        top: -12px;
        height: calc(50% + 14px);
    }

    .query-builder .rules-list > :last-child::before {
        border-radius: 0 0 0 4px;
    }

    .query-builder .rules-list > :last-child::after {
        display: none;
    }
