/**

 * Front Workspace — layout tweaks (design system loaded separately).

 */



.ml-front-workspace .ml-ui-dashboard,

.ml-ui-dashboard.ml-ui-dashboard--sidebar {

    min-height: 50vh;

    margin-top: 0;

    padding-top: 0;

}



/* Sidebar 300px + fluid content — workspace shell only.
 * Poké HUB modules pages use theme 18-modules-nav.css
 * (minmax(220px, 260px)) via .pokehub-modules-page-layout. */

.ml-ui-dashboard--sidebar .ml-ui-dashboard__inner:not(.pokehub-modules-page-layout):not(.me5rine-lab-modules-page-layout) {

    display: grid;

    grid-template-columns: 300px minmax(0, 1fr);

    column-gap: var(--me5rine-lab-spacing-xl, 2rem);

    row-gap: 0;

    max-width: var(--me5rine-chrome-width, min(1280px, calc(100% - 2 * var(--me5rine-lab-spacing-lg, 20px))));

    margin: 0 auto;

    align-items: stretch;

}

@media (min-width: 1025px) {
    .ml-ui-dashboard--sidebar .ml-ui-dashboard__inner.pokehub-modules-page-layout,
    .ml-ui-dashboard--sidebar .ml-ui-dashboard__inner.me5rine-lab-modules-page-layout {
        display: grid;
        grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
        column-gap: var(--me5rine-lab-spacing-xl, 2rem);
        row-gap: 0;
        max-width: none;
        margin: 0;
        align-items: start;
    }
}

.ml-ui-dashboard--sidebar .ml-ui-sidebar {

    grid-column: 1;

    grid-row: 1;

    align-self: stretch;

    display: flex;

    flex-direction: column;

    position: relative;

    min-height: 0;

    padding: 0;

    margin: 0;

    border: none;

    background: transparent;

    max-height: none;

    overflow: visible;

}



.ml-ui-dashboard--sidebar .ml-ui-dashboard__panel {

    display: flex;

    flex-direction: column;

    gap: var(--ml-ui-space-sm, 0.5rem);

    grid-column: 2;

    grid-row: 1;

    min-width: 0;

    margin: 0;

    padding: 0;

    align-self: start;

}



/* Page title — plain header (no card), tiles start below in content */

[data-ml-dashboard] .ml-ui-page-header--front {

    display: flex;

    align-items: flex-start;

    gap: var(--ml-ui-space-md, 1rem);

    margin: 0;

    padding: 0;

    background: none;

    border: none;

    border-radius: 0;

    flex-shrink: 0;

}



[data-ml-dashboard] .ml-ui-page-header__inner {

    flex: 1;

    min-width: 0;

}



[data-ml-dashboard] .ml-ui-page-header__title {

    margin: 0;

    font-size: clamp(1.35rem, 2vw, 1.625rem);

    font-weight: 700;

    line-height: 1.25;

    color: var(--lab-ds-text, var(--ml-ui-text, #11161e));

}



[data-ml-dashboard] .ml-ui-page-header__desc {

    margin: 0.35rem 0 0;

    font-size: var(--ml-ui-font-size-sm, 0.875rem);

    line-height: 1.45;

    color: var(--lab-ds-text-muted, var(--ml-ui-text-muted, #5d697d));

}



[data-ml-dashboard] .ml-ui-page-header__actions {

    display: flex;

    align-items: center;

    gap: var(--ml-ui-space-sm, 0.5rem);

    flex-wrap: wrap;

    margin-left: auto;

}



[data-ml-dashboard] .ml-ui-page-header__toggle {

    display: none;

}



.lab-ds-page--front .lab-ds-module-card__footer .lab-ds-btn-group {

    display: flex;

    flex-wrap: wrap;

    gap: var(--lab-ds-space-xs, 4px);

}



.lab-ds-module-activation-toolbar {

    display: flex;

    flex-wrap: wrap;

    align-items: flex-start;

    gap: var(--lab-ds-space-md, 16px);

}



.lab-ds-module-activation-toolbar .lab-ds-limit-badge {

    flex-shrink: 0;

    margin-top: 0.35rem;

}



.ml-ui-dashboard--sidebar .ml-ui-dashboard__content {

    margin: 0;

    padding: 0;

    min-width: 0;

    flex: 1;

}



/* Standalone FO shell — no duplicate header/sidebar chrome */

.m5fo-app--workspace-shell {

    max-width: var(--me5rine-chrome-width, min(1280px, calc(100% - 2 * var(--me5rine-lab-spacing-lg, 20px))));

    margin: 0 auto;

    padding: var(--ml-ui-space-lg, 1.5rem);

    box-sizing: border-box;

}



.m5fo-body--workspace-shell .m5fo-app--workspace-shell {

    min-height: 50vh;

}



.m5fo-main:has(.ml-ui-dashboard) {

    padding: 0;

    margin: 0;

}



.ml-front-dashboard-home__summary {

    margin-bottom: var(--lab-ds-space-lg, 1.5rem);

}



.ml-front-module-tabs {

    margin-bottom: var(--lab-ds-space-lg, 1.5rem);

}



.page .ml-ui-dashboard,

.entry-content .ml-ui-dashboard,

.ml-front--integrated .ml-ui-dashboard {

    margin-top: 0;

    margin-bottom: 0;

    padding: 0;

}



.page .ml-ui-dashboard--sidebar .ml-ui-sidebar,

.entry-content .ml-ui-dashboard--sidebar .ml-ui-sidebar {

    align-self: start;

    min-height: 0;

    padding: 0;

    margin: 0;

}



@media (max-width: 1024px) {

    .ml-ui-dashboard--sidebar .ml-ui-dashboard__inner {

        grid-template-columns: 1fr;

    }



    .ml-ui-dashboard--sidebar .ml-ui-sidebar,

    .ml-ui-dashboard--sidebar .ml-ui-dashboard__panel {

        grid-column: 1;

        grid-row: auto;

    }



    /* Empty spacer only needed on desktop grid; collapse on stacked layout. */
    [data-ml-dashboard] .ml-ui-dashboard--sidebar .ml-ui-sidebar.is-empty {
        display: none !important;
    }

    [data-ml-dashboard] .ml-ui-dashboard--sidebar .ml-ui-sidebar {

        display: block;

        position: relative;

        width: 100%;

        max-width: none;

        inset: auto;

        box-shadow: none;

    }

    [data-ml-dashboard] .ml-ui-dashboard--sidebar .ml-ui-sidebar__sticky {

        position: static;

        max-height: none;

        overflow: visible;

    }



    [data-ml-dashboard] .ml-ui-page-header__toggle,

    .ml-ui-topbar__toggle {

        display: inline-flex;

    }



    .lab-ds-page--front .lab-ds-module-grid {

        grid-template-columns: 1fr;

    }

}



@media (max-width: 768px) {

    .page .ml-ui-dashboard--sidebar .ml-ui-sidebar__sticky {

        position: static;

    }

}


