/* Gather & Graze — teacup theme: raspberry & hot pink, ornate gold accents,
   ivory cards, deep plum-burgundy text. Clean, bright, uplifting. */
:root {
  --plum: #4a1030;
  --plum-deep: #33102a;
  --raspberry: #b3123f;
  --pink: #e75480;
  --pink-soft: #fbe3ec;
  --gold: #c9a227;
  --gold-soft: #f3e5bd;
  --ivory: #fffaf1;
  --cream: #fdf3e7;
  --ink: #4a1030;
  --muted: #8a6472;
  --line: #ecd9c3;
  --ok: #2e7d4f;
  --ok-bg: #e2f2e7;
  --warn: #b25f00;
  --warn-bg: #fdeeda;
  --bad: #b3123f;
  --bad-bg: #fbe3ec;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(74, 16, 48, 0.10);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}
h1, h2, h3, .serif {
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  color: var(--plum);
  margin: 0;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }
a { color: var(--raspberry); }

/* ---------- header ---------- */
header.app {
  background: linear-gradient(135deg, var(--plum-deep), var(--raspberry));
  color: #fff;
  padding: 14px 18px 0;
  position: sticky; top: 0; z-index: 20;
  box-shadow: var(--shadow);
}
header.app .title-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
header.app h1 { color: #fff; font-size: 26px; letter-spacing: 0.3px; }
header.app .cup { font-size: 26px; }
header.app .spacer { flex: 1; }
header.app .head-btn {
  background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px; padding: 6px 14px; font-size: 14px;
}
header.app .head-btn:hover { background: rgba(255,255,255,0.25); }
nav.tabs { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; }
nav.tabs button {
  background: transparent; border: none; color: #ffd9e6;
  padding: 9px 16px; font-size: 15px; border-radius: 10px 10px 0 0; white-space: nowrap;
}
nav.tabs button.active { background: var(--cream); color: var(--plum); font-weight: 600; }
.gold-rule { height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-soft), var(--gold)); }

/* ---------- layout & cards ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 18px 14px 60px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card {
  background: var(--ivory); border: 1px solid var(--line); border-top: 3px solid var(--gold);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
}
.card h3 { font-size: 18px; margin-bottom: 4px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.section-title h2 { font-size: 21px; }
.section-title .spacer { flex: 1; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }

/* ---------- buttons, badges, chips ---------- */
.btn {
  background: var(--raspberry); color: #fff; border: none; border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 600;
}
.btn:hover { background: #960f34; }
.btn.secondary { background: #fff; color: var(--raspberry); border: 1px solid var(--raspberry); }
.btn.gold { background: var(--gold); color: var(--plum-deep); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.danger { background: #fff; color: var(--bad); border: 1px solid var(--bad); }
.btn.tiny { padding: 4px 10px; font-size: 13px; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.plain { background: var(--pink-soft); color: var(--raspberry); }
.badge.grey { background: #f1e7dc; color: var(--muted); }
.chip {
  border: 1px solid var(--raspberry); color: var(--raspberry); background: #fff;
  border-radius: 999px; padding: 5px 13px; font-size: 14px;
}
.chip.active { background: var(--raspberry); color: #fff; }
.tag { font-size: 12px; color: var(--muted); }

/* ---------- lists & rows ---------- */
.row {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 14px; }
.toolbar input[type="search"], .toolbar select {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.toolbar input[type="search"] { flex: 1; min-width: 180px; }

/* ---------- forms & modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(51, 16, 42, 0.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 12px; overflow-y: auto; z-index: 50;
}
.modal {
  background: var(--ivory); border-radius: var(--radius); border-top: 4px solid var(--gold);
  box-shadow: var(--shadow); max-width: 620px; width: 100%; padding: 20px;
}
.modal h2 { font-size: 21px; margin-bottom: 10px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.field textarea { min-height: 90px; resize: vertical; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.ing-row { display: flex; gap: 8px; margin-bottom: 8px; }
.ing-row input:first-child { flex: 0 0 34%; }
.ing-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { max-width: 400px; width: 100%; text-align: center; padding: 28px 24px; }
.login-card .cup { font-size: 44px; }
.login-card h1 { font-size: 27px; margin: 8px 0 4px; }
.login-card input {
  width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  margin: 14px 0 10px; text-align: center; font-size: 17px;
}
.error { color: var(--bad); font-size: 14px; min-height: 20px; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--plum); color: #fff; padding: 10px 18px; border-radius: 999px;
  box-shadow: var(--shadow); z-index: 90; font-size: 14px; max-width: 92vw; text-align: center;
}
.hidden { display: none !important; }
.strike { text-decoration: line-through; color: var(--muted); }
.checkline { display: flex; align-items: center; gap: 10px; }
.checkline input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--raspberry); }
.kv { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.divider { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }
.progress-note { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) {
  header.app h1 { font-size: 21px; }
  .grid { grid-template-columns: 1fr; }
}
