.planner-page {
  background-color: #FDFBD4;
  color: #1a1a1a;
}

.planner-navbar {
  top: 0;
  background-color: #FDFBD4;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 1.2rem 2rem;
}
.planner-page .navbar-logo { color: #2d7a2d; }
.planner-page .navbar-link { color: #1a1a1a; }
.planner-page .navbar-link--bordered {
  border-color: #2d7a2d;
  color: #2d7a2d;
}
.planner-page .navbar-link--bordered:hover {
  background: #2d7a2d;
  color: #fff;
}

/* Top */
.planner-top {
  text-align: center;
  padding: 3.5rem 2rem 2rem;
  background: linear-gradient(135deg, #e8f5e9, #FDFBD4);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.planner-top h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
}
.planner-top p {
  color: #666;
  margin: 0 0 1.2rem;
  font-size: 0.95rem;
}
.planner-top-btns {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
}
.planner-top-btns button {
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-family: "Poppins", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #2d7a2d;
  background: #fff;
  color: #2d7a2d;
  transition: all 0.2s;
}
.planner-top-btns button:hover {
  background: #2d7a2d;
  color: #fff;
}
#clear-btn {
  border-color: #e74c3c !important;
  color: #e74c3c !important;
}
#clear-btn:hover {
  background: #e74c3c !important;
  color: #fff !important;
}

/* Wrap */
.planner-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Week grid */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.8rem;
  margin-bottom: 2rem;
}

/* Day card */
.day-card {
  background: #fff;
  border-radius: 16px;
  padding: 0.9rem 0.7rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.day-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #2d7a2d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: 0.2rem;
}

/* Slot */
.meal-slot {
  background: #f9fdf9;
  border: 1.5px dashed #c8e6c9;
  border-radius: 10px;
  padding: 0.5rem;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.slot-type {
  font-size: 0.65rem;
  font-weight: 700;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Filled slot */
.slot-filled {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border-radius: 8px;
  padding: 0.35rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.slot-filled img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.slot-meal-name {
  font-size: 0.7rem;
  font-weight: 600;
  flex: 1;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.slot-remove {
  background: none;
  border: none;
  color: #ddd;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  transition: color 0.2s;
  flex-shrink: 0;
}
.slot-remove:hover { color: #e74c3c; }

/* Add button */
.slot-add {
  background: none;
  border: none;
  color: #c8e6c9;
  font-size: 1.3rem;
  cursor: pointer;
  width: 100%;
  padding: 0.2rem 0;
  transition: color 0.2s;
}
.slot-add:hover { color: #2d7a2d; }

/* Shopping box */
.shopping-box {
  background: #fff;
  border-radius: 18px;
  padding: 1.6rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.shopping-box-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.shopping-box-top h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
}
.shopping-box-top button {
  background: #2d7a2d;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.5rem 1.2rem;
  font-family: "Poppins", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.shopping-box-top button:hover { background: #1f5c1f; }
.empty-msg {
  color: #bbb;
  font-size: 0.88rem;
  text-align: center;
  padding: 1.5rem 0;
  margin: 0;
}
.shopping-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}
.shopping-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #f9fdf9;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
  color: #333;
  cursor: pointer;
}
.shopping-item input { accent-color: #2d7a2d; }
.shopping-item.done span { text-decoration: line-through; color: #bbb; }

/* Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-bg.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}
.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.3rem;
  border-bottom: 1px solid #f0f0f0;
}
.modal-top h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0;
}
.modal-top button {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #888;
}
#modal-search {
  border: none;
  border-bottom: 1px solid #f0f0f0;
  padding: 0.8rem 1.3rem;
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
#modal-results {
  overflow-y: auto;
  padding: 0.7rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.modal-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.modal-item:hover { background: #e8f5e9; }
.modal-item img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.modal-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.1rem;
}
.modal-item-cat {
  font-size: 0.75rem;
  color: #888;
  margin: 0;
}

/* Print */
@media print {
  header, footer, .planner-top-btns,
  .shopping-box-top button,
  .slot-add, .slot-remove,
  .modal-bg { display: none !important; }
}

/* Mobile */
@media (max-width: 900px) {
  .week-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 580px) {
  .week-grid { grid-template-columns: repeat(2, 1fr); }
  .planner-top h1 { font-size: 1.7rem; }
  .planner-wrap { padding: 1rem; }
}