/* Nutra Sua Vida — design system v2
   vinho #882127 · dourado #E2AD5B · verde #5F7D36 / #96BC62 · creme #FBF7F2
   Princípios: um foco por tela (Gestalt: figura/fundo), blocos de cor com significado fixo
   (vinho = jornada/ação, dourado = conquista, verde = saúde/feito, azul = água), botões táteis. */
:root {
  --wine: #882127; --wine-d: #5e1418; --wine-s: #f6e7e8;
  --gold: #e2ad5b; --gold-d: #b98634; --gold-s: #fbf1e1; --gold-t: #6b4510;
  --leaf: #5f7d36; --leaf-d: #44591f; --leaf-l: #96bc62; --leaf-s: #edf4e3; --leaf-t: #33461b;
  --sky: #4a95d6; --sky-s: #e7f1fa;
  --ink: #2b1f20; --ink-2: #5d5152; --ink-3: #8f8485;
  --line: #ece4dc; --bg: #fbf7f2; --card: #ffffff; --danger: #b3261e;
  --r: 20px; --r-sm: 14px;
  --font: 'Jost', 'Futura', 'Avenir', 'Segoe UI', system-ui, sans-serif;
  --script: 'Cookie', cursive;
  font-size: 16px;
}
html.font-large { font-size: 19px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--wine); }
h1, h2, h3, h4 { margin: 0 0 .35em; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .6em; }
.ti { line-height: 1; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: .86rem; } .tiny { font-size: .74rem; }
.row { display: flex; gap: 10px; align-items: center; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; } .center { text-align: center; } .mt { margin-top: 14px; } .mb { margin-bottom: 14px; } .hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------------------------------------------------------------- botões táteis */
.btn { --c: var(--wine); --d: var(--wine-d); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 10px 22px;
  border-radius: 16px; border: 0; background: var(--c); color: #fff; font-weight: 600; letter-spacing: .02em; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 0 var(--d); transform: translateY(0); transition: transform .06s, box-shadow .06s, filter .15s; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--d); }
.btn .ti { font-size: 1.25em; }
.btn.leaf { --c: var(--leaf); --d: var(--leaf-d); } .btn.gold { --c: var(--gold); --d: var(--gold-d); color: #3a2a10; }
.btn.light { --c: #fff; --d: var(--line); color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; min-height: 42px; padding: 6px 12px; }
.btn.block { width: 100%; } .btn.sm { min-height: 40px; padding: 6px 14px; font-size: .9rem; border-radius: 12px; box-shadow: 0 3px 0 var(--d); }
.btn[disabled] { opacity: .45; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; min-height: 40px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: .9rem; white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; font-weight: 600; font-size: .88rem; background: #fff; border: 1.5px solid var(--line); }
.pill.gold { background: var(--gold-s); border-color: transparent; color: var(--gold-t); }
.pill.wine { background: var(--wine-s); border-color: transparent; color: var(--wine); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--leaf-s); color: var(--leaf-t); font-size: .76rem; font-weight: 500; margin: 2px 4px 2px 0; }
.tag.warn { background: #fdecea; color: var(--danger); } .tag.gold { background: var(--gold-s); color: var(--gold-t); } .tag.wine { background: var(--wine-s); color: var(--wine); }

/* ---------------------------------------------------------------- superfícies e formulários */
.card { background: var(--card); border-radius: var(--r); border: 1.5px solid var(--line); padding: 16px; margin-bottom: 14px; }
.card.flat { border-color: transparent; background: #fff; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-title h3 { margin: 0; }
label { display: block; font-weight: 500; margin: 10px 0 6px; font-size: .92rem; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=search], input[type=time], select, textarea {
  width: 100%; min-height: 46px; padding: 9px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; }
.check { display: flex; align-items: center; gap: 12px; padding: 9px 0; cursor: pointer; font-weight: 400; margin: 0; }
.check input { width: 22px; height: 22px; accent-color: var(--leaf); flex: none; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.info { background: var(--leaf-s); color: var(--leaf-t); border-radius: 14px; padding: 11px 13px; margin: 10px 0; font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; }
.alert { background: #fdecea; color: #7a1c15; border-radius: 14px; padding: 11px 13px; margin: 10px 0; font-size: .92rem; display: flex; gap: 10px; }
.tip { background: var(--gold-s); color: var(--gold-t); border-radius: 16px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: .95rem; }
.tip .ti { font-size: 1.4rem; flex: none; }

/* ---------------------------------------------------------------- app do paciente: moldura */
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: 92px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(251, 247, 242, .92); backdrop-filter: blur(10px); }
.topbar .mark { width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 1.5px solid var(--line); object-fit: contain; padding: 2px; }
.topbar .brand { font-weight: 600; font-size: 1rem; line-height: 1.05; }
.topbar .brand span { display: block; font-family: var(--script); font-weight: 400; color: var(--gold-d); font-size: 1.15rem; line-height: .9; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--ink-2); }
.screen { padding: 4px 16px 16px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; background: #fff; border-top: 1.5px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar .inner { display: flex; width: 100%; max-width: 520px; }
.tabbar button { flex: 1; border: 0; background: none; padding: 8px 2px 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; color: var(--ink-3); font-size: .76rem; font-weight: 500; min-height: 66px; position: relative; }
.tabbar button .ti { font-size: 1.6rem; }
.tabbar button.on { color: var(--wine); }
.tabbar button.on .ico { background: var(--wine-s); }
.tabbar .ico { width: 54px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.badge { position: absolute; top: 4px; right: calc(50% - 26px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--gold); color: #3a2a10; font-size: .68rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------- JORNADA */
.unit { border-radius: 22px; padding: 16px; color: #fff; position: relative; overflow: hidden; margin: 6px 0 4px; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; background: var(--wine); }
.unit .cover { position: absolute; inset: 0; background-size: cover; background-position: 85% 22%; }
.unit .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(74, 14, 18, .94) 0%, rgba(110, 26, 31, .78) 38%, rgba(136, 33, 39, .12) 72%, rgba(136, 33, 39, 0) 100%); }
.unit.done .cover::after { background: linear-gradient(90deg, rgba(51, 70, 27, .94) 0%, rgba(68, 89, 31, .78) 38%, rgba(95, 125, 54, .1) 72%, rgba(95, 125, 54, 0) 100%); }
.unit > * { position: relative; }
.unit .eyebrow { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: #f3d9b0; font-weight: 600; }
.unit h2 { color: #fff; margin: 2px 0 8px; font-size: 1.35rem; max-width: 70%; }
.unit .bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .25); overflow: hidden; max-width: 60%; }
.unit .bar > div { height: 100%; background: var(--gold); border-radius: 4px; }
.unit.locked { background: #e9e2da; color: var(--ink-2); min-height: 0; }
.unit.locked h2 { color: var(--ink-2); max-width: none; }
.unit.locked .eyebrow { color: var(--ink-3); }
.unit.done { background: var(--leaf); }
.trail { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 22px 0 26px; }
.node { position: relative; border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.node .disc { width: 70px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; color: #fff; background: var(--gold); box-shadow: 0 6px 0 var(--gold-d); transition: transform .08s, box-shadow .08s; }
.node:active .disc { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-d); }
.node.current .disc { width: 80px; height: 76px; background: var(--wine); box-shadow: 0 7px 0 var(--wine-d), 0 0 0 8px rgba(136, 33, 39, .12); }
.node.locked .disc { background: #e6dfd7; color: #b3a99f; box-shadow: 0 6px 0 #d3c9be; }
.node.lockedch .disc { background: #efe9e3; color: #c9bfb4; box-shadow: 0 5px 0 #e0d7cd; width: 60px; height: 56px; font-size: 1.5rem; }
.node .start { position: absolute; top: -34px; background: #fff; color: var(--wine); border: 1.5px solid var(--line); border-radius: 12px; padding: 4px 12px; font-weight: 600; font-size: .82rem; white-space: nowrap; animation: bob 1.6s ease-in-out infinite; }
.node .start::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; background: #fff; border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.node .ring { position: absolute; inset: -6px; border-radius: 50%; }
.node .label { margin-top: 12px; font-size: .78rem; color: var(--ink-2); max-width: 120px; text-align: center; line-height: 1.15; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.next-lock { text-align: center; color: var(--ink-3); font-size: .9rem; padding: 4px 0 18px; display: flex; gap: 6px; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------- HOJE */
.hello { margin: 4px 0 14px; } .hello h1 { margin: 0; } .hello p { margin: 0; }
.faces { display: flex; justify-content: space-between; gap: 6px; }
.face { flex: 1; aspect-ratio: 1; max-width: 62px; border-radius: 50%; border: 0; background: #f4eee8; color: var(--ink-3); font-size: 1.9rem; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .1s, background .2s; }
.face:active { transform: scale(.92); }
.face.on { background: var(--leaf-s); color: var(--leaf); box-shadow: inset 0 0 0 2px var(--leaf-l); }
.face.on.neg { background: var(--gold-s); color: var(--gold-d); box-shadow: inset 0 0 0 2px var(--gold); }
.face-label { text-align: center; font-size: .78rem; color: var(--ink-3); margin-top: 6px; min-height: 1.1em; }
.tiles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.tile { border: 1.5px solid var(--line); background: #fff; border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; text-align: left; min-height: 128px; transition: transform .08s; }
.tile:active { transform: scale(.98); }
.tile .ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.tile .big { font-size: 1.45rem; font-weight: 600; line-height: 1; } .tile .big small { font-size: .85rem; color: var(--ink-3); font-weight: 400; }
.tile .lbl { font-size: .8rem; color: var(--ink-3); }
.tile.done { border-color: var(--leaf-l); background: var(--leaf-s); }
.meter { height: 7px; border-radius: 4px; background: #f1ebe4; overflow: hidden; } .meter > div { height: 100%; border-radius: 4px; transition: width .4s; }
.quick-cta { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; background: var(--wine); color: #fff; cursor: pointer; border: 0; width: 100%; text-align: left; box-shadow: 0 5px 0 var(--wine-d); margin-bottom: 18px; }
.quick-cta .ti { font-size: 1.6rem; } .quick-cta b { display: block; } .quick-cta span { font-size: .85rem; color: #f3d9b0; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 2px 10px; }
.section-h h3 { margin: 0; font-size: 1rem; }

/* ---------------------------------------------------------------- PLANO */
.seg { display: flex; background: #efe8e1; border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 11px; padding: 9px 4px; font-weight: 500; color: var(--ink-2); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.daybar { display: flex; align-items: center; gap: 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 20px; padding: 12px 14px; margin-bottom: 14px; }
.daybar .kcal { font-size: 1.5rem; font-weight: 600; line-height: 1; } .daybar .kcal small { font-size: .8rem; color: var(--ink-3); font-weight: 400; }
.mstack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #f1ebe4; margin-top: 6px; }
.mleg { display: flex; gap: 12px; font-size: .78rem; color: var(--ink-2); margin-top: 6px; flex-wrap: wrap; }
.mleg i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.c-carb { background: var(--gold); } .c-prot { background: var(--wine); } .c-fat { background: var(--leaf-l); }
.meal { background: #fff; border: 1.5px solid var(--line); border-radius: 22px; padding: 14px; margin-bottom: 14px; }
.meal.eaten { border-color: var(--leaf-l); }
.meal-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.meal-h .when { width: 46px; height: 46px; border-radius: 14px; background: var(--gold-s); color: var(--gold-t); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .72rem; font-weight: 600; line-height: 1.05; flex: none; }
.meal-h .when .ti { font-size: 1.15rem; }
.meal-body { display: flex; gap: 14px; align-items: center; }
.donut { flex: none; }
.items { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.items li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.items li:last-child { border: 0; }
.items .q { color: var(--ink-3); font-size: .8rem; text-align: right; white-space: nowrap; }
.items .lnk { color: var(--wine); font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.optdots { display: flex; gap: 6px; }
.optdots button { width: 34px; height: 30px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: .85rem; cursor: pointer; color: var(--ink-2); }
.optdots button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.meal-actions { display: flex; gap: 10px; margin-top: 12px; }
.meal-actions .btn { flex: 1; min-height: 44px; }

/* receitas */
.search { position: relative; margin-bottom: 10px; } .search .ti { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 1.15rem; }
.search input { padding-left: 42px; border-radius: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; } .chips::-webkit-scrollbar { display: none; }
.recipes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.rcard { background: #fff; border-radius: 20px; overflow: hidden; cursor: pointer; border: 1.5px solid var(--line); padding: 0; text-align: left; display: flex; flex-direction: column; }
.rcard .ph { aspect-ratio: 4/3; background: var(--gold-s); display: flex; align-items: center; justify-content: center; color: var(--gold-d); font-size: 2.4rem; position: relative; background-size: cover; background-position: center; }
.rcard .ph .rec { position: absolute; top: 8px; left: 8px; font-size: .68rem; background: var(--wine); color: #fff; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.rcard .ph .fav { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--wine); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.rcard .body { padding: 10px 12px 12px; } .rcard h4 { font-size: .93rem; margin: 0 0 4px; line-height: 1.2; font-weight: 600; }
.rcard .meta { font-size: .78rem; color: var(--ink-3); display: flex; gap: 8px; }
.r-hero { aspect-ratio: 16/10; border-radius: 22px; background: var(--gold-s); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; font-size: 3.5rem; color: var(--gold-d); margin-bottom: 14px; }
.macro { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.macro div { background: var(--bg); border-radius: 14px; padding: 10px 6px; text-align: center; } .macro b { display: block; font-size: 1.05rem; } .macro span { font-size: .72rem; color: var(--ink-2); }
.ing { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ing input { width: 24px; height: 24px; flex: none; accent-color: var(--leaf); margin-top: 1px; }
.ing.have span { text-decoration: line-through; color: var(--ink-3); }
.ing-h { font-weight: 600; margin: 14px 0 2px; color: var(--wine); }
ol.steps { padding-left: 22px; } ol.steps li { margin-bottom: 10px; }
.nutri-hl { display: flex; gap: 8px; flex-wrap: wrap; } .nutri-hl .n { background: var(--leaf-s); border-radius: 12px; padding: 8px 10px; font-size: .85rem; flex: 1 1 140px; color: var(--leaf-t); }

/* compras */
.shop-cat { font-weight: 600; color: var(--ink-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 4px; }
.shop-item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.shop-item input { width: 26px; height: 26px; accent-color: var(--leaf); flex: none; }
.shop-item.done .txt { text-decoration: line-through; color: var(--ink-3); }
.shop-item .from { font-size: .74rem; color: var(--ink-3); }

/* ---------------------------------------------------------------- EVOLUÇÃO */
.deltas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-bottom: 14px; }
.delta { border-radius: 18px; padding: 12px 14px; background: var(--leaf-s); color: var(--leaf-t); }
.delta.neu { background: var(--gold-s); color: var(--gold-t); }
.delta span { font-size: .78rem; } .delta b { display: block; font-size: 1.45rem; line-height: 1.1; }
.delta small { font-size: .74rem; opacity: .8; }
.doc { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 16px; background: #fff; border: 1.5px solid var(--line); margin-bottom: 8px; cursor: pointer; width: 100%; text-align: left; text-decoration: none; color: inherit; }
.doc .ti-file-type-pdf { font-size: 1.6rem; color: var(--wine); } .doc .ti-download { margin-left: auto; color: var(--ink-3); font-size: 1.2rem; }
.medals { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.medal { flex: none; width: 86px; text-align: center; font-size: .72rem; color: var(--ink-2); }
.medal .m { width: 62px; height: 62px; margin: 0 auto 6px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; background: var(--gold); color: #fff; box-shadow: 0 4px 0 var(--gold-d); }
.medal.off .m { background: #eee7e0; color: #c4bab0; box-shadow: 0 4px 0 #ddd4ca; }
.guide { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 18px; border: 1.5px solid var(--line); background: #fff; margin-bottom: 8px; cursor: pointer; width: 100%; text-align: left; }
.guide .ic { width: 42px; height: 42px; border-radius: 13px; background: var(--leaf-s); color: var(--leaf); display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex: none; }

/* gráficos */
.chart { width: 100%; height: auto; display: block; }
.chart .ch-x, .chart .ch-y { font-size: 10px; fill: var(--ink-3); font-family: var(--font); }
.chart .ch-last { font-size: 12px; font-weight: 600; fill: var(--ink); font-family: var(--font); }
.chart .ch-axis { stroke: var(--line); } .chart .col { fill: var(--leaf-l); } .chart .col:hover { fill: var(--leaf); }
.chart-empty { padding: 24px; text-align: center; color: var(--ink-3); background: var(--bg); border-radius: 12px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 52px; gap: 10px; align-items: center; font-size: .88rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; background: var(--bg); border-radius: 6px; overflow: hidden; } .bar-fill { height: 100%; background: var(--wine); border-radius: 6px; }
.bar-val { text-align: right; font-weight: 600; }

/* ---------------------------------------------------------------- folha (bottom sheet), avisos, comemoração */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(30, 15, 15, .42); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@media (min-width: 700px) { .modal-wrap { align-items: center; } }
.modal { background: var(--bg); width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; border-radius: 26px 26px 0 0; padding: 26px 18px 28px; position: relative; animation: up .22s cubic-bezier(.2, .8, .2, 1); }
.modal::before { content: ''; position: absolute; top: 9px; left: 50%; width: 40px; height: 5px; border-radius: 3px; background: #ddd3c9; transform: translateX(-50%); }
@media (min-width: 700px) { .modal { border-radius: 26px; } .modal::before { display: none; } }
.modal.wide { max-width: 980px; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; cursor: pointer; font-size: 1.1rem; z-index: 2; color: var(--ink-2); border: 1.5px solid var(--line); }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-ic { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 12px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 18px 0; }
.stepper button { width: 64px; height: 64px; border-radius: 50%; font-size: 1.8rem; }
.stepper .val { font-size: 3rem; font-weight: 600; min-width: 90px; text-align: center; line-height: 1; } .stepper .val small { display: block; font-size: .85rem; font-weight: 400; color: var(--ink-3); }
.opt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.opt { min-height: 60px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; padding: 10px 12px; display: flex; align-items: center; gap: 10px; text-align: left; font-weight: 500; }
.opt .ti { font-size: 1.4rem; color: var(--ink-3); } .opt.on { border-color: var(--leaf); background: var(--leaf-s); } .opt.on .ti { color: var(--leaf); }
#toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 16px; transition: opacity .4s, transform .4s; text-align: center; font-weight: 500; }
.toast.good { background: var(--leaf); } .toast.bad { background: var(--danger); } .toast.out { opacity: 0; transform: translateY(10px); }
.celebrate { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.celebrate span { position: absolute; top: -30px; width: 10px; height: 14px; border-radius: 3px; animation: fall 2.2s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .7; } }
.celebrate-msg { position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%); background: #fff; padding: 20px 26px; border-radius: 22px; box-shadow: 0 16px 50px rgba(0, 0, 0, .18); font-weight: 600; font-size: 1.15rem; text-align: center; animation: pop .4s cubic-bezier(.2, 1.4, .4, 1); max-width: 86vw; }
.celebrate-msg .ti { display: block; font-size: 2.6rem; color: var(--gold); margin-bottom: 6px; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.6); opacity: 0; } }
.demo-banner { background: var(--gold-s); color: var(--gold-t); text-align: center; font-size: .78rem; padding: 4px 10px; }
.demo-banner button { background: none; border: 0; text-decoration: underline; cursor: pointer; font-size: .78rem; color: inherit; }

/* login / boas-vindas */
.auth { max-width: 440px; margin: 0 auto; padding: 32px 20px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.auth .logo { width: 128px; height: 128px; margin: 0 auto 8px; display: block; object-fit: contain; }
.auth h1 { text-align: center; }
.auth .script { font-family: var(--script); color: var(--gold-d); font-size: 1.9rem; text-align: center; display: block; margin-top: -8px; }
.demo-list button { width: 100%; justify-content: flex-start; margin-bottom: 10px; }
.ob-opts { display: grid; gap: 10px; margin: 18px 0; }
.ob-opt { min-height: 58px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; font-size: 1.02rem; cursor: pointer; padding: 10px 16px; text-align: left; box-shadow: 0 3px 0 var(--line); }
.ob-opt.on { border-color: var(--wine); background: var(--wine-s); font-weight: 600; box-shadow: 0 3px 0 var(--wine); }
.progress-top { height: 10px; border-radius: 5px; background: #ece4dc; overflow: hidden; margin-bottom: 18px; } .progress-top > div { height: 100%; background: var(--leaf-l); border-radius: 5px; transition: width .3s; }

/* ---------------------------------------------------------------- painel da nutricionista */
.admin { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; font-size: 15px; }
.side { background: #1f1416; color: #f3e9e3; padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side .brand { display: flex; gap: 10px; align-items: center; margin-bottom: 24px; }
.side .brand img { width: 44px; height: 44px; border-radius: 50%; background: #fff; object-fit: contain; padding: 2px; }
.side .brand b { display: block; color: var(--gold); }
.side nav button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 11px 12px; border: 0; background: none; color: inherit; border-radius: 10px; cursor: pointer; text-align: left; margin-bottom: 2px; }
.side nav button .ti { font-size: 1.2rem; }
.side nav button:hover { background: rgba(255, 255, 255, .07); } .side nav button.on { background: var(--wine); color: #fff; }
.side .foot { margin-top: auto; font-size: .8rem; color: #b9a9a3; }
.side .foot button { color: var(--gold); background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline; }
.main { padding: 24px 28px 60px; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border-radius: 16px; padding: 14px 16px; border: 1.5px solid var(--line); }
.kpi b { font-size: 1.6rem; display: block; line-height: 1.1; } .kpi span { color: var(--ink-2); font-size: .85rem; } .kpi small { display: block; color: var(--ink-3); font-size: .75rem; margin-top: 4px; }
.cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.cols3 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 1100px) { .cols2, .cols3 { grid-template-columns: minmax(0, 1fr); } }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1.5px solid var(--line); }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--gold-s); }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; border-bottom: 3px solid transparent; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.tabs button.on { color: var(--wine); border-color: var(--wine); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.ok { background: var(--leaf-l); } .dot.warn { background: var(--gold); } .dot.bad { background: var(--danger); } .dot.off { background: #c9c0b7; }
.timeline { list-style: none; margin: 0; padding: 0; } .timeline li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .88rem; } .timeline .when { color: var(--ink-3); width: 110px; flex: none; }
/* editor de plano */
.pe-meal { border: 1.5px solid var(--line); border-radius: 18px; background: #fff; margin-bottom: 14px; overflow: hidden; }
.pe-head { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 10px; align-items: end; padding: 12px 14px; background: var(--bg); border-bottom: 1.5px solid var(--line); }
.pe-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
@media (max-width: 1200px) { .pe-opts { grid-template-columns: minmax(0, 1fr); } }
.pe-opt { padding: 12px 14px; border-right: 1.5px solid var(--line); } .pe-opt:last-child { border-right: 0; }
.pe-opt h4 { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: .9rem; }
.pe-item { display: grid; grid-template-columns: minmax(0, 1fr) 64px 26px; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.pe-item .nm { cursor: pointer; } .pe-item .nm small { display: block; color: var(--ink-3); font-size: .74rem; }
.pe-item input { min-height: 32px; padding: 4px 6px; font-size: .85rem; text-align: right; border-radius: 8px; }
.pe-item .x { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 1rem; }
.pe-tot { font-size: .78rem; color: var(--ink-2); margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.pe-tot b { color: var(--ink); }
.pe-add { margin-top: 8px; width: 100%; border: 1.5px dashed var(--line); background: none; border-radius: 10px; padding: 7px; cursor: pointer; color: var(--ink-2); font-size: .85rem; }
.pe-day { position: sticky; top: 0; z-index: 5; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.food-results { max-height: 300px; overflow: auto; border: 1.5px solid var(--line); border-radius: 12px; margin-top: 8px; background: #fff; }
.food-results button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; text-align: left; font-size: .88rem; }
.food-results button:hover { background: var(--gold-s); }
.diff { font-size: .84rem; margin: 4px 0 0 0; padding-left: 18px; color: var(--ink-2); }
@media (max-width: 860px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; }
  .side .brand { margin: 0; } .side nav { display: flex; gap: 4px; overflow-x: auto; width: 100%; min-width: 0; }
  .side nav button { width: auto; white-space: nowrap; } .side .foot { display: none; } .main { padding: 16px; }
}

/* compatibilidade com classes antigas do painel */
.btn.secondary { --c: #fff; --d: var(--line); color: var(--wine); border: 1.5px solid var(--line); }
.btn.green { --c: var(--leaf); --d: var(--leaf-d); }
.tag.brand { background: var(--wine-s); color: var(--wine); }
.kpi b, .card h3 { letter-spacing: -.01em; }
