/* MODULE: Dashboard | FILE: styles.css */

/* ─── Layout ──────────────────────────────────────────────────────── */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  max-width: 1440px;
  margin: 0 auto;
}

.dashboard__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
}

/* ─── KPI Bar ─────────────────────────────────────────────────────── */
.kpi-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

.kpi-tile {
  background: #1e2443;
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.kpi-tile__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b8fa3;
}

.kpi-tile__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.kpi-tile__delta {
  font-size: 0.8125rem;
  font-weight: 500;
}

.kpi-tile__delta--green {
  color: #22c55e;
}

.kpi-tile__delta--amber {
  color: #f59e0b;
}

.kpi-tile__delta--red {
  color: #ef4444;
}

/* ─── Panels (Alerts + Suggestions) ──────────────────────────────── */
.panels-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.panel {
  background: #1e2443;
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.panel__title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

/* ─── Alert Cards ─────────────────────────────────────────────────── */
.alert-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.alert-card--warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
}

.alert-card--critical {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
}

.alert-card--info {
  background: rgba(99, 91, 255, 0.1);
  border-left: 3px solid #635bff;
}

.alert-card__message {
  font-size: 0.8125rem;
  color: #c4c7d4;
  flex: 1;
}

.alert-card__dismiss {
  background: none;
  border: none;
  color: #8b8fa3;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.alert-card__dismiss:hover {
  color: #ffffff;
}

/* ─── Suggestion Cards ────────────────────────────────────────────── */
.suggestion-card {
  padding: 0.75rem;
  background: rgba(99, 91, 255, 0.06);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.suggestion-card__action {
  font-size: 0.8125rem;
  color: #c4c7d4;
  margin-bottom: 0.5rem;
}

.suggestion-card__impact {
  font-size: 0.75rem;
  color: #8b8fa3;
  margin-bottom: 0.625rem;
}

.suggestion-card__buttons {
  display: flex;
  gap: 0.5rem;
}

.suggestion-btn {
  padding: 0.3125rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.suggestion-btn--accept {
  background: #635bff;
  color: #ffffff;
}

.suggestion-btn--accept:hover {
  background: #524ae0;
}

.suggestion-btn--snooze {
  background: #2a2f4e;
  color: #c4c7d4;
}

.suggestion-btn--dismiss {
  background: none;
  color: #8b8fa3;
}

/* ─── Top Campaigns Table ─────────────────────────────────────────── */
.campaigns-section {
  background: #1e2443;
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.campaigns-section__title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.campaigns-table {
  width: 100%;
  border-collapse: collapse;
}

.campaigns-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b8fa3;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #2a2f4e;
}

.campaigns-table td {
  font-size: 0.8125rem;
  color: #c4c7d4;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid #1a1f36;
}

.campaigns-table tr:hover td {
  background: rgba(99, 91, 255, 0.04);
}

.sparkline-cell {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 1.5rem;
}

.sparkline-bar {
  width: 4px;
  border-radius: 1px;
  background: #635bff;
}

/* ─── Trend Chart ─────────────────────────────────────────────────── */
.trend-section {
  background: #1e2443;
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.trend-section__title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.trend-chart {
  width: 100%;
  height: 260px;
  position: relative;
}

.trend-chart__canvas {
  width: 100%;
  height: 100%;
}

.trend-chart__legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: #8b8fa3;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot--spend {
  background: #635bff;
}

.legend-dot--leads {
  background: #22c55e;
}

.legend-dot--forecast {
  background: #f59e0b;
  opacity: 0.5;
}

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .kpi-bar {
    grid-template-columns: repeat(3, 1fr);
  }
  .panels-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .kpi-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard {
    padding: 1rem;
  }
}
