/* Dashboard Patterns - ROA2WEB */

/* ===== Page Headers ===== */
.page-header {
  margin-bottom: var(--space-xl);
  text-align: center;
}

.page-title {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.page-subtitle {
  margin: 0;
  font-size: var(--text-base);
  color: var(--color-text-secondary);
}

/* ===== Section Structure ===== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.section-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin: 0;
}

.section-controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* ===== Metrics Grid ===== */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

@media (max-width: 1024px) {
  .metrics-row {
    grid-template-columns: 1fr;
  }
}

/* ===== Breakdown Patterns ===== */
.breakdown-section {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-lg);
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
}

.breakdown-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-medium);
}

.breakdown-value {
  font-size: var(--text-base);
  color: var(--color-text);
  font-weight: var(--font-semibold);
  font-family: var(--font-mono, monospace);
}

.breakdown-subitems {
  padding-left: var(--space-lg);
  margin-top: var(--space-sm);
}

.breakdown-subitem {
  display: flex;
  justify-content: space-between;
  padding: var(--space-xs) 0;
}

.breakdown-sublabel {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.breakdown-subvalue {
  font-weight: var(--font-medium);
  font-family: var(--font-mono, monospace);
  font-size: var(--text-sm);
}

/* ===== Enhanced Sparkline Patterns ===== */

.metric-sparkline {
  margin: var(--space-md) 0;
}

.sparkline-container {
  width: 100%;
  height: 60px;
  position: relative;
}

.sparkline-canvas {
  width: 100%;
  height: 100%;
}

.sparkline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
}

.sparkline-title {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  font-weight: var(--font-medium);
}

.sparkline-value {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  font-family: var(--font-mono, monospace);
}

/* ===== Enhanced Breakdown Patterns ===== */

.breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
  margin-bottom: var(--space-xs);
}

.breakdown-header:hover {
  background: var(--color-bg-secondary);
}

.breakdown-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.breakdown-toggle {
  color: var(--color-text-secondary);
  font-size: 0.625rem;
  transition: transform var(--transition-fast);
}

.breakdown-toggle.expanded {
  transform: rotate(90deg);
}

.breakdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-md) 0;
}
