/* =====================================================================
   HEAL App - Nutrition (4th Home tile, posts, booking calendar, admin)
   Loaded after style.css. Everything for the Nutrition update lives here.
   ===================================================================== */

:root {
  --food: #B9540A;          /* strong: selected day, selected time, buttons */
  --food-mid: #E8751A;      /* borders and accents */
  --food-soft: #FFF1E3;
  --food-line: #F6D9BB;
  --food-ink: #9A4A07;      /* text on the soft background */
}

/* ----- Home: four tiles, two across ----- */

.tiles {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tile {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  padding: 14px;
  min-height: 132px;
}

.tile-ico {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 25px;
}

.tile-name {
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.tile-sub {
  font-size: 13px;
  line-height: 1.3;
}

.tile-food { background: var(--food-soft); border-color: var(--food-line); }
.tile-food .tile-name { color: var(--food-ink); }

/* ----- Nutrition colours for the shared pieces ----- */

.sec-food { background: var(--food-soft); }
.sec-food .sec-title { color: var(--food-ink); }

.post-food { border-left-color: var(--food-mid); }

.chip-food { background: var(--food-soft); color: var(--food-ink); }

.cta-food {
  background: var(--food-soft);
  border: 1px solid var(--food-line);
}

.cta-food .cta-title { color: var(--food-ink); }

.nt-articles { margin-top: 8px; }

.nt-next {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  background: #f1faf4;
  border: 1px solid #cfe9d9;
  box-shadow: none;
  padding: 12px 14px;
}

.nt-next-ico { font-size: 22px; }
.nt-next-text { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nt-next-title { font-weight: 700; color: #1d7040; font-size: 14px; }
.nt-next-sub { font-size: 15px; color: var(--ink); }

/* ----- Booking page ----- */

.nt-page { padding-bottom: 28px; }

.nt-card {
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 16px;
}

.nt-about {
  border: 1px solid var(--food-line);
  background: #fffaf4;
  box-shadow: none;
}

.nt-about-top { display: flex; align-items: center; gap: 12px; }
.nt-about-ico { font-size: 26px; }
.nt-about-name { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--food-ink); }
.nt-about-place { font-size: 14px; color: var(--muted); margin-top: 2px; }
.nt-about-info { font-size: 14px; color: var(--ink); margin-top: 10px; line-height: 1.45; overflow-wrap: anywhere; }

.nt-mine { border-color: #cfe9d9; background: #f7fcf9; }

.nt-mine-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid #e0efe6;
}

.nt-mine-row:first-of-type { border-top: none; }

.nt-mine-when { display: flex; flex-direction: column; gap: 1px; }
.nt-mine-when span { font-size: 14px; color: var(--muted); }
.nt-mine-actions { display: flex; gap: 8px; }

/* month calendar */

.nt-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.nt-month { font-family: var(--display); font-size: 20px; text-align: center; flex: 1; }

.nt-nav {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 26px;
  line-height: 1;
  padding-bottom: 3px;
  color: var(--ink);
  cursor: pointer;
}

.nt-nav:disabled { opacity: 0.3; cursor: default; }

.nt-dow,
.nt-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.nt-dow span {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 6px;
}

.nt-day {
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #f4f7f8;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px 0;
  font: inherit;
}

.nt-num { font-size: 16px; font-weight: 700; line-height: 1; }

.nt-count { font-size: 11px; font-weight: 700; line-height: 1; }

.nt-blank { background: transparent; border: none; min-height: 0; }

.nt-ok {
  background: var(--food-soft);
  border-color: var(--food-line);
  color: var(--food-ink);
  cursor: pointer;
}

.nt-ok .nt-count { background: #fff; border-radius: 9px; padding: 2px 6px; }

.nt-full { background: #eceff1; color: #66757e; }

.nt-closed,
.nt-off { background: transparent; color: #8d9aa2; }

.nt-today { box-shadow: inset 0 0 0 2px var(--primary); }

.nt-sel,
.nt-ok.nt-sel {
  background: var(--food);
  border-color: var(--food);
  color: #fff;
}

.nt-sel .nt-count { background: rgba(255, 255, 255, 0.25); color: #fff; }

.nt-day:disabled { cursor: default; }

.nt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.nt-legend span { display: inline-flex; align-items: center; gap: 6px; }

.lg { display: inline-block; width: 14px; height: 14px; border-radius: 5px; border: 1px solid transparent; }
.lg-ok { background: var(--food-soft); border-color: var(--food-line); }
.lg-full { background: #eceff1; }
.lg-off { background: #fff; border-color: var(--line); }

/* time slots */

.nt-slots-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
  margin-bottom: 12px;
}

.nt-slots-title { font-family: var(--display); font-size: 19px; }
.nt-slots-count { font-size: 13px; color: var(--muted); }
.nt-hint { font-size: 14px; color: var(--muted); text-align: center; padding: 6px 0; }

.nt-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.nt-slot {
  min-height: 54px;
  border-radius: 12px;
  border: 1.5px solid var(--food-line);
  background: #fff;
  color: var(--food-ink);
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
}

.nt-slot:active { transform: scale(0.97); }

.nt-t { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nt-sub { font-size: 11px; line-height: 1.1; }

.nt-pick {
  background: var(--food);
  border-color: var(--food);
  color: #fff;
}

.nt-taken {
  background: repeating-linear-gradient(135deg, #f3f5f6, #f3f5f6 6px, #e9eef0 6px, #e9eef0 12px);
  border-color: #e1e8ec;
  color: #6b7a84;
  cursor: not-allowed;
}

.nt-taken .nt-t { text-decoration: line-through; }

.nt-break {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 7px 0;
  border-top: 1px dashed #cfd9de;
  border-bottom: 1px dashed #cfd9de;
  margin: 2px 0;
}

/* booking form */

.nt-form { scroll-margin-top: 76px; border-color: var(--food-line); }

.nt-sum {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--food-soft);
  margin-bottom: 6px;
}

.nt-sum-ico { font-size: 24px; }
.nt-sum-text { display: flex; flex-direction: column; gap: 1px; color: var(--food-ink); }
.nt-sum-text span { font-size: 14px; }

.nt-who { font-size: 14px; min-height: 0; margin-top: 6px; }
.nt-who.ok { color: #1d7040; font-weight: 600; }
.nt-who.warn { color: #8a5a00; }

.nt-msg { font-size: 14px; margin-top: 10px; min-height: 0; }
.nt-msg.err { color: #b42318; font-weight: 600; }
.nt-msg.ok { color: #1d7040; font-weight: 600; }

.nt-confirm { background: var(--food); }
.nt-confirm:disabled { opacity: 0.6; }

.nt-ticket { text-align: center; scroll-margin-top: 76px; border-color: #cfe9d9; background: #f7fcf9; }

.nt-ticket-check {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: #2a9658;
  color: #fff;
  font-size: 32px;
  line-height: 56px;
}

.nt-ticket-title { font-family: var(--display); font-size: 22px; }
.nt-ticket-when { margin-top: 8px; font-size: 17px; font-weight: 700; }
.nt-ticket-time { font-size: 24px; font-weight: 700; color: var(--food-ink); font-variant-numeric: tabular-nums; }
.nt-ticket-place { margin-top: 6px; font-size: 14px; color: var(--muted); }

@media (max-width: 360px) {
  .nt-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nt-day { min-height: 46px; }
  .nt-num { font-size: 15px; }
  .nt-card { padding: 12px; }
}

@media (min-width: 720px) {
  .nt-slots { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ----- Admin: bookings and availability ----- */

.nta-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.nta-tile { background: #fff; border-radius: 16px; padding: 12px; box-shadow: var(--shadow); text-align: center; }
.nta-tile-v { font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--food-ink); line-height: 1.1; }
.nta-tile-l { font-size: 12px; color: var(--muted); margin-top: 2px; }

.nta-cell .nt-count { font-size: 10px; letter-spacing: -0.02em; }

.nt-day.nta-past { color: #8d9aa2; }
.nt-day.nta-open { background: #f1faf4; border-color: #cfe9d9; color: #1d7040; cursor: pointer; }
.nt-day.nta-has { background: var(--food-soft); border-color: var(--food-mid); color: var(--food-ink); cursor: pointer; }
.nt-day.nta-past.nta-has,
.nt-day.nta-past.nta-open { opacity: 0.8; }
.nt-day.nta-cell:disabled { opacity: 1; }

.nta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.nta-row:first-of-type { border-top: none; }

.nta-time {
  flex: none;
  width: 52px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.nta-main { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.nta-main small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.nta-free .nta-main { color: #1d7040; }
.nta-block .nta-main { color: var(--muted); }
.nta-warn { color: #8a5a00; font-size: 13px; }
.nta-row.nta-orphan { background: #fff9ec; border-radius: 10px; padding-left: 8px; padding-right: 8px; }

.nta-note { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.45; }

.nta-quick { background: #fffaf4; border: 1px dashed var(--food-line); border-radius: 14px; padding: 12px; margin-top: 12px; }
.nta-quick-title { font-weight: 700; font-size: 14px; color: var(--food-ink); }
.nta-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nta-chips .chip-btn { padding: 8px 12px; }

.nta-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nta-grid2 > div { min-width: 0; }
.nta-grid2 select,
.nta-grid2 input { margin-top: 4px; min-width: 0; max-width: 100%; }

.nta-day {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-top: 10px;
  background: #fff;
}

.nta-day.on { border-color: var(--food-line); background: #fffdfb; }

.nta-day-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.nta-day-head input[type="checkbox"] { width: 22px; height: 22px; margin: 0; flex: none; }
.nta-day-sum { margin-left: auto; font-weight: 400; font-size: 13px; color: var(--muted); text-align: right; }
.nta-day-body { margin-top: 10px; }
.nta-day-body[hidden] { display: none; }

.nta-lock { text-align: left; }

.nta-exc { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.nta-exc:first-of-type { border-top: none; }
.nta-exc-main { flex: 1; min-width: 0; font-size: 15px; }
.nta-exc-main small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }

@media (max-width: 360px) {
  .nta-tile-v { font-size: 22px; }
  .nta-day-sum { display: none; }
}

/* a chosen day always wins over the other day colours (admin and member calendars) */
.nt-day.nt-sel,
.nt-day.nta-has.nt-sel,
.nt-day.nta-open.nt-sel,
.nt-day.nt-ok.nt-sel {
  background: var(--food);
  border-color: var(--food);
  color: #fff;
}
