:root {
  --bg: #faf6ef;
  --bg2: #f3ecdf;
  --card: #ffffff;
  --ink: #2f2a24;
  --muted: #7a7167;
  --line: #e6ddcd;
  --olive: #5b7a3a;
  --olive-dark: #42592a;
  --terra: #c4552d;
  --terra-soft: #f6e3d8;
  --sand: #efe6d4;
  --shadow: 0 2px 10px rgba(60, 45, 20, 0.06);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 500px at 100% -10%, #f6ead8 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── topbar ─────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(250, 246, 239, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-emoji { font-size: 1.7rem; }
.brand-text { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; display: flex; flex-direction: column; line-height: 1.05; }
.brand-text small { font-weight: 600; font-size: 0.7rem; color: var(--olive); text-transform: uppercase; letter-spacing: 0.12em; }
.topnav { display: flex; gap: 6px; }
.topnav a {
  text-decoration: none; color: var(--muted); font-size: 0.88rem; font-weight: 600;
  padding: 7px 13px; border-radius: 999px; transition: all 0.15s;
}
.topnav a:hover { background: var(--sand); color: var(--olive-dark); }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 26px 22px 60px; flex: 1; }

/* ── hero ───────────────────────────────────────────────── */
.hero { margin-bottom: 20px; }
.hero h1 { font-size: 2rem; letter-spacing: -0.03em; }
.hero-sub { color: var(--muted); margin-top: 4px; }

.stats-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 16px; display: flex; align-items: baseline; gap: 7px; box-shadow: var(--shadow);
}
.stat b { font-size: 1.25rem; color: var(--olive-dark); }
.stat span { color: var(--muted); font-size: 0.8rem; }

/* ── filters ────────────────────────────────────────────── */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 22px 0; box-shadow: var(--shadow);
}
.search { flex: 1 1 260px; min-width: 180px; }
.filters input[type="search"], .filters select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-size: 0.95rem; outline: none;
}
.filters select { flex: 0 1 190px; width: auto; }
.filters input:focus, .filters select:focus { border-color: var(--olive); box-shadow: 0 0 0 3px rgba(91,122,58,0.12); }
.check { display: flex; align-items: center; gap: 7px; font-size: 0.88rem; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
.check input { width: 17px; height: 17px; accent-color: var(--olive); }

.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none;
  font-weight: 700; font-size: 0.9rem; padding: 11px 18px; border-radius: 10px;
  transition: all 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--olive); color: #fff; }
.btn-primary:hover { background: var(--olive-dark); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg2); }
.btn-danger { background: var(--terra-soft); color: var(--terra); border: 1px solid #eecdbd; }
.btn-danger:hover { background: var(--terra); color: #fff; }

/* ── grid ───────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }

.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 17px 18px; box-shadow: var(--shadow);
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(60,45,20,0.10); border-color: #d8cbb4; }
.card-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 9px; }
.card-title { font-size: 1.06rem; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 5px; }
.card-desc { color: var(--muted); font-size: 0.85rem; }

.badge { font-size: 0.7rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; letter-spacing: 0.02em; }
.badge-comida { background: #e8f0dc; color: var(--olive-dark); }
.badge-cena { background: #ece4f5; color: #5b3f86; }
.badge-taper { background: var(--terra-soft); color: var(--terra); }
.time { margin-left: auto; font-size: 0.78rem; color: var(--muted); font-weight: 600; }

/* ── flash ──────────────────────────────────────────────── */
.flash {
  padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 0.9rem; font-weight: 600;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
}
.flash.ok { background: #eaf3e2; border-color: #cfe3bd; color: var(--olive-dark); }
.flash.error { background: #fbeae4; border-color: #f0cfc2; color: var(--terra); }

/* ── detail ─────────────────────────────────────────────── */
.back { display: inline-block; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.88rem; margin-bottom: 14px; }
.back:hover { color: var(--olive-dark); }

.recipe { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.recipe-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.recipe h1 { font-size: 1.7rem; letter-spacing: -0.03em; line-height: 1.2; }
.recipe-desc { color: var(--muted); margin-top: 6px; font-size: 1rem; }

.note { margin: 18px 0; padding: 12px 16px; border-radius: 12px; font-size: 0.88rem; line-height: 1.45; }
.note-taper { background: var(--terra-soft); color: #8a3d20; }
.note-fresh { background: var(--bg2); color: var(--muted); }

.cols { display: grid; grid-template-columns: 1fr 1.35fr; gap: 28px; margin-top: 10px; }
.block h2 { font-size: 1.05rem; margin-bottom: 12px; color: var(--olive-dark); letter-spacing: -0.01em; }
.block h2 small { color: var(--muted); font-weight: 500; font-size: 0.78rem; }

.ingredients { list-style: none; }
.ingredients li {
  padding: 8px 0 8px 22px; border-bottom: 1px dashed var(--line); font-size: 0.92rem; position: relative;
}
.ingredients li::before { content: "•"; color: var(--olive); font-weight: 900; position: absolute; left: 6px; }
.ingredients li:last-child { border-bottom: none; }

.steps { padding-left: 22px; }
.steps li { padding: 7px 0; font-size: 0.93rem; }
.steps li::marker { color: var(--olive); font-weight: 800; }

.delete-form { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); text-align: right; }

/* ── empty / 404 ────────────────────────────────────────── */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h1 { font-size: 3rem; color: var(--line); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ── footer ─────────────────────────────────────────────── */
.foot { text-align: center; color: var(--muted); font-size: 0.78rem; padding: 22px; border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  .cols { grid-template-columns: 1fr; gap: 20px; }
  .hero h1 { font-size: 1.65rem; }
  .recipe { padding: 18px; }
  .recipe h1 { font-size: 1.4rem; }
  .topnav a { padding: 6px 9px; font-size: 0.8rem; }
}
