:root {
    --brand-primary: #ff3b2f;
    --brand-primary-dark: #cc2f26;
    --brand-primary-soft: rgba(255, 59, 47, 0.12);
    --brand-secondary: #3f3f46;
    --brand-muted: #f6f6f8;
    --sidebar-gradient-start: #1f1f1f;
    --sidebar-gradient-end: #2b0f0f;
    --sidebar-accent-start: #ff4b2b;
    --sidebar-accent-end: #ff1e56;
    --sidebar-icon: #ffb8a5;
    --sidebar-muted: rgba(255, 255, 255, 0.08);
}

.custom-sidebar {
    background: linear-gradient(180deg, var(--sidebar-gradient-start) 0%, var(--sidebar-gradient-end) 100%);
}

.custom-sidebar .brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
}

.custom-sidebar .brand-link .brand-text {
    font-weight: 600;
    letter-spacing: 0.04em;
}

.custom-sidebar .nav-sidebar > .nav-item > .nav-link {
    margin: 3px 0.75rem;
    border-radius: 0.65rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.custom-sidebar .nav-sidebar > .nav-item > .nav-link i {
    width: 1.35rem;
    text-align: center;
    color: var(--sidebar-icon);
    transition: color 0.2s ease;
}

.custom-sidebar .nav-sidebar > .nav-item > .nav-link:hover {
    background-color: var(--sidebar-muted);
    transform: translateX(4px);
}

.custom-sidebar .nav-sidebar > .nav-item > .nav-link.active {
    background: linear-gradient(135deg, var(--sidebar-accent-start) 0%, var(--sidebar-accent-end) 100%);
    color: #fff;
    box-shadow: 0 8px 22px rgba(255, 75, 43, 0.35);
}

.custom-sidebar .nav-sidebar > .nav-item > .nav-link.active i,
.custom-sidebar .nav-sidebar > .nav-item > .nav-link:hover i {
    color: #fff;
}

.custom-sidebar .nav-treeview > .nav-item > .nav-link {
    margin: 2px 1.6rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.75);
}

.custom-sidebar .nav-treeview > .nav-item > .nav-link:hover {
    background-color: rgba(255, 75, 43, 0.2);
    color: #fff;
}

.custom-sidebar .nav-treeview > .nav-item > .nav-link.active {
    background-color: rgba(255, 75, 43, 0.32);
    color: #fff;
}

.custom-sidebar .nav-header,
.custom-nav-header {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    font-weight: 600;
    color: #ffb8a5;
    padding: 1rem 1.25rem 0.35rem;
    opacity: 0.9;
}

.custom-sidebar .nav-header:first-of-type {
    padding-top: 1.2rem;
}

.custom-sidebar .sidebar-search .form-control-sidebar {
    border-radius: 999px;
    background-color: var(--sidebar-muted);
    border: none;
    color: #f8fafc;
}

.custom-sidebar .sidebar-search .form-control-sidebar:focus {
    background-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.custom-sidebar .sidebar-search .btn-sidebar {
    color: #ffd5cb;
}

.custom-sidebar::-webkit-scrollbar {
    width: 6px;
}

.custom-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 75, 43, 0.45);
    border-radius: 999px;
}

/* Brand surface emphasis */

.content-wrapper,
.content-header,
.card,
.card-header,
.card-body,
.card-footer {
    color: var(--brand-secondary);
}

.card.highlighted,
.info-box,
.small-box,
.callout,
.alert-light {
    border-color: var(--brand-primary);
    box-shadow: 0 12px 30px rgba(255, 59, 47, 0.08);
}

.text-primary,
.custom-text-primary {
    color: var(--brand-primary) !important;
}

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

.badge-primary,
.badge-danger,
.badge.custom-badge-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--sidebar-accent-end) 100%);
}

/* Buttons */

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--sidebar-accent-end) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 24px rgba(255, 59, 47, 0.35);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-primary) 100%);
    color: #fff;
}

.btn-primary:focus,
.btn-primary.focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 59, 47, 0.25);
}

.btn-outline-primary {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(255, 59, 47, 0.2);
}

.btn-link {
    color: var(--brand-primary);
}

.btn-link:hover,
.btn-link:focus {
    color: var(--brand-primary-dark);
}

.btn-light,
.btn-outline-light {
    color: var(--brand-primary);
}

.btn-light:hover,
.btn-outline-light:hover {
    color: var(--brand-primary-dark);
}

/* Form focus states */

.form-control:focus,
.custom-select:focus,
.form-check-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.25rem rgba(255, 59, 47, 0.15);
}

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

/* Tables and pagination */

.table thead th {
    color: var(--brand-secondary);
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: var(--brand-primary-soft);
}

.page-item.active .page-link {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    box-shadow: 0 6px 18px rgba(255, 59, 47, 0.25);
}

.page-link,
.page-link:hover {
    color: var(--brand-primary);
}

/* Alerts, callouts and emphasis */

.alert-primary,
.callout.callout-info,
.callout.callout-danger,
.callout.callout-warning {
    border-left-color: var(--brand-primary);
}

.alert-primary {
    background-color: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
}

.timeline > div > .timeline-item {
    border-color: var(--brand-primary-soft);
}

.timeline > div > .timeline-item::before {
    background: var(--brand-primary);
}

/* Select2 form control alignment */

.select2-container .select2-selection--single,
.select2-container--bootstrap-5 .select2-selection--single {
    min-height: calc(1.5em + 0.75rem + 2px);
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    flex: 1 1 auto;
    line-height: 1.5;
    padding: 0;
    color: #212529;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder,
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
    color: #6c757d;
}

.select2-container--default .select2-selection--single .select2-selection__arrow,
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--bootstrap-5.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--bootstrap-5.select2-container--focus .select2-selection--multiple {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.25rem rgba(255, 59, 47, 0.2);
    outline: 0;
}

.select2-container .select2-selection--multiple,
.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 38px;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select2-container .select2-selection--multiple .select2-selection__rendered,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    margin: 0;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    margin-right: 0.35rem;
}
