:root {
  --bg: #0b1220;
  --bg-soft: #111827;
  --card: rgba(17,24,39,0.92);
  --text: #e5eef8;
  --muted: #9db0c8;
  --line: rgba(148,163,184,0.16);
  --accent: #60a5fa;
  --accent-2: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --radius: 18px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(96,165,250,.12), transparent 30%),
    radial-gradient(circle at left bottom, rgba(52,211,153,.08), transparent 35%),
    var(--bg);
  color: var(--text);
}
.container { width: min(1280px, calc(100% - 32px)); margin: 0 auto; }
.header { padding: 28px 0 18px; position: sticky; top: 0; z-index: 5; backdrop-filter: blur(10px); background: rgba(11,18,32,.86); border-bottom: 1px solid var(--line); }
.header h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.header p { color: var(--muted); margin: 10px 0 0; max-width: 980px; }
.grid { display: grid; gap: 18px; padding: 24px 0 36px; align-items: start; }
@media (min-width: 980px) { .grid { grid-template-columns: 380px 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: 0 18px 45px rgba(0,0,0,.22); }
.card h2, .card h3 { margin: 0 0 12px; }
.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.row-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
input, select, textarea, button {
  width: 100%; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text);
  padding: 11px 12px; font: inherit;
}
textarea { min-height: 84px; resize: vertical; }
button { cursor: pointer; font-weight: 600; }
button.primary { background: linear-gradient(135deg, var(--accent), #3b82f6); border: 0; }
button.secondary { background: rgba(255,255,255,.04); }
button.good { background: linear-gradient(135deg, var(--accent-2), #10b981); border: 0; }
.stack { display: grid; gap: 12px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.badge { border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 999px; padding: 6px 10px; font-size: .82rem; color: var(--muted); }
.food-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.food-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: rgba(255,255,255,.025); }
.food-item.selected { border-color: rgba(96,165,250,.6); box-shadow: inset 0 0 0 1px rgba(96,165,250,.35); }
.food-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.small { font-size: .85rem; color: var(--muted); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: rgba(255,255,255,.02); }
.kpi strong { display: block; font-size: 1.2rem; margin-top: 6px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.notice { border-left: 3px solid var(--accent-2); background: rgba(52,211,153,.08); padding: 12px; border-radius: 10px; }
.warn { border-left-color: var(--warning); background: rgba(251,191,36,.08); }
.error { border-left-color: var(--danger); background: rgba(248,113,113,.08); }
.spacer { height: 6px; }
.hidden { display: none; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab-btn.active { background: rgba(96,165,250,.16); border-color: rgba(96,165,250,.4); }
.footer-note { color: var(--muted); font-size: .88rem; margin-top: 10px; }
.training-toggle.active { background: rgba(96,165,250,.16); border-color: rgba(96,165,250,.45); }

.day-presets { display: grid; gap: 8px; }
.day-preset-btn {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(251,191,36,.08);
  text-align: left;
}
.day-preset-btn.active {
  background: rgba(251,191,36,.16);
  border-color: rgba(251,191,36,.55);
  box-shadow: inset 0 0 0 1px rgba(251,191,36,.25);
}
.day-preset-name { font-weight: 700; }
.day-total-label {
  border: 1px dashed rgba(148,163,184,.35);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  color: var(--muted);
  padding: 10px 12px;
  font-size: .88rem;
}
