/* ═══════════════════════════════════════════════════════════
   Charts Widget — chart tile styling
   Glassmorphism container matching V4 caldash aesthetic
   ═══════════════════════════════════════════════════════════ */

/* Dynamic chart grid — lives below the calendar grid */
.caldash-chart-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  padding: 0 0 10px 0;
  margin-top: 4px;
}

/* A single chart tile. Default span = 2 day-card widths.
   Inner grid of CalendarDashboard is 6 columns (5 days + 1 week).
   So each day-card ≈ 2 columns of the 12-col chart grid → span 4. */
.caldash-chart-tile {
  grid-column: span 4;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  backdrop-filter: blur(8px) saturate(150%);
  padding: 8px 10px 6px 10px;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.caldash-chart-tile.is-wide  { grid-column: span 6; }
.caldash-chart-tile.is-xwide { grid-column: span 8; }
.caldash-chart-tile.is-full  { grid-column: span 12; }

.caldash-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 6px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.caldash-chart-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.caldash-chart-subtitle {
  font-size: 11px;
  font-weight: 600;
}
.caldash-chart-subtitle.is-green { color: #4ade80; }
.caldash-chart-subtitle.is-red   { color: #ff8a8a; }
.caldash-chart-subtitle.is-flat  { color: var(--text-muted); }

.caldash-chart-body {
  flex: 1 1 auto;
  min-height: 120px;
  position: relative;
}

.chart-empty,
.chart-err {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}
.chart-err { color: #ff8a8a; font-style: normal; }

/* Mobile — stack tiles */
@media (max-width: 850px) {
  .caldash-chart-grid { grid-template-columns: 1fr; }
  .caldash-chart-tile,
  .caldash-chart-tile.is-wide,
  .caldash-chart-tile.is-xwide,
  .caldash-chart-tile.is-full {
    grid-column: span 1;
  }
}
