diff --git a/src/app/globals.css b/src/app/globals.css
index 489a58688f4..4df43dff070 100644
--- a/src/app/globals.css
+++ b/src/app/globals.css
@@ -496,3 +496,15 @@ select option {
.react-flow__controls-button svg {
fill: var(--color-text-main);
}
+
+/* Desktop sidebar visibility must not depend on Tailwind's hidden/lg:flex cascade
+ (ordering/specificity can collapse it). Explicit class + 1024px media query. */
+.dashboard-sidebar-desktop {
+ display: none;
+ min-height: 0;
+}
+@media (min-width: 1024px) {
+ .dashboard-sidebar-desktop {
+ display: flex;
+ }
+}
diff --git a/src/shared/components/layouts/DashboardLayout.tsx b/src/shared/components/layouts/DashboardLayout.tsx
index 0a0a3fa866e..f72841a6e7c 100644
--- a/src/shared/components/layouts/DashboardLayout.tsx
+++ b/src/shared/components/layouts/DashboardLayout.tsx
@@ -73,8 +73,8 @@ export default function DashboardLayout({ children }) {
/>
)}
- {/* Sidebar - Desktop */}
-
+ {/* Sidebar - Desktop: keep visibility independent from Tailwind hidden/lg:flex ordering. */}
+
{
+ const source = readSrc("src/shared/components/layouts/DashboardLayout.tsx");
+
+ // The desktop sidebar wrapper must reference the dedicated class.
+ assert.match(
+ source,
+ /className="dashboard-sidebar-desktop"/,
+ "Desktop sidebar wrapper must use the dashboard-sidebar-desktop class"
+ );
+
+ // The fragile Tailwind cascade must be gone.
+ assert.doesNotMatch(
+ source,
+ /className="hidden[^"]*lg:flex"/,
+ "Desktop sidebar wrapper must not rely on the hidden/lg:flex Tailwind cascade"
+ );
+});
+
+test("globals.css defines dashboard-sidebar-desktop hidden by default and flex at >=1024px", () => {
+ const css = readSrc("src/app/globals.css");
+
+ // Class exists.
+ assert.match(
+ css,
+ /\.dashboard-sidebar-desktop\s*\{/,
+ "globals.css must define .dashboard-sidebar-desktop"
+ );
+
+ // Hidden by default (mobile-first), then shown via a 1024px desktop media query.
+ const classIndex = css.indexOf(".dashboard-sidebar-desktop");
+ const desktopRule =
+ /@media\s*\(min-width:\s*1024px\)\s*\{[^}]*\.dashboard-sidebar-desktop\s*\{[^}]*display:\s*flex/;
+ assert.match(
+ css.slice(classIndex - 200),
+ desktopRule,
+ "globals.css must show .dashboard-sidebar-desktop with display:flex at min-width:1024px"
+ );
+
+ // Default state hides it (display:none) so mobile is unaffected.
+ const baseRule = /\.dashboard-sidebar-desktop\s*\{[^}]*display:\s*none/;
+ assert.match(
+ css,
+ baseRule,
+ "globals.css must hide .dashboard-sidebar-desktop by default (display:none)"
+ );
+});