/* ==========================================================================
   FINKU GEN-Z — DASHBOARD HOME OVERVIEW STYLES (dashboard.css)
   ========================================================================== */

/* ── Ghost Spending card ─────────────────────────────────────────────────── */
.dashboard-ghost-card {
  margin-bottom: 20px;
  padding: 16px 18px;
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-card) 70%);
}

.dashboard-ghost-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-ghost-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dashboard-ghost-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.dashboard-ghost-btn {
  border-color: #f59e0b;
  color: #b45309;
}

.dashboard-ghost-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.dashboard-ghost-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.dashboard-ghost-item-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.dashboard-ghost-item-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.dashboard-ghost-item-amount {
  font-size: 14px;
  font-weight: 700;
  color: #b45309;
}

/* ── KPI card note / sub-text ────────────────────────────────────────────── */
.dashboard-kpi-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.dashboard-kpi-note.warning {
  color: var(--accent-red);
  font-weight: 700;
}

.dashboard-kpi-progress {
  margin-top: 6px;
}

/* ── Section wrappers (Daftar Kantong / Aset Terkunci) ──────────────────── */
.dashboard-section {
  margin-bottom: 24px;
}

.dashboard-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dashboard-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.dashboard-wallet-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.dashboard-empty-msg {
  font-size: 12px;
  color: var(--text-muted);
}

.dashboard-wallet-card {
  min-width: 160px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.dashboard-wallet-card-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  /* background-color set inline per wallet (custom user color) */
}

.dashboard-wallet-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-wallet-balance {
  font-size: 15px;
  color: var(--text-primary);
}

.dashboard-wallet-balance.negative {
  color: var(--accent-red);
}

.dashboard-locked-wallet-card {
  min-width: 160px;
  background: rgba(255, 193, 7, 0.05);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 12px;
  padding: 14px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.dashboard-locked-wallet-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #ffc107;
}

.dashboard-locked-wallet-balance {
  font-size: 15px;
  color: #ffc107;
}

/* ── Summary strip (Pemasukan | Pengeluaran | Sisa) ─────────────────────── */
.dashboard-summary-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 24px;
}

.dashboard-summary-cell {
  padding: 14px 20px;
  border-right: 1px solid var(--border-color);
}

.dashboard-summary-cell:last-child {
  border-right: none;
}

.dashboard-summary-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.dashboard-summary-value {
  font-size: 16px;
}

.dashboard-summary-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Main chart & alert split ────────────────────────────────────────────── */
.dashboard-chart-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-chart-header {
  margin-bottom: 0;
}

.dashboard-chart-wrapper-lg {
  height: 240px;
}

.dashboard-category-row {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
}

.dashboard-category-title {
  font-size: 14px;
  margin-bottom: 4px;
}

.dashboard-category-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.dashboard-category-chart-wrapper {
  height: 140px;
}

.dashboard-alert-card {
  display: flex;
  flex-direction: column;
}

.dashboard-alert-btn {
  margin-top: 20px;
  width: 100%;
}

.dashboard-alert-empty {
  text-align: center;
  padding: 28px;
  color: var(--text-secondary);
}

.dashboard-alert-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.dashboard-alert-empty-title {
  font-weight: 600;
}

.dashboard-alert-empty-desc {
  font-size: 12px;
  margin-top: 4px;
}

.dashboard-alert-item-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.dashboard-alert-item-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Fin AI Assistant Widget ─────────────────────────────────────────────── */
.dashboard-ai-widget {
  margin-top: 8px;
  border: 1px solid color-mix(in srgb, var(--accent-ai-purple) 30%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-ai-purple) 5%, transparent) 0%, var(--bg-card) 100%);
}

.dashboard-ai-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dashboard-ai-widget-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-ai-widget-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.dashboard-ai-widget-title {
  font-size: 16px;
  font-weight: 700;
}

.dashboard-ai-widget-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.dashboard-ai-widget-refresh-btn {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.dashboard-ai-widget-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  min-height: 60px;
}

.dashboard-ai-skeleton-line {
  height: 14px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.dashboard-ai-skeleton-line.w-85 {
  width: 85%;
}

.dashboard-ai-skeleton-line.w-65 {
  width: 65%;
  margin-bottom: 0;
}

.dashboard-ai-loading-text {
  color: var(--text-muted);
  font-size: 13px;
}

.dashboard-ai-error-box {
  padding: 12px 14px;
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.25);
  border-radius: 8px;
}

.dashboard-ai-error-title {
  font-size: 12px;
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 4px;
}

.dashboard-ai-error-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.dashboard-ai-error-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

.dashboard-ai-result-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* KPI Card accent glows — restrained gallery wash, not neon circus */
.kpi-card-networth  { --stat-glow: rgba(0, 229, 160, 0.07); }
.kpi-card-burnrate  { --stat-glow: rgba(255, 181, 71, 0.07); }
.kpi-card-bnpl      { --stat-glow: rgba(255, 71, 87, 0.07); }
.kpi-card-guiltfree { --stat-glow: rgba(236, 72, 153, 0.07); }

/* KPI stat value sizing */
.kpi-card-networth .stat-value,
.kpi-card-burnrate .stat-value,
.kpi-card-bnpl .stat-value,
.kpi-card-guiltfree .stat-value {
  font-size: 22px;
  font-family: var(--font-mono);
}

/* Empty state widget */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 10px;
  color: var(--text-secondary);
}
.empty-state .empty-icon {
  font-size: 42px;
  margin-bottom: 6px;
}
.empty-state .empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Activity heatmap (7-day bar chart area) */
.heatmap-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 16px;
}
.heatmap-cell {
  height: 36px;
  border-radius: 6px;
  background-color: var(--bg-tertiary);
  transition: all var(--transition-fast);
  cursor: default;
  position: relative;
}
.heatmap-cell:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}
/* Touch device support for heatmap tooltip */
@media (hover: none) {
  .heatmap-cell:active::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
  }
}
.heatmap-cell.level-0 { background: var(--bg-tertiary); }
.heatmap-cell.level-1 { background: rgba(0, 229, 160, 0.2); }
.heatmap-cell.level-2 { background: rgba(255, 181, 71, 0.35); }
.heatmap-cell.level-3 { background: rgba(255, 71, 87, 0.45); }
.heatmap-cell.level-4 { background: var(--accent-red); }

/* Day labels for heatmap */
.heatmap-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.heatmap-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
}

@media (max-width: 768px) {
  .kpi-card-networth .stat-value,
  .kpi-card-burnrate .stat-value,
  .kpi-card-bnpl .stat-value,
  .kpi-card-guiltfree .stat-value {
    font-size: 18px;
    overflow-wrap: anywhere;
  }
  .empty-state {
    padding: 32px 16px;
  }
  .heatmap-strip {
    gap: 4px;
  }
  .heatmap-cell {
    height: 32px;
  }
}
