/*
 * Professional Frontend Theme
 * Bootstrap 5.x compatible
 *
 * Important:
 * - Existing JavaScript hooks/classes are intentionally preserved.
 * - Existing FormType classes are preserved.
 * - Bootstrap remains the primary layout/component system.
 * - This file contains only project-specific visual rules.
 */

:root {
    --app-primary: #e10614;
    --app-primary-dark: #b80510;
    --app-primary-soft: #fbe8ea;

    --app-bg: #f5f7fa;
    --app-surface: #ffffff;
    --app-surface-muted: #f8f9fb;

    --app-border: #e3e7ed;
    --app-border-strong: #d4dae2;

    --app-text: #212529;
    --app-text-muted: #6c757d;

    --app-success: #198754;
    --app-warning: #ffc107;
    --app-danger: #dc3545;
    --app-info: #0d6efd;

    --app-radius: .65rem;
    --app-radius-sm: .4rem;
    --app-shadow: 0 .25rem 1rem rgba(33, 37, 41, .07);
    --app-shadow-lg: 0 .75rem 2rem rgba(33, 37, 41, .12);

    --app-sidebar-width: 280px;
    --app-navbar-height: 56px;
}

/* ------------------------------------------------------------
 * Base
 * ------------------------------------------------------------ */

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    background: var(--app-bg);
    color: var(--app-text);
    font-size: .925rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #445788;
}

a:hover {
    color: #303e65;
}

ul {
    margin-top: 0;
    margin-bottom: 0;
    padding-left: 0;
    list-style: none;
}

li {
    list-style: none;
}

li::marker {
    content: "";
}

.link-unstyled,
.link-unstyled:link,
.link-unstyled:visited,
.link-unstyled:hover,
.link-unstyled:active,
.link-unstyled:active:hover {
    color: inherit;
    text-decoration: none;
}

/* ------------------------------------------------------------
 * Navbar
 * ------------------------------------------------------------ */

body > nav.navbar,
body > header.navbar {
    min-height: var(--app-navbar-height);
    height: auto;
}

header.navbar {
    box-shadow: 0 .1rem .6rem rgba(0, 0, 0, .12);
    z-index: 1030;
}

.navbar .navbar-brand {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    font-weight: 600;
    letter-spacing: .01em;
}

.navbar .navbar-brand i {
    width: auto;
    font-style: normal;
    font-size: .8rem;
    font-weight: 500;
    opacity: .8;
}

nav a > i {
    width: 22px;
}

.navbar .nav-link {
    transition: color .15s ease, background-color .15s ease;
}

.navbar .btn {
    white-space: nowrap;
}
.navbar-nav {
    flex-wrap: nowrap !important;
    white-space: nowrap;
}

.navbar-nav .nav-link {
    white-space: nowrap;
}

/* ------------------------------------------------------------
 * Main content
 * ------------------------------------------------------------ */

#page-headline {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

main,
.container-fluid {
    --bs-gutter-x: 1.5rem;
}

.container-fluid > .row > [class*="col-"] {
    min-width: 0;
}

/* Keep the existing fixed-sidebar layout functional. */
@media (min-width: 768px) {
    .sidebar + [class*="offset-md-"],
    .sidebar ~ [class*="offset-md-"] {
        padding-left: 1.5rem;
    }
}

/* ------------------------------------------------------------
 * Cards
 * ------------------------------------------------------------ */

.card {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    background: var(--app-surface);
}

.card-header {
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    padding: .85rem 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.1rem;
}

.card-footer {
    background: var(--app-surface-muted);
    border-top: 1px solid var(--app-border);
}

/* ------------------------------------------------------------
 * Headings / page headers
 * ------------------------------------------------------------ */

.page-header,
.d-flex.justify-content-between.flex-wrap.flex-md-nowrap.align-items-center.border-bottom {
    border-bottom-color: var(--app-border) !important;
}

.page-header h1,
#page-headline,
h1.h2 {
    font-weight: 650;
    letter-spacing: -.015em;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--app-text);
}

/* ------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------ */

.btn {
    border-radius: var(--app-radius-sm);
    font-weight: 500;
    transition:
        color .15s ease,
        background-color .15s ease,
        border-color .15s ease,
        box-shadow .15s ease,
        transform .05s ease;
}

.btn:focus-visible {
    box-shadow: 0 0 0 .2rem rgba(225, 6, 20, .18);
}

.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary-dark);
    --bs-btn-hover-border-color: var(--app-primary-dark);
    --bs-btn-active-bg: var(--app-primary-dark);
    --bs-btn-active-border-color: var(--app-primary-dark);
}

.btn-outline-primary {
    --bs-btn-color: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary);
    --bs-btn-hover-border-color: var(--app-primary);
}

.btn-danger {
    --bs-btn-bg: var(--app-danger);
    --bs-btn-border-color: var(--app-danger);
}

.btn-sm {
    border-radius: .35rem;
}

.btn-toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

/* ------------------------------------------------------------
 * Forms
 * ------------------------------------------------------------ */

form label,
form legend {
    font-weight: 600;
    color: #343a40;
}

form label.form-check-label {
    font-weight: 400;
}

form .col-form-label {
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: .5rem;
}

.form-control,
.form-select,
.bootstrap-select > .dropdown-toggle {
    border-color: var(--app-border-strong);
    border-radius: var(--app-radius-sm);
}

.form-control:focus,
.form-select:focus,
.bootstrap-select > .dropdown-toggle:focus {
    border-color: rgba(225, 6, 20, .55);
    box-shadow: 0 0 0 .2rem rgba(225, 6, 20, .1);
}

.form-control::placeholder {
    color: #9aa1aa;
}

.form-check-input:checked {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

form .bootstrap-select {
    padding: 0;
    width: 100%;
}

/* Existing application / JS hooks */
input.spinner {
    text-align: center;
}

.filter-active,
select.filter-active,
input.filter-active,
.form-select.filter-active,
.form-control.filter-active {
    background-color: #e8f4fd !important;
    border-color: #0d6efd !important;
    color: #0b5ed7 !important;
    font-weight: 600 !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15) !important;
}

.filter-active option,
select.filter-active option {
    background-color: #ffffff !important;
    color: #212529 !important;
    font-weight: normal !important;
}

.Entity-Filter {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: .25rem 0 .75rem;
    padding: .35rem .5rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
    font-size: .9rem;
    float: right;
}

.Entity-Filter select {
    background: var(--app-primary);
    border: 1px solid var(--app-primary);
    border-radius: .35rem;
    color: #fff;
    padding: .25rem .5rem;
}

/* ------------------------------------------------------------
 * Tables
 * ------------------------------------------------------------ */

.table {
    --bs-table-bg: transparent;
    vertical-align: middle;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--app-border);
}

.table thead th {
    white-space: nowrap;
    font-weight: 600;
    color: #495057;
    background: var(--app-surface-muted);
    border-bottom: 1px solid var(--app-border-strong);
}

.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: #fafbfc;
}

table thead.grey {
    background: var(--app-primary);
    color: #fff;
}

table thead.grey th {
    background: var(--app-primary);
    color: #fff;
    border-bottom-color: var(--app-primary-dark);
}

.table-sort-link {
    text-decoration: none;
    color: inherit;
}

.table-sort-link:hover {
    color: inherit;
    text-decoration: underline;
}

.table-sort-link i,
.table-sort-link > .text-muted {
    margin-left: .25rem;
    color: inherit !important;
}

table tr.actionRow,
tr.OpenModalForm,
tr.openByModal,
tr.openByWidthModal {
    cursor: pointer;
}

tr.openByModal:hover,
tr.openByWidthModal:hover,
tr.OpenModalForm:hover,
table tr.actionRow:hover {
    background-color: rgba(225, 6, 20, .045);
}

table.user-table tr.disabled td,
.isUndo {
    text-decoration: line-through;
}
table .table-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.isUndo {
    color: var(--app-text-muted);
}

.checkAll {
    border-bottom: 2px solid var(--app-border-strong);
}

/* ------------------------------------------------------------
 * Sidebar Layout
 * ------------------------------------------------------------ */

#sidebarMenu {
    flex: 0 0 240px;
    width: 240px;
    max-width: 240px;
}


/* ------------------------------------------------------------
 * Sidebar
 * ------------------------------------------------------------ */

#sidebarMenu .position-sticky {
    top: 0;
}

#sidebarMenu .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 42px;
    margin: .25rem 0;
    padding: .65rem .85rem;
    border: 1px solid transparent;
    border-radius: .5rem;
    color: #adb5bd;
    text-align: left;
    font-size: .9rem;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

#sidebarMenu .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .08);
}

#sidebarMenu .nav-link.active {
    color: #fff;
    background: var(--app-primary);
    border-color: var(--app-primary);
    box-shadow: 0 .25rem .75rem rgba(225, 6, 20, .22);
}

#sidebarMenu .nav-item > a[aria-current="page"] {
    margin-top: 1rem;
    border-top-color: rgba(255, 255, 255, .12);
}

#sidebarMenu li.text-center {
    padding: .75rem .5rem 1rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}
#sidebarMenu .project-sidebar-title {
    padding: 1rem .75rem 1.25rem;
    margin-bottom: .75rem;
    color: #dadada;
    background: rgba(239, 234, 234, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    border-radius: .5rem;
}

#sidebarMenu .project-sidebar-title h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color:inherit;
}

#sidebarMenu .project-sidebar-title h5 {
    margin: .25rem 0 0;
    font-size: .8rem;
    font-weight: 400;
    color:inherit;
    line-height: 1.3;
}
/* ------------------------------------------------------------
 * Dashboard
 * ------------------------------------------------------------ */

.user-dashboard .item {
    background: transparent;
    border: 0;
    color: #fff;
}

.user-dashboard .item a {
    display: flex;
    align-items: center;
    min-height: 100%;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--app-radius);
    background: var(--app-primary);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    box-shadow: var(--app-shadow);
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.user-dashboard .item a:hover {
    border-color: var(--app-primary);
    background: var(--app-primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--app-shadow-lg);
}

/* Existing information-center tiles */
#displayModeMenu .tile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#displayModeMenu .tile-menu li {
    margin-bottom: 1rem;
}

#displayModeMenu .tile-menu a {
    color: inherit;
    text-decoration: none;
}

#displayModeMenu .tile-card {
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--app-radius);
    background: var(--app-primary);
    color: #fff;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

#displayModeMenu .tile-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--app-shadow-lg);
    background: var(--app-primary-dark);
}

/* ------------------------------------------------------------
 * Dropdowns
 * ------------------------------------------------------------ */

.dropdown-menu[data-bs-popper],
.dropdown-menu {
    padding: .35rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    box-shadow: var(--app-shadow-lg);
}

.dropdown-item {
    margin-top: 0;
    padding: .55rem .7rem;
    border-radius: .3rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--app-primary-soft);
    color: var(--app-text);
}

.dropdown-divider {
    margin: .35rem 0;
    background-color: var(--app-border);
}

/* ------------------------------------------------------------
 * Alerts / Toasts
 * ------------------------------------------------------------ */

#flashes {
    position: fixed;
    top: calc(var(--app-navbar-height) + .75rem);
    right: 1rem;
    z-index: 1080;
}

#flashes .Success,
#flashes .Failed {
    position: static;
    padding: .75rem 1rem;
    border-radius: var(--app-radius-sm);
    box-shadow: var(--app-shadow-lg);
}

#flashes .Success {
    background: var(--app-success);
    color: #fff;
}

#flashes .Failed {
    background: var(--app-danger);
    color: #fff;
}
#flash-container
{
    z-index:999;
}
.flash-toast {
    min-width: 320px;
    max-width: 420px;
    border: 0;
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-lg);
}
.flash-toast .toast-header {
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    background: var(--app-primary);
    color: #fff;
}

.flash-success {
    border-left: 4px solid var(--app-success);
}

.flash-error {
    border-left: 4px solid var(--app-danger);
}

.flash-warning {
    border-left: 4px solid var(--app-warning);
}

.flash-info {
    border-left: 4px solid var(--app-info);
}

/* ------------------------------------------------------------
 * Modals
 * ------------------------------------------------------------ */

.modal-content {
    border: 0;
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-lg);
    overflow: hidden;
}

.modal-header {
    border-bottom-color: var(--app-border);
}

.modal-footer {
    border-top-color: var(--app-border);
    background: var(--app-surface-muted);
}

.width-modal {
    min-width: 100%;
}

@media (min-width: 768px) {
    .width-modal {
        min-width: 75%;
    }
}

@media (min-width: 992px) {
    .width-modal {
        min-width: 75%;
    }
}

@media (min-width: 1200px) {
    .width-modal {
        min-width: 75%;
    }
}

/* ------------------------------------------------------------
 * Pagination
 * ------------------------------------------------------------ */

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 38px;
    min-width: 300px;
    padding: .35rem 0;
}

.pager .pager-navigator {
    display: flex;
    align-items: center;
    gap: .25rem;
    position: static;
    margin-left: auto;
}

.pager .arrow,
.pager .page-number-list {
    float: none;
    margin-right: 0;
}

.pager .page-info {
    display: block;
    float: none;
    margin-right: auto;
    padding-top: 0;
}

.pager .arrow .button,
.pager .page-number-list a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    padding: .25rem .5rem;
    border: 1px solid var(--app-border-strong);
    border-radius: .35rem;
    background: var(--app-surface);
    color: var(--app-text);
    text-decoration: none;
}

.pager .page-number-list a {
    margin-right: .25rem;
}

.pager .page-number-list a:hover,
.pager .arrow .button:hover {
    border-color: var(--app-primary);
    color: var(--app-primary);
    background: var(--app-primary-soft);
}

.pager .page-number-list a.current-page {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #fff;
    text-decoration: none;
}

.pager .arrow.inactive {
    opacity: .45;
    pointer-events: none;
}

.pager .entities-per-page {
    float: none;
}

/* ------------------------------------------------------------
 * List actions
 * ------------------------------------------------------------ */

.list-action {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin: 0;
    padding: 0;
}

.list-action li {
    min-width: 25px;
    min-height: 1.5em;
    float: none;
    text-align: center;
}

.list-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: .35rem;
    background: transparent;
    color: var(--app-text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}

.list-action-button:hover {
    color: var(--app-text);
    background: rgba(108, 117, 125, .1);
}

.list-action-delete:hover {
    color: var(--app-danger);
    background: rgba(220, 53, 69, .08);
}

/* ------------------------------------------------------------
 * Autocomplete / Selectpicker
 * ------------------------------------------------------------ */

.bootstrap-autocomplete .dropdown-item {
    border-bottom: 1px solid var(--app-border);
    cursor: pointer;
}

.bootstrap-autocomplete .dropdown-item:last-child {
    border-bottom: 0;
}

/* ------------------------------------------------------------
 * Project documents
 * ------------------------------------------------------------ */

#projectDocuments .category-headline {
    padding: .65rem .8rem;
    border-radius: var(--app-radius-sm);
    background: #454a54;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

#projectDocuments .category-headline.noDocuments a.openList {
    color: #adb5bd;
}

#projectDocuments .documents {
    padding: .75rem 1rem;
}

#projectDocuments .table-documents .download {
    color: inherit;
    text-decoration: none;
}

#projectDocuments .table-documents .fa-star {
    color: var(--app-primary);
}

#projectDocuments table {
    margin-bottom: 0;
}

#projectDocuments .category-headline h4 {
    margin: 0;
}

#projectDocuments .category-headline .btn {
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
}

#projectDocuments a[aria-expanded="false"] .fa-angle-double-up {
    display: none;
}

#projectDocuments a[aria-expanded="true"] .fa-angle-double-down {
    display: none;
}

/* ------------------------------------------------------------
 * Attribute tables
 * ------------------------------------------------------------ */

table.address-attribute .attribut-col {
    width: 150px;
}

table.address-attribute .project-choice {
    min-width: 200px;
}

table.address-attribute thead {
    color: #dcdcdc;
}

.filter-attribute {
    width: 150px;
}

table.address-attribute th select {
    padding-top: .2rem;
    padding-bottom: .2rem;
    border: 0;
    border-radius: 0;
    background: var(--app-primary);
    color: #fff;
    text-align: center;
}

table.address-attribute th select:focus {
    box-shadow: none;
}

table.address-attribute thead tr th {
    padding-top: .2rem;
    padding-bottom: .2rem;
    border: 1px solid var(--app-primary);
    background: var(--app-primary);
    color: #fff;
}

table.address-attribute .attribut-select {
    border: 1px solid #e32631;
}

table.address-attribute .attribut-select:has(option[selected="selected"]) {
    border-color: var(--app-primary-dark);
    background: #ba0815;
    color: #fff;
}

.address-attribute .icons .icon-green,
.icon-green {
    color: var(--app-success);
}

.address-attribute .icons .icon-red,
.icon-red {
    color: var(--app-danger);
}

.icon-grey {
    color: #4e4e4e;
}

.icon-lightgrey {
    color: #a3a3a3;
}

.icon-blue {
    color: #40409f;
}

.bg_primary {
    background-color: var(--app-primary) !important;
}

.bg-grey {
    background-color: var(--app-surface-muted) !important;
}

/* ------------------------------------------------------------
 * Custom attribute selector
 * ------------------------------------------------------------ */

.attribute-custom-select {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-top: -.25rem;
    margin-bottom: .75rem;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}

.attribute-custom-select .arrow {
    width: auto;
    padding: .65rem .9rem;
    border: 0;
    background: #6c757d;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s ease;
}

.attribute-custom-select .arrow:hover {
    background: #5c636a;
}

.attribute-custom-select .left-arrow {
    position: absolute;
    left: 0;
}

.attribute-custom-select .right-arrow {
    position: absolute;
    right: 0;
}

.attribute-custom-select .selected-option {
    width: 80%;
    padding: .55rem 2rem;
    border-left: 1px solid var(--app-border);
    border-right: 1px solid var(--app-border);
    background: var(--app-surface-muted);
    color: var(--app-text);
    font-size: .95rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

/* ------------------------------------------------------------
 * App checkbox - legacy JS component, intentionally retained
 * ------------------------------------------------------------ */

@font-face {
    font-family: "AppIcons";
    src: url("../css/font/fontello.eot?60538351");
    src:
        url("../css/font/fontello.eot?60538351#iefix") format("embedded-opentype"),
        url("../css/font/fontello.woff2?60538351") format("woff2"),
        url("../css/font/fontello.woff?60538351") format("woff"),
        url("../css/font/fontello.ttf?60538351") format("truetype"),
        url("../css/font/fontello.svg?60538351#fontello") format("svg");
    font-weight: normal;
    font-style: normal;
}

.AppCheckbox {
    display: inline-flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    margin-right: .25rem;
    padding: .35rem .6rem;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
    color: var(--app-text-muted);
    cursor: pointer;
    line-height: 1.25;
}

.AppCheckbox:before {
    display: inline-block;
    width: 20px;
    margin-right: .35rem;
    font-family: "AppIcons";
    font-size: 14px;
    text-align: left;
    content: "\e801";
    color: var(--app-danger);
}

.AppCheckbox.CheckboxActive {
    border-color: rgba(25, 135, 84, .45);
    background: rgba(25, 135, 84, .08);
    color: #155d3d;
}

.AppCheckbox.CheckboxActive:before {
    content: "\e800";
    color: var(--app-success);
}

/* ------------------------------------------------------------
 * Toggle component - legacy markup, visual refresh only
 * ------------------------------------------------------------ */

.CheckBoxOnOff {
    display: inline-block;
    position: relative;
    width: 100%;
    height: 40px;
    vertical-align: middle;
    font-size: .9rem;
    line-height: 40px;
    cursor: pointer;
}

.CheckBoxOnOff label {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0 1rem;
    border-radius: var(--app-radius-sm);
    background: #dc3545;
    color: #fff;
    font-weight: 600;
    text-indent: 27px;
    cursor: pointer;
    transition: background-color .2s ease, text-indent .2s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}

.CheckBoxOnOff label:after {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;
    color: #fff;
    font-size: .8rem;
    text-align: center;
}

.CheckBoxOnOff label:before {
    content: "";
    display: block;
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: #fff;
    transition: left .2s ease;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .25);
}

.CheckBoxOnOff input:checked + label {
    background: var(--app-success);
    text-indent: 8px;
}

.CheckBoxOnOff input:checked + label:before {
    left: calc(100% - 36px);
}

/* ------------------------------------------------------------
 * Loader - selector preserved for existing JS
 * ------------------------------------------------------------ */

.loader {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 2000;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    padding: 0;
    color: #fff;
    pointer-events: none;
}

.loader:before {
    content: "";
    position: absolute;
    inset: -16px;
    border: 4px solid rgba(255, 255, 255, .25);
    border-top-color: var(--app-primary);
    border-radius: 50%;
    animation: app-loader-spin .8s linear infinite;
}

.loader div {
    display: none;
}

@keyframes app-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ------------------------------------------------------------
 * Images / gallery helpers
 * ------------------------------------------------------------ */

.icon-wrapper {
    position: relative;
}

.icon {
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity .15s ease;
}

.icon.hover {
    opacity: 0;
}

.icon-wrapper:hover .hover {
    opacity: 1;
}

.icon-wrapper:hover .default {
    opacity: 0;
}

.openGallery:hover {
    color: var(--app-primary);
}

/* ------------------------------------------------------------
 * Legacy utility aliases retained for compatibility
 * ------------------------------------------------------------ */

.border-right-1 {
    border-right: 1px solid var(--app-border-strong);
    border-bottom: none;
}

tr.lastRowUpdate {
    background-image: none;
    animation: app-row-update 2s ease-in-out;
}

@keyframes app-row-update {
    0%, 100% {
        background-color: inherit;
    }
    50% {
        background-color: rgba(25, 135, 84, .25);
    }
}

/* ------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------ */

@media (max-width: 767.98px) {
    body {
        font-size: .9rem;
    }

    .sidebar {
        width: min(85vw, var(--app-sidebar-width));
        padding-top: calc(var(--app-navbar-height) + .5rem);
    }

    #flashes {
        right: .75rem;
        left: .75rem;
    }

    .flash-toast {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .pager {
        flex-wrap: wrap;
        min-width: 0;
    }

    .pager .page-info {
        width: 100%;
        margin-bottom: .25rem;
    }

    .table-responsive {
        border: 1px solid var(--app-border);
        border-radius: var(--app-radius-sm);
        background: var(--app-surface);
    }

    .card-body {
        padding: .9rem;
    }
}