/* Shared content rhythm. Keep tab buttons compact; give their content room. */
:root {
    --ginoma-content-inset: 12px;
    --ginoma-toolbar-inset: 10px;
}

/* The toolbar owns its internal spacing. Previously only its bottom had
   space, leaving grouping, search and actions against the dark top edge. */
body .adm-table-panel .grid-toolbar {
    padding: var(--ginoma-toolbar-inset) 8px;
    margin: 0;
    box-sizing: border-box;
}

/* Do not add another bottom-only gap around the shared toolbar. */
body .adm-table-panel > .grid-sticky-top {
    padding: 0;
}

/* Route tabs have no content panel: space the following page section instead. */
.catalog-navigation,
.sgm-module-navigation {
    margin-bottom: var(--ginoma-content-inset);
}

/* Applies equally to page tabs, nested tabs and tabs mounted in dialogs.
   Only the top inset is owned here; preserve each layout's side/bottom padding. */
body .mud-tabs > .mud-tabs-panels {
    padding-top: var(--ginoma-content-inset) !important;
    box-sizing: border-box;
    min-width: 0;
}

/* Some dashboards put the same inset on the child panel. Avoid doubling it. */
body .mud-tabs > .mud-tabs-panels > .mud-tab-panel {
    padding-top: 0 !important;
}

body .mud-tabs > .mud-tabs-panels > .mud-tab-panel > :is(.adm-list-panel, .adm-stack, .gma-kpi-grid):first-child {
    margin-top: 0;
}

/* Integration uses native tab strips rather than MudTabs. */
.int-tabs,
.int-subtabs {
    margin-bottom: var(--ginoma-content-inset);
}

.int-subtabs {
    margin-top: 0;
}

@media (max-width: 700px) {
    :root {
        --ginoma-content-inset: 12px;
    }
}

/* One spacing owner per boundary: page, header, tabs, then content. */
:root { --ginoma-section-gap:12px; --ginoma-panel-inset:16px; }
body .full-width-content > .adm-page { padding:0 0 16px; }
body .full-width-content > .module-navigation { padding:4px 8px; margin-bottom:12px; }
body .module-navigation a { padding:9px 16px; }
body .mud-tab-panel > .adm-page { padding:0 4px 12px; }
body .adm-page > .adm-header { margin-bottom:12px; gap:12px; }
html:root .ginoma-dashboard.ginoma-dashboard > .adm-header {
    padding:8px 0 12px; margin:0 0 12px; min-height:56px; align-items:center;
}
/* Catalog tabs navigate to pages. Their empty panels must reserve no space. */
body :is(.catalog-navigation,.sgm-module-navigation) { margin-bottom:12px; }
body :is(.catalog-navigation,.sgm-module-navigation) .mud-tabs > .mud-tabs-panels { display:none; padding:0 !important; }
html:root .ginoma-dashboard.ginoma-dashboard :is(.mud-tabs-tabbar,.mud-tabs-toolbar) { margin-bottom:0; }
body :is(.catalog-navigation,.sgm-module-navigation) :is(.mud-tabs-tabbar,.mud-tabs-toolbar) { margin-bottom:0; }
body :is(.adm-stack,.adm-grid,.adm-grid-wide) { gap:12px; }
body :is(.gma-kpi-grid,.sgm-dashboard-metrics,.sge-dashboard-grid,.sgc-chart-grid,.manager-kpi-grid) { gap:12px; }
html:root .ginoma-dashboard.ginoma-dashboard :is(.sge-dashboard-filters,.sgd-dashboard-filters,.sgm-dashboard-filter-panel,.gio-dashboard-filters,.sga-command-bar,.sct-filter-row,.sup-filter-row) {
    padding:12px 16px !important; margin-block:12px !important; gap:12px;
}
html:root .ginoma-dashboard.ginoma-dashboard :is(.dashboard-chart-panel,.dashboard-radar-panel,.gio-chart-card,.gio-company-chart,.sgm-dashboard-section,.sge-health-card) { padding:16px !important; }
html:root .ginoma-dashboard.ginoma-dashboard :is(.gma-kpi,.sgm-dashboard-metric,.sge-indicator-card) { padding:14px 16px !important; }
body .sge-dashboard-grid { margin-top:12px; }
/* SGD library, forms and dialog boundaries share the same rhythm. */
body .sgd-page .sgd-workspace { gap:16px; }
body .sgd-page :is(.sgd-folder-pane,.sgd-content-pane) { padding:16px; }
body .sgd-page :is(.sgd-current-folder,.sgd-section-heading) { gap:12px; margin-bottom:16px; }
body .sgd-page .sgd-support-tabs { margin-bottom:12px; }
body .sgd-page .sga-modal-title { padding-bottom:12px; margin-bottom:12px; }
body .sgd-page .sga-form-modal .adm-actions { padding-top:12px; margin-top:12px; }
body :is(.dashboard-alert-modal-header,.sga-modal-title) { gap:12px; margin-bottom:12px; }
body .dashboard-alert-modal > .adm-table-panel { margin-top:0; }
body .financial-dashboard { gap:16px; padding:4px 0 12px; }
body .financial-panel { padding:16px; }
body .financial-cards { gap:12px; }
@media(max-width:700px) {
    body .full-width-content > .adm-page { padding-inline:0; }
    body .module-navigation a { padding:8px 12px; }
}body .gma-kpi-grid { margin-bottom:12px; }
body .adm-stack > :is(.gma-kpi-grid,.sge-dashboard-grid) { margin-block:0; }
body .mud-tab-panel > .manager-page { padding:0 4px 12px; gap:12px; }
body .full-width-content > .constructor-page,
body .mud-tab-panel > .constructor-page { padding:0 0 16px; }
body .constructor-tabs .report-builder-page { padding-top:0; }