/* App shell — sidebar + header + main content */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 100vh;
    height: 100vh;
    overflow: hidden;
}
.app-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-8);
}
.app-content__inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
}
/* A page that is wide by nature (the Forecast grid) takes the whole content area. */
.app-content__inner--wide { max-width: none; }

/* Menu collapsed (the sidebar logo toggles it; remembered per browser, see sidebar.js) — the sidebar
   shrinks to a rail holding just the logo and the content takes the rest of the window. The class sits
   on <html> so _Layout can apply it before first paint. */
html.is-sidebar-collapsed .app-shell { grid-template-columns: var(--sidebar-rail-width) 1fr; }

/* Page header row (title + actions) */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-6);
}
.page-head__actions { display: flex; gap: var(--spacing-3); flex-shrink: 0; }

/* Generic layout helpers */
.grid { display: grid; gap: var(--spacing-5); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: var(--spacing-4); }
.row { display: flex; align-items: center; gap: var(--spacing-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-3); }

@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar { display: none; }
}

/* Icon + text on one line, and a wrapping cluster of controls. */
.cluster { display: flex; align-items: center; gap: var(--spacing-2); }
.cluster--inline { display: inline-flex; }
.cluster-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-3); }
/* Auto-fitting grid of equal tiles. */
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--spacing-5); }
