:root {
  --bg: #121311;
  --panel: #1a1b18;
  --panel-2: #22241f;
  --line: #2e302a;
  --fg: #f2f2ec;
  --muted: #9a9c93;
  --faint: #6e7068;
  --accent: #c8f031;
  --accent-ink: #121311;
  --ok: #8fd14f;
  --bad: #ff6b5a;
  --protein: #c8f031;
  --fat: #f2b84b;
  --carbs: #7cc6ff;
  --radius: 14px;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --sans: Inter, system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-family: var(--display); font-size: 40px; letter-spacing: 0.02em; line-height: 1.1; }
h2 { font-size: 18px; }
.num { font-variant-numeric: tabular-nums; }

/* Düzen */
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 20px 64px; display: flex; flex-direction: column; gap: 32px; }
.topbar { border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 0.18em; color: var(--accent); }
.topbar nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }

/* Kartlar */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2 { margin-bottom: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-family: var(--display); font-weight: 600; font-size: 40px; line-height: 1.05; }
.kpi-value small { font-size: 18px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.kpi-sub { font-size: 13px; color: var(--muted); }
.good { color: var(--ok); }
.bad { color: var(--bad); }
.accent { color: var(--accent); }

/* İlerleme */
.bar { height: 10px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bar.time > i { background: var(--faint); }

/* Bölümler */
.section h2 { margin-bottom: 4px; }
.section .lead { margin: 0 0 14px; color: var(--muted); }
.section .lead b { color: var(--fg); font-weight: 600; }
.chart { position: relative; width: 100%; height: 260px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.tip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.tip .t { color: var(--muted); }
.tip div:first-child { font-weight: 600; margin-bottom: 2px; }

/* Fotoğraflar */
.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.photo { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.photo-box { aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; color: var(--faint); font-size: 14px; background: var(--panel-2); }
.photo-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-box.filled { padding: 0; }
.photo-cap { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; font-size: 13px; color: var(--muted); }
.photo-cap b { color: var(--fg); font-weight: 600; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.thumb { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); }
.thumb img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.thumb .cap { padding: 6px 8px; font-size: 12px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }

/* Tablolar */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
tr.link-row:hover td { background: var(--panel-2); }

/* Formlar */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input, textarea, select {
  font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 140px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 10px; padding: 10px 18px; min-height: 44px;
  background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--line); }
.msg { font-size: 14px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); }
.msg.error { color: var(--bad); }
.msg.ok { color: var(--ok); }
.msg ul { margin: 6px 0 0; padding-left: 18px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg); font-size: 14px; }
.tabs a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.tabs a:hover { text-decoration: none; }

/* Giriş */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }

/* Görsel önizleme */
.visual-stage { width: 100%; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: #0b0c0a; }
.visual-scale { transform-origin: top left; }

@media (max-width: 560px) {
  h1 { font-size: 32px; }
  .kpi-value { font-size: 32px; }
  .photos { gap: 10px; }
}
