/**
 * 3-layout.css — Page Layout
 * ============================================================
 * Main content area offset, container padding, layout helpers.
 * Depends on: 1-tokens.css, 2-base.css
 * ============================================================
 */

/* --------------------------------------------------------
 * MAIN CONTENT AREA
 * -------------------------------------------------------- */
.main-content {
    margin-left: var(--sidebar-width);
    padding: var(--content-padding);
    padding-top: calc(var(--header-height) + var(--content-padding));
    min-height: calc(100vh - var(--header-height));
    /* Subtle page backdrop (every page): faint dotted grid + a soft brand
     * glow at the top so white cards float instead of sitting on flat gray. */
    background:
        radial-gradient(900px 360px at 100% -5%,
            color-mix(in srgb, var(--color-primary) 9%, transparent) 0%, transparent 60%),
        radial-gradient(circle, color-mix(in srgb, var(--color-gray-900) 5%, transparent) 1px, transparent 1px);
    background-size: auto, 22px 22px;
    background-attachment: fixed;
}

/* --------------------------------------------------------
 * CONTAINER
 * -------------------------------------------------------- */
.container-fluid {
    padding-left: var(--content-padding);
    padding-right: var(--content-padding);
}

/* --------------------------------------------------------
 * LAYOUT HELPERS
 * -------------------------------------------------------- */
.vh-fit {
    max-height: calc(100vh - var(--header-height) - 40px);
    overflow-y: auto;
}

.dashboard-content {
    max-height: calc(100vh - var(--header-height) - 20px);
    overflow-y: auto;
}

/* --------------------------------------------------------
 * ROW GRID GUTTERS
 * -------------------------------------------------------- */
.row.g-2 > * { padding: var(--space-1); }
.row.g-3 > * { padding: 5px; }
.row.g-4 > * { padding: var(--space-2); }

/* --------------------------------------------------------
 * RESPONSIVE BREAKPOINTS
 * -------------------------------------------------------- */
/* Below 1024px the sidebar is off-canvas and its round menu button floats in
 * the bottom-right corner (navigation.css, .sidebar-toggle: 48px, 16px in).
 * The page ends 80px short of the bottom so its last row -- a Save button, the
 * pager, a table's last line -- can scroll clear of the button instead of
 * staying under it. */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: calc(var(--header-height) + 10px) 10px 80px 10px;
    }
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: calc(var(--header-height) + 8px) 10px 80px 10px;
    }
}

/* Phones: a .col-auto is as wide as its content, and a toolbar of pickers in
   one (a card header's filters) ran past the screen. It stops at the row. */
@media (max-width: 575.98px) {
    .row > .col-auto { max-width: 100%; }
}
