:root {
    /* Neonlegacy theme palette: edit these values to retheme the interface. */
    --nl-primary: #696cff;
    --nl-primary-hover: #5f63e6;
    --nl-primary-active: #595cd9;
    --nl-primary-soft: #f0f0ff;
    --nl-primary-border: #cfd0ff;
    --nl-primary-rgb: 105, 108, 255;
    --nl-on-primary: #ffffff;
    --nl-secondary: #667085;
    --nl-success: #20c997;
    --nl-warning: #f6c23e;
    --nl-danger: #ff5b63;
    --nl-surface: #ffffff;
    --nl-page: #f5f7fb;
    --nl-border: #e4e9f0;
    --nl-text: #344054;
    --nl-muted: #667085;
    --bs-primary: var(--nl-primary);
    --bs-primary-rgb: var(--nl-primary-rgb);
}

body.neonlegacy-polished {
    color: var(--nl-text);
}

body.neonlegacy-polished .btn-primary,
body.neonlegacy-polished .btn-primary:visited {
    --bs-btn-bg: var(--nl-primary);
    --bs-btn-border-color: var(--nl-primary);
    --bs-btn-hover-bg: var(--nl-primary-hover);
    --bs-btn-hover-border-color: var(--nl-primary-hover);
    --bs-btn-active-bg: var(--nl-primary-active);
    --bs-btn-active-border-color: var(--nl-primary-active);
    --bs-btn-disabled-bg: var(--nl-primary);
    --bs-btn-disabled-border-color: var(--nl-primary);
    background-color: var(--nl-primary) !important;
    border-color: var(--nl-primary) !important;
    color: var(--nl-on-primary, #fff) !important;
}

body.neonlegacy-polished .btn-primary:hover {
    background-color: var(--nl-primary-hover) !important;
    border-color: var(--nl-primary-hover) !important;
}

body.neonlegacy-polished .btn-primary:active,
body.neonlegacy-polished .btn-primary.active {
    background-color: var(--nl-primary-active) !important;
    border-color: var(--nl-primary-active) !important;
}

body.neonlegacy-polished:not(.topmenu-auth) {
    background: var(--nl-page);
}

body.neonlegacy-polished:not(.topmenu-auth) .content-wrapper,
body.neonlegacy-polished:not(.topmenu-auth) .layout-page {
    background: var(--nl-page);
}

body.neonlegacy-polished .container-xxl.container-p-y {
    padding-top: 1.5rem !important;
    padding-bottom: 2rem !important;
}

body.neonlegacy-polished .content-header {
    margin-bottom: 1rem;
}

body.neonlegacy-polished .content-header h1,
body.neonlegacy-polished .content-header h2,
body.neonlegacy-polished .content-header h3,
body.neonlegacy-polished .container-xxl h1,
body.neonlegacy-polished .container-xxl h2,
body.neonlegacy-polished .container-xxl h3 {
    color: #1f2937;
    font-weight: 700;
}

body.neonlegacy-polished .card {
    margin-bottom: 1.25rem !important;
    border: 1px solid var(--nl-border);
    border-radius: 0.85rem;
    box-shadow: 0 4px 16px rgba(27, 39, 54, 0.055);
}

body.neonlegacy-polished .card:not([class*="bg-"]) {
    background: var(--nl-surface);
}

body.neonlegacy-polished .card-header {
    padding: 0.9rem 1.25rem !important;
}

body.neonlegacy-polished .card-header:not([class*="bg-"]) {
    border-bottom: 1px solid #e9edf3;
    border-radius: 0.85rem 0.85rem 0 0;
    background: #fff;
    color: #27364b;
    font-weight: 700;
}

body.neonlegacy-polished .card-body {
    padding: 1.25rem !important;
}

body.neonlegacy-polished .card-footer {
    padding: 0.9rem 1.25rem !important;
}

body.neonlegacy-polished .card-footer:not([class*="bg-"]) {
    border-top: 1px solid #e9edf3;
    border-radius: 0 0 0.85rem 0.85rem;
    background: #fff;
}

body.neonlegacy-polished .card-body .row:has(.filter-submit) {
    align-items: flex-end !important;
}

body.neonlegacy-polished .card-body .row > [class*="col-"]:has(.filter-submit) {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

body.neonlegacy-polished .filter-submit {
    min-height: 40px;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-self: flex-start;
}

body.neonlegacy-polished .card-footer:has(.filter-submit) {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

body.neonlegacy-polished label,
body.neonlegacy-polished .form-label {
    margin-bottom: 0.4rem;
    color: #344054;
    font-size: 0.875rem;
    font-weight: 600;
}

body.neonlegacy-polished .form-control:not(.form-control-sm),
body.neonlegacy-polished .form-select,
body.neonlegacy-polished .select2-container--default .select2-selection--single,
body.neonlegacy-polished .select2-container--default .select2-selection--multiple {
    min-height: 40px;
    border-color: #d7dee8;
    border-radius: 0.5rem;
    color: var(--nl-text);
}

body.neonlegacy-polished textarea.form-control {
    min-height: 6rem;
}

body.neonlegacy-polished .form-control:focus,
body.neonlegacy-polished .form-select:focus,
body.neonlegacy-polished .select2-container--default.select2-container--focus .select2-selection {
    border-color: var(--nl-primary-hover);
    box-shadow: 0 0 0 0.18rem rgba(var(--nl-primary-rgb), 0.12);
}

body.neonlegacy-polished .input-group-text {
    border-color: #d7dee8;
    background: #f8fafc;
    color: #64748b;
}

body.neonlegacy-polished .btn {
    border-radius: 0.5rem;
    font-weight: 600;
    transition: filter 0.15s ease, transform 0.15s ease;
}

body.neonlegacy-polished .btn:hover:not(:disabled) {
    filter: brightness(0.96);
}

body.neonlegacy-polished .btn-primary {
    border-color: var(--nl-primary);
    background-color: var(--nl-primary);
}

body.neonlegacy-polished .table {
    margin-bottom: 0;
    color: var(--nl-text);
    background: #fff;
}

body.neonlegacy-polished .table thead th {
    padding: 0.75rem 0.8rem;
    border-bottom: 1px solid #dce3ec;
    background: #f3f6fa;
    color: #475467;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: middle;
}

body.neonlegacy-polished .table tbody td {
    padding: 0.7rem 0.8rem;
    border-color: #edf0f4;
    vertical-align: middle;
}

body.neonlegacy-polished .table tbody tr:hover {
    background-color: var(--nl-primary-soft);
}

body.neonlegacy-polished .table-responsive,
body.neonlegacy-polished .scroll-top,
body.neonlegacy-polished .scroll-inner {
    max-width: 100%;
    overflow-x: auto;
}

body.neonlegacy-polished .nav-tabs,
body.neonlegacy-polished .nav-pills {
    gap: 0.4rem;
    border-bottom-color: var(--nl-border);
}

body.neonlegacy-polished .nav-tabs .nav-link,
body.neonlegacy-polished .nav-pills .nav-link {
    border-radius: 0.55rem;
    color: #536174;
    font-weight: 600;
}

body.neonlegacy-polished .nav-tabs .nav-link.active,
body.neonlegacy-polished .nav-pills .nav-link.active {
    border-color: var(--nl-primary);
    background: var(--nl-primary);
    color: #fff;
}

body.neonlegacy-polished .breadcrumb {
    padding: 0.55rem 0.8rem;
    border-radius: 0.55rem;
    background: #fff;
    color: var(--nl-muted);
}

body.neonlegacy-polished .alert {
    border: 1px solid transparent;
    border-radius: 0.65rem;
}

body.neonlegacy-polished .modal-content {
    overflow: hidden;
    border: 1px solid var(--nl-border);
    border-radius: 0.85rem;
    box-shadow: 0 16px 48px rgba(16, 24, 40, 0.18);
}

body.neonlegacy-polished #exampleModal .modal-dialog,
body.neonlegacy-polished #modalEditPrivilege .modal-dialog {
    width: min(calc(100% - 2rem), 42rem);
    max-width: 42rem;
    margin: 1rem auto;
}

body.neonlegacy-polished #exampleModal .modal-body#priv_list,
body.neonlegacy-polished #modalEditPrivilege .modal-body#priv_list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 1rem;
    max-height: min(65vh, 34rem);
    margin: 0;
    padding: 1.25rem !important;
    overflow-y: auto;
}

body.neonlegacy-polished #exampleModal #priv_list > .border-bottom,
body.neonlegacy-polished #modalEditPrivilege #priv_list > .border-bottom {
    grid-column: 1 / -1;
    margin: 0.75rem 0 0.25rem !important;
    padding: 0 0 0.45rem;
    border-color: var(--nl-border) !important;
    color: var(--nl-primary);
}

body.neonlegacy-polished #exampleModal #priv_list > .form-check,
body.neonlegacy-polished #modalEditPrivilege #priv_list > .form-check {
    width: auto;
    min-height: 2rem;
    margin: 0 !important;
    padding-left: 1.75rem !important;
}

body.neonlegacy-polished #exampleModal .modal-footer,
body.neonlegacy-polished #modalEditPrivilege .modal-footer {
    gap: 0.5rem;
}

@media (max-width: 575.98px) {
    body.neonlegacy-polished #exampleModal .modal-dialog,
    body.neonlegacy-polished #modalEditPrivilege .modal-dialog {
        width: calc(100% - 1rem);
        margin: 0.5rem auto;
    }

    body.neonlegacy-polished #exampleModal .modal-body#priv_list,
    body.neonlegacy-polished #modalEditPrivilege .modal-body#priv_list {
        grid-template-columns: minmax(0, 1fr);
        max-height: 65vh;
    }
}

body.neonlegacy-polished .modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem;
}

body.neonlegacy-polished .modal-header .modal-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

body.neonlegacy-polished .modal-header .btn-close {
    position: relative;
    z-index: 2;
    display: block !important;
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    margin: 0 0 0 auto !important;
    padding: 0.5rem;
    opacity: 1;
    pointer-events: auto;
}

body.neonlegacy-polished .modal-header,
body.neonlegacy-polished .modal-footer {
    border-color: #e9edf3;
    background: #fff;
}

body.neonlegacy-polished .dataTables_wrapper {
    padding: 0.75rem 0;
    color: var(--nl-muted);
}

body.neonlegacy-polished .dataTables_wrapper .dataTables_length select,
body.neonlegacy-polished .dataTables_wrapper .dataTables_filter input {
    min-height: 36px;
    border: 1px solid #d7dee8;
    border-radius: 0.45rem;
    padding: 0.35rem 0.55rem;
}

body.neonlegacy-polished .dataTables_wrapper .dataTables_paginate {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-top: 0.75rem !important;
}

body.neonlegacy-polished .dataTables_wrapper .dataTables_paginate .pagination {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.15rem !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.neonlegacy-polished .dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0.15rem 0.35rem !important;
    border: 1px solid var(--nl-border) !important;
    border-radius: 0.4rem !important;
    background: #fff !important;
    background-image: none !important;
    color: var(--nl-primary) !important;
    font-size: 0.72rem !important;
    line-height: 1 !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

body.neonlegacy-polished .dataTables_wrapper .dataTables_paginate .paginate_button > .page-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0.15rem 0.35rem !important;
    border: 0 !important;
    border-radius: 0.4rem !important;
    background: transparent !important;
    color: inherit !important;
    line-height: 1 !important;
    box-shadow: none !important;
}

body.neonlegacy-polished .dataTables_wrapper .dataTables_paginate .paginate_button:not(.current):not(.active):not(.disabled):hover,
body.neonlegacy-polished .dataTables_wrapper .dataTables_paginate .paginate_button:not(.current):not(.active):not(.disabled):hover > .page-link {
    border-color: var(--nl-primary-border) !important;
    background: var(--nl-primary-soft) !important;
    color: var(--nl-primary) !important;
}

body.neonlegacy-polished .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.neonlegacy-polished .dataTables_wrapper .dataTables_paginate .paginate_button.active,
body.neonlegacy-polished .dataTables_wrapper .dataTables_paginate .paginate_button.active > .page-link,
body.neonlegacy-polished .dataTables_wrapper .dataTables_paginate .pagination .page-item.active .page-link {
    border-color: var(--nl-primary) !important;
    background: var(--nl-primary) !important;
    background-image: none !important;
    color: #fff !important;
    font-weight: 600 !important;
}

body.neonlegacy-polished .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
body.neonlegacy-polished .dataTables_wrapper .dataTables_paginate .paginate_button.disabled > .page-link {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

@media (max-width: 767.98px) {
    body.neonlegacy-polished .container-xxl.container-p-y {
        padding: 1rem 0.75rem 1.5rem !important;
    }

    body.neonlegacy-polished .card-body {
        padding: 0.9rem !important;
    }

    body.neonlegacy-polished .card-header,
    body.neonlegacy-polished .card-footer {
        padding: 0.8rem 0.9rem !important;
    }

    body.neonlegacy-polished .card-footer .btn {
        margin: 0.15rem;
    }
}
