/* =========================================================
   CraftGrid Professional Enterprise Shell
   ---------------------------------------------------------
   Presentation-only layer for the authenticated header and
   navigation. Routes, permissions and business behaviour are
   intentionally unchanged.
   ========================================================= */

:root {
    --cg-pro-header: #172B4D;
    --cg-pro-header-deep: #12233F;
    --cg-pro-sidebar: #1F2937;
    --cg-pro-sidebar-deep: #182231;
    --cg-pro-sidebar-hover: #303B4A;
    --cg-pro-sidebar-active: #2E7D5B;
    --cg-pro-sidebar-active-line: #55C99F;
    --cg-pro-sidebar-text: #E7ECF2;
    --cg-pro-sidebar-muted: #9EACBC;
    --cg-pro-page: #F5F7FA;
    --cg-pro-border: #E3E8EE;
}

/* ---------------------------------------------------------
   Application header
   --------------------------------------------------------- */
.craftgrid-authenticated-shell .craftgrid-topbar,
.craftgrid-authenticated-shell .navbar {
    min-height: 76px;
    background: var(--cg-pro-header) !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    box-shadow: 0 3px 14px rgba(15,31,56,.16) !important;
}

.craftgrid-authenticated-shell .craftgrid-topbar .container-fluid {
    min-height: 76px;
}

.craftgrid-authenticated-shell .craftgrid-brand,
.craftgrid-authenticated-shell .craftgrid-brand:focus,
.craftgrid-authenticated-shell .craftgrid-brand:hover {
    color: #fff !important;
}

.craftgrid-authenticated-shell .cg-brand-grid-mark {
    background: rgba(255,255,255,.08) !important;
    border: 1px solid rgba(255,255,255,.08);
}

.craftgrid-authenticated-shell .cg-brand-copy strong {
    color: #fff !important;
}

.craftgrid-authenticated-shell .cg-brand-copy strong span {
    color: #55C99F !important;
}

/* Search control: quiet translucent field against navy header. */
.craftgrid-authenticated-shell .cg-header-global-search .cg-global-search-bar {
    background: rgba(255,255,255,.085) !important;
    border-color: rgba(255,255,255,.16) !important;
    border-radius: 10px;
}

.craftgrid-authenticated-shell .cg-header-global-search .cg-global-search-bar:focus-within {
    background: rgba(255,255,255,.12) !important;
    border-color: rgba(255,255,255,.30) !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,.045) !important;
}

/* Header icon / profile controls. */
.craftgrid-authenticated-shell .craftgrid-icon-button,
.craftgrid-authenticated-shell .craftgrid-user-button,
.craftgrid-authenticated-shell .craftgrid-mobile-menu {
    background: rgba(255,255,255,.07) !important;
    border-color: rgba(255,255,255,.14) !important;
    color: #fff !important;
}

.craftgrid-authenticated-shell .craftgrid-icon-button:hover,
.craftgrid-authenticated-shell .craftgrid-user-button:hover,
.craftgrid-authenticated-shell .craftgrid-user-button:focus,
.craftgrid-authenticated-shell .craftgrid-mobile-menu:hover,
.craftgrid-authenticated-shell .craftgrid-mobile-menu:focus {
    background: rgba(255,255,255,.13) !important;
    border-color: rgba(255,255,255,.23) !important;
    color: #fff !important;
}

.craftgrid-authenticated-shell .craftgrid-avatar {
    background: #F3F6FA !important;
    color: var(--cg-pro-header) !important;
    border: 2px solid rgba(255,255,255,.22) !important;
}

.craftgrid-authenticated-shell .craftgrid-user-name {
    color: #fff !important;
}

.craftgrid-authenticated-shell .craftgrid-user-role,
.craftgrid-authenticated-shell .craftgrid-topbar .text-muted {
    color: rgba(255,255,255,.58) !important;
}

.craftgrid-authenticated-shell .craftgrid-topbar .vr {
    border-color: rgba(255,255,255,.16) !important;
    opacity: 1;
}

/* ---------------------------------------------------------
   Desktop / mobile sidebar
   --------------------------------------------------------- */
.craftgrid-authenticated-shell .erp-sidebar,
.craftgrid-authenticated-shell .craftgrid-mobile-sidebar {
    background: linear-gradient(180deg, var(--cg-pro-sidebar-deep) 0%, var(--cg-pro-sidebar) 100%) !important;
    border-right: 1px solid rgba(255,255,255,.07) !important;
    color: var(--cg-pro-sidebar-text);
}

.craftgrid-authenticated-shell .erp-sidebar {
    box-shadow: 5px 0 20px rgba(15,23,42,.16);
}

.craftgrid-authenticated-shell .sidebar-section-label {
    color: #8E9BAD !important;
    letter-spacing: .13em;
}

.craftgrid-authenticated-shell .sidebar-group-toggle,
.craftgrid-authenticated-shell .sidebar-link {
    color: var(--cg-pro-sidebar-text);
    border-radius: 8px;
}

.craftgrid-authenticated-shell .sidebar-group-toggle:hover,
.craftgrid-authenticated-shell .sidebar-link:hover {
    background: var(--cg-pro-sidebar-hover) !important;
    color: #fff !important;
}

.craftgrid-authenticated-shell .sidebar-nested > .sidebar-group-toggle,
.craftgrid-authenticated-shell .sidebar-submenu-link {
    color: var(--cg-pro-sidebar-muted);
}

.craftgrid-authenticated-shell .sidebar-submenu-link:hover,
.craftgrid-authenticated-shell .sidebar-submenu-link:focus-visible {
    background: rgba(255,255,255,.055) !important;
    color: #fff !important;
}

/* Active item: green is the single strong navigation accent. */
.craftgrid-authenticated-shell .sidebar-link.active {
    background: var(--cg-pro-sidebar-active) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--cg-pro-sidebar-active-line), 0 4px 12px rgba(0,0,0,.12) !important;
}

.craftgrid-authenticated-shell .sidebar-submenu-link.active {
    background: rgba(46,125,91,.24) !important;
    color: #fff !important;
    box-shadow: inset 2px 0 0 var(--cg-pro-sidebar-active-line) !important;
}

.craftgrid-authenticated-shell .sidebar-link.active > span,
.craftgrid-authenticated-shell .sidebar-link.active > i,
.craftgrid-authenticated-shell .sidebar-submenu-link.active > span,
.craftgrid-authenticated-shell .sidebar-submenu-link.active > i {
    color: #fff !important;
}

/* Keep module icons recognizable without turning the sidebar colorful. */
.craftgrid-authenticated-shell .sidebar-icon-dashboard,
.craftgrid-authenticated-shell .sidebar-icon-setup,
.craftgrid-authenticated-shell .sidebar-icon-buy,
.craftgrid-authenticated-shell .sidebar-icon-stock,
.craftgrid-authenticated-shell .sidebar-icon-sell,
.craftgrid-authenticated-shell .sidebar-icon-accounts,
.craftgrid-authenticated-shell .sidebar-icon-administration {
    color: #AEB9C7;
}

.craftgrid-authenticated-shell .sidebar-link.active .sidebar-icon-dashboard,
.craftgrid-authenticated-shell .sidebar-link.active .sidebar-icon-setup,
.craftgrid-authenticated-shell .sidebar-link.active .sidebar-icon-buy,
.craftgrid-authenticated-shell .sidebar-link.active .sidebar-icon-stock,
.craftgrid-authenticated-shell .sidebar-link.active .sidebar-icon-sell,
.craftgrid-authenticated-shell .sidebar-link.active .sidebar-icon-accounts,
.craftgrid-authenticated-shell .sidebar-link.active .sidebar-icon-administration {
    color: #fff !important;
}

.craftgrid-authenticated-shell .sidebar-chevron {
    color: #7F8C9D;
}

.craftgrid-authenticated-shell .sidebar-group[open] > .sidebar-group-toggle > .sidebar-chevron {
    color: #fff;
}

.craftgrid-authenticated-shell .sidebar-submenu {
    border-left-color: rgba(174,185,199,.18);
}

/* Mobile off-canvas uses exactly the same navigation palette. */
.craftgrid-authenticated-shell .craftgrid-mobile-sidebar .offcanvas-header {
    background: rgba(0,0,0,.10);
    border-bottom-color: rgba(255,255,255,.08);
}

/* ---------------------------------------------------------
   Workspace surface
   --------------------------------------------------------- */
.craftgrid-authenticated-shell,
.craftgrid-authenticated-shell .craftgrid-app-shell main {
    background: var(--cg-pro-page) !important;
}

.craftgrid-authenticated-shell .craftgrid-app-shell main > .container-fluid {
    color: #172B4D;
}

/* Slightly cleaner overlay when the collapsible desktop menu opens. */
.craftgrid-authenticated-shell .craftgrid-sidebar-backdrop {
    background: rgba(15,23,42,.18) !important;
}

/* Keep the desktop shell's existing dimensions/behavior unchanged. */
@media (max-width: 575.98px) {
    .craftgrid-authenticated-shell .craftgrid-topbar,
    .craftgrid-authenticated-shell .craftgrid-topbar .container-fluid {
        min-height: 64px;
    }
}

/* -------------------------------------------------------------
   Global ERP breadcrumbs
   Consistent navigation path across authenticated CraftGrid screens.
   ------------------------------------------------------------- */
.cg-breadcrumb-wrap {
    margin: 0 0 0.65rem 0;
    padding: 0;
}

.cg-breadcrumb {
    --bs-breadcrumb-divider: '›';
    font-size: 0.88rem;
    font-weight: 500;
    color: #60758a;
    align-items: center;
}

.cg-breadcrumb a {
    color: #4d6b84;
    text-decoration: none;
    transition: color 0.15s ease;
}

.cg-breadcrumb a:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.cg-breadcrumb .breadcrumb-item.active {
    color: #193b58;
    font-weight: 600;
}

.cg-breadcrumb .breadcrumb-item::before {
    color: #9aabb9;
    font-weight: 400;
}

.cg-breadcrumb .bi-house-door {
    font-size: 0.82rem;
}

/* CraftGrid Admin visual refinement: premium navy header treatment.
   Presentation-only; navigation routes and permissions are unchanged. */
.craftgrid-authenticated-shell .craftgrid-topbar,
.craftgrid-authenticated-shell .navbar {
    background: linear-gradient(112deg, #102c4d 0%, #173d63 58%, #1a466f 100%) !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
    box-shadow: 0 5px 18px rgba(11,32,56,.22) !important;
    position: relative;
}

.craftgrid-authenticated-shell .craftgrid-topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, rgba(22,163,116,0), rgba(22,163,116,.9), rgba(82,150,221,.75), rgba(22,163,116,0));
    opacity: .72;
    pointer-events: none;
}

.craftgrid-authenticated-shell .cg-brand-grid-mark {
    box-shadow: 0 5px 12px rgba(0,0,0,.12);
    border-radius: 10px !important;
}

.craftgrid-authenticated-shell .cg-header-global-search .cg-global-search-bar {
    border-radius: 11px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.craftgrid-authenticated-shell .craftgrid-user-button {
    border-radius: 11px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

/* =========================================================
   CraftGrid One header identity refinement
   ---------------------------------------------------------
   Presentation-only: keep the product name consistent while
   retaining the established navy/green CraftGrid palette.
   ========================================================= */
.craftgrid-authenticated-shell .cg-brand-copy strong em {
    color: #55C99F !important;
    font-style: normal;
    font-weight: 750;
    font-size: .90em;
    margin-left: .08em;
}

/* User avatar: circular white badge with the original CraftGrid navy K. */
.craftgrid-authenticated-shell .craftgrid-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 50% !important;
    background: #F3F6FA !important;
    color: var(--cg-pro-header) !important;
    border: 2px solid rgba(255,255,255,.22) !important;
    font-size: .90rem;
    font-weight: 750;
    line-height: 1;
}

@media (max-width: 575.98px) {
    .craftgrid-authenticated-shell .craftgrid-avatar {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
        border-radius: 50% !important;
        font-size: .8rem;
    }
}
