/* ====================================
   BOOTSTRAP 5 THEME CUSTOMIZATION
   Avolve Fleet Management Design
   ==================================== */

:root {
    --avolve-primary: #5c2d90;
    --avolve-primary-dark: #4a2473;
    --avolve-primary-light: #6b4c9a;
    --avolve-secondary: #9854CB;
    --avolve-light: #f6edfd;
    --avolve-lighter: #faf8fc;
    --bs-primary: #5c2d90;
    --bs-primary-rgb: 92, 45, 144;
    --bs-body-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ====================================
   GLOBAL OVERRIDES
   ==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--bs-body-font-family);
    background: #f5f5f5;
    overflow-x: hidden;
}


/* ====================================
   HEADER/NAVBAR
   ==================================== */
.header-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    background: var(--avolve-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1030;
    height: 68px;
}

.avolve-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 300px;
    height: 70px;
    background-color: #fff;
    gap: 50px;
    border-radius: 0 50px 50px 0;
    box-shadow: var(--avolve-primary) 1.95px 1.95px 2.6px;
}

.sidebar-toggle {
    margin-right: 20px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.logo {
    margin-left: 20px;
}

.avolve-logo {
    width: 150px;
}

.nav-right-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-right: 30px;
    gap: 25px;
}

.nav-right-icons {
    padding: 0;
    margin: 0;
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.nav-right-icons img {
    width: 30px;
    height: 30px;
}

.notifications {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.notifications:hover {
    background-color: #f0e6fa;
}

.notifications.active {
    background-color: var(--avolve-primary);
}

.notifications.active img {
    filter: brightness(0) invert(1);
}

/* ====================================
   SIDEBAR (Bootstrap Offcanvas Style)
   ==================================== */
.sidebar {
    position: fixed;
    top: 68px;
    left: 0;
    width: 270px;
    height: calc(100vh - 68px);
    background: #fff;
    transition: all 0.4s ease;
    z-index: 1020;
    box-shadow: var(--avolve-primary) 1.95px 1.95px 2.6px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(92, 45, 145, 0.5);
    border-radius: 4px;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-nav .nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding: 0 3px 15px 12px;
}

.sidebar-nav .nav-link {
    color: var(--avolve-primary);
    display: flex;
    gap: 11px;
    white-space: nowrap;
    border-radius: 8px;
    padding: 10px 10px 10px 13px;
    font-weight: 600;
    font-size: 15px;
    margin-top: 5px;
    align-items: center;
    text-decoration: none;
    transition: 0.3s ease;
    cursor: pointer;
}

.icon-block img {
    width: 24px;
    height: 24px;
    transition: filter 0.3s ease;
}

.nav-link:hover .icon-block img {
    filter: brightness(0) invert(1);
}

.nav-item.active > .nav-link .icon-block img {
    filter: brightness(0) invert(1);
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: var(--avolve-secondary);
}

.nav-item.active > .nav-link {
    color: #fff;
    background: var(--avolve-secondary);
}

.child-menu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 0;
}

.nav-item.has-children.open .child-menu {
    max-height: 500px;
}

.child-menu .nav-link {
    padding-left: 47px;
    font-size: 14px;
}

.sidebar.collapsed .child-menu {
    display: none;
}

/* ====================================
   MAIN CONTENT
   ==================================== */
#main-content {
    margin-left: 80px;
    margin-top: 68px;
    min-height: calc(100vh - 68px);
    background: #f5f5f5;
    transition: margin-left 0.3s ease;
    padding: 0;
}

#main-content.expanded {
    margin-left: 270px;
}

/* ====================================
   BOOTSTRAP MODAL OVERRIDES
   ==================================== */
.modal-header {
    background: linear-gradient(135deg, var(--avolve-lighter) 0%, var(--avolve-light) 100%);
    border-bottom: 2px solid var(--avolve-primary);
    padding: 20px 24px;
}

.modal-title {
    color: var(--avolve-primary);
    font-weight: 650;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title i {
    font-size: 22px;
}

.btn-close {
    filter: invert(29%) sepia(60%) saturate(1000%) hue-rotate(252deg);
}

.modal-body {
    padding: 32px 32px 0 32px;
}

.modal-footer {
    border-top: 2px solid #f1f5f9;
    background: #fafafa;
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: center;
}

.is-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}

.invalid-feedback {
    color: #dc2626;
    font-size: 13px;
}

/* ====================================
   BOOTSTRAP ALERT OVERRIDES
   ==================================== */
.alert {
    border-radius: 10px;
    border-left: 4px solid;
    padding: 16px 20px;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left-color: #2563eb;
}

.alert-success {
    background: #dcfce7;
    color: #15803d;
    border-left-color: #16a34a;
}

.alert-warning {
    background: #fef3c7;
    color: #a16207;
    border-left-color: #d97706;
}

.alert-danger {
    background: #fee2e2;
    color: #b91c1c;
    border-left-color: #dc2626;
}

/* ====================================
   BOOTSTRAP BADGE OVERRIDES
   ==================================== */
.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge.bg-success {
    background: #D9FFCE !important;
    color: #008516 !important;
}

.badge.bg-warning {
    background: #FFFFCD !important;
    color: #ADAD0E !important;
}

.badge.bg-primary {
    background: #E5E5FD !important;
    color: #6919CC !important;
}

.badge.bg-danger {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

/* ====================================
   BOOTSTRAP NAV TABS OVERRIDE
   ==================================== */
.nav-tabs {
    border-bottom: 2px solid var(--avolve-light);
}

.nav-tabs .nav-link {
    color: #64748b;
    font-weight: 600;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
}

.nav-tabs .nav-link:hover {
    color: var(--avolve-primary);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--avolve-primary);
    background: transparent;
    border-color: transparent transparent var(--avolve-primary);
}

/* ====================================
   SELECT2 INSIDE BOOTSTRAP MODALS
   Fix z-index stacking issue
==================================== */

/* Make Select2 dropdown appear above Bootstrap modal */
.modal .select2-container {
    z-index: 1060 !important;
}

.modal .select2-dropdown {
    z-index: 1060 !important;
}

.modal .select2-container--open {
    z-index: 1060 !important;
}

/* Ensure close mask is below dropdown but above modal */
.modal .select2-close-mask {
    z-index: 1059 !important;
}

/* Alternative: Set on the Select2 container when modal is present */
.modal-open .select2-container--open {
    z-index: 1060 !important;
}

.modal-open .select2-dropdown {
    z-index: 1060 !important;
}