/*
  Custom Overrides
  Most styling is handled by Bootstrap 5 utility classes in the HTML.
*/

/* Borderless inputs inside bordered wrappers should blend with their container */
input.form-control.border-0 {
    background-color: transparent;
}
input.form-control.border-0:focus {
    background-color: transparent;
}

/* Dark mode form controls — fix incorrect var(--bs-dark) background from style_rafuj.css
   (--bs-dark = #f5f5f5 in dark mode, intended for text, not backgrounds) */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--bs-white);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--bs-white);
    border-color: rgba(var(--bs-primary-rgb), 0.5);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] .form-select::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
[data-bs-theme="dark"] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
[data-bs-theme="dark"] .form-check-input {
    background-color: var(--bs-white);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
[data-bs-theme="dark"] .input-group-text {
    background-color: var(--bg-2);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

/* Dark mode Select2 — same var(--bs-dark) bug */
[data-bs-theme="dark"]
    .js-select2
    + .select2
    .select2-selection--single
    .select2-selection__rendered,
[data-bs-theme="dark"]
    .js-select2-with-img
    + .select2
    .select2-selection--single
    .select2-selection__rendered {
    background-color: var(--bs-white) !important;
    color: var(--bs-body-color) !important;
    border-color: var(--bs-border-color) !important;
}
[data-bs-theme="dark"] .js-select2 + .select2 .select2-selection--multiple,
[data-bs-theme="dark"]
    .js-select2-with-img
    + .select2
    .select2-selection--multiple {
    background-color: var(--bs-white) !important;
    border-color: var(--bs-border-color) !important;
}
[data-bs-theme="dark"] .select2-dropdown {
    background-color: var(--bg-2);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .select2-dropdown .select2-search__field {
    background-color: var(--bs-white);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .select2-dropdown .select2-results__option {
    color: var(--bs-body-color);
}
[data-bs-theme="dark"]
    .select2-dropdown
    .select2-results__option[aria-selected="true"] {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Dark mode misc input components */
[data-bs-theme="dark"] .input-content {
    background: var(--bs-white);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .alert-custom {
    background: var(--bg-2);
}

/* Hover effect for footer links and others */
.hover-primary:hover {
    color: var(--bs-primary) !important;
}

/* Smooth transitions for interactive elements */
a,
button,
.card {
    transition: all 0.2s ease-in-out;
}

/* FAQ Accordion Plus/Minus Icons */
.accordion-button::after {
    /* only plus icon, not circle plus */
    content: "\f4f5" !important;
    font-family: "uicons-regular-rounded" !important;
    background-image: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--bs-primary);
    transform: none !important;
    transition: all 0.3s ease;
    font-weight: normal !important;
    background-color: var(--bs-primary-light);
    color: var(--bs-primary);
    border-radius: 0.25rem;
    padding: 0.5rem;
}

.accordion-button:not(.collapsed)::after {
    content: "\f62e" !important;
    transform: rotate(180deg);
    background-color: var(--bs-primary);
    color: var(--bs-white);
}

.accordion-button:not(.collapsed) {
    color: var(--bs-primary) !important;
    background-color: var(--bs-white) !important;
    box-shadow: none !important;
}

/* Sidebar Nav Link Active State Fix */
/* Need to Specify the Active State of the Sidebar Nav Link - recheck and reassign with the parent class */
/* .nav-link.active {
  background-color: var(--bs-primary-light) !important;
  color: var(--bs-primary) !important;
  font-weight: bold !important;
} */

/* Login Page Specifics */
.hover-shadow:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-1px);
}

/* Category Accordion */
.category-accordion .accordion-item {
    border: none;
    margin-bottom: 1rem;
    background: #fff;
}

.category-accordion .accordion-button:not(.collapsed) {
    background: var(--bs-primary) !important;
    color: #fff !important;
}

.category-accordion .accordion-button::after {
    display: none !important;
}
.article {
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        margin-bottom: 0.5em;
    }
    img {
        max-width: 100%;
        margin-bottom: 1.5em;
    }
    p {
        margin-bottom: 2em;
    }
    h2 {
        font-size: 1.875rem;
    }
    h3 {
        font-size: 1.25rem;
    }
}

/* --- Utilities --- */

.cursor-pointer {
    cursor: pointer;
}

.hover-bg-light {
    transition: all 0.2s ease-in-out;
    &:hover {
        background-color: var(--bs-light);
    }
}

/* Filter Utilities */
.grayscale {
    filter: grayscale(100%);
}

.grayscale-0 {
    filter: grayscale(0%);
}

/* Feedback Emoji Interaction */
.feedback-option input[type="radio"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.feedback-option {
    --size: 60px;
    background-color: var(--bs-light);
    @media (max-width: 575px) {
        --size: 40px;
    }
}

.feedback-emoji {
    transition: all 0.2s ease-in-out;
}

/* State: Hover or Checked */
.feedback-option:hover .feedback-emoji,
.feedback-option input:checked + label .feedback-emoji {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.2);
}

/* Label Visibility */
.feedback-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    opacity: 0;
    transition:
        opacity 0.2s,
        transform 0.2s;
    white-space: nowrap;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bs-primary);
    @media (max-width: 575px) {
        font-size: 0.75rem;
    }
}

.feedback-option input:checked + label .feedback-label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Optional: Active Background Circle on Checked */
.feedback-option input:checked + label::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 45px;
    height: 45px;
    background-color: var(--bs-primary-light);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    opacity: 0.5;
}

/* Deals Pipeline Kanban Board */
.bg-kanban-proposal {
    background-color: #f3e8ff !important;
}
.doc-uploader
    .doc-file-list.style-2
    .doc-file-item
    .file-remove
    .fi-rr-trash:before {
    content: "\fad3" !important;
}

.attendance-history-timeline {
    position: relative;
    padding-left: 10px;
    margin-top: 10px;

    &::before {
        content: "";
        position: absolute;
        top: 8px;
        bottom: 8px;
        inset-inline-start: 14.5px;
        width: 1px;
        background-color: var(--border-medium);
        z-index: 0;
    }

    .timeline-item {
        position: relative;
        padding-bottom: 20px;
        padding-left: 25px;

        &:last-child {
            padding-bottom: 0;
        }
    }

    .timeline-dot {
        position: absolute;
        inset-inline-start: 0;
        top: 4px;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background-color: #e2e4e9;
        z-index: 1;

        &.active {
            background-color: #00a78e;
        }
    }

    .timeline-content {
        font-size: 14px;
        color: var(--bs-dark);
        font-weight: 500;

        .time {
            color: var(--text-semi-dark-80);
            font-weight: 400;
            margin-left: 8px;
            position: relative;
            padding-left: 12px;
            &::before {
                content: "•";
                position: absolute;
                left: 0;
            }
        }
    }
}

/* Sidebar transition effects
 *
 * 1. Icon bar pill — smooth background/color on active state change.
 *    No JS toggle; pure CSS so there is no double-flash from Livewire morph.
 * 2. Sub-menu links — fade background + color on hover and active.
 * 3. Sub-menu pane — driven by Alpine x-transition on the x-show divs in
 *    _sidebar.blade.php so the animation only fires when a pane actually
 *    appears, not on every Livewire morph.
 * 4. Collapse chevron — rotate smoothly on expand/collapse.
 */

/* 1. Icon bar pill */
.aside-menu__main .aside-menu__list > li > a {
    transition:
        background-color 0.25s ease,
        color 0.25s ease !important;
}

/* 2. Sub-menu links — both the direct links and the nested panel links */
.aside-menu .aside-menu__sub ul li a,
.aside-menu__sub .aside-menu__sub-wrapper a {
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

/* 3. Sub-menu pane — Alpine x-transition classes */
.sidebar-pane-enter {
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}
.sidebar-pane-enter-start {
    opacity: 0;
    transform: translateX(-10px);
}
.sidebar-pane-enter-end {
    opacity: 1;
    transform: translateX(0);
}

/* 4. Collapse chevron */
.aside-menu__sub .fi-rr-angle-small-up {
    transition: transform 0.2s ease;
}
.aside-menu__sub .collapsed .fi-rr-angle-small-up {
    transform: rotate(180deg);
}

/* Tab transition effects
 * Header: smooth background/shadow slide on the active pill.
 * Body: fade + lift animation fires whenever Livewire swaps in new content.
 */
.tab-list .nav-link {
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

@keyframes tab-body-enter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

.tab-content > * {
    animation: tab-body-enter 0.22s ease;
}

/* Tab spacing fix
 * Swiper JS sets display:flex and transform inline on .swiper-wrapper.
 * Livewire's DOM morph strips those inline styles on every tab click,
 * collapsing the tab row. Setting these in CSS makes the layout
 * independent of Swiper's JS-injected styles so it survives morphing.
 * spaceBetween:6 is replicated via gap so the margin Swiper inlines
 * on each slide is also not needed.
 *
 * font-weight: 600 on all nav-links prevents the active-state weight
 * change from shifting sibling tab widths.
 */
.tabs-slider .swiper-wrapper {
    display: flex !important;
    gap: 6px;
}

.tab-list .nav-link {
    font-weight: 600;
}

/* Sidebar / Main-Content Gap Fix
 * The sidebar body has max-inline-size: 280px (17.5rem).
 * The default .main-content padding-inline-start is 18rem (288px),
 * leaving an 8px gap. Override to align content flush with the sidebar.
 * For the folded state, the icon bar is given a min-width of 3.5rem
 * so it fills the same 3.5rem gap the body already uses.
 */
@media (min-width: 992px) {
    .footer,
    .main-content {
        padding-inline-start: 17.5rem; /* 280px — matches aside-menu__body max-inline-size */
    }

    .aside-folded .footer,
    .aside-folded .main-content,
    body:has(.aside-menu.aside-folded) .footer,
    body:has(.aside-menu.aside-folded) .main-content {
        padding-inline-start: 3.5rem; /* matches icon bar min-inline-size below */
    }
}

.aside-menu .aside-menu__main {
    min-inline-size: 3.5rem; /* keeps icon bar flush with folded content edge */
}

/* Sidebar toggle button: flip arrow direction when sidebar is collapsed */
.aside-toggle-desktop i {
    display: inline-block;
    transition: transform 0.2s ease;
}

body.aside-folded .aside-toggle-desktop i {
    transform: scaleX(-1);
}

/* ── Collapsed Sidebar Fly-out Popup ──────────────────────────────────────────
 * Only rendered when body.aside-folded (user manually collapsed the sidebar).
 * Each icon-bar li that has a submenu gets one of these; it fly-out appears to
 * the right on hover and mirrors the Column 2 pane content.
 * ──────────────────────────────────────────────────────────────────────────── */

/* ── Hoverable sub-menu flyout (icons like Announcements, Reports) ── */
.aside-menu__main .aside-menu__list > li .aside-sub-menu {
    inline-size: 220px;
    background: var(--bg-2);
    border-radius: 10px;
    border: 1px solid var(--bs-border-color);
    box-shadow:
        0 4px 8px -2px rgba(0, 0, 0, 0.08),
        0 12px 32px -4px rgba(0, 0, 0, 0.13);
    padding-block: 0;
    overflow: hidden;
}

.aside-menu__main .aside-menu__list > li .aside-sub-menu::after {
    border-inline-end-color: var(--bg-2);
    filter: drop-shadow(-1px 0 0 rgba(0, 0, 0, 0.08));
}

.aside-menu__main
    .aside-menu__list
    > li
    .aside-sub-menu
    .aside-sub-menu__title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 9px;
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.06);
    border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.1);
    line-height: 1;
}

.aside-menu__main .aside-menu__list > li .aside-sub-menu ul {
    padding-block: 4px;
}

.aside-menu__main .aside-menu__list > li .aside-sub-menu ul li a {
    padding: 9px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--bs-body-color);
    transition:
        background 0.12s ease,
        color 0.12s ease;
    line-height: 1.3;
}

.aside-menu__main .aside-menu__list > li .aside-sub-menu ul li a:hover {
    background: rgba(var(--bs-primary-rgb), 0.07);
    color: var(--bs-primary);
}

.aside-menu__main .aside-menu__list > li .aside-sub-menu ul li.active a {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    font-weight: 600;
}

/* ── Dashboard Enhancements ───────────────────────────────────────────────── */

/* Hover lift effect for stat cards and interactive elements */
.hover-lift {
	transition: box-shadow 0.22s ease, transform 0.22s ease;
}
.hover-lift:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
	transform: translateY(-2px);
}

/* ── Modern Stat Cards ──────────────────────────────────────────────────── */
.stat-card {
	padding: 20px 22px;
	border-radius: 14px;
	height: 100%;
	border: 1px solid transparent;
	position: relative;
	overflow: hidden;
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.stat-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.stat-card__icon {
	width: 46px;
	height: 46px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.stat-card__icon i {
	font-size: 20px;
	display: inline-flex;
}
.stat-card__value {
	font-size: 28px;
	font-weight: 700;
	line-height: 1.15;
	color: var(--text-dark);
	letter-spacing: -0.02em;
}
.stat-card__label {
	font-size: 13px;
	color: var(--text-semi-dark);
	margin-top: 3px;
	line-height: 1.3;
}

/* Chart card header with icon badge */
.chart-card-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--bs-border-color);
}
.chart-card-header__icon {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	flex-shrink: 0;
}

/* ── Sidebar Hover-Expand ──────────────────────────────────────────────────
 * When collapsed (body.aside-folded) the sidebar shows only the icon bar.
 * Hovering over the aside adds .sidebar-hover-expanded via Alpine, which
 * reveals the full sub-wrapper pane as a floating overlay on top of the
 * main content — the content does NOT shift.
 * ────────────────────────────────────────────────────────────────────────── */

/* Override the style.css rule that hides the sub-wrapper when collapsed.
 * The !important is required because Alpine's x-show also sets inline
 * display:none, and we need to force-show during hover-expand. */
@media (min-width: 992px) {
    body.aside-folded
        .aside-menu.sidebar-hover-expanded
        .aside-menu__sub-wrapper {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
    }
}

/* Overlay shadow so the sidebar visually floats above the content */
.aside-menu.sidebar-hover-expanded {
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.1);
}

/* Reset the folded title style (white text) back to normal during hover-expand.
 * style.css sets .aside-folded .aside-sub-menu__title { color: var(--absolute-white) }
 * which is invisible on the light-purple pane background. */
@media (min-width: 992px) {
    body.aside-folded
        .aside-menu.sidebar-hover-expanded
        .aside-sub-menu__title {
        color: var(--bs-primary);
        font-size: inherit;
    }
    body.aside-folded
        .aside-menu.sidebar-hover-expanded
        .aside-sub-menu__title::after {
        display: none;
    }
}

/* Slide-in animation for the sub-wrapper pane */
body.aside-folded .aside-menu.sidebar-hover-expanded .aside-menu__sub-wrapper {
    animation: sidebarHoverSlideIn 0.22s ease-out;
}

@keyframes sidebarHoverSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Conversation Search Results */
#searchResultsContainer .chat-message .chat-bubble {
    background-color: #fff !important;
    border: 1px solid var(--bs-border-color);
}

#searchResultsContainer .chat-message--outgoing .chat-bubble {
    background-color: var(--bs-primary-light) !important;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--bs-border-color);
    border-radius: 10px;
}

.text-truncate-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================
   Module Switcher
   ======================== */
.module-switcher__trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--bs-primary);
    color: var(--bs-white);
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease;
}
.module-switcher__trigger:hover {
    background: var(--bs-primary-dark);
    box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb), 0.25);
}
.module-switcher__icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    font-size: 0.75rem;
}
.module-switcher__label {
    white-space: nowrap;
}
.module-switcher__chevron {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-inline-start: -0.125rem;
}
.module-switcher__menu {
    min-width: 240px;
    margin-top: 0.5rem !important;
}
.module-switcher__header {
    padding: 0.75rem 1rem 0.5rem;
    color: var(--text-semi-dark-80, #9ca3af);
    border-bottom: 1px solid var(--bs-border-color);
    letter-spacing: 0.05em;
}
.module-switcher__list {
    padding: 0.375rem;
}
.module-switcher__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.12s ease;
    text-align: start;
}
.module-switcher__item:hover {
    background: var(--bs-gray-100, #f3f4f6);
}
.module-switcher__item--active {
    background: var(--bs-primary-light) !important;
}
.module-switcher__item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.module-switcher__item-icon--primary {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}
.module-switcher__item-icon--success {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}
.module-switcher__item-icon--danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}
.module-switcher__item-icon--secondary {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}
.module-switcher__item-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--bs-dark);
}

/* Profile dropdown fixes */
.profile-dropdown {
    z-index: 1032; /* above aside-menu z-index 1031 */
    overflow: visible;
}
.profile-dropdown .dropdown-menu {
    z-index: 1033;
}

/* Sticky form action bar
 * Used on settings pages and full-page forms to pin
 * Reset/Save buttons to the bottom of the viewport.
 */
.sticky-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: var(--bs-white);
    border-top: 1px solid var(--bs-border-color);
    padding: 0.875rem 1.5rem;
    margin-top: 1.5rem;
    margin-inline: -1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
}
.sticky-form-actions .btn {
    min-width: 120px;
}
[data-bs-theme="dark"] .sticky-form-actions {
    background: var(--bs-body-bg);
}

/* Ensure footer clears sticky form actions */
.main-content:has(.sticky-form-actions) + .footer {
    padding-top: 0;
}

/* Inline form actions (non-sticky) — for short forms that fit on screen.
 * Place INSIDE the card at the bottom. No sticky positioning, no shadow.
 */
.inline-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--bs-border-color);
}
.inline-form-actions .btn {
    min-width: 120px;
}

/* intl-tel-input phone field fixes
 * The .iti__tel-input already has .form-control from the Blade component.
 * We only fix width, background, and the flag/dial-code area — the rest
 * is inherited from Bootstrap's .form-control so it always matches
 * sibling inputs on the page (height, font-size, border, radius).
 */
.iti {
    width: 100% !important;
}
/* Background fix — use high-specificity selector to override the library */
.iti--show-selected-dial-code input.iti__tel-input,
.iti--show-selected-dial-code input.iti__tel-input[type="tel"] {
    background-color: var(--bs-body-bg) !important;
}
/* Add right padding to the country button. The library's JS reads
   selectedCountry.offsetWidth to calculate the input's padding-left,
   so extra padding here = more breathing room for the placeholder text. */
.iti__selected-country {
    padding-right: 0.75rem !important;
    background: transparent !important;
}
.iti__country-container {
    border-right: 1px solid var(--bs-border-color);
}
.iti--show-selected-dial-code .iti__selected-dial-code {
    font-size: inherit;
}
/* Country dropdown — appended to <body> via dropdownContainer option */
.iti--container .iti__dropdown-content {
    z-index: 1060;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-height: 220px;
}
.iti--container .iti__search-input {
    border-bottom: 1px solid var(--bs-border-color) !important;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}
.iti--container .iti__country-list {
    max-height: 170px;
}

/* ========================
   Header Settings Dropdown (hsd-*)
   ======================== */

/* Trigger link */
.hsd-trigger {
    color: var(--bs-dark);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    gap: 0.375rem;
    transition: color 0.15s ease;
}
.hsd-trigger:hover,
.header-settings:hover .hsd-trigger {
    color: var(--bs-primary);
}
.hsd-trigger__icon {
    font-size: 1rem;
    color: var(--text-semi-dark-80, #6b7280);
    transition: color 0.15s ease;
}
.hsd-trigger:hover .hsd-trigger__icon,
.header-settings:hover .hsd-trigger__icon {
    color: var(--bs-primary);
}
.hsd-trigger__chevron {
    font-size: 0.75rem;
    opacity: 0.6;
    transition:
        transform 0.2s ease,
        opacity 0.15s ease;
}
.header-settings:hover .hsd-trigger__chevron {
    transform: rotate(-180deg);
    opacity: 1;
    color: var(--bs-primary);
}

/* Dropdown panel */
@media (min-width: 992px) {
    .header-settings-dropdown {
        position: absolute;
        top: calc(100% + 0.75rem);
        left: 50%;
        transform: translateX(-50%) translateY(-6px);
        min-width: 260px;
        background: var(--bs-white);
        border: 1px solid var(--bs-border-color);
        border-radius: 0.75rem;
        box-shadow:
            0 20px 40px -8px rgba(0, 0, 0, 0.14),
            0 4px 12px -2px rgba(0, 0, 0, 0.08);
        padding: 0.5rem;
        opacity: 0;
        visibility: hidden;
        transition:
            opacity 0.2s ease,
            transform 0.2s ease,
            visibility 0.2s ease;
        z-index: 1040;
    }
    .header-settings:hover .header-settings-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

/* Arrow notch */
.hsd-arrow {
    display: none;
}
@media (min-width: 992px) {
    .hsd-arrow {
        display: block;
        position: absolute;
        top: -5px;
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
        width: 10px;
        height: 10px;
        background: var(--bs-white);
        border-top: 1px solid var(--bs-border-color);
        border-left: 1px solid var(--bs-border-color);
        border-radius: 2px 0 0 0;
    }
}

/* Section header */
.hsd-section-header {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-semi-dark-80, #9ca3af);
    padding: 0.625rem 0.75rem 0.25rem;
}
.hsd-section-header:not(:first-child) {
    margin-top: 0.25rem;
    border-top: 1px solid var(--bs-border-color);
    padding-top: 0.75rem;
}

/* Dropdown item */
.hsd-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--bs-dark);
    transition:
        background 0.12s ease,
        color 0.12s ease;
    cursor: pointer;
}
.hsd-item:hover {
    background: var(--bs-gray-100, #f3f4f6);
    color: var(--bs-primary);
}
.hsd-item--active {
    background: rgba(var(--bs-primary-rgb), 0.07);
}
.hsd-item--active .hsd-item__label {
    color: var(--bs-primary);
    font-weight: 600;
}

/* Item icon */
.hsd-item__icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    border-radius: 0.5rem;
    background: rgba(var(--bs-primary-rgb), 0.08);
    color: var(--bs-primary);
    font-size: 0.875rem;
    flex-shrink: 0;
    transition: background 0.12s ease;
}
.hsd-item:hover .hsd-item__icon-wrap {
    background: rgba(var(--bs-primary-rgb), 0.14);
}
.hsd-item--active .hsd-item__icon-wrap {
    background: rgba(var(--bs-primary-rgb), 0.14);
}

/* Item body */
.hsd-item__body {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
    min-width: 0;
}
.hsd-item__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bs-dark);
    white-space: nowrap;
    transition: color 0.12s ease;
}
.hsd-item:hover .hsd-item__label {
    color: var(--bs-primary);
}
.hsd-item__desc {
    font-size: 0.6875rem;
    color: var(--text-semi-dark-80, #9ca3af);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hsd-item__check {
    font-size: 0.75rem;
    color: var(--bs-primary);
    flex-shrink: 0;
}

/* Mobile: settings panel rendered as a full-width expandable */
@media (max-width: 991px) {
    .header-settings-dropdown {
        margin-top: 0.5rem;
        padding: 0.375rem 0.375rem 0.375rem 1rem;
        background: var(--bg-1, #f8f9fa);
        border-radius: 0.5rem;
        display: none;
    }
    .header-settings.open .header-settings-dropdown {
        display: block;
    }
    .hsd-item {
        padding: 0.375rem 0.5rem;
    }
    .hsd-item__icon-wrap {
        width: 1.75rem;
        height: 1.75rem;
        min-width: 1.75rem;
    }
}

/* ========================
   Stat Filter Dropdown
   ======================== */

/* Trigger button */
.stat-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem 0.5rem 0.625rem;
    background: var(--bs-white);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.625rem;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
    white-space: nowrap;
}
.stat-filter-trigger:hover,
.stat-filter-dropdown.show .stat-filter-trigger {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.08);
}

.stat-filter-trigger__icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    border-radius: 0.5rem;
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    font-size: 1rem;
    flex-shrink: 0;
}
.stat-filter-trigger__text {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
    text-align: start;
}
.stat-filter-trigger__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-dark);
    line-height: 1.2;
}
.stat-filter-trigger__sub {
    font-size: 0.6875rem;
    color: var(--text-semi-dark-80, #9ca3af);
    line-height: 1.2;
}
.stat-filter-trigger__chevron {
    font-size: 0.75rem;
    color: var(--text-semi-dark-80, #9ca3af);
    margin-left: 0.125rem;
    transition: transform 0.2s ease;
}
.stat-filter-dropdown.show .stat-filter-trigger__chevron {
    transform: rotate(-180deg);
}

/* Dropdown panel */
.stat-filter-menu {
    min-width: 260px;
    margin-top: 0.375rem !important;
    background: var(--bs-white);
    border: 1px solid var(--bs-border-color) !important;
    border-radius: 0.75rem !important;
    box-shadow:
        0 20px 40px -8px rgba(0, 0, 0, 0.14),
        0 4px 12px -2px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden;
}
.stat-filter-menu__header {
    padding: 0.625rem 1rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-semi-dark-80, #9ca3af);
    border-bottom: 1px solid var(--bs-border-color);
}
.stat-filter-menu__list {
    padding: 0.375rem;
}

/* Dropdown item */
.stat-filter-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    text-align: start;
    transition: background 0.12s ease;
}
.stat-filter-item:hover {
    background: var(--bs-gray-100, #f3f4f6);
}
.stat-filter-item--active {
    background: rgba(var(--bs-primary-rgb), 0.07);
}

/* Item icon */
.stat-filter-item__icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.stat-filter-item__icon-wrap--primary {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}
.stat-filter-item__icon-wrap--success {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}
.stat-filter-item__icon-wrap--warning {
    background: rgba(255, 193, 7, 0.15);
    color: #d39e00;
}

/* Item body */
.stat-filter-item__body {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
    flex: 1;
    min-width: 0;
}
.stat-filter-item__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bs-dark);
    white-space: nowrap;
}
.stat-filter-item--active .stat-filter-item__label {
    color: var(--bs-primary);
    font-weight: 600;
}
.stat-filter-item__desc {
    font-size: 0.6875rem;
    color: var(--text-semi-dark-80, #9ca3af);
}
.stat-filter-item__check {
    font-size: 0.75rem;
    color: var(--bs-primary);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.12s ease;
}
.stat-filter-item--active .stat-filter-item__check {
    opacity: 1;
}

/* Bookmark toggle button */
.bookmark-toggle {
    transition: transform 0.15s ease;
}
.bookmark-toggle:hover {
    transform: scale(1.15);
}
.bookmark-toggle:active {
    transform: scale(0.95);
}

/* ========================
   Search Modal (Cmd+K)
   ======================== */
.search-modal {
    background: var(--bs-white);
}

/* Input bar */
.search-modal__input-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
}

.search-modal__icon {
    font-size: 1.125rem;
    color: var(--bs-primary);
    position: relative;
    top: 1px;
}

.search-modal__input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--bs-dark);
    font-weight: 500;
}
.search-modal__input::placeholder {
    color: var(--text-semi-dark-80, #9ca3af);
    font-weight: 400;
}

/* Keyboard badges */
.search-modal__kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.125rem 0.5rem;
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-semi-dark-80, #6b7280);
    background: var(--bs-gray-100, #f3f4f6);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.15s ease;
    line-height: 1.6;
}
.search-modal__kbd:hover {
    background: var(--bs-gray-200, #e5e7eb);
}

.search-modal__kbd-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.25rem;
    font-family: inherit;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-semi-dark-80, #6b7280);
    background: var(--bs-gray-100, #f3f4f6);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
    line-height: 1;
}

/* Results body */
.search-modal__body {
    padding: 0.75rem;
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    position: relative;
}

.search-modal__loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    z-index: 5;
    border-radius: inherit;
}

/* Section headers */
.search-modal__section {
    margin-bottom: 0.25rem;
}

.search-modal__section-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-semi-dark-80, #9ca3af);
}

/* Result items */
.search-modal__result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: start;
}
.search-modal__result-item:hover,
.search-modal__result-item:focus-visible,
.search-modal__result-item--active {
    background: var(--bs-primary-light, #f5f3ff);
}
.search-modal__result-item:hover .search-modal__result-arrow,
.search-modal__result-item--active .search-modal__result-arrow {
    opacity: 1;
}
.search-modal__result-item {
    text-decoration: none;
    color: inherit;
}
.search-modal__result-item:hover {
    color: inherit;
}

.search-modal__result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: var(--bs-primary-light, #f5f3ff);
    color: var(--bs-primary);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.search-modal__result-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    flex: 1;
}

.search-modal__result-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-modal__result-path {
    font-size: 0.6875rem;
    color: var(--text-semi-dark-80, #9ca3af);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-modal__result-arrow {
    color: var(--text-semi-dark-80, #9ca3af);
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

/* Empty state */
.search-modal__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 1rem;
}

/* Footer hints */
.search-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.5rem 1.25rem;
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-gray-50, #f9fafb);
}

/* Remove default Bootstrap modal slide animation for search */
#staticBackdropSearchModal .modal-content {
    animation: searchModalIn 0.15s ease-out;
}
@keyframes searchModalIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── View Button Loading Spinner ──────────────────────────────────────────────
 * Applied via JS when any square-btn containing an eye icon is clicked.
 * Works for both wire:navigate links and wire:click buttons — no blade changes.
 * ──────────────────────────────────────────────────────────────────────────── */
@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

.square-btn.btn-view-loading {
    pointer-events: none; /* prevent double-click */
    position: relative;
    opacity: 0.75;
}

/* Hide the icon while loading */
.square-btn.btn-view-loading > i,
.square-btn.btn-view-loading > .fi {
    visibility: hidden;
}

/* Centered spinner overlay */
.square-btn.btn-view-loading::after {
    content: "";
    position: absolute;
    inset: 50%;
    translate: -50% -50%;
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    opacity: 0.7;
    animation: btn-spin 0.55s linear infinite;
}

/* ════════════════════════════════════════════════════════════════════════════
   DARK MODE
   Full system-wide overrides for [data-bs-theme="dark"].
   Bootstrap 5.3 handles its own components automatically via the CSS variable
   cascade (--bs-white → #0c1015, --bs-body-bg → #02070e, etc.).
   This block patches: missing variables, hardcoded colours, and third-party
   plugins that predate Bootstrap dark mode.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Missing CSS custom property overrides ───────────────────────────────── */
[data-bs-theme="dark"] {
    /* Muted text colours (used via var() throughout custom CSS) */
    --text-semi-dark: #adb5bd;
    --text-semi-dark-80: #8d99a6;

    /* Bootstrap grey-scale shades (used as fallback values in custom CSS) */
    --bs-gray-50: #161b22;
    --bs-gray-100: #21262d;
    --bs-gray-200: #2d3138;

    /* Primary tints — light mode uses color-mix(…white) which produces
	   near-white pastels; dark mode replaces with semi-transparent primary */
    --bs-primary-light: rgba(var(--bs-primary-rgb), 0.12);
    --bs-primary-medium: rgba(var(--bs-primary-rgb), 0.25);

    /* Semantic colour tints (success / info / warning / danger) */
    --bs-success-light: rgba(7, 170, 115, 0.12);
    --bs-success-medium: rgba(7, 170, 115, 0.25);
    --bs-info-light: rgba(34, 106, 184, 0.12);
    --bs-info-medium: rgba(34, 106, 184, 0.25);
    --bs-warning-light: rgba(233, 157, 58, 0.12);
    --bs-warning-medium: rgba(233, 157, 58, 0.3);
    --bs-danger-light: rgba(209, 74, 74, 0.12);
    --bs-danger-medium: rgba(209, 74, 74, 0.25);
}

/* ── Theme toggle: icon & label swap (pure CSS, zero JS) ─────────────────── */
/* Light mode: sun hidden, "Light Mode" label hidden */
.theme-icon--sun {
    display: none;
}
.theme-label--light {
    display: none;
}
.theme-ball-icon--sun {
    display: none;
}

/* Dark mode: moon hidden, "Dark Mode" label hidden */
[data-bs-theme="dark"] .theme-icon--moon {
    display: none;
}
[data-bs-theme="dark"] .theme-icon--sun {
    display: inline;
}
[data-bs-theme="dark"] .theme-label--dark {
    display: none;
}
[data-bs-theme="dark"] .theme-label--light {
    display: inline;
}
[data-bs-theme="dark"] .theme-ball-icon--moon {
    display: none;
}
[data-bs-theme="dark"] .theme-ball-icon--sun {
    display: inline;
}

/* ── Smooth transitions (enabled after first paint to avoid load flash) ───── */
body.theme-ready,
body.theme-ready .card,
body.theme-ready header,
body.theme-ready aside,
body.theme-ready .modal-content,
body.theme-ready .dropdown-menu {
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease !important;
}
body.theme-ready .offcanvas {
    transition:
        transform 0.3s ease-in-out,
        background-color 0.25s ease,
        border-color 0.25s ease !important;
}

/* ── Hardcoded-colour fixes ───────────────────────────────────────────────── */

/* Category accordion (background: #fff on line ~69) */
[data-bs-theme="dark"] .category-accordion .accordion-item {
    background: var(--bs-white);
}

/* Search modal results loader overlay (rgba(255,255,255,0.8)) */
[data-bs-theme="dark"] .search-modal__loader {
    background: rgba(var(--bs-white-rgb), 0.9);
}

/* Chat / conversation search bubbles (background-color: #fff) */
[data-bs-theme="dark"] #searchResultsContainer .chat-message .chat-bubble {
    background-color: var(--bs-white) !important;
}

/* ── Third-party plugin: DateRangePicker ──────────────────────────────────── */
[data-bs-theme="dark"] .daterangepicker {
    background-color: var(--bg-2);
    border-color: var(--bs-border-color);
    color: var(--bs-dark);
}
[data-bs-theme="dark"] .daterangepicker::before {
    border-bottom-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .daterangepicker::after {
    border-bottom-color: var(--bg-2);
}
[data-bs-theme="dark"] .daterangepicker .calendar-table {
    background-color: var(--bg-2);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .daterangepicker .calendar-table td,
[data-bs-theme="dark"] .daterangepicker .calendar-table th {
    color: var(--bs-dark);
}
[data-bs-theme="dark"] .daterangepicker td.available:hover,
[data-bs-theme="dark"] .daterangepicker th.available:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.15);
    color: var(--bs-dark);
}
[data-bs-theme="dark"] .daterangepicker td.active,
[data-bs-theme="dark"] .daterangepicker td.active:hover {
    background-color: var(--bs-primary);
    color: #fff;
}
[data-bs-theme="dark"] .daterangepicker td.off,
[data-bs-theme="dark"] .daterangepicker td.off.in-range,
[data-bs-theme="dark"] .daterangepicker td.off.start-date,
[data-bs-theme="dark"] .daterangepicker td.off.end-date {
    color: var(--text-semi-dark-80);
    background-color: transparent;
}
[data-bs-theme="dark"] .daterangepicker td.in-range {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-dark);
}
[data-bs-theme="dark"] .daterangepicker .drp-buttons {
    border-top-color: var(--bs-border-color);
    background-color: var(--bg-2);
}
[data-bs-theme="dark"] .daterangepicker select.monthselect,
[data-bs-theme="dark"] .daterangepicker select.yearselect {
    background-color: var(--bg-1);
    color: var(--bs-dark);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .daterangepicker .ranges li.active {
    background-color: var(--bs-primary);
    color: #fff;
}
[data-bs-theme="dark"] .daterangepicker .ranges li:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-dark);
}
[data-bs-theme="dark"] .daterangepicker .ranges ul {
    background-color: var(--bg-2);
    border-right-color: var(--bs-border-color);
}

/* ── Third-party plugin: Summernote ──────────────────────────────────────── */
[data-bs-theme="dark"] .note-editor.note-frame,
[data-bs-theme="dark"] .note-editor.note-airframe {
    border-color: var(--bs-border-color) !important;
}
[data-bs-theme="dark"] .note-editor .note-toolbar {
    background-color: var(--bg-2) !important;
    border-bottom-color: var(--bs-border-color) !important;
}
[data-bs-theme="dark"] .note-editor .note-editing-area .note-editable {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-dark) !important;
}
[data-bs-theme="dark"] .note-editor .note-statusbar {
    background-color: var(--bg-2) !important;
    border-top-color: var(--bs-border-color) !important;
    color: var(--text-semi-dark-80) !important;
}
[data-bs-theme="dark"] .note-popover .note-toolbar {
    background-color: var(--bg-2) !important;
    border-color: var(--bs-border-color) !important;
}
[data-bs-theme="dark"] .note-btn {
    background-color: transparent !important;
    border-color: transparent !important;
    color: var(--bs-dark) !important;
}
[data-bs-theme="dark"] .note-btn:hover,
[data-bs-theme="dark"] .note-btn.active,
[data-bs-theme="dark"] .note-btn-group.open .note-btn {
    background-color: rgba(var(--bs-primary-rgb), 0.12) !important;
    border-color: transparent !important;
    color: var(--bs-dark) !important;
}
[data-bs-theme="dark"] .note-toolbar .dropdown-menu {
    background-color: var(--bg-2) !important;
    border-color: var(--bs-border-color) !important;
}
[data-bs-theme="dark"] .note-toolbar .dropdown-item {
    color: var(--bs-dark) !important;
}
[data-bs-theme="dark"] .note-toolbar .dropdown-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
    color: var(--bs-dark) !important;
}

/* ── Third-party plugin: Select2 ─────────────────────────────────────────── */
[data-bs-theme="dark"] .select2-container--default .select2-selection--single,
[data-bs-theme="dark"]
    .select2-container--default
    .select2-selection--multiple {
    background-color: var(--bs-body-bg) !important;
    border-color: var(--bs-border-color) !important;
}
[data-bs-theme="dark"]
    .select2-container--default
    .select2-selection--single
    .select2-selection__rendered {
    color: var(--bs-dark) !important;
}
[data-bs-theme="dark"]
    .select2-container--default
    .select2-selection--single
    .select2-selection__placeholder {
    color: var(--text-semi-dark-80) !important;
}
[data-bs-theme="dark"]
    .select2-container--default.select2-container--focus
    .select2-selection--multiple {
    border-color: var(--bs-primary) !important;
}
[data-bs-theme="dark"] .select2-dropdown {
    background-color: var(--bg-2) !important;
    border-color: var(--bs-border-color) !important;
    color: var(--bs-dark) !important;
}
[data-bs-theme="dark"] .select2-container--default .select2-results__option {
    color: var(--bs-dark) !important;
    background-color: transparent !important;
}
[data-bs-theme="dark"]
    .select2-container--default
    .select2-results__option--highlighted[aria-selected] {
    background-color: rgba(var(--bs-primary-rgb), 0.15) !important;
    color: var(--bs-dark) !important;
}
[data-bs-theme="dark"]
    .select2-container--default
    .select2-results__option[aria-selected="true"] {
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
}
[data-bs-theme="dark"] .select2-search--dropdown .select2-search__field {
    background-color: var(--bs-body-bg) !important;
    border-color: var(--bs-border-color) !important;
    color: var(--bs-dark) !important;
}
[data-bs-theme="dark"]
    .select2-container--default
    .select2-selection--multiple
    .select2-selection__choice {
    background-color: rgba(var(--bs-primary-rgb), 0.15) !important;
    border-color: transparent !important;
    color: var(--bs-dark) !important;
}
[data-bs-theme="dark"]
    .select2-container--default
    .select2-selection--multiple
    .select2-selection__choice__remove {
    color: var(--text-semi-dark-80) !important;
    border-right-color: rgba(var(--bs-primary-rgb), 0.2) !important;
}
[data-bs-theme="dark"]
    .select2-container--default
    .select2-selection--multiple
    .select2-selection__choice__remove:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.2) !important;
    color: var(--bs-dark) !important;
}

/* ── Third-party plugin: intl-tel-input ──────────────────────────────────── */
[data-bs-theme="dark"] .iti--container .iti__dropdown-content {
    background-color: var(--bg-2) !important;
    border-color: var(--bs-border-color) !important;
}
[data-bs-theme="dark"] .iti__country:hover,
[data-bs-theme="dark"] .iti__country.iti__highlight {
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
    color: var(--bs-dark);
}
[data-bs-theme="dark"] .iti--container .iti__search-input {
    background-color: var(--bg-1) !important;
    color: var(--bs-dark) !important;
    border-bottom-color: var(--bs-border-color) !important;
}
[data-bs-theme="dark"] .iti__dial-code {
    color: var(--text-semi-dark-80);
}
[data-bs-theme="dark"] .iti__divider {
    border-bottom-color: var(--bs-border-color) !important;
}
[data-bs-theme="dark"] .iti__selected-country-primary:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.08);
}

/* ── Profile page & offcanvas footer dark mode ───────────────────────────── */
[data-bs-theme="dark"] .offcanvas-footer {
    background-color: var(--bs-body-bg) !important;
    border-top: 1px solid var(--bs-border-color);
}
[data-bs-theme="dark"] .profile-dropdown {
    background-color: var(--bg-2) !important;
}
[data-bs-theme="dark"] .modal-content {
    background-color: var(--bg-2);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    border-color: var(--bs-border-color);
}

/* Fix Flaticon Uicons icons in buttons — .fi uses display:flex !important (block-level)
   which stacks icon above text. Two-class selector (0,2,0) beats one-class (0,1,0)
   even with both using !important, so this properly overrides the Uicons stylesheet. */
.btn .fi,
.btn-sm .fi {
    display: inline-flex !important;
}

/* ─── Client Select Component ─── */
.client-select-wrapper {
    width: 100%;
}

.client-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--bs-body-color);
    background-color: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    text-align: left;
    outline: none;
}

.client-select-trigger:hover {
    border-color: #a0aec0;
}

.client-select-trigger:focus,
.client-select-trigger--open {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.12);
}

.client-select-trigger--disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--bs-secondary-bg);
}

.client-select-value {
    color: var(--bs-body-color);
    font-weight: 500;
}

.client-select-placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.client-select-chevron {
    flex-shrink: 0;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.client-select-chevron--open {
    transform: rotate(180deg);
}

.client-select-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 50;
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.client-select-options {
    list-style: none;
    margin: 0;
    padding: 4px;
}

.client-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--bs-body-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.client-select-option:hover {
    background-color: #f3f4f6;
}

.client-select-option--active {
    background-color: rgba(var(--bs-primary-rgb), 0.08);
    color: var(--bs-primary);
    font-weight: 500;
}

.client-select-option--active:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
}

.client-select-check {
    flex-shrink: 0;
    color: var(--bs-primary);
}

/* Transitions */
.client-select-enter {
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}
.client-select-enter-start {
    opacity: 0;
    transform: translateY(-4px);
}
.client-select-enter-end {
    opacity: 1;
    transform: translateY(0);
}
.client-select-leave {
    transition:
        opacity 0.1s ease,
        transform 0.1s ease;
}
.client-select-leave-start {
    opacity: 1;
    transform: translateY(0);
}
.client-select-leave-end {
    opacity: 0;
    transform: translateY(-4px);
}

.grecaptcha-badge {
    width: 70px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    left: -2px !important;
    bottom: 20px !important;
}

.grecaptcha-badge:hover {
    width: 256px !important;
}
