/* CraftGrid One — focused UI polish for header spacing, sidebar labels and navigation consistency.
   Added after the base theme so these refinements win without broad !important overrides. */

@media (min-width: 992px) {
    /* The highlighted gap in the top bar is after the tenant trial pill, before global search.
       Remove Bootstrap's trailing brand margin and keep a small intentional separation. */
    .craftgrid-authenticated-shell .craftgrid-topbar .navbar-brand.craftgrid-brand {
        margin-right: 0 !important;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .cg-header-global-search {
        margin-left: 4px !important;
        margin-right: 8px !important;
    }

    /* Compact rail labels must wrap between words, never through the middle of a word. */
    .craftgrid-authenticated-shell .desktop-sidebar .sidebar-link-content > span:not(.cg-work-nav-badge) {
        font-size: 8.6px !important;
        letter-spacing: -.12px !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
        hyphens: none !important;
    }
}

/* Match Pricing & Commercial Rules to the other sidebar section labels.
   Keep the semantic grouping; remove only the one-off amber text treatment. */
.craftgrid-authenticated-shell .desktop-sidebar .cg-admin-nav-section--pricing,
.craftgrid-authenticated-shell .craftgrid-mobile-sidebar .cg-admin-nav-section--pricing {
    color: #a9bfd6 !important;
    background: rgba(70, 111, 157, .12) !important;
    border-color: rgba(111, 151, 195, .18) !important;
}

.craftgrid-authenticated-shell .desktop-sidebar .cg-admin-nav-section--pricing > i,
.craftgrid-authenticated-shell .craftgrid-mobile-sidebar .cg-admin-nav-section--pricing > i {
    color: inherit !important;
}

/* Keyboard users receive the same clear, consistent focus treatment as pointer users. */
.craftgrid-authenticated-shell .desktop-sidebar .sidebar-link:focus-visible,
.craftgrid-authenticated-shell .desktop-sidebar .sidebar-group-toggle:focus-visible,
.craftgrid-authenticated-shell .craftgrid-mobile-sidebar .sidebar-link:focus-visible,
.craftgrid-authenticated-shell .craftgrid-mobile-sidebar .sidebar-group-toggle:focus-visible {
    outline: 2px solid #72d8b3 !important;
    outline-offset: 1px !important;
    box-shadow: 0 0 0 3px rgba(114, 216, 179, .14) !important;
}

@media (prefers-reduced-motion: reduce) {
    .craftgrid-authenticated-shell .desktop-sidebar .sidebar-link,
    .craftgrid-authenticated-shell .desktop-sidebar .sidebar-group-toggle {
        transition: none !important;
    }
}
