/* CraftGrid One — brand wordmark and compact professional sidebar.
   UI-only overrides. Additive stylesheet; preserves routes, permissions,
   favourites, count badges, expand/collapse and active navigation logic. */

/* Brand: CraftGrid in white, One in CraftGrid green, with a clear word gap. */
.craftgrid-authenticated-shell .craftgrid-topbar .craftgrid-brand .cg-brand-copy strong {
    color: #ffffff !important;
    font-weight: 750;
}

.craftgrid-authenticated-shell .craftgrid-topbar .craftgrid-brand .cg-brand-copy strong > span {
    color: #ffffff !important;
}

.craftgrid-authenticated-shell .craftgrid-topbar .craftgrid-brand .cg-brand-copy strong > em {
    display: inline-block;
    margin-left: .28em;
    color: #55c99f !important;
    font-style: normal;
}

/* Tight, even rhythm between top-level modules. */
.erp-sidebar > .sidebar-modules > .sidebar-group {
    margin: 0 0 4px !important;
}

.erp-sidebar > .sidebar-modules > .sidebar-group:last-child {
    margin-bottom: 8px !important;
}

.erp-sidebar .sidebar-group-toggle {
    min-height: 39px !important;
    padding: 6px 9px !important;
    border-radius: 8px !important;
    color: #f8fafc !important;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

/* Module labels: clean white, slightly stronger hierarchy. */
.erp-sidebar .sidebar-group-toggle > .sidebar-link-content > span:not([class*="badge"]) {
    color: #f8fafc !important;
    font-size: .89rem !important;
    font-weight: 600 !important;
    line-height: 1.22 !important;
}

.erp-sidebar .sidebar-group-toggle > .sidebar-link-content > i {
    color: #d5e2ee !important;
}

/* Keep management controls subdued but visible and aligned. */
.erp-sidebar .sidebar-drag-handle,
.erp-sidebar .sidebar-favorite-button {
    color: rgba(235, 244, 252, .70) !important;
}

.erp-sidebar .sidebar-drag-handle:hover,
.erp-sidebar .sidebar-favorite-button:hover,
.erp-sidebar .sidebar-favorite-button:focus-visible {
    color: #ffffff !important;
    background: rgba(255, 255, 255, .09) !important;
}

.erp-sidebar .sidebar-chevron {
    color: #b9cada !important;
}

/* Reduce indentation gaps while keeping the tree structure obvious. */
.erp-sidebar .sidebar-submenu {
    margin: 3px 0 5px 13px !important;
    padding: 2px 0 2px 9px !important;
    border-left-color: rgba(196, 218, 237, .24) !important;
}

.erp-sidebar .sidebar-submenu-link {
    min-height: 34px !important;
    margin: 1px 0 !important;
    padding: 5px 8px !important;
    border-radius: 7px !important;
    color: #edf4fb !important;
    transition: background-color .15s ease, color .15s ease;
}

.erp-sidebar .sidebar-submenu-link .sidebar-link-content > span:not([class*="badge"]),
.erp-sidebar .sidebar-submenu-link > span:not([class*="badge"]) {
    color: #edf4fb !important;
    font-size: .84rem !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
}

.erp-sidebar .sidebar-submenu-link .sidebar-link-content > i,
.erp-sidebar .sidebar-submenu-link > i {
    color: #c2d3e3 !important;
}

/* Soft hover. Do not override the selected link's green state. */
.erp-sidebar .sidebar-group-toggle:hover,
.erp-sidebar .sidebar-submenu-link:hover:not(.active) {
    background: rgba(255, 255, 255, .075) !important;
    color: #ffffff !important;
}

.erp-sidebar .sidebar-submenu-link:hover:not(.active) .sidebar-link-content > span,
.erp-sidebar .sidebar-submenu-link:hover:not(.active) > span,
.erp-sidebar .sidebar-submenu-link:hover:not(.active) .sidebar-link-content > i,
.erp-sidebar .sidebar-submenu-link:hover:not(.active) > i {
    color: #ffffff !important;
}

/* A quiet open-parent state and clear green current-module treatment. */
.erp-sidebar > .sidebar-modules > .sidebar-group[open] > .sidebar-group-toggle {
    background: rgba(255, 255, 255, .045) !important;
    color: #ffffff !important;
}

.erp-sidebar > .sidebar-modules > .sidebar-group:has(.sidebar-submenu-link.active) > .sidebar-group-toggle {
    background: linear-gradient(90deg, rgba(8, 127, 91, .36), rgba(8, 127, 91, .14)) !important;
    color: #ffffff !important;
    box-shadow: inset 3px 0 0 #55c99f !important;
}

.erp-sidebar > .sidebar-modules > .sidebar-group:has(.sidebar-submenu-link.active) > .sidebar-group-toggle > .sidebar-link-content > span:not([class*="badge"]),
.erp-sidebar > .sidebar-modules > .sidebar-group:has(.sidebar-submenu-link.active) > .sidebar-group-toggle > .sidebar-link-content > i {
    color: #ffffff !important;
}

.craftgrid-authenticated-shell .erp-sidebar .sidebar-submenu-link.active {
    background: rgba(8, 127, 91, .30) !important;
    color: #ffffff !important;
    box-shadow: inset 2px 0 0 #55c99f !important;
}

.craftgrid-authenticated-shell .erp-sidebar .sidebar-submenu-link.active .sidebar-link-content > span,
.craftgrid-authenticated-shell .erp-sidebar .sidebar-submenu-link.active > span,
.craftgrid-authenticated-shell .erp-sidebar .sidebar-submenu-link.active .sidebar-link-content > i,
.craftgrid-authenticated-shell .erp-sidebar .sidebar-submenu-link.active > i {
    color: #ffffff !important;
}

/* Keyboard focus remains visible against the dark navigation surface. */
.erp-sidebar .sidebar-group-toggle:focus-visible,
.erp-sidebar .sidebar-submenu-link:focus-visible,
.erp-sidebar .sidebar-favorite-button:focus-visible,
.erp-sidebar .sidebar-drag-handle:focus-visible {
    outline: 2px solid #80e2c4 !important;
    outline-offset: 2px;
}

/* Preserve a comfortable touch target on phones/tablets. */
@media (max-width: 991.98px) {
    .erp-sidebar > .sidebar-modules > .sidebar-group {
        margin-bottom: 3px !important;
    }

    .erp-sidebar .sidebar-group-toggle {
        min-height: 42px !important;
    }

    .erp-sidebar .sidebar-submenu-link {
        min-height: 38px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .erp-sidebar .sidebar-group-toggle,
    .erp-sidebar .sidebar-submenu-link {
        transition: none !important;
    }
}


/* Tenant Administration: restrained, icon-led section hierarchy. */
.cg-admin-nav-section {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: .85rem .55rem .35rem !important;
    padding: .48rem .65rem;
    border: 1px solid rgba(148, 170, 195, .13);
    border-radius: 9px;
    color: #a9bfd6 !important;
    font-size: .68rem !important;
    font-weight: 800 !important;
    letter-spacing: .075em;
    line-height: 1.35;
    text-transform: uppercase;
}
.cg-admin-nav-section > i {
    flex: 0 0 auto;
    font-size: .9rem;
    opacity: .92;
}
.cg-admin-nav-section--sales,
.cg-admin-nav-section--governance {
    background: rgba(70, 111, 157, .12);
    border-color: rgba(111, 151, 195, .18);
}
.cg-admin-nav-section--pricing {
    background: rgba(183, 139, 57, .10);
    border-color: rgba(208, 166, 91, .20);
    color: #d8c8a7 !important;
}
.cg-admin-nav-section--purchasing {
    background: rgba(128, 105, 178, .11);
    border-color: rgba(155, 132, 204, .20);
}
.cg-admin-nav-section--billing {
    background: rgba(54, 137, 135, .10);
    border-color: rgba(82, 165, 160, .18);
}
@media (max-width: 767.98px) {
    .cg-admin-nav-section {
        margin-left: .35rem !important;
        margin-right: .35rem !important;
        padding: .42rem .55rem;
        font-size: .65rem !important;
    }
}
