/* === Dashboard styles === */

#dashboardView {
  min-height: 100vh;
  background: #F1F5F9;
  padding: 80px 0 40px;
}

.dash {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.dash__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.dash__title {
  font-size: 28px;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
}
.dash__meta {
  font-size: 14px;
  color: #64748B;
  margin: 4px 0 0;
}

/* KPI cards */
.dash__kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.dash-kpi {
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-left: 4px solid transparent;
}
.dash-kpi--green  { border-left-color: #10B981; }
.dash-kpi--red    { border-left-color: #EF4444; }
.dash-kpi--blue   { border-left-color: #2563EB; }
.dash-kpi--orange { border-left-color: #F59E0B; }
.dash-kpi--gray   { border-left-color: #94A3B8; }

.dash-kpi__label {
  display: block;
  font-size: 13px;
  color: #64748B;
  margin-bottom: 4px;
  font-weight: 500;
}
.dash-kpi__value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: #0F172A;
}

/* Grid layout */
.dash__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.dash__grid--full {
  grid-template-columns: 1fr;
}

/* Income/expense chart legend */
.dash-chart-legend {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}
.dash-chart-legend__item {
  font-size: 13px;
  color: #64748B;
  padding-left: 18px;
  position: relative;
}
.dash-chart-legend__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 3px;
  border-radius: 2px;
}
.dash-chart-legend__item--green::before { background: #10B981; }
.dash-chart-legend__item--red::before {
  background: repeating-linear-gradient(90deg, #EF4444 0 6px, transparent 6px 10px);
}

/* Card */
.dash__card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dash__card-title {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 20px;
}

/* Bar chart */
.dash-bar {
  display: grid;
  grid-template-columns: 140px 1fr 100px 45px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.dash-bar__label {
  font-size: 13px;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-bar__track {
  height: 22px;
  background: #F1F5F9;
  border-radius: 6px;
  overflow: hidden;
}
.dash-bar__fill {
  height: 100%;
  border-radius: 6px;
  width: 0;
  transition: width 0.8s ease-out;
}
.dash-bar__val {
  font-size: 13px;
  font-weight: 600;
  color: #0F172A;
  text-align: right;
}
.dash-bar__pct {
  font-size: 12px;
  color: #64748B;
  text-align: right;
}

/* SVG chart */
.dash-chart-svg {
  width: 100%;
  height: auto;
}

/* Top table */
.dash-top {
  width: 100%;
  border-collapse: collapse;
}
.dash-top tr {
  border-bottom: 1px solid #F1F5F9;
}
.dash-top tr:last-child {
  border-bottom: none;
}
.dash-top td {
  padding: 10px 4px;
  font-size: 14px;
}
.dash-top__num {
  width: 30px;
  color: #94A3B8;
  font-weight: 600;
}
.dash-top__name {
  color: #334155;
  word-break: break-word;
}
.dash-top__sum {
  text-align: right;
  font-weight: 600;
  color: #0F172A;
  white-space: nowrap;
}

/* Actions */
.dash__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
}
.dash__upload-btn {
  cursor: pointer;
}

/* Upload zone states */
.upload-zone--dragover {
  border-color: #2563EB !important;
  background: rgba(37, 99, 235, 0.08) !important;
  transform: scale(1.02);
}

/* === Responsive === */
@media (max-width: 768px) {
  #dashboardView { padding-top: 70px; }

  .dash__kpis {
    grid-template-columns: 1fr 1fr;
  }
  .dash__grid {
    grid-template-columns: 1fr;
  }
  .dash-bar {
    grid-template-columns: 100px 1fr 80px 40px;
  }
  .dash-bar__label { font-size: 12px; }
  .dash-kpi__value { font-size: 18px; }
  .dash__title { font-size: 22px; }
}

@media (max-width: 480px) {
  .dash__kpis {
    grid-template-columns: 1fr;
  }
  .dash-bar {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .dash-bar__label { margin-bottom: 2px; }
  .dash-bar__val,
  .dash-bar__pct {
    display: inline;
    margin-right: 8px;
  }
}
