/* pastel.css — "Modern" skin.
   Keeps the app's OWN colours (accent themes, plum, dark mode) untouched, and
   only modernises FORM: rounder borderless cards, a cleaner type scale with
   bigger numbers, and the new .pc-* dashboard hero / stat / ring components.
   Every colour here comes from the existing tokens (--accent, --accent-pale,
   --accent-light, --plum, --card-bg …), so it recolours automatically with the
   user's chosen accent and works in light + dark. Remove the one <link> in
   head.php to revert. */

/* Shape tokens only (colour-neutral). */
:root {
  --radius-card: 22px;
  --radius-pill: 999px;
}

/* Modern typeface + big, confident numbers. */
body {
  font-family: 'Plus Jakarta Sans', 'Montserrat', system-ui, sans-serif;
}
.stat-value, .hero-ring-val, .cal-num, .progress-pct, .psc-val,
.topbar-title, .section-label, .pc-big, .pc-stat-n {
  font-family: 'Plus Jakarta Sans', 'Montserrat', system-ui, sans-serif;
  letter-spacing: -0.02em;
}
.stat-value, .hero-ring-val, .cal-num, .progress-pct { font-weight: 800; }

/* Cards: rounder + borderless, keeping the app's own shadow token. */
.card-section {
  border-radius: var(--radius-card);
  border: none;
}
.card-section .card-section,
.card-section .inner-card {
  border: 1px solid var(--border);
  border-radius: 16px;
}
.btn, .es-cta { border-radius: var(--radius-pill); }
.form-control-custom, .form-select { border-radius: 14px; }
.stat-card { border-radius: 20px; }
.topbar { border-bottom: none; background: transparent; }

/* ── Modern dashboard header (partials/dash-modern.php) ───────────────────
   Coloured entirely by the current accent theme's tokens. */
.pc-greet { display: flex; align-items: center; margin: 2px 0 14px; }
.pc-greet small { display: block; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.pc-greet b { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; color: var(--plum); }

.pc-hero {
  background: var(--accent-pale);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.pc-hero-l { flex: 1; min-width: 0; }
.pc-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.pc-tag i { width: 26px; height: 26px; border-radius: 9px; background: var(--card-bg); display: inline-flex; align-items: center; justify-content: center; color: var(--accent); font-size: 14px; }
.pc-big { font-size: 52px; line-height: .95; font-weight: 800; letter-spacing: -0.03em; color: var(--plum); margin: 14px 0 4px; }
.pc-big span { font-size: 26px; margin-left: 2px; }
.pc-sub { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--accent); }

.pc-ring { position: relative; width: 128px; height: 128px; flex: none; }
.pc-ring svg { display: block; }
.pc-ring-track { stroke: var(--card-bg); }
.pc-ring-fill { stroke: var(--accent); transition: stroke-dashoffset 1.1s cubic-bezier(.22, 1, .36, 1); }
.pc-ring-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pc-ring-mid b { font-size: 23px; font-weight: 800; color: var(--plum); letter-spacing: -0.02em; }
.pc-ring-mid small { font-size: 10.5px; font-weight: 600; color: var(--accent); }

.pc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.pc-stat { background: var(--card-bg); border-radius: 20px; padding: 16px 16px 14px; box-shadow: var(--shadow); }
.pc-stat-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pc-stat-h span { font-size: 12.5px; font-weight: 700; color: var(--text-muted); line-height: 1.25; }
.pc-chip { width: 30px; height: 30px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 15px; background: var(--accent-pale); color: var(--accent); }
.pc-stat-n { font-size: 27px; font-weight: 800; letter-spacing: -0.02em; margin: 12px 0 3px; color: var(--plum); }
.pc-stat-n i { font-size: 13px; font-weight: 600; font-style: normal; color: var(--text-muted); margin-left: 2px; }
.pc-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.pc-delta.good { color: #2E9E6B; }
.pc-sub2 { font-size: 12px; font-weight: 600; color: var(--text-muted); }

.pc-steps { display: flex; align-items: center; gap: 12px; background: var(--card-bg); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.pc-steps-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-pale); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.pc-steps-main { flex: 1; min-width: 0; }
.pc-steps-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.pc-steps-top span { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.pc-steps-top b { font-size: 15px; font-weight: 800; color: var(--plum); font-variant-numeric: tabular-nums; }
.pc-steps-top b i { font-style: normal; font-weight: 600; color: var(--text-muted); font-size: 12px; }
.pc-steps-bar { height: 8px; border-radius: 99px; background: var(--accent-pale); overflow: hidden; }
.pc-steps-fill { height: 100%; border-radius: 99px; background: var(--accent); }
.pc-steps-done { width: 28px; height: 28px; border-radius: 50%; background: #E4F5EE; color: #12805C; display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* ── Modern sidebar (mobile app drawer) — keeps the plum/accent colours ──── */
@media (max-width: 991px) {
  .sidebar {
    width: 84vw;
    max-width: 340px;
    border-right: none;
    border-radius: 0 26px 26px 0;              /* rounded app-sheet edge */
    box-shadow: 14px 0 44px rgba(20, 8, 32, 0.40);
    padding-left: max(0px, env(safe-area-inset-left));
  }
}
.sidebar-brand {
  padding: 1.15rem 1rem 1rem;
  border-bottom: none !important;
  gap: 0.7rem;
}
.brand-icon { border-radius: 13px; }
.brand-text { font-weight: 800; letter-spacing: -0.01em; }

.sidebar-nav { padding: 0.5rem 0.85rem 1rem; gap: 0.15rem; }
.sidebar-nav .nav-link {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border-left: none;
  font-size: 0.9rem;
  font-weight: 600;
  gap: 0.85rem;
}
.sidebar-nav .nav-link:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.07);
}
.sidebar-nav .nav-link.active {
  border-left: none;
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.55);
}
.sidebar-nav .nav-link i { font-size: 1.15rem; width: 1.45rem; }
.nav-group-items .nav-sublink { padding-left: 2.7rem; }
.nav-section-label { padding: 0.7rem 0.95rem 0.35rem; }

/* Profile footer → a modern rounded chip that reads as a tappable card. */
.sidebar-profile {
  margin: 0 0.85rem 0.9rem;
  padding: 0.7rem 0.8rem;
  border-top: none !important;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}
.profile-avatar { border-radius: 14px; width: 40px; height: 40px; }

/* ── Bottom nav: modern rounded active pill, in the app's accent (not yellow) ─ */
.mobile-bottom-nav {
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px -18px rgba(61, 32, 80, 0.22);
}
.mobile-bottom-nav .mbn-item.active i,
.mobile-bottom-nav .mbn-item.mbn-going i {
  color: var(--accent);
  background: var(--accent-pale);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Bottom navigation sheet (partials/bottom-sheet.php) ─────────────────── */
.nav-sheet { position: fixed; inset: 0; z-index: 210; display: none; }
.nav-sheet.is-open { display: block; }
.nav-sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 10, 30, 0.45); opacity: 0; transition: opacity 0.25s ease; }
.nav-sheet.is-open .nav-sheet-backdrop { opacity: 1; }
.nav-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--card-bg);
  border-radius: 26px 26px 0 0;
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 82vh; overflow-y: auto;
  box-shadow: 0 -18px 44px rgba(20, 8, 32, 0.30);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(.22, 1, .36, 1);
  overscroll-behavior: contain;
}
.nav-sheet.is-open .nav-sheet-panel { transform: translateY(0); }
.nav-sheet-grab { width: 42px; height: 4px; border-radius: 99px; background: var(--border); margin: 8px auto 6px; }
.nav-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.nav-sheet-title { font-weight: 800; font-size: 1.08rem; color: var(--plum); }
.nav-sheet-x { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-pale); color: var(--accent); border: 0; display: inline-flex; align-items: center; justify-content: center; }
.nav-sheet-list { display: flex; flex-direction: column; gap: 2px; }
.nav-sheet-item { display: flex; align-items: center; gap: 14px; padding: 11px 10px; border-radius: 14px; text-decoration: none; color: var(--text); }
.nav-sheet-item:active { background: var(--accent-pale); }
.nav-sheet-item .nsi-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-pale); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; flex: none; }
.nav-sheet-item .nsi-label { flex: 1; min-width: 0; font-weight: 700; font-size: 0.95rem; }
.nav-sheet-item .nsi-chev { color: var(--text-muted); font-size: 0.8rem; flex: none; opacity: 0.6; }
.nav-sheet-item.is-on { background: var(--accent-pale); }
.nav-sheet-item.is-on .nsi-ico { background: var(--brand-grad); color: var(--on-brand); }
.nav-sheet-item.is-on .nsi-label { color: var(--accent); }
.nav-sheet-foot { display: flex; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.nav-sheet-row { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: none; color: var(--text); font: inherit; font-weight: 700; font-size: 0.85rem; text-decoration: none; cursor: pointer; }
.nav-sheet-danger { color: #D1301F; }
/* Two-column list on wider sheets. */
@media (min-width: 560px) { .nav-sheet-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; } }

/* ── Dashboard tabbed card (This Week / Today's Food) ───────────────────── */
.dash-tabbar { display: flex; gap: 6px; background: var(--accent-pale); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.dash-tab { flex: 1; border: 0; background: none; padding: 9px 8px; border-radius: 11px; font: inherit; font-weight: 700; font-size: 0.82rem; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.dash-tab.is-on { background: var(--card-bg); color: var(--accent); box-shadow: var(--shadow); }
.dash-panel { display: none; }
.dash-panel.is-on { display: block; }

/* ── Nutrition tiles → swipeable slider on mobile (reduce vertical scroll) ── */
@media (max-width: 991px) {
  .nutrition-today .nutrient-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .nutrition-today .nutrient-grid::-webkit-scrollbar { display: none; }
  .nutrition-today .nutrient-card {
    flex: 0 0 46%;
    scroll-snap-align: start;
  }
}

/* ── Prominent Home anchor in the bottom nav ────────────────────────────── */
.mobile-bottom-nav .mbn-item.mbn-home i {
  background: var(--brand-grad);
  color: var(--on-brand);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 7px 16px -6px var(--accent-light);
  font-size: 1.3rem;
}
.mobile-bottom-nav .mbn-item.mbn-home span { color: var(--accent); font-weight: 700; }

/* ── Shared page polish — bolder modern section headers + topbar titles ──── */
.section-label { font-weight: 800; letter-spacing: -0.01em; }
.topbar-title { font-weight: 800; letter-spacing: -0.02em; }

/* Day-summary hero (Log): calories are 4-digit, so a smaller number fits the ring. */
.pc-hero-cal .pc-big { font-size: 40px; }
.pc-hero-cal .pc-big span { font-size: 18px; }
