/* Customer dashboard: summary, quick actions, card visuals, charts. */

.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }

.dash-top {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* ---------- summary ---------- */

.summary-rich {
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, #123a8f 0%, #0f2a6b 55%, #0b1b33 100%);
}
.summary-rich::after {
  content: "";
  position: absolute;
  right: -3rem;
  top: -4rem;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, .38), transparent 68%);
  pointer-events: none;
}
.summary-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.summary-rich .summary-totals,
.summary-rich .summary-meta { position: relative; z-index: 1; }

.trend {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  font-weight: 650;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  white-space: nowrap;
}
.trend svg { width: 14px; height: 14px; }
.trend.is-up { color: #6ee7b7; }
.trend.is-down { color: #fca5a5; }

/* ---------- quick actions ---------- */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  align-content: start;
}
.quick-action {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .25s ease, transform .25s var(--ease-out, ease);
}
.quick-action:hover { transform: translateY(-2px); border-color: #93b4f5; box-shadow: var(--shadow-md); }
.quick-action.is-locked { opacity: .55; cursor: not-allowed; }
.quick-action.is-locked:hover { transform: none; border-color: var(--line); box-shadow: var(--shadow-sm); }
.quick-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
}
.quick-icon svg { width: 19px; height: 19px; }
.quick-label { font-size: .92rem; font-weight: 600; }
.quick-lock {
  position: absolute;
  top: .85rem;
  right: .85rem;
  width: 15px;
  height: 15px;
  color: var(--ink-subtle);
  fill: none;
}

/* ---------- account cards ---------- */

.account-card { position: relative; overflow: hidden; }
.account-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
}
.account-chip {
  width: 30px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f6c453, #d9a021);
  position: relative;
}
.account-chip::after {
  content: "";
  position: absolute;
  inset: 5px 7px;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 1px;
}
.account-currency {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--ink-subtle);
}
.acct-credit .account-chip { background: linear-gradient(135deg, #c4b5fd, #8b5cf6); }
.acct-savings .account-chip { background: linear-gradient(135deg, #93c5fd, #3b82f6); }

.account-card-new .account-foot { display: none; }

/* ---------- charts ---------- */

.chart-card { margin-bottom: 1.5rem; }
.chart-card .section-head { margin-bottom: 1rem; }
.chart {
  display: block;
  width: 100%;
  height: 190px;
  overflow: visible;
}
.chart-line {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: drawLine 1.6s cubic-bezier(.22, .9, .3, 1) .2s forwards;
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.chart-area { opacity: 0; animation: fadeIn .8s ease 1s forwards; }
.chart-dot { opacity: 0; animation: fadeIn .4s ease 1.6s forwards; }

.chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--ink-subtle);
  margin-top: .4rem;
}

.donut-wrap { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.donut { width: 160px; height: 160px; }
.donut-slice {
  transform-origin: 70px 70px;
  animation: donutIn .7s cubic-bezier(.22, .9, .3, 1) both;
  animation-delay: calc(.15s + var(--slice) * .08s);
}
@keyframes donutIn { from { opacity: 0; } to { opacity: 1; } }
.donut-total {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  fill: var(--ink);
}
.donut-caption {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 10px;
  fill: #94a3b8;
}

.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.legend li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: .6rem;
  font-size: .89rem;
}
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-label { text-transform: capitalize; color: var(--ink-muted); }
.legend-pct { color: var(--ink-subtle); font-size: .82rem; font-variant-numeric: tabular-nums; }
.legend-value { font-weight: 620; font-variant-numeric: tabular-nums; }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .dash-top { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-head { gap: .5rem; }
  .chart { height: 150px; }
  .donut { width: 138px; height: 138px; }
  .legend li { grid-template-columns: auto 1fr auto; }
  .legend-pct { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .chart-line { animation: none; stroke-dashoffset: 0; }
  .chart-area, .chart-dot { animation: none; opacity: 1; }
  .donut-slice { animation: none; }
  .quick-action:hover { transform: none; }
}
