/* ==========================================================================
   Sehat Mentor — shared design system
   Palette and type carried over from the original prototype.
   ========================================================================== */

:root{
  --bg:            #EFF3EA;   /* pale sage paper */
  --panel:         #FFFFFF;
  --ink:           #1F3A5F;   /* indigo */
  --ink-soft:      #4C5F73;
  --forest:        #2F5233;   /* primary — leaf green */
  --forest-deep:   #23401F;
  --marigold:      #E2983B;   /* warm accent — nutrition */
  --marigold-deep: #C67A22;
  --leaf:          #3F7D4C;   /* activity */
  --water:         #3D7EA6;   /* hydration */
  --dusk:          #6B5B95;   /* sleep */
  --clay:          #C9662E;   /* habits */
  --danger:        #B23B3B;
  --line:          #DDE4D6;
  --card-shadow:   0 6px 20px rgba(31,58,95,0.08);
  --lift-shadow:   0 18px 40px rgba(31,58,95,0.16);
  --radius:        18px;
  --sidebar-w:     248px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0; padding:0;
  background:var(--bg);
  color:var(--ink);
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  -webkit-font-smoothing:antialiased;
  line-height:1.5;
}
h1,h2,h3,h4,.display{ font-family:'Baloo 2','Baloo2',system-ui,sans-serif; margin:0; }
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
button{ font-family:inherit; }
:focus-visible{ outline:3px solid rgba(63,125,76,.45); outline-offset:2px; border-radius:6px; }

/* ---------- atoms ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border:none; border-radius:14px; padding:13px 20px;
  font-weight:700; font-size:14.5px; cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-align:center; white-space:nowrap;
}
.btn:hover{ transform:translateY(-1px); }
.btn:active{ transform:translateY(0); }
.btn-primary{ background:var(--forest); color:#fff; box-shadow:0 6px 16px rgba(47,82,51,.25); }
.btn-primary:hover{ background:var(--forest-deep); }
.btn-secondary{ background:var(--panel); color:var(--forest-deep); border:1.5px solid var(--line); }
.btn-secondary:hover{ border-color:var(--forest); }
.btn-marigold{ background:var(--marigold); color:#fff; box-shadow:0 6px 16px rgba(226,152,59,.28); }
.btn-marigold:hover{ background:var(--marigold-deep); }
.btn-ghost{ background:transparent; color:var(--ink-soft); font-weight:600; }
.btn-block{ width:100%; }
.btn-sm{ padding:9px 14px; font-size:13px; border-radius:11px; }

.pill{ display:inline-block; padding:4px 11px; border-radius:999px; font-size:10.5px; font-weight:700; letter-spacing:.02em; }
.pill-coach{ background:#E7EFE3; color:var(--forest-deep); }
.pill-ai{ background:#F3E7D4; color:var(--marigold-deep); }
.pill-water{ background:#E2EDF4; color:var(--water); }
.pill-danger{ background:#F7E2E2; color:var(--danger); }

.card{ background:var(--panel); border-radius:var(--radius); padding:18px 20px; box-shadow:var(--card-shadow); margin-bottom:16px; }
.card-head{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.card-title{ font-weight:700; font-size:14px; }
.note-card{ background:#F6F9F3; border-radius:16px; padding:18px 20px; font-size:13px; color:var(--ink-soft); line-height:1.6; }
.note-card b{ color:var(--ink); }
.muted{ color:var(--ink-soft); }
.action-link{ color:var(--forest); font-weight:700; font-size:12.5px; cursor:pointer; }
.action-link:hover{ text-decoration:underline; }

.avatar{
  width:34px; height:34px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center;
  color:#fff; font-weight:700; font-size:12.5px; flex:0 0 auto;
}
.status-dot{ width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:6px; }

.form-group{ margin-bottom:14px; }
.form-label{ display:block; font-size:11.5px; font-weight:700; color:var(--ink-soft); margin-bottom:6px; text-transform:uppercase; letter-spacing:.03em; }
.form-input, .form-select, .form-textarea{
  width:100%; border:1.5px solid var(--line); border-radius:12px; padding:12px 14px;
  font-family:inherit; font-size:14px; color:var(--ink); background:var(--panel);
}
.form-input:focus, .form-select:focus, .form-textarea:focus{ outline:none; border-color:var(--forest); box-shadow:0 0 0 3px rgba(47,82,51,.10); }
.form-row{ display:flex; gap:12px; flex-wrap:wrap; }
.form-row > *{ flex:1; min-width:150px; }
.form-hint{ font-size:11.5px; color:var(--ink-soft); margin-top:6px; }
.form-error{ background:#F7E2E2; color:var(--danger); border-radius:10px; padding:10px 12px; font-size:12.5px; font-weight:600; margin-bottom:14px; display:none; }
.form-error.show{ display:block; }

.brand-mark{
  width:38px; height:38px; border-radius:11px;
  background:linear-gradient(135deg,var(--forest),var(--leaf));
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-family:'Baloo 2',sans-serif; font-weight:800; font-size:18px;
  box-shadow:0 4px 10px rgba(47,82,51,.28); flex:0 0 auto;
}
.brand{ display:flex; align-items:center; gap:10px; }
.brand-name{ font-family:'Baloo 2',sans-serif; font-weight:700; font-size:21px; color:var(--forest-deep); line-height:1.1; }
.brand-sub{ font-size:11px; color:var(--ink-soft); }

/* ==========================================================================
   PUBLIC SITE
   ========================================================================== */
.site-nav{
  position:sticky; top:0; z-index:50;
  background:rgba(239,243,234,.82); backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}
.site-nav-inner{ max-width:1180px; margin:0 auto; padding:14px 22px; display:flex; align-items:center; justify-content:space-between; gap:20px; }
.nav-links{ display:flex; align-items:center; gap:6px; }
.nav-links a{ padding:9px 14px; border-radius:10px; font-weight:600; font-size:14px; color:var(--ink-soft); }
.nav-links a:hover, .nav-links a.active{ background:var(--panel); color:var(--forest-deep); }
.nav-auth-link{ display:none; }  /* desktop: the top-bar buttons already cover these */
.step-link{ color:var(--forest-deep); text-decoration:none; }
.step-link:hover{ text-decoration:underline; }
.nav-cta{ display:flex; align-items:center; gap:10px; }
.nav-toggle{ display:none; border:none; background:var(--panel); border-radius:10px; padding:9px 12px; font-size:17px; cursor:pointer; box-shadow:var(--card-shadow); }

@media(max-width:900px){
  .nav-toggle{ display:block; }
  .nav-links{
    position:absolute; top:100%; left:0; right:0; flex-direction:column; align-items:stretch;
    background:var(--panel); padding:12px; gap:2px; box-shadow:var(--lift-shadow);
    border-bottom:1px solid var(--line); display:none;
  }
  .nav-links.open{ display:flex; }
  .nav-cta .btn-secondary{ display:none; }
  .nav-auth-link{ display:block; margin-top:2px; }
  .nav-auth-link:first-of-type{ border-top:1px solid var(--line); margin-top:8px; padding-top:12px; }
  .nav-links a.nav-auth-link.register{ background:var(--forest-deep); color:#fff; font-weight:700; text-align:center; margin-top:6px; }
}

.wrap{ max-width:1180px; margin:0 auto; padding:0 22px; }
.section{ padding:78px 0; }
.section-tight{ padding:52px 0; }
.eyebrow{ font-size:11.5px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; color:var(--leaf); margin-bottom:10px; }
.section-title{ font-size:34px; color:var(--forest-deep); margin-bottom:10px; line-height:1.2; }
.section-lead{ font-size:15.5px; color:var(--ink-soft); max-width:620px; line-height:1.6; }
.center{ text-align:center; }
.center .section-lead{ margin-left:auto; margin-right:auto; }

/* ---------- hero + carousel ---------- */
.hero{ padding:44px 0 10px; }
.carousel{
  position:relative; border-radius:28px; overflow:hidden;
  box-shadow:var(--lift-shadow); background:var(--forest-deep);
}
.slides{ position:relative; height:min(560px,72vh); min-height:420px; }
.slide{
  position:absolute; inset:0; opacity:0; transition:opacity .7s ease;
  display:grid; grid-template-columns:1.05fr .95fr; align-items:center; gap:20px;
  padding:52px 56px;
}
.slide.active{ opacity:1; }
.slide-copy{ position:relative; z-index:2; max-width:520px; color:#fff; }
.slide-tag{
  display:inline-block; background:rgba(255,255,255,.18); color:#fff; border:1px solid rgba(255,255,255,.28);
  padding:5px 13px; border-radius:999px; font-size:11.5px; font-weight:700; letter-spacing:.04em; margin-bottom:16px;
}
.slide-title{ font-size:clamp(30px,4.4vw,46px); line-height:1.12; margin-bottom:14px; }
.slide-text{ font-size:16px; line-height:1.6; color:rgba(255,255,255,.88); margin-bottom:26px; }
.slide-actions{ display:flex; gap:12px; flex-wrap:wrap; }
.slide-art{ position:relative; z-index:2; display:flex; align-items:center; justify-content:center; }
.slide-art svg{ width:100%; max-width:420px; height:auto; filter:drop-shadow(0 18px 34px rgba(0,0,0,.22)); }
.slide::after{ content:""; position:absolute; inset:0; z-index:1; }

.slide-1{ background:linear-gradient(125deg,#23401F 0%,#2F5233 45%,#3F7D4C 100%); }
.slide-2{ background:linear-gradient(125deg,#8C4E12 0%,#C67A22 48%,#E2983B 100%); }
.slide-3{ background:linear-gradient(125deg,#1E4560 0%,#3D7EA6 55%,#5FA3C7 100%); }
.slide-4{ background:linear-gradient(125deg,#3B325B 0%,#6B5B95 52%,#8C7BB8 100%); }
.slide::before{
  content:""; position:absolute; inset:0; z-index:0; opacity:.5;
  background:
    radial-gradient(520px 320px at 82% 22%, rgba(255,255,255,.22), transparent 70%),
    radial-gradient(420px 280px at 12% 88%, rgba(0,0,0,.30), transparent 70%);
}

.carousel-btn{
  position:absolute; top:50%; transform:translateY(-50%); z-index:6;
  width:44px; height:44px; border-radius:50%; border:none; cursor:pointer;
  background:rgba(255,255,255,.9); color:var(--forest-deep); font-size:19px; font-weight:800;
  box-shadow:0 6px 18px rgba(0,0,0,.18); display:flex; align-items:center; justify-content:center;
}
.carousel-btn:hover{ background:#fff; }
.carousel-prev{ left:18px; }
.carousel-next{ right:18px; }
.carousel-dots{ position:absolute; bottom:22px; left:56px; z-index:6; display:flex; gap:8px; }
.carousel-dots button{
  width:9px; height:9px; padding:0; border:none; border-radius:999px; cursor:pointer;
  background:rgba(255,255,255,.45); transition:width .25s ease, background .25s ease;
}
.carousel-dots button.active{ width:28px; background:#fff; }

@media(max-width:900px){
  .slide{ grid-template-columns:1fr; padding:34px 26px; align-content:center; text-align:center; }
  .slide-copy{ margin:0 auto; }
  .slide-actions{ justify-content:center; }
  .slide-art{ display:none; }
  .slides{ height:auto; min-height:440px; }
  .carousel-dots{ left:50%; transform:translateX(-50%); bottom:16px; }
  .carousel-btn{ width:36px; height:36px; }
  .carousel-prev{ left:8px; } .carousel-next{ right:8px; }
}

/* ---------- stats strip ---------- */
.stats-strip{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-top:-42px; position:relative; z-index:10; }
.stat-tile{ background:var(--panel); border-radius:16px; padding:18px 20px; box-shadow:var(--card-shadow); text-align:center; }
.stat-tile .n{ font-family:'Baloo 2',sans-serif; font-weight:800; font-size:27px; color:var(--forest-deep); }
.stat-tile .l{ font-size:12px; color:var(--ink-soft); font-weight:600; }
@media(max-width:760px){ .stats-strip{ grid-template-columns:repeat(2,1fr); margin-top:22px; } }

/* ---------- feature grid ---------- */
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.grid-2{ display:grid; grid-template-columns:repeat(2,1fr); gap:24px; }
@media(max-width:900px){ .grid-3, .grid-2{ grid-template-columns:1fr; } }

.feature{
  background:var(--panel); border-radius:var(--radius); padding:26px 24px; box-shadow:var(--card-shadow);
  transition:transform .18s ease, box-shadow .18s ease; border:1.5px solid transparent;
}
.feature:hover{ transform:translateY(-4px); box-shadow:var(--lift-shadow); border-color:#E4EBDD; }
.feature-ico{
  width:48px; height:48px; border-radius:14px; display:flex; align-items:center; justify-content:center;
  font-size:23px; margin-bottom:14px;
}
.feature h3{ font-size:18px; color:var(--forest-deep); margin-bottom:8px; }
.feature p{ margin:0; font-size:13.5px; color:var(--ink-soft); line-height:1.6; }

/* ---------- how it works ---------- */
.steps{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; counter-reset:step; }
@media(max-width:900px){ .steps{ grid-template-columns:repeat(2,1fr); } }
@media(max-width:560px){ .steps{ grid-template-columns:1fr; } }
.step{ background:var(--panel); border-radius:16px; padding:22px 20px; box-shadow:var(--card-shadow); position:relative; }
.step-n{
  width:32px; height:32px; border-radius:10px; background:#E7EFE3; color:var(--forest-deep);
  font-family:'Baloo 2',sans-serif; font-weight:800; font-size:16px;
  display:flex; align-items:center; justify-content:center; margin-bottom:12px;
}
.step h4{ font-size:16px; margin-bottom:6px; color:var(--forest-deep); }
.step p{ margin:0; font-size:13px; color:var(--ink-soft); line-height:1.55; }

/* ---------- role cards ---------- */
.role-card{
  border-radius:22px; padding:30px 28px; color:#fff; position:relative; overflow:hidden;
  box-shadow:var(--lift-shadow); display:flex; flex-direction:column; min-height:100%;
}
.role-card.customer{ background:linear-gradient(135deg,#2F5233,#3F7D4C); }
.role-card.coach{ background:linear-gradient(135deg,#8C4E12,#E2983B); }
.role-card h3{ font-size:24px; margin-bottom:8px; }
.role-card p{ font-size:14px; color:rgba(255,255,255,.9); line-height:1.6; margin:0 0 18px; }
.role-list{ list-style:none; padding:0; margin:0 0 24px; }
.role-list li{ font-size:13.5px; padding:7px 0 7px 26px; position:relative; color:rgba(255,255,255,.94); }
.role-list li::before{ content:"✓"; position:absolute; left:0; font-weight:800; }
.role-card .btn{ align-self:flex-start; margin-top:auto; }
.role-card .btn-light{ background:#fff; color:var(--forest-deep); }

/* ---------- pricing ---------- */
.plan-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
@media(max-width:900px){ .plan-grid{ grid-template-columns:1fr; } }
.plan-card{
  background:var(--panel); border-radius:20px; padding:28px 22px; box-shadow:var(--card-shadow);
  border:2px solid transparent; text-align:center; position:relative;
}
.plan-card.best{ border-color:var(--marigold); transform:scale(1.03); }
.best-badge{
  position:absolute; top:-12px; left:50%; transform:translateX(-50%);
  background:var(--marigold); color:#fff; font-size:10.5px; font-weight:700; padding:4px 14px; border-radius:999px;
}
.plan-name{ font-size:15px; font-weight:700; color:var(--ink-soft); margin-bottom:6px; }
.plan-price{ font-size:34px; font-weight:800; color:var(--forest-deep); font-family:'Baloo 2',sans-serif; }
.plan-per{ font-size:12.5px; color:var(--ink-soft); margin-bottom:16px; }
.plan-feats{ list-style:none; padding:0; margin:0 0 20px; font-size:13px; color:var(--ink-soft); }
.plan-feats li{ padding:6px 0; border-bottom:1px dashed var(--line); }
.plan-feats li:last-child{ border-bottom:none; }

/* ---------- testimonials ---------- */
.quote-card{ background:var(--panel); border-radius:18px; padding:24px; box-shadow:var(--card-shadow); }
.quote-card p{ font-size:14px; line-height:1.65; color:var(--ink); margin:0 0 16px; }
.quote-who{ display:flex; align-items:center; gap:10px; }
.quote-who .n{ font-weight:700; font-size:13.5px; }
.quote-who .r{ font-size:12px; color:var(--ink-soft); }
.stars{ color:var(--marigold); font-size:14px; letter-spacing:2px; margin-bottom:10px; }

/* ---------- cta band + footer ---------- */
.cta-band{
  background:linear-gradient(135deg,var(--forest-deep),var(--leaf));
  border-radius:26px; padding:52px 44px; color:#fff; text-align:center; box-shadow:var(--lift-shadow);
}
.cta-band h2{ font-size:32px; margin-bottom:12px; }
.cta-band p{ font-size:15px; color:rgba(255,255,255,.9); max-width:560px; margin:0 auto 26px; }
.cta-actions{ display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }

.site-footer{ background:#FBFBF8; border-top:1px solid var(--line); padding:48px 0 26px; margin-top:70px; }
.footer-grid{ display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr; gap:28px; }
@media(max-width:820px){ .footer-grid{ grid-template-columns:1fr 1fr; } }
.footer-grid h5{ font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-soft); margin:0 0 12px; }
.footer-grid a, .footer-grid li{ display:block; font-size:13.5px; color:var(--ink-soft); padding:5px 0; }
.footer-grid a:hover{ color:var(--forest); }
.footer-bottom{ margin-top:30px; padding-top:18px; border-top:1px solid var(--line); font-size:12.5px; color:var(--ink-soft); display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; }

/* ==========================================================================
   AUTH PAGES
   ========================================================================== */
.auth-page{ min-height:100vh; display:grid; grid-template-columns:1.05fr .95fr; }
@media(max-width:920px){ .auth-page{ grid-template-columns:1fr; } .auth-aside{ display:none; } }
.auth-aside{
  background:linear-gradient(140deg,#23401F,#2F5233 55%,#3F7D4C);
  color:#fff; padding:52px 48px; display:flex; flex-direction:column; justify-content:space-between;
}
.auth-aside h2{ font-size:32px; line-height:1.2; margin-bottom:14px; }
.auth-aside p{ color:rgba(255,255,255,.86); font-size:14.5px; line-height:1.65; max-width:400px; }
.auth-aside .role-list{ margin-top:26px; }
.auth-main{ display:flex; align-items:center; justify-content:center; padding:44px 24px; }
.auth-card{ width:100%; max-width:420px; }
.auth-card h1{ font-size:27px; color:var(--forest-deep); margin-bottom:6px; }
.auth-card .sub{ font-size:14px; color:var(--ink-soft); margin-bottom:24px; }

.role-toggle{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:22px; }
.role-opt{
  border:2px solid var(--line); background:var(--panel); border-radius:16px; padding:14px 12px;
  cursor:pointer; text-align:left; transition:.15s;
}
.role-opt .ri{ font-size:20px; }
.role-opt .rn{ font-weight:700; font-size:14px; margin-top:4px; }
.role-opt .rd{ font-size:11.5px; color:var(--ink-soft); }
.role-opt.selected{ border-color:var(--forest); background:#F1F6EE; }

.password-wrap{ position:relative; }
.password-wrap .form-input{ padding-right:44px; }
.password-eye{ position:absolute; right:10px; top:34px; border:none; background:transparent; cursor:pointer; font-size:15px; opacity:.55; }
.password-eye:hover{ opacity:.9; }
.auth-switch{ text-align:center; font-size:13px; color:var(--ink-soft); margin-top:18px; }
.auth-switch a{ color:var(--forest); font-weight:700; }
.demo-box{ background:#F6F9F3; border:1.5px dashed #C7D6BF; border-radius:14px; padding:14px 16px; font-size:12.5px; color:var(--ink-soft); margin-bottom:20px; line-height:1.6; }
.demo-box b{ color:var(--forest-deep); }
.row-between{ display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }

/* ==========================================================================
   PORTAL SHELL (customer + coach)
   ========================================================================== */
.portal{ display:flex; min-height:100vh; }
.sidebar{
  width:var(--sidebar-w); flex:0 0 auto; background:#FBFBF8; border-right:1px solid var(--line);
  padding:20px 14px; display:flex; flex-direction:column; gap:6px;
  position:sticky; top:0; height:100vh; overflow-y:auto;
}
.sidebar-brand{ display:flex; align-items:center; gap:10px; padding:4px 8px 18px; }
.side-section{ font-size:10.5px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:#9AA79B; padding:14px 12px 6px; }
.nav-item{
  display:flex; align-items:center; gap:11px; padding:11px 13px; border-radius:12px;
  font-size:14px; font-weight:600; color:var(--ink-soft); cursor:pointer; transition:.15s;
}
.nav-item:hover{ background:#EFF3EA; color:var(--forest-deep); }
.nav-item.active{ background:var(--forest); color:#fff; box-shadow:0 4px 12px rgba(47,82,51,.22); }
.nav-item .ni{ font-size:16px; width:20px; text-align:center; }
.nav-item .badge{ margin-left:auto; background:var(--marigold); color:#fff; font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:999px; }
.nav-item.active .badge{ background:rgba(255,255,255,.25); }
.sidebar-foot{ margin-top:auto; padding-top:14px; }

.portal-main{ flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:16px 28px; background:rgba(255,255,255,.85); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line); position:sticky; top:0; z-index:30;
}
.topbar-title{ font-family:'Baloo 2',sans-serif; font-weight:700; font-size:19px; color:var(--forest-deep); }
.topbar-sub{ font-size:12.5px; color:var(--ink-soft); }
.topbar-right{ display:flex; align-items:center; gap:12px; }
.icon-btn{ border:none; background:var(--bg); width:38px; height:38px; border-radius:11px; cursor:pointer; font-size:16px; position:relative; }
.icon-btn .dot{ position:absolute; top:8px; right:9px; width:7px; height:7px; border-radius:50%; background:var(--marigold); }
.menu-toggle{ display:none; border:none; background:var(--bg); border-radius:11px; padding:9px 12px; font-size:17px; cursor:pointer; }

.user-chip{ display:flex; align-items:center; gap:9px; cursor:pointer; padding:5px 10px 5px 5px; border-radius:999px; border:1.5px solid var(--line); background:var(--panel); }
.user-chip .un{ font-size:13px; font-weight:700; line-height:1.15; }
.user-chip .ur{ font-size:11px; color:var(--ink-soft); }
.user-menu{
  position:absolute; top:66px; right:28px; width:230px; background:var(--panel); border-radius:14px;
  box-shadow:var(--lift-shadow); border:1px solid var(--line); padding:8px; display:none; z-index:60;
}
.user-menu.open{ display:block; }
.user-menu a{ display:block; padding:10px 12px; border-radius:10px; font-size:13.5px; font-weight:600; color:var(--ink-soft); }
.user-menu a:hover{ background:var(--bg); color:var(--forest-deep); }
.user-menu .sep{ height:1px; background:var(--line); margin:6px 4px; }
.user-menu .danger{ color:var(--danger); }

.page-body{ padding:26px 28px 60px; max-width:1180px; width:100%; }
@media(max-width:1000px){
  .sidebar{
    position:fixed; left:0; top:0; z-index:80; transform:translateX(-100%); transition:transform .25s ease;
    box-shadow:var(--lift-shadow);
  }
  .sidebar.open{ transform:translateX(0); }
  .menu-toggle{ display:block; }
  .page-body{ padding:20px 16px 50px; }
  .topbar{ padding:14px 16px; }
  .user-menu{ right:16px; }
  .scrim{ position:fixed; inset:0; background:rgba(31,58,95,.35); z-index:70; display:none; }
  .scrim.open{ display:block; }
}
@media(max-width:620px){ .user-chip .um{ display:none; } }

/* ---------- portal content bits ---------- */
.page-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:14px; margin-bottom:20px; flex-wrap:wrap; }
.page-head h2{ font-size:23px; color:var(--forest-deep); }
.page-head .lead{ font-size:13.5px; color:var(--ink-soft); max-width:560px; margin-top:4px; }

.stat-row{ display:grid; grid-template-columns:repeat(auto-fit,minmax(165px,1fr)); gap:14px; margin-bottom:20px; }
.stat-card{ background:var(--panel); border-radius:16px; padding:16px 18px; box-shadow:var(--card-shadow); }
.stat-card.tinted{ background:#F6F9F3; box-shadow:none; }
.stat-num{ font-size:24px; font-weight:800; color:var(--forest-deep); font-family:'Baloo 2',sans-serif; line-height:1.15; }
.stat-lbl{ font-size:12px; color:var(--ink-soft); font-weight:600; }
.trend-chip{ display:inline-block; font-size:11px; font-weight:700; padding:3px 10px; border-radius:999px; margin-top:7px; }
.trend-up{ background:#E7EFE3; color:var(--forest-deep); }
.trend-down{ background:#FBEADD; color:#B8600C; }
.trend-flat{ background:var(--bg); color:var(--ink-soft); }

.cols{ display:grid; grid-template-columns:1.25fr .75fr; gap:20px; align-items:start; }
.cols-even{ display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start; }
@media(max-width:940px){ .cols, .cols-even{ grid-template-columns:1fr; } }

.tabs{ display:inline-flex; background:var(--bg); border-radius:12px; padding:4px; margin-bottom:18px; flex-wrap:wrap; }
.tab-btn{ border:none; background:transparent; padding:8px 18px; font-size:13px; font-weight:700; color:var(--ink-soft); border-radius:9px; cursor:pointer; }
.tab-btn.active{ background:var(--forest); color:#fff; }
.tab-panel{ display:none; }
.tab-panel.active{ display:block; animation:fadeIn .22s ease; }
@keyframes fadeIn{ from{ opacity:0; transform:translateY(6px);} to{ opacity:1; transform:none; } }

.quick-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:18px; }
@media(max-width:620px){ .quick-row{ grid-template-columns:repeat(2,1fr); } }
.quick-btn{
  background:var(--panel); border-radius:14px; padding:15px 8px; text-align:center;
  box-shadow:var(--card-shadow); cursor:pointer; border:1.5px solid transparent; transition:.15s;
}
.quick-btn:hover{ border-color:var(--forest); transform:translateY(-2px); }
.quick-btn .ico{ font-size:21px; }
.quick-btn .lbl{ font-size:11.5px; font-weight:700; margin-top:5px; color:var(--ink-soft); }

.macro-row{ margin-bottom:13px; }
.macro-row:last-child{ margin-bottom:0; }
.macro-row-head{ display:flex; justify-content:space-between; font-size:12.5px; font-weight:600; color:var(--ink-soft); margin-bottom:5px; }
.macro-row-head b{ color:var(--ink); font-weight:700; }
.macro-bar-track{ width:100%; height:9px; background:var(--bg); border-radius:999px; overflow:hidden; }
.macro-bar-fill{ height:100%; border-radius:999px; transition:width .6s ease; }

.meal-row{ display:flex; align-items:center; gap:12px; padding:11px 0; border-bottom:1px dashed var(--line); }
.meal-row:last-child{ border-bottom:none; }
.meal-thumb{ width:44px; height:44px; border-radius:12px; background:#F3E7D4; display:flex; align-items:center; justify-content:center; font-size:21px; flex:0 0 auto; }
.meal-name{ font-weight:700; font-size:14px; }
.meal-meta{ font-size:11.5px; color:var(--ink-soft); }
.meal-cal{ margin-left:auto; font-weight:700; font-size:13px; color:var(--forest-deep); white-space:nowrap; }

.result-row{ display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:13px; padding:10px 0; border-bottom:1px dashed var(--line); }
.result-row:last-child{ border-bottom:none; }

.table-wrap{ overflow-x:auto; background:var(--panel); border-radius:16px; box-shadow:var(--card-shadow); padding:6px 18px 10px; }
table.data{ width:100%; border-collapse:collapse; font-size:13.5px; min-width:640px; }
table.data th{ text-align:left; padding:12px; color:var(--ink-soft); font-size:11px; text-transform:uppercase; letter-spacing:.03em; border-bottom:2px solid var(--line); white-space:nowrap; }
table.data td{ padding:13px 12px; border-bottom:1px solid var(--line); vertical-align:middle; }
table.data tr:last-child td{ border-bottom:none; }
table.data tbody tr:hover{ background:#FAFCF8; }
.row-flex{ display:flex; align-items:center; gap:9px; }
.client-name{ font-weight:700; }

.plan-slot{ padding:12px 0; border-bottom:1px dashed var(--line); }
.plan-slot:last-of-type{ border-bottom:none; }
.plan-slot-label{ font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-soft); margin-bottom:5px; }
.plan-slot-item{ font-size:13.5px; font-weight:600; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.plan-slot-item.add-item{ color:var(--forest); cursor:pointer; }
.plan-slot-time{ font-size:11.5px; color:var(--ink-soft); font-weight:600; margin-left:auto; }
.plan-slot-note{ font-size:11.5px; color:var(--marigold-deep); margin-top:4px; font-style:italic; }
.chip-x{ color:var(--ink-soft); font-weight:400; cursor:pointer; }

.day-chips{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.day-chip{
  border:1.5px solid var(--line); background:var(--panel); color:var(--ink-soft);
  font-weight:700; font-size:12.5px; padding:8px 15px; border-radius:999px; cursor:pointer;
}
.day-chip.active{ background:var(--forest); border-color:var(--forest); color:#fff; }

.msg-layout{ display:flex; background:var(--panel); border-radius:16px; overflow:hidden; box-shadow:var(--card-shadow); min-height:520px; }
.msg-list{ width:250px; border-right:1px solid var(--line); flex:0 0 auto; overflow-y:auto; }
.msg-list-item{ display:flex; align-items:center; gap:10px; padding:13px 14px; cursor:pointer; border-bottom:1px solid var(--bg); position:relative; }
.msg-list-item.active{ background:#F1F6EE; }
.msg-list-item:hover{ background:#F6F9F3; }
.msg-list-text{ min-width:0; }
.msg-list-name{ font-weight:700; font-size:13px; }
.msg-list-preview{ font-size:11.5px; color:var(--ink-soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:140px; }
.unread-dot{ width:8px; height:8px; border-radius:50%; background:var(--marigold); position:absolute; right:14px; top:18px; }
.msg-thread{ flex:1; display:flex; flex-direction:column; min-width:0; }
.msg-thread-head{ display:flex; align-items:center; gap:10px; padding:14px 18px; border-bottom:1px solid var(--line); }
.msg-bubbles{ flex:1; padding:18px; display:flex; flex-direction:column; gap:10px; overflow-y:auto; max-height:420px; }
.bubble{ max-width:74%; padding:10px 14px; border-radius:14px; font-size:13px; line-height:1.45; }
.bubble-in{ align-self:flex-start; background:#F1F0EA; color:var(--ink); border-bottom-left-radius:4px; }
.bubble-out{ align-self:flex-end; background:var(--forest); color:#fff; border-bottom-right-radius:4px; }
.msg-input-row{ display:flex; gap:10px; padding:14px 18px; border-top:1px solid var(--line); }
.msg-input{ flex:1; border:1.5px solid var(--line); border-radius:12px; padding:10px 14px; font-family:inherit; font-size:13px; }
.msg-input:focus{ outline:none; border-color:var(--forest); }
@media(max-width:760px){ .msg-layout{ flex-direction:column; } .msg-list{ width:100%; max-height:190px; border-right:none; border-bottom:1px solid var(--line); } }

.seat-label{ font-size:12.5px; font-weight:700; color:var(--ink-soft); margin-bottom:7px; }
.seat-bar{ width:100%; height:10px; background:var(--bg); border-radius:999px; overflow:hidden; }
.seat-fill{ height:100%; background:linear-gradient(90deg,var(--forest),var(--leaf)); border-radius:999px; }

.capture-box{ border:2px dashed #C7D6BF; border-radius:20px; padding:34px 18px; text-align:center; background:#F6F9F3; margin-bottom:16px; }
.capture-icon{ font-size:34px; margin-bottom:8px; }
.divider-or{ display:flex; align-items:center; gap:10px; margin:16px 0; color:var(--ink-soft); font-size:11.5px; font-weight:700; }
.divider-or::before, .divider-or::after{ content:""; flex:1; height:1px; background:var(--line); }

.profile-head{ display:flex; align-items:center; gap:18px; flex-wrap:wrap; margin-bottom:6px; }
.profile-avatar{
  width:76px; height:76px; border-radius:24px; display:flex; align-items:center; justify-content:center;
  font-family:'Baloo 2',sans-serif; font-weight:800; font-size:30px; color:#fff;
  background:linear-gradient(135deg,var(--forest),var(--leaf)); box-shadow:0 8px 20px rgba(47,82,51,.25);
}
.profile-name{ font-family:'Baloo 2',sans-serif; font-weight:700; font-size:24px; color:var(--forest-deep); }
.kv-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:16px; }
.kv{ background:#F6F9F3; border-radius:14px; padding:13px 15px; }
.kv .k{ font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-soft); }
.kv .v{ font-size:14.5px; font-weight:700; color:var(--ink); margin-top:3px; }

.bmi-chip{ background:#F1F6EE; border:1.5px dashed #C7D6BF; border-radius:12px; padding:11px 14px; font-size:12.5px; color:var(--forest-deep); font-weight:600; text-align:center; }
.toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--forest-deep); color:#fff; padding:13px 22px; border-radius:14px; font-size:13.5px; font-weight:600;
  box-shadow:var(--lift-shadow); opacity:0; pointer-events:none; transition:.25s ease; z-index:200;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.hidden{ display:none !important; }

/* ---------- meal photo scan / editable nutrition list ---------- */
.photo-preview{
  width:100%; height:190px; border-radius:16px; border:1.5px solid var(--line);
  background:#F1F0EA center/cover no-repeat; position:relative;
}
.photo-preview::after{
  content:"Your photo"; position:absolute; left:10px; bottom:8px;
  background:rgba(31,58,95,.62); color:#fff; font-size:10.5px; font-weight:700;
  padding:3px 9px; border-radius:8px; letter-spacing:.02em;
}
.nutri-row{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.nutri-row .nutri-name{ flex:1; min-width:0; }
.nutri-row .nutri-kcal{ width:96px; text-align:right; }
.nutri-unit{ font-size:12px; color:var(--ink-soft); font-weight:600; width:28px; flex:0 0 auto; }
.nutri-del{
  border:none; background:#F7E2E2; color:var(--danger); width:34px; height:34px; flex:0 0 auto;
  border-radius:10px; font-size:17px; line-height:1; cursor:pointer;
}
.nutri-del:hover{ background:#F1CFCF; }
.nutri-row.add-row{
  justify-content:center; border:1.5px dashed #C7D6BF; border-radius:12px; padding:11px;
  color:var(--forest); font-weight:700; font-size:13px; cursor:pointer; background:#F6F9F3;
}
.nutri-row.add-row:hover{ background:#EEF4E8; }
.nutri-total{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding:13px 2px 2px; margin-top:6px; border-top:1.5px solid var(--line); font-weight:700; font-size:14px;
}
.nutri-total b{ color:var(--forest-deep); font-size:17px; font-family:'Baloo 2',sans-serif; }

.choose-row{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
.choose-row .btn{ flex:0 1 auto; }
.chosen-row{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:10px; font-size:12.5px; }
.chosen-row .fname{ color:var(--ink-soft); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:70%; }
.scan-progress{ display:flex; align-items:center; gap:11px; justify-content:center; padding:18px; color:var(--ink-soft); font-weight:600; font-size:13.5px; }
.spinner{ width:19px; height:19px; border-radius:50%; border:2.5px solid var(--line); border-top-color:var(--forest); animation:spin .8s linear infinite; flex:0 0 auto; }
@keyframes spin{ to{ transform:rotate(360deg); } }
.scan-note{ font-size:11px; text-align:center; margin-top:10px; color:var(--ink-soft); }
.scan-note .dot{ display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:5px; vertical-align:middle; }
