/* =========================================================
   CraftGrid Global Search
   Dashboard command/search experience
   ========================================================= */

.cg-global-search {
    position: relative;
    z-index: 20;
    margin-bottom: 1.5rem;
}

.cg-global-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 0 .65rem 0 1rem;
    background: var(--cg-surface);
    border: 1px solid var(--cg-border);
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(15, 31, 56, .08);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.cg-global-search-bar:focus-within {
    border-color: rgba(37, 99, 235, .55);
    box-shadow: 0 12px 32px rgba(37, 99, 235, .12);
}

.cg-global-search-leading {
    flex: 0 0 auto;
    color: var(--cg-text-muted);
    font-size: 1.1rem;
    margin-right: .75rem;
}

.cg-global-search-input {
    min-width: 0;
    flex: 1 1 auto;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--cg-text);
    font-size: 1rem;
    padding: .8rem 0;
}

.cg-global-search-input::placeholder {
    color: #8a96a8;
}

.cg-global-search-shortcut {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    margin-right: .5rem;
    color: #7a8799;
    font-size: .72rem;
}

.cg-global-search-shortcut kbd,
.cg-global-search-footer kbd {
    min-width: 24px;
    padding: .18rem .4rem;
    border: 1px solid #d9dfe8;
    border-bottom-width: 2px;
    border-radius: 6px;
    background: #f8fafc;
    color: #66758a;
    font-family: inherit;
    font-size: .68rem;
    text-align: center;
}

.cg-global-search-action {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #526174;
    font-size: 1rem;
    transition: background .15s ease, color .15s ease;
}

.cg-global-search-action:hover {
    background: var(--cg-blue-050);
    color: var(--cg-blue-600);
}

.cg-global-search-action.is-listening {
    background: rgba(var(--bs-success-rgb), .10);
    color: var(--bs-success);
}

.cg-global-search-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: min(620px, calc(100vh - 150px));
    overflow: auto;
    background: var(--cg-surface);
    border: 1px solid var(--cg-border);
    border-radius: 16px;
    box-shadow: 0 20px 55px rgba(15, 31, 56, .18);
}

.cg-global-search-status {
    padding: 1rem 1.15rem;
    color: var(--cg-text-muted);
    font-size: .88rem;
}

.cg-global-search-group + .cg-global-search-group {
    border-top: 1px solid #edf0f4;
}

.cg-global-search-group-title {
    padding: .8rem 1.15rem .45rem;
    color: #7b8798;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.cg-global-search-result {
    display: flex;
    align-items: center;
    gap: .8rem;
    width: 100%;
    padding: .75rem 1.15rem;
    border: 0;
    background: transparent;
    color: inherit;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
}

.cg-global-search-result:hover,
.cg-global-search-result.is-active {
    background: var(--cg-blue-050);
}

.cg-global-search-result-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #eef4fb;
    color: var(--cg-blue-700);
    font-size: 1rem;
}

.cg-global-search-result-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.cg-global-search-result-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    font-weight: 650;
    color: var(--cg-text);
}

.cg-global-search-result-title span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cg-global-search-result-code {
    flex: 0 0 auto;
    color: #778397;
    font-size: .72rem;
    font-weight: 600;
}

.cg-global-search-result-subtitle {
    margin-top: .15rem;
    overflow: hidden;
    color: var(--cg-text-muted);
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cg-global-search-result-arrow {
    color: #9aa5b5;
}

.cg-global-search-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding: .65rem 1rem;
    border-top: 1px solid #edf0f4;
    background: #fbfcfe;
    color: #7a8799;
    font-size: .7rem;
}

.cg-global-search-footer span {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.cg-global-search-voice-status {
    margin-top: .5rem;
    padding: .65rem .9rem;
    border: 1px solid rgba(var(--bs-success-rgb), .25);
    border-radius: 10px;
    background: rgba(var(--bs-success-rgb), .06);
    color: var(--bs-success);
    font-size: .82rem;
}

.cg-global-search-voice-status.is-listening {
    border-color: rgba(var(--bs-success-rgb), .25);
    background: rgba(var(--bs-success-rgb), .06);
}

@media (max-width: 767.98px) {
    .cg-global-search-bar {
        min-height: 54px;
        border-radius: 14px;
    }

    .cg-global-search-shortcut {
        display: none;
    }

    .cg-global-search-panel {
        position: fixed;
        top: 132px;
        left: .75rem;
        right: .75rem;
        max-height: calc(100vh - 150px);
    }

    .cg-global-search-footer {
        display: none;
    }
}

/* =========================================================
   Shared CraftGrid voice input
   ========================================================= */

.cg-global-search-voice {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 50%;
    font-size: 1.15rem;
    transition: width .18s ease, height .18s ease, flex-basis .18s ease,
                transform .18s ease, background .18s ease,
                color .18s ease, box-shadow .18s ease;
}

.cg-global-search-voice.is-listening {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    transform: scale(1.02);
    background: rgba(var(--bs-success-rgb), .10);
    color: var(--bs-success);
    box-shadow: 0 0 0 7px rgba(var(--bs-success-rgb), .10),
                0 8px 22px rgba(var(--bs-success-rgb), .18);
    animation: cg-voice-pulse 1.35s ease-in-out infinite;
}

.cg-global-search-input.is-voice-listening {
    font-weight: 600;
}

.cg-voice-input-button {
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    transition: min-width .18s ease, min-height .18s ease,
                transform .18s ease, background .18s ease,
                color .18s ease, box-shadow .18s ease;
}

.cg-voice-input-button .bi-mic {
    font-size: 1.2rem;
    transition: font-size .18s ease, transform .18s ease;
}

.cg-voice-input-button.is-listening {
    min-width: 62px;
    min-height: 62px;
    transform: scale(1.03);
    background: rgba(var(--bs-success-rgb), .10);
    border-color: var(--bs-success);
    color: var(--bs-success);
    box-shadow: 0 0 0 7px rgba(var(--bs-success-rgb), .10),
                0 8px 22px rgba(var(--bs-success-rgb), .18);
    animation: cg-voice-pulse 1.35s ease-in-out infinite;
}

.cg-voice-input-button.is-listening .bi-mic {
    font-size: 1.55rem;
    transform: scale(1.08);
}

#visitNotes.is-voice-listening {
    background-image: linear-gradient(transparent, transparent);
    font-weight: 500;
}

.cg-global-search-voice-status.is-listening,
#visitVoiceNoteStatus.is-listening {
    font-weight: 600;
}

@keyframes cg-voice-pulse {
    0%, 100% {
        box-shadow: 0 0 0 5px rgba(var(--bs-success-rgb), .08),
                    0 8px 22px rgba(var(--bs-success-rgb), .15);
    }
    50% {
        box-shadow: 0 0 0 11px rgba(var(--bs-success-rgb), .04),
                    0 10px 26px rgba(var(--bs-success-rgb), .22);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cg-global-search-voice.is-listening,
    .cg-voice-input-button.is-listening {
        animation: none;
    }
}

/* =========================================================
   CraftGrid Global Search - Header Integration
   Presentation-only: the existing search endpoint, keyboard
   shortcut, voice search and result behavior remain unchanged.
   ========================================================= */

.cg-header-global-search {
    flex: 0 1 390px;
    width: min(390px, 32vw);
    min-width: 250px;
    margin: 0 1rem 0 auto;
    z-index: 1100;
}

.cg-header-global-search .cg-global-search-bar {
    min-height: 44px;
    height: 44px;
    padding-left: .8rem;
    padding-right: .4rem;
    border-radius: 12px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: none;
}

.cg-header-global-search .cg-global-search-bar:focus-within {
    border-color: rgba(255,255,255,.34);
    background: rgba(255,255,255,.14);
    box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}

.cg-header-global-search .cg-global-search-leading {
    margin-right: .55rem;
    color: rgba(255,255,255,.82);
    font-size: 1rem;
}

.cg-header-global-search .cg-global-search-input {
    color: #fff;
    font-size: .88rem;
    padding: .45rem 0;
}

.cg-header-global-search .cg-global-search-input::placeholder {
    color: rgba(255,255,255,.66);
}

.cg-header-global-search .cg-global-search-shortcut {
    margin-right: .25rem;
    color: rgba(255,255,255,.58);
}

.cg-header-global-search .cg-global-search-shortcut kbd {
    min-width: 21px;
    padding: .12rem .32rem;
    border-color: rgba(255,255,255,.20);
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.82);
}

.cg-header-global-search .cg-global-search-action {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    color: rgba(255,255,255,.84);
}

.cg-header-global-search .cg-global-search-action:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.cg-header-global-search .cg-global-search-voice {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
}

.cg-header-global-search .cg-global-search-panel {
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 320px;
    max-height: min(620px, calc(100vh - 95px));
}

.cg-global-search-mobile-trigger {
    display: none;
}

@media (min-width: 992px) and (max-width: 1399.98px) {
    .cg-header-global-search {
        width: 300px;
        min-width: 220px;
    }
}

@media (max-width: 991.98px) {
    .cg-header-global-search {
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        margin: 0 .35rem 0 auto;
    }

    .cg-header-global-search > .cg-global-search-bar {
        display: none;
    }

    .cg-global-search-mobile-trigger {
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 1px solid rgba(255,255,255,.14);
        border-radius: 12px;
        background: rgba(255,255,255,.08);
        color: #fff;
        font-size: 1rem;
    }

    .cg-global-search-mobile-trigger:hover,
    .cg-global-search-mobile-trigger:focus {
        background: rgba(255,255,255,.15);
        border-color: rgba(255,255,255,.24);
        color: #fff;
        outline: none;
    }

    .cg-header-global-search.is-mobile-open > .cg-global-search-mobile-trigger {
        display: none;
    }

    .cg-header-global-search.is-mobile-open > .cg-global-search-bar {
        position: fixed;
        display: flex;
        top: 8px;
        left: 12px;
        right: 12px;
        z-index: 1200;
        min-height: 46px;
        height: 46px;
        background: #fff;
        border-color: var(--cg-border);
        box-shadow: 0 12px 32px rgba(15,31,56,.20);
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-leading {
        color: var(--cg-text-muted);
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-input {
        color: var(--cg-text);
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-input::placeholder {
        color: #8a96a8;
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-action {
        color: #526174;
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-panel {
        position: fixed;
        top: 62px;
        left: 12px;
        right: 12px;
        min-width: 0;
        max-height: calc(100vh - 76px);
    }

    .cg-header-global-search .cg-global-search-shortcut {
        display: none;
    }

    .cg-header-global-search .cg-global-search-voice {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }
}

/* =========================================================
   Mobile header correction
   Keep menu, brand, search, notifications and profile on ONE
   compact row. The search opens as an overlay when tapped.
   ========================================================= */
@media (max-width: 575.98px) {
    .craftgrid-authenticated-shell .craftgrid-topbar .container-fluid {
        display: flex;
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 0 !important;
        overflow: visible;
    }

    .craftgrid-authenticated-shell .craftgrid-brand {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 145px;
        margin-right: 0 !important;
        white-space: nowrap;
        overflow: hidden;
    }

    .craftgrid-authenticated-shell .craftgrid-brand .cg-brand-copy strong {
        font-size: 1rem;
    }

    .craftgrid-authenticated-shell .cg-header-global-search {
        flex: 0 0 40px;
        width: 40px;
        min-width: 40px;
        margin: 0 4px 0 auto;
        order: 3;
    }

    .craftgrid-authenticated-shell .cg-global-search-mobile-trigger {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .container-fluid > .ms-auto {
        flex: 0 0 auto;
        margin-left: 0 !important;
        gap: 4px !important;
        order: 4;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .container-fluid > .ms-auto .vr {
        display: none !important;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .container-fluid > .ms-auto .craftgrid-icon-button {
        width: 40px;
        height: 40px;
    }

    .craftgrid-authenticated-shell .craftgrid-user-button {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
        padding: 3px !important;
        justify-content: center;
        border-radius: 11px;
    }

    .craftgrid-authenticated-shell .craftgrid-user-button::after {
        margin-left: 2px;
    }

    .craftgrid-authenticated-shell .craftgrid-avatar {
        width: 28px;
        height: 28px;
        font-size: .8rem;
    }
}


/* =========================================================
   CraftGrid Mobile Global Search UX Correction
   The search field opens below the header so it never gets
   visually mixed with the brand/profile controls. Explicit
   text color/paint is used for reliable mobile rendering.
   ========================================================= */

@media (max-width: 991.98px) {
    .cg-header-global-search.is-mobile-open > .cg-global-search-bar {
        position: fixed !important;
        /* Mobile search is a true overlay below the fixed-height header.
           It must never cover the header controls themselves. */
        top: 72px !important;
        left: 12px !important;
        right: 12px !important;
        z-index: 1300 !important;
        display: flex !important;
        min-height: 48px !important;
        height: 48px !important;
        background: #ffffff !important;
        border: 1px solid #cfd8e3 !important;
        color: #17324d !important;
        opacity: 1 !important;
        box-shadow: 0 12px 30px rgba(15,31,56,.18) !important;
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-input {
        color: #17324d !important;
        -webkit-text-fill-color: #17324d !important;
        caret-color: #17324d !important;
        opacity: 1 !important;
        font-weight: 600;
        background: transparent !important;
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-input::placeholder {
        color: #7a8799 !important;
        -webkit-text-fill-color: #7a8799 !important;
        opacity: 1 !important;
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-panel {
        position: fixed !important;
        top: 124px !important;
        left: 12px !important;
        right: 12px !important;
        z-index: 1299 !important;
        min-width: 0 !important;
        max-height: calc(100vh - 136px) !important;
        background: #ffffff !important;
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-leading {
        color: #526174 !important;
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-action {
        color: #526174 !important;
    }
}

/* The compact phone header is 64px high; the wider mobile/tablet header
   retains the 76px shell height. Keep the search consistently below it. */
@media (min-width: 576px) and (max-width: 991.98px) {
    .cg-header-global-search.is-mobile-open > .cg-global-search-bar {
        top: 84px !important;
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-panel {
        top: 136px !important;
        max-height: calc(100vh - 148px) !important;
    }
}


/* =========================================================
   CraftGrid One - Global Voice Search Final UX
   Normal: compact mic.
   Listening: large red mic + clear Listening state.
   Processing: blue understanding state.
   Applies to desktop and mobile.
   ========================================================= */

.cg-global-search-voice.is-listening,
.cg-header-global-search .cg-global-search-voice.is-listening {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    transform: none;
    background: #dc2626 !important;
    color: #fff !important;
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 5px rgba(220,38,38,.16),
                0 7px 20px rgba(220,38,38,.28);
    animation: cg-voice-red-pulse 1.2s ease-in-out infinite;
}

.cg-global-search-voice.is-listening .bi-mic {
    color: #fff !important;
    transform: scale(1.12);
}

.cg-global-search-input.is-voice-listening {
    color: #b91c1c !important;
    -webkit-text-fill-color: #b91c1c !important;
    caret-color: #b91c1c !important;
    font-weight: 750 !important;
}

.cg-global-search-voice-overlay {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 1250;
    padding: 18px 20px 20px;
    border: 1px solid rgba(220,38,38,.16);
    border-radius: 18px;
    background: linear-gradient(180deg, #fff8f8 0%, #ffffff 100%);
    box-shadow: 0 20px 55px rgba(15,31,56,.20);
    text-align: center;
}

.cg-global-search-voice-overlay[hidden] {
    display: none !important;
}

.cg-global-search-voice-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
    color: #dc2626;
    font-size: 1rem;
    font-weight: 800;
}

.cg-global-search-voice-cancel {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(15,31,56,.06);
    color: #526174;
}

.cg-global-search-voice-cancel:hover {
    background: rgba(15,31,56,.11);
    color: #17324d;
}

.cg-global-search-voice-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    min-height: 126px;
    padding: 12px 0 2px;
}

.cg-global-search-voice-orb {
    width: 86px;
    height: 86px;
    flex: 0 0 86px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    box-shadow: 0 0 0 10px rgba(220,38,38,.11),
                0 12px 28px rgba(220,38,38,.25);
    animation: cg-voice-orb-pulse 1.35s ease-in-out infinite;
}

.cg-global-search-voice-orb .bi-mic-fill {
    font-size: 2rem;
}

.cg-global-search-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 78px;
    height: 54px;
}

.cg-global-search-wave span {
    width: 3px;
    height: 18px;
    border-radius: 999px;
    background: #ef4444;
    animation: cg-voice-wave .85s ease-in-out infinite;
}

.cg-global-search-wave span:nth-child(1) { animation-delay: -.35s; height: 13px; }
.cg-global-search-wave span:nth-child(2) { animation-delay: -.22s; height: 25px; }
.cg-global-search-wave span:nth-child(3) { animation-delay: -.10s; height: 38px; }
.cg-global-search-wave span:nth-child(4) { animation-delay: -.22s; height: 25px; }
.cg-global-search-wave span:nth-child(5) { animation-delay: -.35s; height: 13px; }

.cg-global-search-voice-hint {
    color: #17324d;
    font-size: .9rem;
    font-weight: 650;
}

.cg-global-search-voice-overlay.is-processing {
    border-color: rgba(37,99,235,.15);
    background: linear-gradient(180deg, #f5f8ff 0%, #ffffff 100%);
}

.cg-global-search-voice-overlay.is-processing .cg-global-search-voice-overlay-header {
    color: #2563eb;
}

.cg-global-search-voice-overlay.is-processing .cg-global-search-voice-orb {
    background: #2563eb;
    box-shadow: 0 0 0 10px rgba(37,99,235,.10),
                0 12px 28px rgba(37,99,235,.22);
    animation: cg-voice-processing-pulse 1.2s ease-in-out infinite;
}

.cg-global-search-voice-overlay.is-processing .cg-global-search-wave span {
    background: #3b82f6;
    animation-name: cg-voice-processing-wave;
}

.cg-global-search-voice-overlay.is-processing .cg-global-search-voice-hint {
    color: #315b93;
}

@keyframes cg-voice-red-pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(220,38,38,.12),
                    0 7px 20px rgba(220,38,38,.25);
    }
    50% {
        box-shadow: 0 0 0 9px rgba(220,38,38,.05),
                    0 9px 25px rgba(220,38,38,.32);
    }
}

@keyframes cg-voice-orb-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.045); }
}

@keyframes cg-voice-wave {
    0%, 100% { transform: scaleY(.55); opacity: .55; }
    50% { transform: scaleY(1.12); opacity: 1; }
}

@keyframes cg-voice-processing-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.035); }
}

@keyframes cg-voice-processing-wave {
    0%, 100% { transform: scaleY(.65); opacity: .55; }
    50% { transform: scaleY(.9); opacity: .9; }
}

@media (prefers-reduced-motion: reduce) {
    .cg-global-search-voice.is-listening,
    .cg-global-search-voice-orb,
    .cg-global-search-wave span {
        animation: none !important;
    }
}

@media (max-width: 991.98px) {
    .cg-header-global-search.is-mobile-open .cg-global-search-voice-overlay {
        position: fixed;
        top: 144px;
        left: 12px;
        right: 12px;
        z-index: 1210;
        max-height: calc(100vh - 160px);
        overflow: auto;
        border-radius: 18px;
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-voice-stage {
        min-height: 108px;
        gap: 10px;
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-voice-orb {
        width: 72px;
        height: 72px;
        flex-basis: 72px;
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-voice-orb .bi-mic-fill {
        font-size: 1.7rem;
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-wave {
        width: 58px;
    }

    .cg-header-global-search.is-mobile-open .cg-global-search-voice {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }
}

/* =========================================================
   Sidebar final alignment / readable module labels
   ========================================================= */

@media (min-width: 992px) {
    :root {
        --cg-sidebar-width: 340px;
    }
}

@media (max-width: 991.98px) {
    .craftgrid-authenticated-shell .craftgrid-mobile-sidebar {
        width: min(360px, 92vw);
    }

    .erp-sidebar .sidebar-group-toggle > .sidebar-link-content > span {
        overflow: visible;
        text-overflow: clip;
    }

    .erp-sidebar .sidebar-group-toggle > .sidebar-link-content {
        flex: 1 1 auto;
        min-width: 0;
    }

    .erp-sidebar .sidebar-group-toggle > .sidebar-link-content > span {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* Planning uses the same visual alignment as the inventory submenu items. */
.erp-sidebar .sidebar-planning-group > .sidebar-group-toggle {
    min-height: 38px;
    margin: 1px 0;
    padding: 7px 12px;
    border-radius: 8px;
    gap: 10px;
}

.erp-sidebar .sidebar-planning-group > .sidebar-group-toggle > .sidebar-link-content {
    display: flex;
    align-items: center;
    gap: 11px;
    flex: 1 1 auto;
    min-width: 0;
}

.erp-sidebar .sidebar-planning-group > .sidebar-group-toggle > .sidebar-link-content > i {
    flex: 0 0 17px;
    width: 17px;
    margin-right: 0;
    text-align: center;
}

.erp-sidebar .sidebar-planning-group > .sidebar-group-toggle > .sidebar-link-content > span {
    flex: 1 1 auto;
    min-width: 0;
    font-size: .86rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.erp-sidebar .sidebar-planning-group > .sidebar-group-toggle > .sidebar-chevron {
    flex: 0 0 18px;
    width: 18px;
    min-width: 18px;
}
