
/* SkatteFix v5G — Sidebar overflow fix
   Fixar att Growth Rewards/Tillväxt-pilen kan hamna långt åt höger
   och skapa osynlig overflow/blockering på mobil/desktop-view.
*/

.sidebar,
.sidebar-nav,
.dashboard-sidebar,
aside {
    max-width: 280px;
}

.sidebar *,
.dashboard-sidebar *,
aside * {
    box-sizing: border-box;
}

/* Section headers i sidebar */
.sidebar-section,
.sidebar-group,
.nav-section,
.sidebar-heading,
.sidebar-title {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

/* Collapse arrows/toggles ska aldrig ligga ute i main-content */
.sidebar [class*="chevron"],
.sidebar [class*="arrow"],
.sidebar [class*="toggle"],
.dashboard-sidebar [class*="chevron"],
.dashboard-sidebar [class*="arrow"],
.dashboard-sidebar [class*="toggle"],
aside [class*="chevron"],
aside [class*="arrow"],
aside [class*="toggle"] {
    max-width: 28px;
    max-height: 28px;
}

/* Om toggle är absolut placerad: håll den inom sidebar */
.sidebar .section-toggle,
.sidebar .sidebar-toggle,
.sidebar .collapse-toggle,
.dashboard-sidebar .section-toggle,
.dashboard-sidebar .sidebar-toggle,
.dashboard-sidebar .collapse-toggle,
aside .section-toggle,
aside .sidebar-toggle,
aside .collapse-toggle {
    right: 10px !important;
    left: auto !important;
}

/* Sidebar links får inte skapa horizontal overflow */
.sidebar a,
.dashboard-sidebar a,
aside a {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Desktop site på mobil: hindra sidebar från att skapa 100vw+ layout */
@media (max-width: 899px) {
    .dashboard-layout {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .dashboard-layout .sidebar,
    .dashboard-layout .dashboard-sidebar,
    .dashboard-layout aside {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .dashboard-layout .main-content {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .dashboard-layout [style*="right:"] {
        max-width: 100vw;
    }
}
