/* Page layout: container, headers, and grids. */

main {
  flex: 1 0 auto;
  width: 100%;
}

.container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.site-footer {
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.25rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 2.5rem;
}

.site-footer a {
  color: var(--primary-dark);
  font-weight: 500;
}

[data-theme="dark"] .site-footer a {
  color: var(--primary);
}

.site-footer a:hover {
  color: var(--primary-hover);
}

.site-footer-sep {
  display: none;
  color: var(--border);
}

.site-footer-version {
  margin-left: auto;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--ring);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
}

@media (min-width: 640px) {
  .site-footer-sep { display: inline; }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header:empty {
  display: none;
}

.page-header .hint,
.page-header > nav {
  margin-right: auto;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.dashboard-grid > .panel,
.chart-grid > .panel,
.grid-2 > .panel {
  min-width: 0;
}

.dashboard-grid > .panel {
  margin-bottom: 0;
}

.dashboard-grid > .span-2 {
  grid-column: 1 / -1;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-wrap,
.chart-wrap > * {
  max-width: 100%;
}

@media (max-width: 900px) {
  .dashboard-grid,
  .chart-grid { grid-template-columns: 1fr; }
  .dashboard-grid > .span-2 { grid-column: auto; }
}

.kpi-grid--compact { margin-bottom: 1.25rem; }

.grid-2--flat { margin-bottom: 0; }

.table-gap { margin-bottom: 1.25rem; }

.table-follow { margin-top: 1rem; }

.panel-body--flush { padding: 0; }

.empty--compact { padding: 1rem 0; }

.chart-title--loose { margin-bottom: 0.85rem; }

.hint--flush { margin: 0; }

.page-header .hint.hint--flush { margin: 0; }

.hint--section { margin: 0 0 1.25rem; }

.hint--tight {
  margin-top: -0.35rem;
  margin-bottom: 0.75rem;
}

.hint--gap { margin-bottom: 0.85rem; }

.hint--follow { margin-top: 1rem; }

.form-follow { margin-top: 0.75rem; }

.form-follow-lg { margin-top: 1rem; }

.text-center-flush {
  text-align: center;
  margin-top: 0;
}

.muted { color: var(--muted); }

.muted-block {
  display: block;
  color: var(--muted);
}

.value--md { font-size: 1.1rem; }

.kpi .value.value--md { font-size: 1.1rem; }

.value--sm { font-size: 1rem; }

.pre-block {
  margin: 0;
  font-size: 0.85rem;
  overflow-x: auto;
}

.pre-block--error {
  margin: 0;
  color: var(--red);
  white-space: pre-wrap;
}

.user-menu-section--end {
  border-bottom: none;
  padding-bottom: 0.25rem;
}

.org-switcher--compact {
  width: auto;
  min-width: 7rem;
}

.nav-divider {
  border-top: 1px solid var(--border);
  padding-top: 0.25rem;
  margin-top: 0.15rem;
}
