/* Dashboard (js/dashboard.js): a grid of cards, in the app's own colours. */

.db-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 14px 20px; margin: 4px 0 22px; }
.db-crumb { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.db-crumb svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.db-title { font: 400 40px/1.1 var(--sans); letter-spacing: -.03em; margin: 0; }
.db-title b { font-weight: 600; }
.db-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.db-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 999px; font: 500 13.5px var(--sans); cursor: pointer; text-decoration: none;
  background: var(--card); color: var(--text); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  box-shadow: var(--shadow-soft); }
.db-pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.db-pill.dark { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.db-pill.violet { background: var(--violet); color: #fff; border-color: var(--violet); }
@media (hover: hover) and (pointer: fine) { .db-pill:hover { box-shadow: var(--shadow-lift); } }

/* ---------- the grid ---------- */
.db-grid { display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "plan   act     score   streak"
    "plan   alerts  alerts  bench"
    "spy    time    sound   ideas"
    "recent recent  recent  ideas"; }
.a-plan { grid-area: plan; } .a-act { grid-area: act; } .a-score { grid-area: score; }
.a-streak { grid-area: streak; } .a-alerts { grid-area: alerts; } .a-bench { grid-area: bench; }
.a-spy { grid-area: spy; } .a-time { grid-area: time; } .a-sound { grid-area: sound; }
.a-ideas { grid-area: ideas; } .a-recent { grid-area: recent; }

@media (max-width: 1180px) {
  .db-grid { grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "plan   act"   "plan   score"
      "streak bench" "alerts alerts"
      "spy    time"  "sound  ideas"
      "recent recent"; }
}
@media (max-width: 640px) {
  .db-title { font-size: 30px; }
  .db-grid { grid-template-columns: 1fr;
    grid-template-areas: "plan" "act" "score" "streak" "alerts" "bench" "spy" "time" "sound" "ideas" "recent"; }
}

/* ---------- a card ---------- */
.db-card { position: relative; min-width: 0; display: flex; flex-direction: column;
  background: var(--card); border-radius: 22px; padding: 20px 20px 18px;
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent); box-shadow: var(--shadow-card);
  animation: db-in 420ms var(--ease-out) both; }
.db-card:nth-child(2) { animation-delay: 40ms; } .db-card:nth-child(3) { animation-delay: 80ms; }
.db-card:nth-child(4) { animation-delay: 120ms; } .db-card:nth-child(n+5) { animation-delay: 160ms; }
@keyframes db-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .db-card { animation: none; } }

.db-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.db-name { font: 500 17px var(--sans); letter-spacing: -.01em; }
.db-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.db-icons { display: flex; gap: 6px; flex-shrink: 0; }
.db-ic { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  background: var(--card); color: var(--text); cursor: pointer; padding: 0; box-shadow: none; }
.db-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .db-ic:hover { border-color: var(--violet); color: var(--violet-ink); } }

/* Big light numbers, with the small part dimmed — like the reference's $6,010.29. */
.db-num { font: 300 42px/1 var(--sans); letter-spacing: -.035em; color: var(--text); }
.db-num small { font-size: .55em; color: var(--muted); letter-spacing: -.01em; margin-left: 2px; }
.db-num-sm { font: 400 30px/1 var(--sans); letter-spacing: -.03em; }
.db-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font: 600 11.5px var(--sans); background: var(--violet-soft); color: var(--violet-ink); }
.db-badge.up { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.db-badge.down { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.db-muted { color: var(--muted); font-size: 12.5px; }
.db-foot { margin-top: auto; padding-top: 14px; }
.db-link { color: var(--violet-ink); font-size: 13px; font-weight: 500; text-decoration: none;
  background: none; border: 0; padding: 0; cursor: pointer; box-shadow: none; }

/* ---------- plan (navy) ---------- */
.a-plan { background: radial-gradient(120% 70% at 100% 0%, rgba(142, 112, 214, .45), transparent 60%),
  linear-gradient(170deg, var(--navy-2), var(--navy)); color: var(--on-navy); border-color: var(--navy); }
.a-plan .db-sub, .a-plan .db-muted { color: var(--on-navy-muted); }
.a-plan .db-ic { background: rgba(255, 255, 255, .08); color: var(--on-navy); border-color: rgba(255, 255, 255, .16); }
.db-ring { position: relative; width: 150px; height: 150px; margin: 10px auto 6px; }
.db-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.db-ring .trk { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 12; }
.db-ring .val { fill: none; stroke: #B59DF0; stroke-width: 12; stroke-linecap: round; }
.db-ring .val2 { fill: none; stroke: #6CC3F0; stroke-width: 12; stroke-linecap: round; }
.db-ring div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.db-ring b { font: 300 40px/1 var(--sans); letter-spacing: -.03em; }
.db-ring span { font-size: 11.5px; color: var(--on-navy-muted); margin-top: 4px; }
.db-plan-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.db-plan-row { display: flex; justify-content: space-between; font-size: 13px; padding: 9px 12px;
  border-radius: 12px; background: rgba(255, 255, 255, .06); }
.db-plan-row b { font-weight: 600; }
.db-plan-row i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.db-plan-cta { margin-top: 14px; display: flex; gap: 8px; }
.db-plan-cta .db-pill { flex: 1; justify-content: center; }
.db-plan-cta .db-pill.light { background: #fff; color: var(--navy); border-color: #fff; }
.db-plan-cta .db-pill.line { background: transparent; color: var(--on-navy); border-color: rgba(255,255,255,.25); box-shadow: none; }
.db-plan-list { list-style: none; padding: 0; margin: 14px 0 0; font-size: 12.5px; color: var(--on-navy-muted); }
.db-plan-list li { padding: 3px 0 3px 18px; position: relative; }
.db-plan-list li::before { content: ''; position: absolute; left: 2px; top: 10px; width: 8px; height: 2px;
  border-radius: 2px; background: #B59DF0; }

/* ---------- bars ---------- */
.db-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 112px; margin-top: 34px; }
.db-bar { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.db-bar i { width: 100%; max-width: 30px; border-radius: 9px; min-height: 8px;
  background: color-mix(in srgb, var(--violet) 16%, var(--well)); }
.db-bar.on i { background: var(--violet); }
.db-bar em { margin-bottom: 6px; font: 600 11px var(--sans); font-style: normal; white-space: nowrap;
  background: var(--violet-soft); color: var(--violet-ink); padding: 2px 8px; border-radius: 999px; }
.db-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 6px;
  font-size: 11px; color: var(--muted); text-align: center; }

/* ---------- line chart ---------- */
.db-line { width: 100%; height: 110px; display: block; margin-top: 6px; }
.db-line .ln { fill: none; stroke: var(--violet); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.db-line .ar { fill: var(--violet-soft); }
.db-line .pt { fill: var(--card); stroke: var(--violet); stroke-width: 2; }
.db-line .gd { stroke: var(--line); stroke-dasharray: 3 4; }

/* ---------- streak (violet tint — the reference's mint card, in our colour) ---------- */
.a-streak { background: color-mix(in srgb, var(--violet) 13%, var(--card)); }
.db-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 12px; }
.db-dots span { aspect-ratio: 1; border-radius: 6px; background: color-mix(in srgb, var(--card) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--violet) 18%, transparent); }
.db-dots span.on { background: var(--violet); border-color: var(--violet); }
.db-dots span.today { outline: 2px solid var(--violet-ink); outline-offset: 1px; }

/* ---------- alerts ---------- */
.db-alert { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px;
  background: var(--well); margin-bottom: 8px; }
.db-alert:last-child { margin-bottom: 0; }
.db-av { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center;
  justify-content: center; font: 600 15px var(--sans); color: #fff; background: var(--violet); }
.db-alert-body { flex: 1; min-width: 0; }
.db-alert-body b { font-weight: 600; font-size: 14px; }
.db-alert-body p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-mult { font: 500 22px var(--sans); letter-spacing: -.02em; color: var(--green); }
.db-alert-acts { display: flex; gap: 6px; flex-shrink: 0; }
.db-alert-acts button { height: 32px; padding: 0 12px; font-size: 12px; }
@media (max-width: 640px) { .db-alert { flex-wrap: wrap; } .db-alert-acts { width: 100%; } }

/* ---------- donut ---------- */
.db-donut { position: relative; width: 140px; height: 140px; margin: 4px auto 8px; }
.db-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.db-donut .trk { fill: none; stroke: var(--well); stroke-width: 16; }
.db-donut .val { fill: none; stroke: var(--violet); stroke-width: 16; stroke-linecap: round; }
.db-donut div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.db-donut b { font: 300 34px/1 var(--sans); letter-spacing: -.03em; }
.db-donut span { font-size: 11px; color: var(--muted); margin-top: 3px; }
.db-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: auto; padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.db-stats div { text-align: center; }
.db-stats b { display: block; font: 500 20px var(--sans); }
.db-stats span { font-size: 11px; color: var(--muted); }

/* ---------- meters ---------- */
.db-meter { margin-bottom: 12px; }
.db-meter:last-child { margin-bottom: 0; }
.db-meter-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.db-meter-top b { font-weight: 600; }
.db-meter-bar { height: 10px; border-radius: 999px; background: var(--well); overflow: hidden; }
.db-meter-bar i { display: block; height: 100%; border-radius: 999px; background: var(--violet); }
.db-meter-bar i.full { background: var(--amber); }

/* ---------- best time ---------- */
.db-slot { padding: 14px; border-radius: 16px; background: var(--well); margin-bottom: 10px; }
.db-slot b { display: block; font: 500 20px var(--sans); letter-spacing: -.01em; }
.db-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.db-week div { text-align: center; font-size: 10.5px; color: var(--muted); }
.db-week i { display: block; height: 34px; border-radius: 8px; margin-bottom: 4px; background: var(--well); }

/* ---------- lists (sounds, ideas, recent) ---------- */
.db-list { display: flex; flex-direction: column; gap: 6px; }
.db-li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; font-size: 13px; min-width: 0; }
.db-li:nth-child(odd) { background: var(--well); }
.db-li .r { font: 600 12px var(--sans); color: var(--muted); width: 16px; flex-shrink: 0; }
.db-li .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-li .m { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }
.db-date { flex-shrink: 0; width: 40px; text-align: center; border-radius: 10px; background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); padding: 3px 0; line-height: 1.1; }
.db-date b { display: block; font: 600 15px var(--sans); }
.db-date span { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.db-score { flex-shrink: 0; min-width: 40px; text-align: center; padding: 3px 8px; border-radius: 999px;
  font: 600 12.5px var(--sans); background: var(--violet-soft); color: var(--violet-ink); }
.db-score.good { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.db-score.bad { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.db-recent .db-li { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .db-recent .db-li:hover { background: var(--violet-soft); } }

/* Locked / empty states inside a card. */
.db-empty { margin: auto 0; text-align: center; padding: 10px 4px; font-size: 13px; color: var(--muted); line-height: 1.55; }
.db-empty .db-pill { margin-top: 10px; height: 34px; font-size: 12.5px; }

/* Dark theme: the "dark" pill would vanish into the page, so it turns violet. */
[data-theme="dark"] .db-pill.dark { background: var(--violet); border-color: transparent; color: #fff; }
