.auth-body-dark {
    background: radial-gradient(circle at top, #24324a 0, #17212f 46%, #0f151c 100%);
}
.auth-card { background-color: var(--bs-secondary-bg); }
.vertical-menu .avatar-md { width: 4.5rem; height: 4.5rem; }
.avatar-xs { width: 2rem; height: 2rem; }
.page-title-box { gap: 1rem; }
.page-title-box .page-title-right { flex-shrink: 0; }
.form-group { margin-bottom: 1rem; }
.font-weight-medium { font-weight: 500 !important; }
.font-weight-bold { font-weight: 700 !important; }
.text-right, .text-sm-right { text-align: right !important; }
.float-right { float: right !important; }
.dropdown-menu-right { --bs-position: end; right: 0; left: auto; }
.btn-block { display: block; width: 100%; }
.mr-1 { margin-right: .25rem !important; }
.mr-2 { margin-right: .5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.ml-1 { margin-left: .25rem !important; }
.ml-2 { margin-left: .5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.badge-info { color: #fff; background-color: var(--bs-info); }
.badge-danger { color: #fff; background-color: var(--bs-danger); }
.badge-success { color: #fff; background-color: var(--bs-success); }
.badge-warning { color: #212529; background-color: var(--bs-warning); }
.badge-primary { color: #fff; background-color: var(--bs-primary); }

/* Keep every topbar control on the same visual axis. */
.admin-topbar-actions {
    height: var(--bs-header-height);
}

.admin-topbar-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: var(--bs-header-height);
    padding: 0 !important;
    line-height: 1 !important;
}

.admin-topbar-action > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin: 0;
    line-height: 22px !important;
    text-align: center;
}

.admin-topbar-action.noti-icon .badge {
    top: 12px;
    right: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    line-height: 18px;
}

.admin-topbar-user {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    height: var(--bs-header-height);
    padding: 0 .75rem !important;
    line-height: 1;
}

.admin-topbar-user .avatar-xs {
    flex: 0 0 2rem;
}
.close { border: 0; background: transparent; font-size: 1.4rem; line-height: 1; }

/* Bootstrap 4 compatibility: legacy helpers still render custom-select. */
.custom-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%231e2938' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    display: block;
    width: 100%;
    min-height: 38px;
    padding: .47rem 2.25rem .47rem .75rem;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--bs-body-color);
    appearance: none;
    background-color: var(--bs-input-bg);
    background-image: var(--bs-form-select-bg-img);
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.custom-select:focus {
    border-color: var(--bs-primary);
    outline: 0;
    box-shadow: 0 0 0 .15rem rgba(var(--bs-primary-rgb), .25);
}

.custom-select:disabled {
    color: var(--bs-secondary-color);
    background-color: var(--bs-secondary-bg);
    opacity: 1;
}

[data-bs-theme="dark"] .custom-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23adb5bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    color-scheme: dark;
}

.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 38px;
    color: var(--bs-body-color);
    background: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
}

/* Select2 ships with light-only colours. Keep active filters readable in dark mode. */
[data-bs-theme="dark"] .form-control:not(:disabled),
[data-bs-theme="dark"] .form-select:not(:disabled),
[data-bs-theme="dark"] .custom-select:not(:disabled) {
    color: #dce3ec;
    background-color: var(--bs-input-bg);
    border-color: #3b4a5f;
    opacity: 1;
}

[data-bs-theme="dark"] select.form-control:not(:disabled),
[data-bs-theme="dark"] select.form-select:not(:disabled),
[data-bs-theme="dark"] select.custom-select:not(:disabled) {
    color-scheme: dark;
}

[data-bs-theme="dark"] select.form-control option,
[data-bs-theme="dark"] select.form-select option,
[data-bs-theme="dark"] select.custom-select option {
    color: #dce3ec;
    background-color: var(--bs-input-bg);
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single,
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple {
    color: #dce3ec;
    background-color: var(--bs-input-bg);
    border-color: #3b4a5f !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__rendered,
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple .select2-search__field,
[data-bs-theme="dark"] .select2-container--default .select2-selection__placeholder {
    color: #dce3ec !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice {
    color: #e8edf4;
    background-color: #34445a;
    border-color: #53657d;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #c7d0dc;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fff;
}

[data-bs-theme="dark"] .select2-dropdown,
[data-bs-theme="dark"] .select2-container--default .select2-results > .select2-results__options,
[data-bs-theme="dark"] .select2-container--default .select2-results__option {
    color: #dce3ec;
    background-color: var(--bs-input-bg);
}

[data-bs-theme="dark"] .select2-dropdown {
    border: 1px solid #46576e;
    box-shadow: 0 .75rem 1.5rem rgba(0, 0, 0, .28);
}

[data-bs-theme="dark"] .select2-container--default .select2-search--dropdown,
[data-bs-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    color: #dce3ec;
    background-color: #1a2636;
    border-color: #46576e;
}

[data-bs-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"],
[data-bs-theme="dark"] .select2-container--default .select2-results__option--selected {
    color: #fff;
    background-color: #34445a !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
    color: #fff;
    background-color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .select2-container--default.select2-container--disabled .select2-selection--single,
[data-bs-theme="dark"] .select2-container--default.select2-container--disabled .select2-selection--multiple,
[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-select:disabled,
[data-bs-theme="dark"] .custom-select:disabled {
    opacity: .6;
}
.table td, .table th { vertical-align: middle; }
.table-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.note-preview { max-width: 32rem; white-space: normal; }
.stat-card-icon { width: 3rem; height: 3rem; display: inline-flex; align-items: center; justify-content: center; }
.activity-icon { width: 2.25rem; height: 2.25rem; flex: 0 0 2.25rem; display: inline-flex; align-items: center; justify-content: center; }
.timeline-list { position: relative; }
.timeline-list::before { content: ""; position: absolute; left: 1.1rem; top: 1rem; bottom: 1rem; width: 1px; background: var(--bs-border-color); }
.timeline-item { position: relative; display: flex; gap: .75rem; padding-bottom: 1rem; }
.timeline-item .activity-icon { z-index: 1; }
@media (max-width: 767.98px) {
    .page-title-box { align-items: flex-start !important; flex-direction: column; }
    .text-right, .text-sm-right { text-align: left !important; }
}
