/* ============================================================
   MaaşAnaliz Dashboard — v1.0
   Dashboard widgets, charts, data displays, calculators
   ============================================================ */

/* ---------- 1. DASHBOARD GRID ---------- */
.dashboard-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
      "stats     quick"
      "chart     quick"
      "recent    recent";
  }
}
.dash-area-stats { grid-area: stats; }
.dash-area-chart { grid-area: chart; }
.dash-area-quick { grid-area: quick; }
.dash-area-recent { grid-area: recent; }

/* ---------- 2. WIDGET ---------- */
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  overflow: hidden;
}
.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 768px) {
  .widget-header { padding: 16px 20px; }
}
.widget-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.widget-action {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  transition: opacity var(--t-fast);
}
.widget-action:hover { opacity: 0.8; }
.widget-body { padding: 14px; }
@media (min-width: 768px) {
  .widget-body { padding: 20px; }
}

/* ---------- 3. QUICK ACTIONS ---------- */
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text);
  transition: background var(--t-fast);
  border: 1px solid transparent;
}
.quick-action:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}
.quick-action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quick-action-icon.primary { background: var(--primary-soft); color: var(--primary); }
.quick-action-icon.success { background: var(--success-soft); color: var(--success-foreground); }
.quick-action-icon.warning { background: var(--warning-soft); color: var(--warning-foreground); }
.quick-action-icon.info { background: var(--info-soft); color: var(--info-foreground); }
.quick-action-text { flex: 1; min-width: 0; }
.quick-action-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.quick-action-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ---------- 4. CHART CONTAINER ---------- */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 240px;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}

/* ---------- 5. RECENT LIST ---------- */
.recent-list { display: flex; flex-direction: column; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--t-fast);
}
@media (min-width: 768px) {
  .recent-item { padding: 12px 20px; gap: 12px; }
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: var(--surface-hover); }
.recent-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.recent-item-content { flex: 1; min-width: 0; }
.recent-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-item-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.recent-item-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- 6. CALCULATOR FORM ---------- */
.calc-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.calc-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .calc-row { grid-template-columns: 1fr 1fr; } }
.calc-result {
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft-hover);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-top: 8px;
}
.calc-result-label {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 6px;
}
.calc-result-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.calc-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.calc-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.calc-breakdown-row:last-child { border-bottom: none; }
.calc-breakdown-label { color: var(--text-secondary); }
.calc-breakdown-value {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.calc-breakdown-value.negative { color: var(--danger); }
.calc-breakdown-value.positive { color: var(--success); }

/* ---------- 7. PROGRESS BAR ---------- */
.progress {
  width: 100%;
  height: 8px;
  background: var(--bg-alt);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: var(--r-full);
  transition: width var(--t-smooth);
}
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

/* ---------- 8. INFO ROW ---------- */
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.info-row:last-child { border-bottom: none; }
.info-row-label {
  font-size: 14px;
  color: var(--text-secondary);
}
.info-row-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---------- 9. EMPTY STATE ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}
.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}
.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-state-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.5;
}

/* ---------- 10. ALERT / CALLOUT ---------- */
.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  line-height: 1.5;
}
.callout-info {
  background: var(--info-soft);
  color: var(--info-foreground);
  border: 1px solid rgba(14, 165, 233, 0.2);
}
.callout-warning {
  background: var(--warning-soft);
  color: var(--warning-foreground);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.callout-success {
  background: var(--success-soft);
  color: var(--success-foreground);
  border: 1px solid rgba(22, 163, 74, 0.2);
}
.callout-danger {
  background: var(--danger-soft);
  color: var(--danger-foreground);
  border: 1px solid rgba(220, 38, 38, 0.2);
}
.callout-icon { flex-shrink: 0; width: 20px; height: 20px; }
