/* PlateSwap Dashboard — clean, data-forward */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #f9fafb;
  color: #111827;
  min-height: 100vh;
}

.header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
}
.header-badge {
  background: #dcfce7;
  color: #16a34a;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
}

.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Summary row */
.summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.summary-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.card-value {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}
.card-sub {
  font-size: 12px;
  color: #9ca3af;
}

/* Charts row */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.chart-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.chart-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}
.chart-sub {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 16px;
}
.chart-wrap {
  height: 240px;
  position: relative;
}

/* Table section */
.table-section {}
.table-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.table-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}
.table-header { margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
thead th.num { text-align: right; }
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafafa; }

.num { text-align: right; }

.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.meal-name { font-weight: 500; color: #111827; }
.meal-cal { font-size: 12px; color: #9ca3af; }
.meal-cal.swap { color: #16a34a; font-weight: 600; }

.loading {
  text-align: center;
  color: #9ca3af;
  padding: 32px;
}

/* Responsive */
@media (max-width: 900px) {
  .summary-row { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .summary-row { grid-template-columns: 1fr 1fr; }
}