/* Customer portal on the ERP look (2026-10-10).
   erp-slim.css + erp-rail.css do the work; this file only bridges the
   customer portal's own markup / inline colours to them.
   body.cp-portal is set on every customer page. */

/* the portal's inline <style> paints the sidebar with !important */
html body.cp-portal.theme-slim .main-sidebar.app-sidebar { background: #0f1e36 !important; }
html body.cp-portal.theme-slim .main-sidebar.app-sidebar .brand-link { color: #fff !important; }
html body.cp-portal.theme-slim .main-header.dashboard-topbar { margin: 6px 8px 0; }
html body.cp-portal.theme-slim .content-wrapper { background: #f4f7fb; }
html body.cp-portal.theme-slim .flash-banner { font-size: 12px; padding: 5px 12px; }

/* classic view keeps the portal's own navy sidebar: icons must stay white
   (erp-rail.css paints classic icons navy, meant for the ERP's light sidebar) */
html body.cp-portal:not(.theme-slim) .app-sidebar .nav-sidebar .nav-link .nav-icon,
html body.cp-portal:not(.theme-slim) .app-sidebar .nav-sidebar .nav-link.active .nav-icon { color: #fff !important; }

/* rail collapsed: also hide the sidebar's alert box and brand text */
@media (min-width: 992px) {
    html body.erp-rail:not(.erp-rail-open) .app-sidebar .sidebar-alerts,
    html body.erp-rail:not(.erp-rail-open) .app-sidebar .brand-text { display: none !important; }
    html body.erp-rail:not(.erp-rail-open) .app-sidebar .brand-link::before {
        content: "UTL"; color: #fff; font-weight: 700; font-size: 13px; display: block; text-align: center;
    }
    html body.erp-rail .flash-banner { margin-left: 72px; }
}

/* auto grid toolbar wrapper (footer script) */
.cp-grid { margin-bottom: 8px; }
.cp-grid .grid-toolbar { padding: 4px 0; }

/* 2026-10-10 (2): some customer pages put their content straight into
   .wrapper without a .content-wrapper (dashboard, statistics, invoice view,
   my worker forms...) - give those the same left offset as the content,
   so the icon rail never covers them. */
@media (min-width: 992px) {
    html body.erp-rail .wrapper > :not(.main-sidebar):not(.main-header):not(.content-wrapper):not(.main-footer):not(.control-sidebar):not(.flash-banner):not(script):not(style):not(#erpRailShade) {
        margin-left: 72px !important;
    }
}
