:root {
    --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --bs-body-font-size: 1rem;
}

body {
    font-size: 1rem;
    font-weight: 400;
}

nav {
    font-weight: 500;
}

@media (max-width: 576px) {

    .btn,
    .dropdown-mobile-margin,
    .dropdown-item {
        padding-top: 0.8rem;
        padding-bottom: 0.8rem;
        font-size: 1rem;
        font-weight: 500;
    }
}

.toast {
    opacity: 0.9;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.toast-header {
    background-color: rgba(0, 0, 0, 0.05);
}

#search-results .dropdown-item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#search-results .dropdown-item:hover {
    overflow: visible;
    white-space: normal;
}

#search-results .dropdown-item span:first-child {
    max-width: 280px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#search-input,
.input-group-text {
    border-radius: 999px !important;
}

#search-input {
    background-color: #fff !important;
    color: #212529;
    border-color: #ced4da;
    border: none;
    color: #212529;
    padding-left: 0rem;
}

#search-input::placeholder {
    color: #6c757d !important;
    opacity: 1;
}

#search-input:focus {
    box-shadow: none;
    outline: none;
}

.input-group {
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #ced4da;
    background-color: #fff;
}

.input-group .input-group-text {
    background-color: #fff;
    border: none;
    border-right: 1px solid #ced4da;
    padding: 0.75rem;
}

.pulsate {
    animation: pulsate 1s infinite;
}

@keyframes pulsate {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

@media (max-width: 991px) {
    .navbar-search {
        flex-grow: 0;
        margin-left: auto;
        margin-right: 10px;
    }

    .navbar-toggler {
        order: 1;
    }
}

.navbar {
    background-color: #f8f9fa;
}

.nav-link.active {
    color: rgb(138, 97, 97) !important;
}

.navbar .nav-link,
.navbar .dropdown-item,
.navbar .dropdown-toggle,
.offcanvas .nav-link,
.offcanvas .dropdown-item,
.user-dropdown .dropdown-item,
.language-dropdown .dropdown-item {
    color: #212529 !important;
}

.navbar .nav-link:hover,
.offcanvas .nav-link:hover,
.dropdown-item:hover {
    background-color: #f1f1f1;
    transition: background-color 0.5s ease-in-out;
    color: #000;
    border-radius: 0.5rem;
}

.navbar .nav-link.active {
    background-color: #eaeaea;
    border-radius: 0.5rem;
    padding: 0.3rem 0.75rem;
    font-weight: 600;
    color: #212529 !important;
}

.dropdown-menu,
.navbar .dropdown-menu,
.user-dropdown,
.language-dropdown {
    background-color: #f9f9f9;
    border-radius: 1rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    min-width: 200px;
    padding: 0.5rem;
    width: auto;
}

.dropdown-menu .dropdown-item,
.user-dropdown .dropdown-item,
.language-dropdown .dropdown-item {
    color: #212529;
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

.dropdown-menu .dropdown-item:hover,
.user-dropdown .dropdown-item:hover,
.language-dropdown .dropdown-item:hover,
.offcanvas .dropdown-item:hover {
    background-color: #f1f1f1;
    border-radius: 0.5rem;
}

.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active,
.offcanvas .dropdown-item.bg-light,
.language-dropdown .dropdown-item.bg-light {
    background-color: #eaeaea !important;
    color: #000 !important;
    font-weight: 600;
    border-radius: 8px;
}

.user-dropdown {
    width: max-content;
    padding: 0.25rem 0;
}

.user-dropdown .dropdown-header {
    font-size: 0.875rem;
    color: #212529 !important;
    font-weight: 500;
    opacity: 1;
}

.user-dropdown .dropdown-item.text-danger {
    font-weight: 600;
    color: #dc3545 !important;
}

.navbar-toggler {
    border: none;
    background-color: transparent;
    padding: 0.5rem;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(33, 37, 41, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
    background-size: contain;
}

.offcanvas.offcanvas-start {
    background-color: #f9f9f9;
    color: #212529;
    border-right: 1px solid #dee2e6;
}

.offcanvas .nav-link {
    padding: 0.5rem 0;
    font-weight: 500;
}

.offcanvas .nav-link:hover {
    background-color: #f1f1f1;
    border-radius: 0.5rem;
    padding-left: 0.5rem;
}

.offcanvas .dropdown-item {
    font-weight: 500;
}

.offcanvas-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.offcanvas-header {
    border-bottom: 1px solid #dee2e6;
}

@media (max-width: 420px) {
    .navbar-search {
        max-width: 100px !important;
    }
}

.nav-active {
    background-color: #f1f1f1;
    border-radius: 0.5rem;
}

/* Fancy style for help popovers */
.popover {
    max-width: 340px;
    min-width: 180px;
    margin: 14px !important;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(80, 110, 170, 0.15), 0 1.5px 5px rgba(60, 60, 80, 0.10);
    border: 1px solid #dee2e6;
    /* border-top: 4px solid #0d6efd;  REMOVED: Bootstrap info blue top border */
    background: #fff;
    transition: box-shadow 0.15s, opacity 0.2s;
    word-break: break-word;
    z-index: 1080;
    /* Over most things */
    opacity: 0;
    animation: popover-fadein 0.25s forwards;
}

/* No blue arrow override: Use Bootstrap's default arrow color */
.popover .popover-arrow::after {
    /* border-top-color: #0d6efd !important;  REMOVED */
}

.popover-body {
    padding: 1rem 1.1rem 0.9rem 1.1rem;
    color: #333;
    font-size: 1em;
    line-height: 1.6;
}

.popover ul,
.popover ol {
    margin-bottom: 0.3em;
    padding-left: 1.2em;
}

.popover b,
.popover strong {
    color: #14539a;
}

@media (max-width: 500px) {
    .popover {
        max-width: 98vw;
        min-width: 120px;
    }
}

@keyframes popover-fadein {
    to {
        opacity: 1;
    }
}

.bi-none::before {
    content: none !important;
    display: none !important;
}


.avatar-container {
    position: relative;
    display: inline-block;
}

.avatar-badge {
    position: absolute;
    top: -5px;
    right: 20px;
    width: 13px;
    height: 13px;
    background-color: red;
    border-radius: 50%;
    border: 2px solid white;
}

.dropdown.ms-3 .avatar-container {
    position: relative;
    display: inline-block;
}

.dropdown-item .avatar-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background-color: red;
    border-radius: 50%;
    border: 2px solid white;
    z-index: 10;
}

.dropdown.ms-3 .menu-item-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.dropdown.ms-3 .menu-item-container .menu-item-badge {
    position: absolute;
    top: 2px;
    right: 0px;
    width: 10px;
    height: 10px;
    background-color: red;
    border-radius: 50%;
    border: 1px solid white;
    z-index: 10;
}


/* SweetAlert2 Bootstrap-like button styles */
.swal2-confirm.btn-primary {
    font-size: 1.25rem;
    padding: 0.75rem 1.5rem;
    margin: 0.5rem;
    border-radius: 0.25rem;
}

.swal2-cancel.btn-secondary {
    font-size: 1.25rem;
    padding: 0.75rem 1.5rem;
    margin: 0.5rem;
    border-radius: 0.25rem;
}


.small-badge {
    font-size: 0.8rem;
    /* Or 0.75rem, 80%, etc. */
}