:root {
    --bs-primary: #013d73;
    --bs-primary-rgb: 1, 61, 115;
    --bs-primary-light: #2a7e95;
    --bs-primary-light-rgb: 42, 126, 149;
}

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

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

.btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: #2a7e95;
    --bs-btn-hover-border-color: #2a7e95;
    --bs-btn-active-bg: #2a7e95;
    --bs-btn-active-border-color: #2a7e95;
    --bs-btn-disabled-bg: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
}

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

/* Light Primary Variants */
.text-primary-light {
    color: var(--bs-primary-light) !important;
}

.bg-primary-light {
    background-color: var(--bs-primary-light) !important;
}

/* Override sidebar active state if needed, often uses primary */
.sidebar-nav ul .sidebar-item.selected>.sidebar-link,
.sidebar-nav ul .sidebar-item.selected>.sidebar-link.active,
.sidebar-nav ul .sidebar-item>.sidebar-link.active {
    background-color: var(--bs-primary) !important;
    color: #fff !important;
    border-radius: 7px;
}

/* Badge overrides */
.badge.bg-primary {
    background-color: var(--bs-primary) !important;
}

/* navbar */
.primary-hover-bg::before {
    background-color: rgba(var(--bs-primary-light-rgb), 0.3);
}

.primary-hover-bg:hover {
    color: var(--bs-primary) !important;
}

/* Fix for dropdown toggle active state */
.sidebar-nav ul .sidebar-item>.sidebar-link.active.has-arrow {
    background-color: var(--bs-light, #f8f9fa) !important;
    color: var(--bs-primary) !important;
}

#sidebarnav .sidebar-item .primary-hover-bg.active.has-arrow::before {
    width: 0 !important;
}

/* Rotate arrow when open */
.sidebar-nav .has-arrow[aria-expanded="true"]::after {
    transform: rotate(45deg) translate(0, -50%) !important;
}

/* Make arrow bolder and match text color */
.sidebar-nav .has-arrow::after {
    border-width: 2px 0 0 2px !important;
    border-color: currentColor !important;
}

/* Sidebar Overlay */
.layout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

html.layout-menu-expanded .layout-overlay {
    opacity: 1;
    visibility: visible;
}

/* Global Loading Screen */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--bs-primary);
}

.loading-text {
    margin-top: 1rem;
    color: var(--bs-primary);
    font-weight: 500;
}


.app-header {
    border-radius: 0px;
}

.body-wrapper .container-fluid, .body-wrapper .container-sm, .body-wrapper .container-md, .body-wrapper .container-lg, .body-wrapper .container-xl, .body-wrapper .container-xxl {
    padding-top: 0px !important;
    min-height: 90vh;
}

/* Readonly input background */
input[readonly],
.form-control[readonly],
.form-select[readonly] {
    background-color: #e9ecef !important;
}