:root {
  color-scheme: light;
  font-family: 'Inter', system-ui, sans-serif;
  background: #eef3f8;
  color: #111827;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
}

button {
  font: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: rgba(255,255,255,0.82);
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(16px);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #e0f2fe;
  font-size: 1.5rem;
}

.brand-label {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.nav-links {
  display: grid;
  gap: 14px;
}

.nav-link {
  display: block;
  padding: 16px 18px;
  border-radius: 16px;
  color: #475569;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #64748b;
}

.main-content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: #2563eb;
}

.topbar h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pill {
  padding: 10px 16px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0f172a;
  font-weight: 600;
}

.primary-btn {
  padding: 14px 20px;
  border: none;
  border-radius: 16px;
  background: #2563eb;
  color: white;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 18px 50px rgba(37, 99, 235, 0.12);
}

.grid {
  display: grid;
  gap: 24px;
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meal-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 16px 50px rgba(15, 23, 42, 0.08);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #475569;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 10px 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #2563eb;
  font-weight: 700;
  font-size: 0.8rem;
}

.goal-card h3,
.chart-meta strong,
.exercise-card strong,
.meal-header h3 {
  margin: 0;
  font-size: 2rem;
}

.goal-bar {
  border-radius: 16px;
  height: 14px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 12px;
}

.goal-progress {
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.card-copy {
  margin: 0;
  color: #64748b;
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.summary-item {
  padding: 16px;
  background: #f8fafc;
  border-radius: 20px;
}

.summary-item p {
  margin: 0 0 8px;
  color: #64748b;
}

.summary-item strong {
  font-size: 1.1rem;
}

.water-meter {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: #eff6ff;
  border-radius: 28px;
  padding: 18px;
}

.recommended-card {
  padding: 30px;
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.food-card {
  padding: 20px;
  background: #f8fafc;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.food-card h4,
.category-card h5 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.food-card p {
  margin: 0;
  color: #475569;
  line-height: 1.7;
}

.wide-card {
  grid-column: span 2;
  background: #dbeafe;
}

.food-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.category-card {
  padding: 20px;
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.category-card p {
  margin: 0;
  color: #475569;
  line-height: 1.75;
}

.avoid-card {
  background: #fef2f2;
  border-color: rgba(239, 68, 68, 0.14);
}

.water-fill {
  width: 70px;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, #3b82f6 0%, #93c5fd 100%);
  box-shadow: inset 0 4px 12px rgba(59,130,246,0.35);
}

.chart-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sparkline {
  width: 100%;
  height: 160px;
}

.chart-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-meta p {
  margin: 0;
  color: #64748b;
}

.exercise-card {
  grid-column: span 2;
}

.exercise-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.exercise-grid div {
  padding: 20px;
  background: #f8fafc;
  border-radius: 22px;
  text-align: center;
}

.exercise-grid p {
  margin: 10px 0 0;
  color: #64748b;
}

.meal-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.meal-card li {
  padding: 12px 14px;
  border-radius: 16px;
  background: #f8fafc;
  color: #334155;
}

.meal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.snack-card {
  background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
}

@media (max-width: 1200px) {
  .dashboard-grid,
  .meal-grid,
  .food-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .food-categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wide-card {
    grid-column: span 1;
  }

  .exercise-card {
    grid-column: unset;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 24px 20px;
  }

  .main-content {
    padding: 24px 20px;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions {
    justify-content: stretch;
  }

  .primary-btn {
    width: 100%;
  }

  .card {
    padding: 22px;
  }
}
