:root {
  --pink:       #e31957;
  --aqua:       #67cac5;
  --orange:     #f2611e;
  --yellow:     #fdd800;
  --dark-teal:  #1e9096;
  --light-teal: #c8ebe9;
  --bg:         #fafafa;
  --surf:       #f0f0f0;
  --card:       #ffffff;
  --bord:       #e0e0e0;
  --text:       #333333;
  --muted:      #777777;
  --body:       #555555;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Muli', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
header.app {
  background: var(--yellow);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.hleft { display: flex; align-items: center; gap: 12px; }
.hlogo {
  width: 36px; height: 36px;
  background: var(--pink); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  box-shadow: 0 0 6px rgba(227,25,87,.25);
  flex-shrink: 0;
}
.htitle {
  font-family: 'McLaren', cursive;
  font-size: 20px;
  color: var(--text);
}
.hright { display: flex; align-items: center; gap: 14px; }
.havatar {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 6px rgba(0,0,0,.15);
}
.hbtn {
  background: var(--card);
  border: 2px solid var(--pink);
  border-radius: 10px;
  padding: 6px 12px;
  color: var(--pink);
  font-size: 12px;
  font-family: 'McLaren', cursive;
  cursor: pointer;
  transition: all .1s ease-in-out;
  text-transform: uppercase;
}
.hbtn:hover { background: var(--pink); color: #fff; }

/* ── Nav ── */
nav.tabs {
  background: var(--card);
  border-bottom: 1px solid var(--bord);
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  position: sticky;
  top: 64px;
  z-index: 9;
}
nav.tabs a {
  padding: 14px 18px;
  font-family: 'Muli', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--body);
  text-transform: uppercase;
  letter-spacing: .5px;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
nav.tabs a:hover { color: var(--pink); text-decoration: none; }
nav.tabs a.active {
  color: var(--pink);
  border-bottom-color: var(--pink);
}

/* ── Layout ── */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.sec-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 16px;
}
.sec-hd:first-child { margin-top: 0; }
.sec-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sec-t {
  font-family: 'McLaren', cursive;
  font-size: 20px;
  color: var(--text);
}
.sec-badge {
  font-size: 11px;
  font-family: 'Muli', sans-serif;
  font-weight: 700;
  background: var(--light-teal);
  padding: 4px 10px;
  border-radius: 20px;
  color: var(--dark-teal);
  margin-left: auto;
}

/* ── Cards ── */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--bord);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 6px rgba(0,0,0,.06);
  transition: all .1s ease-in-out;
}
.card:hover { box-shadow: 0 0 12px rgba(0,0,0,.1); border-color: #ccc; }
.cbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
}
.clbl {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8px;
}
.cval {
  font-family: 'McLaren', cursive;
  font-size: 28px;
  line-height: 1.1;
  color: var(--text);
}
.csub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Buttons / inputs ── */
.btn {
  background: var(--pink);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: 'McLaren', cursive;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0,0,0,.2);
  transition: all .1s ease-in-out;
  text-transform: uppercase;
}
.btn:hover { background: #333; }
.btn.aqua { background: var(--dark-teal); }
.btn.aqua:hover { background: #333; }
.btn.ghost {
  background: transparent;
  color: var(--pink);
  border: 2px solid var(--pink);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--pink); color: #fff; }
.btn.sm { padding: 6px 10px; font-size: 12px; }

input[type=text], input[type=date], select, textarea {
  background: var(--bg);
  border: 1px solid var(--bord);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: 'Muli', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--pink); }

/* ── List rows ── */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--bord);
  border-radius: 12px;
  margin-bottom: 8px;
}
.row.checked { opacity: .55; }
.row.checked .row-text { text-decoration: line-through; color: var(--muted); }
.row-text { flex: 1; font-size: 15px; color: var(--text); }
.row-meta { font-size: 11px; color: var(--muted); }
.row .check {
  width: 28px; height: 28px;
  border: 2px solid var(--bord);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: transparent;
  transition: all .1s;
  flex-shrink: 0;
}
.row.checked .check {
  background: var(--aqua);
  border-color: var(--aqua);
  color: #fff;
}
.row .del {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.row .del:hover { color: var(--pink); background: rgba(227,25,87,.08); }

/* ── Forms ── */
.add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.add-form input { flex: 1; }

/* ── Empty state ── */
.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ── Login ── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.lcard {
  background: var(--card);
  border: 1px solid var(--bord);
  border-radius: 20px;
  padding: 48px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 0 15px rgba(0,0,0,.08);
}
.llogo {
  width: 56px; height: 56px;
  background: var(--pink);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  font-size: 28px;
  color: #fff;
  box-shadow: 0 0 6px rgba(227,25,87,.25);
}
.ltitle { font-family: 'McLaren', cursive; font-size: 26px; margin-bottom: 6px; }
.lsub { color: var(--muted); font-size: 14px; margin-bottom: 32px; }
.gbtn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  font-family: 'Muli', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  transition: all .1s;
  text-decoration: none;
}
.gbtn:hover { border-color: var(--pink); text-decoration: none; }
.gbtn img, .gbtn svg { width: 20px; height: 20px; }

/* ── Calendar (home) ── */
.calwrap {
  background: var(--card);
  border: 1px solid var(--bord);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 0 6px rgba(0,0,0,.06);
}
.calwrap iframe {
  width: 100%;
  height: 700px;
  border: 0;
  border-radius: 12px;
  display: block;
}
@media (max-width: 700px) {
  .calwrap iframe { height: 500px; }
}

/* ── Meal grid ── */
.meal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
@media (max-width: 900px) {
  .meal-week { grid-template-columns: 1fr; }
}
.meal-day {
  background: var(--card);
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: 12px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all .1s;
}
.meal-day:hover { border-color: var(--pink); box-shadow: 0 0 10px rgba(0,0,0,.08); }
.meal-day .dname {
  font-family: 'McLaren', cursive;
  font-size: 14px;
  color: var(--dark-teal);
  margin-bottom: 4px;
}
.meal-day .ddate {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
.meal-day .ddish {
  font-size: 14px;
  color: var(--text);
  font-weight: 700;
  flex: 1;
}
.meal-day.empty .ddish { color: var(--muted); font-weight: 400; font-style: italic; }

.week-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.week-nav .week-label {
  font-family: 'McLaren', cursive;
  font-size: 18px;
  flex: 1;
  text-align: center;
}

/* ── Modal ── */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-bg.open { display: flex; }
.modal-close-x {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--bord);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.modal-close-x:hover { background: var(--pink); color: #fff; border-color: var(--pink); }
.modal {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.modal h3 { font-family: 'McLaren', cursive; font-size: 20px; margin-bottom: 16px; }
.modal .field { margin-bottom: 12px; }
.modal label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
