:root {
  --bg: #fff8f0;
  --surface: #ffffff;
  --ink: #2a2522;
  --muted: #6b6259;
  --line: #ecdfd1;
  --primary: #c25d3a;
  --primary-ink: #fff;
  --primary-soft: #fbe7dd;
  --accent: #4d7c5a;
  --accent-soft: #e2efdf;
  --warn: #b9542b;
  --danger: #9a2929;
  --kott: #c25d3a;
  --fisk: #3a7ba6;
  --vegetarisk: #4d7c5a;
  --snabbt: #b58a1f;
  --annat: #6b6259;
  --shadow: 0 1px 2px rgba(60, 30, 0, 0.04), 0 6px 18px rgba(60, 30, 0, 0.06);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }
.content { padding: 1.75rem 1.25rem 4rem; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.85rem; padding-bottom: 0.85rem; gap: 1rem; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--ink); }
.brand-mark { font-size: 1.4rem; }
.brand-text { font-weight: 700; letter-spacing: 0.2px; }
.primary-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.primary-nav a {
  text-decoration: none; color: var(--muted); padding: 0.5rem 0.85rem;
  border-radius: 999px; font-weight: 500;
}
.primary-nav a:hover { color: var(--ink); background: var(--primary-soft); }
.primary-nav a.active { background: var(--primary); color: var(--primary-ink); }

h1 { font-size: 1.85rem; margin: 0 0 0.25rem; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; margin: 1.5rem 0 0.75rem; }
.lede { color: var(--muted); margin: 0 0 1.5rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card-stat .num { font-size: 2.2rem; font-weight: 700; line-height: 1; color: var(--primary); }
.card-stat .lbl { color: var(--muted); margin-top: 0.35rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--primary); color: var(--primary-ink);
  border: 0; padding: 0.6rem 1rem; border-radius: 999px;
  font-weight: 600; text-decoration: none; cursor: pointer; font-size: 0.95rem;
}
.btn:hover { filter: brightness(0.95); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--primary-soft); }
.btn-accent { background: var(--accent); }
.btn-danger { background: var(--danger); }
.btn-link { background: none; color: var(--primary); padding: 0.25rem 0.4rem; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.flash { padding: 0.7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid var(--line); background: var(--surface); }
.flash-success { background: var(--accent-soft); border-color: #c8dfc4; }
.flash-error { background: #f8e1de; border-color: #e6c1bb; }
.flash-info { background: var(--primary-soft); border-color: #f0d3c4; }

.badge {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  background: #eee; color: #333; font-size: 0.78rem; font-weight: 600;
}
.badge-kott { background: #f7d8cc; color: #6c2a14; }
.badge-fisk { background: #d4e6f2; color: #1f4a6b; }
.badge-vegetarisk { background: #d8e8d4; color: #2c5232; }
.badge-snabbt { background: #f3e3b8; color: #6b4f0a; }
.badge-annat { background: #e7e2dc; color: #4a443e; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #fbf1e6; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }

label { display: block; font-weight: 600; margin: 0.85rem 0 0.3rem; }
input[type=text], input[type=number], select, textarea {
  width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); font: inherit; color: inherit;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.form-grid { display: grid; gap: 0.5rem 1rem; grid-template-columns: 2fr 1fr 1fr 1.5fr auto; align-items: end; }
.form-grid .col-full { grid-column: 1 / -1; }
.ingredient-row { display: grid; gap: 0.5rem; grid-template-columns: 2fr 0.8fr 0.8fr 1.4fr auto; align-items: center; margin-bottom: 0.5rem; }
.ingredient-head { display: grid; gap: 0.5rem; grid-template-columns: 2fr 0.8fr 0.8fr 1.4fr auto; font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.5rem; }
.ingredient-head span { padding: 0 0.25rem; }
@media (max-width: 720px) {
  .ingredient-head { display: none; }
  .ingredient-row { grid-template-columns: 1fr 1fr; }
}

.week-grid { display: grid; gap: 0.85rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.day-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.day-card h3 { margin: 0 0 0.4rem; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.day-dish { font-size: 1.1rem; font-weight: 600; margin: 0.25rem 0 0.6rem; }
.day-empty { color: var(--muted); font-style: italic; margin: 0.25rem 0 0.6rem; }
.day-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.day-actions select { padding: 0.35rem 0.5rem; font-size: 0.88rem; }

.shop-section { margin-top: 1.5rem; }
.shop-section h2 { margin-bottom: 0.5rem; }
.shop-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.shop-list li { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); }
.shop-list li:last-child { border-bottom: 0; }
.shop-list li.checked .name { text-decoration: line-through; color: var(--muted); }
.shop-list .name { flex: 1; }
.shop-list .qty { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 80px; text-align: right; }
.shop-list input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); cursor: pointer; }
.shop-row { display: flex; align-items: center; gap: 0.75rem; width: 100%; cursor: pointer; }
.shop-row .name { flex: 1; }
.shop-row .qty { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 80px; text-align: right; }
.shop-list li.checked .shop-row .name { text-decoration: line-through; color: var(--muted); }

.plan-list { list-style: none; padding: 0; margin: 0; }
.plan-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.7rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 0.4rem; box-shadow: var(--shadow); }
.plan-list li.active { border-color: var(--accent); }
.plan-list li a:first-child { flex: 1; text-decoration: none; color: inherit; display: flex; gap: 0.6rem; align-items: baseline; }
.plan-list .small { font-size: 0.85rem; }

.empty-state { text-align: center; padding: 2.5rem 1rem; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty-state p { margin: 0 0 1rem; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

.site-footer { color: var(--muted); padding: 1.5rem 0; text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.inline-form { display: inline; }
