/* =========================
   DASHBOARD
   ========================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-card {
  padding: 22px !important;
  position: relative;
  overflow: hidden;
  min-height: 100%;
}

.dashboard-card:nth-child(1) {
  background:
    radial-gradient(circle at top right, rgba(111, 174, 74, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)),
    var(--surface) !important;
  border-color: rgba(191, 222, 133, 0.18) !important;
}

.dashboard-card:nth-child(2) {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)), var(--surface) !important;
}

.dashboard-card:nth-child(3) {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008)), rgba(28, 33, 30, 0.98) !important;
}

.dashboard-card h3 {
  margin-bottom: 18px;
}

.dashboard-heading-chip,
.dashboard-label-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-heading-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(177, 214, 94, 0.14);
  border: 1px solid rgba(177, 214, 94, 0.18);
  font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dashboard-label-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(177, 214, 94, 0.14);
  font-size: 13px;
}

.dashboard-status-value.is-good {
  color: #dff3b6;
}

.dashboard-status-value.is-bad {
  color: #ffcec4;
}

.dashboard-card::after {
  content: "";
  position: absolute;
  inset-inline-end: -34px;
  top: -28px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(177, 214, 94, 0.14), transparent 68%);
  pointer-events: none;
}

.dashboard-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(177, 214, 94, 0.08);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.dashboard-stat span {
  font-size: 12px;
  color: rgba(240, 245, 230, 0.6);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-stat strong {
  font-size: 24px;
  color: #ffffff;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.dashboard-progress-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(177, 214, 94, 0.09);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 12px;
}

.dashboard-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-progress-head span {
  font-size: 12px;
  color: rgba(240, 245, 230, 0.64);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-progress-head strong {
  font-size: 15px;
  color: #f7fbef;
  font-weight: 900;
}

.dashboard-progress-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7bbd51, #b9d56a);
  box-shadow: 0 0 18px rgba(125, 188, 81, 0.2);
}

.dashboard-progress-fill-medication {
  background: linear-gradient(90deg, #8d7a59, #d2b46c);
}

.dashboard-ring-wrap {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.dashboard-saving-ring {
  --ring-progress: 0deg;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  padding: 12px;
  background:
    conic-gradient(from -90deg, #7bbd51 var(--ring-progress), rgba(255,255,255,0.08) 0deg),
    radial-gradient(circle, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.dashboard-saving-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(14, 20, 14, 0.92);
}

.dashboard-saving-ring-inner strong {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
}

.dashboard-saving-ring-inner span {
  font-size: 11px;
  color: rgba(240, 245, 230, 0.64);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dashboard-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-actions .action-btn {
  min-width: 170px;
}

.dashboard-stat:last-child {
  margin-bottom: 0;
}

html[data-theme="light"] .dashboard-card::after {
  background: radial-gradient(circle, rgba(90, 117, 70, 0.1), transparent 68%);
}

html[data-theme="light"] .dashboard-heading-badge {
  background: rgba(114, 142, 78, 0.12);
  border-color: rgba(114, 142, 78, 0.16);
}

html[data-theme="light"] .dashboard-label-icon {
  background: rgba(114, 142, 78, 0.1);
  border-color: rgba(114, 142, 78, 0.12);
}

html[data-theme="light"] .dashboard-progress-card,
html[data-theme="light"] .dashboard-stat {
  background: rgba(255, 255, 255, 0.58);
}

html[data-theme="light"] .dashboard-progress-track {
  background: rgba(71, 78, 65, 0.1);
}

html[data-theme="light"] .dashboard-saving-ring-inner {
  background: rgba(248, 244, 236, 0.96);
}
