/*
 * Dashboard layout.
 *
 * Implements the AITHYRA 6×6 column grid with 5% page margins. On
 * screens >= 768px the dashboard uses a 6-column CSS Grid; tiles span
 * a configurable number of columns via .tile--span-N. Below 768px the
 * grid collapses to a single column.
 *
 * See AITHYRA/AITHYRADesign.md §4 for the grid spec.
 */

.page {
  padding: 0 5% var(--space-8);
}

.page__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-8) 0 var(--space-6);
}

.page__title {
  margin: 0;
}

.page__meta {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-6);
}

/* Span helpers: only spans 2/3/6 are used in this batch but 1/4/5 are
   kept available for later pages. */
.tile--span-1 { grid-column: span 1; }
.tile--span-2 { grid-column: span 2; }
.tile--span-3 { grid-column: span 3; }
.tile--span-4 { grid-column: span 4; }
.tile--span-5 { grid-column: span 5; }
.tile--span-6 { grid-column: span 6; }

@media (max-width: 768px) {
  .grid-6 {
    grid-template-columns: 1fr;
  }
  .tile--span-1,
  .tile--span-2,
  .tile--span-3,
  .tile--span-4,
  .tile--span-5,
  .tile--span-6 {
    grid-column: span 1;
  }
}

.section-title {
  grid-column: span 6;
  margin: var(--space-6) 0 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
}

.timeframe {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-3);
  margin: 0 0 var(--space-6);
}

.timeframe__presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.timeframe__field {
  display: grid;
  gap: var(--space-1);
  color: var(--fg-muted);
  font-size: 0.75rem;
}

.timeframe__field input {
  min-height: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--fg);
  padding: 0 var(--space-2);
}

.chart-frame {
  position: relative;
  width: 100%;
  height: 220px;
  min-height: 0;
  flex: 0 0 220px;
}

.chart-frame--large {
  height: 240px;
  flex-basis: 240px;
}

.chart-frame canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.analytics-table th,
.analytics-table td {
  white-space: nowrap;
}

.matrix-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.matrix-cell {
  min-width: 8.5rem;
  color: var(--fg-muted);
}
