:root {
  --surface: #ffffff;
  --on-surface: #0f172a;
  --on-surface-muted: #64748b;
  --success: #16a34a;
  --error: #dc2626;
}

/* ---------------- Global Typography ---------------- */
h1,
h2,
h3 {
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.2px;
}

h2 {
  font-size: 26px;
  line-height: 34px;
  margin-bottom: 8px;
}

h3 {
  font-size: 18px;
  color: var(--on-surface-muted);
}

/* ===============================
   STATS GRID
================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

/* ===============================
   CARD BASE
================================ */
.stat-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.06),
    0 6px 20px rgba(0, 0, 0, 0.08);
}

/* ===============================
   STAT CARDS
================================ */
.stat-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface);
}

.stat-value {
  margin-top: 12px;
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--on-surface);
}

.stat-value.pos {
  color: var(--success);
}

.stat-value.neg {
  color: var(--error);
}

.stat-subtitle {
  font-size: 13px;
  margin-top: 4px;
  color: var(--on-surface-muted);
}


.dashboard-layout {
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

/* ===============================
   CHARTS FLEX LAYOUT
================================ */

.charts-grid {
  display: grid;
  grid-template-columns: 360px 1fr; 
  grid-template-rows: auto auto;
  gap: 28px;
  margin-top: 40px;
  width: 100%;
}


/* ===============================
   DOUGHNUT CHART (CENTERED)
================================ */

#doughnut-container canvas {
  width: 90%;
  height: 90%;
  max-width: 90%;
  max-height: 90%;
  margin-top: 16px;
}

.doughnut-card {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #ffffff;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.08);
}



/* ===============================
   BAR + LINE (FULL WIDTH)
================================ */
.bar-card {
  min-height: 420px;
  width: 100%;
  background-color: #ffffff;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.08);
}

#bar-container canvas {
  width: 100% !important;
  height: 360px !important;
  display: block;
}

.line-card {
  grid-column: 1 / -1; /* SPAN BOTH COLUMNS */
  min-height: 420px;
  background-color: #ffffff;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.08);
}

#line-container canvas {
  width: 100% !important;
  height: 360px !important;
  display: block;
}


/* ===============================
   RESPONSIVE
================================ */


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

  .line-card {
    grid-column: auto;
  }

  #doughnut-container canvas {
    width: 240px;
  }
}
