:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #f0f3f4;
  --border: #e1e6e8;
  --text: #15201f;
  --muted: #5d6b6a;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e0f2ef;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn-soft: #fff4dc;
  --warn: #8a5a00;
  --medico: #7c3aed;
  --nutricionista: #c2410c;
  --treinador: #0369a1;
  --mentorado: #0f766e;
  --admin: #334155;
  --shadow: 0 1px 2px rgba(16, 24, 24, .06), 0 4px 16px rgba(16, 24, 24, .04);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1413;
    --surface: #161e1d;
    --surface-2: #1d2726;
    --border: #2a3534;
    --text: #e6eeec;
    --muted: #93a3a0;
    --accent: #2dd4bf;
    --accent-ink: #062b27;
    --accent-soft: #133a35;
    --danger: #f97066;
    --danger-soft: #3a1714;
    --warn-soft: #3a2e10;
    --warn: #f5c35b;
    --medico: #a78bfa;
    --nutricionista: #fb923c;
    --treinador: #38bdf8;
    --mentorado: #2dd4bf;
    --admin: #94a3b8;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- topo ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 78%, #000)); display: grid; place-items: center; }
.brand-name { font-weight: 500; letter-spacing: .01em; }
.brand-name b { font-weight: 800; letter-spacing: .04em; }
.auth .brand-mark { width: 52px; height: 52px; border-radius: 14px; }
.auth .brand-mark svg { width: 34px; height: 34px; }
.brand-mark svg { width: 18px; height: 18px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.who { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.who-name { font-weight: 600; font-size: 14px; }
main { max-width: 1120px; margin: 0 auto; padding: 24px; }

/* ---------- elementos ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; font-size: 14px; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.on { background: var(--accent-soft); color: var(--accent); }
.badge.off { background: var(--surface-2); color: var(--muted); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.role { font-size: 12px; font-weight: 600; }
.role::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: currentColor; vertical-align: 1px; }
.role-medico { color: var(--medico); }
.role-nutricionista { color: var(--nutricionista); }
.role-treinador { color: var(--treinador); }
.role-mentorado { color: var(--mentorado); }
.role-admin { color: var(--admin); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--accent-soft); color: var(--accent);
}
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }

input, select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[type=checkbox] { width: auto; }
label.f { display: block; }
label.f > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.fgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.fgrid .wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 28px; }
.auth h1 { margin: 14px 0 4px; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; }

/* ---------- lista de mentorados ---------- */
.pcard { display: block; color: inherit; transition: border-color .15s; }
.pcard:hover { text-decoration: none; border-color: var(--accent); }
.pcard .team { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.search { max-width: 320px; }

/* ---------- ficha ---------- */
.phead { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.phead .info { flex: 1; min-width: 220px; }
.facts { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); font-size: 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 20px 0; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { font-size: 12px; color: var(--muted); margin-left: 4px; }

.rec .rec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.rec .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rec dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; margin: 14px 0 0; }
.rec dt { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.rec dd { margin: 2px 0 0; font-weight: 500; }
.rec .block { margin-top: 14px; }
.rec .block h4 { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.pre { white-space: pre-wrap; }
.actions { display: flex; gap: 4px; }

.tbl-wrap { overflow-x: auto; margin-top: 6px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t tr:last-child td { border-bottom: none; }
.group-title { margin-top: 14px; font-weight: 600; font-size: 14px; color: var(--accent); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }
.kpi { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.macros { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.macros div b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.macros div span { font-size: 12px; color: var(--muted); }
.notice { padding: 10px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 14px; }

/* gráfico */
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--border); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.chart .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }

/* ---------- modal ---------- */
dialog {
  width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  border: 1px solid var(--border); border-radius: 14px; padding: 0;
  background: var(--surface); color: var(--text);
}
dialog::backdrop { background: rgba(10, 20, 20, .45); }
.m-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.m-body { padding: 20px; }
.m-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.listed table.t td { padding: 4px; }
.listed input { padding: 6px 8px; font-size: 14px; }
.listed td.x { width: 36px; }
.listed .narrow { width: 70px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px;
  font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 100;
}
#toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .nav { order: 3; flex-basis: 100%; }
  .who-name { display: none; }
  .who { margin-left: auto; }
  main { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
  .m-body { padding: 16px; }
}

/* ---------- logo clicável ---------- */
a.brand { color: var(--text); }
a.brand:hover { text-decoration: none; opacity: .85; }

/* ---------- financeiro ---------- */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.kpi-card .kpi { font-size: 24px; margin: 2px 0; }
.kpi-bad { color: var(--danger); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-chart .bar { fill: var(--accent); opacity: .55; }
.fin-chart .bar.sel { opacity: 1; }
.fin-chart .bar-g:hover .bar { opacity: .85; }
.fin-chart text.sel { fill: var(--text); font-weight: 600; }
.chart .tip {
  position: absolute; pointer-events: none; white-space: nowrap;
  background: var(--text); color: var(--bg); font-size: 12px; font-weight: 500;
  padding: 4px 8px; border-radius: 6px;
}

/* ---------- exercícios ---------- */
.exanim { position: relative; display: inline-block; width: 64px; height: 48px; border-radius: 6px; overflow: hidden; background: #fff; vertical-align: middle; }
.exanim img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.exanim img + img { animation: exflip 1.6s steps(1) infinite; }
.exanim.lg { width: 100%; max-width: 520px; height: auto; aspect-ratio: 4 / 3; }
.exanim.lg img { object-fit: contain; }
@keyframes exflip { 0% { opacity: 0; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .exanim img + img { animation: none; opacity: 0; } }
.exview { display: flex; justify-content: center; }
.exthumb { padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; line-height: 0; overflow: hidden; }
.exthumb:hover { border-color: var(--accent); }
.exthumb.sm { width: 40px; height: 32px; display: inline-block; }
.exthumb.sm img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.exthumb.empty { border-style: dashed; cursor: default; }
td.thumbcell { width: 48px; }
.listed td.thumbcell { width: 46px; vertical-align: middle; }

/* ---------- autocompletar ---------- */
.ac-box {
  position: fixed; z-index: 1000; max-height: 340px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18); padding: 4px;
}
.ac-item { display: flex; gap: 10px; align-items: center; padding: 7px 9px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.ac-item img { width: 52px; height: 40px; object-fit: cover; border-radius: 5px; background: #fff; flex: none; }
.ac-item:hover, .ac-item.on { background: var(--accent-soft); }
.ac-empty { padding: 10px; color: var(--muted); font-size: 13px; }

/* ---------- dieta calculada ---------- */
.listed td.calc input { width: 58px; background: var(--surface-2); border-color: transparent; text-align: right; font-variant-numeric: tabular-nums; }
.list-total { color: var(--muted); }
.list-total b { color: var(--text); }
tr.subtotal td { font-weight: 600; background: var(--surface-2); }
.diet-total { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.macros div span.small { display: block; }
.off-target { color: var(--warn); font-weight: 600; }
dialog:has(.listed) { width: min(1100px, calc(100vw - 24px)); }
.listed td:not(.narrow):not(.calc):not(.thumbcell):not(.x) input { min-width: 120px; }
.listed td.narrow input { min-width: 64px; }
.badge.courtesy { background: var(--accent-soft); color: var(--accent); border: 1px dashed var(--accent); }

/* balão do gráfico de peso */
.weight-chart .plot { position: relative; touch-action: pan-y; }
.weight-chart .hit { cursor: crosshair; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .pt-hover { fill: var(--accent); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.weight-tip { padding: 7px 10px; line-height: 1.3; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); white-space: nowrap; }
.weight-tip .tip-date { font-size: 11px; opacity: .75; }
.weight-tip .tip-val { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.weight-tip .tip-sub { font-size: 11px; opacity: .85; margin-top: 1px; }

/* =========================================================
   Navegação fluida
   ========================================================= */
#progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 50;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%; background-repeat: no-repeat;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
#progress.on { opacity: 1; animation: prog 1s linear infinite; }
@keyframes prog { from { background-position: -40% 0; } to { background-position: 140% 0; } }

.enter { animation: viewIn .22s cubic-bezier(.2, .7, .3, 1); }
.enter-soft { animation: softIn .18s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes softIn { from { opacity: .3; } to { opacity: 1; } }

.skel { min-height: 120px; }
.sk { border-radius: 6px; background: var(--surface-2); position: relative; overflow: hidden; margin-bottom: 10px; }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); animation: shimmer 1.2s infinite; }
@media (prefers-color-scheme: light) { .sk::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.sk-a { height: 18px; width: 55%; } .sk-b { height: 12px; width: 80%; } .sk-c { height: 12px; width: 40%; }

.btn { transition: background .15s, transform .08s, filter .15s, border-color .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.pcard { transition: border-color .15s, transform .15s, box-shadow .15s; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.nav a, .tabs a { transition: color .15s, background .15s, border-color .2s; }

/* abas da ficha fixas ao rolar */
.tabs { position: sticky; top: var(--hh, 53px); z-index: 5; background: var(--bg); margin-left: -4px; margin-right: -4px; padding: 0 4px; }

/* janelas com animação */
dialog[open] { animation: dlgIn .18s cubic-bezier(.2, .7, .3, 1); }
dialog[open]::backdrop { animation: fadeIn .18s ease-out; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .enter, .enter-soft, dialog[open], dialog[open]::backdrop, #progress.on, .sk::after { animation: none !important; }
  .pcard:hover { transform: none; }
}

/* =========================================================
   Painel de atenção
   ========================================================= */
.attn { margin-bottom: 16px; }
.attn summary { list-style: none; cursor: pointer; }
.attn summary::-webkit-details-marker { display: none; }
.attn summary h2::after { content: " ▾"; color: var(--muted); font-size: 13px; }
.attn:not([open]) summary h2::after { content: " ▸"; }
.attn-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.attn-ok { padding: 12px 18px; }
.attn-groups { display: grid; gap: 14px 22px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 14px; }
.attn-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.attn-ico { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 7px; background: var(--surface-2); font-size: 12px; }
.attn ul { list-style: none; margin: 0; padding: 0; }
.attn li a { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 8px; color: var(--text); }
.attn li a:hover { background: var(--surface-2); text-decoration: none; }
.attn li.more { display: none; }
.attn-group.show-all li.more { display: block; }

/* =========================================================
   Gráficos com balão, faixa de referência e linha do tempo
   ========================================================= */
.lc .plot { position: relative; touch-action: pan-y; }
.lc svg { width: 100%; height: auto; display: block; }
.lc .hit { cursor: crosshair; }
.lc .axis { stroke: var(--border); }
.lc text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.lc .line, .spark .line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.spark .line { stroke-width: 2; }
.lc .pt, .spark .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.lc .pt.bad, .spark .pt.bad { stroke: var(--danger); fill: var(--danger); }
.band { fill: var(--accent); opacity: .09; }
.lc .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.lc .pt-hover { fill: var(--accent); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.lc .pt-hover.bad { fill: var(--danger); }
.lc-tip { padding: 7px 10px; line-height: 1.3; box-shadow: 0 4px 14px rgba(0,0,0,.2); white-space: nowrap; }
.tip-date { font-size: 11px; opacity: .75; }
.tip-val { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tip-flag { font-size: 11px; font-weight: 600; color: #ffb4ab; }
.tip-sub { font-size: 11px; opacity: .85; margin-top: 1px; }
.tip-ev { font-size: 11px; margin-top: 3px; padding-top: 3px; border-top: 1px solid rgba(127,127,127,.35); }
.ev line { stroke-width: 1.5; stroke-dasharray: 2 3; }
.ev text { font-weight: 700; font-size: 11px; }
.ev-treino line { stroke: var(--treinador); } .ev-treino text, .ev-key.ev-treino b { fill: var(--treinador); color: var(--treinador); }
.ev-dieta line { stroke: var(--nutricionista); } .ev-dieta text, .ev-key.ev-dieta b { fill: var(--nutricionista); color: var(--nutricionista); }
.ev-protocolo line { stroke: var(--medico); } .ev-protocolo text, .ev-key.ev-protocolo b { fill: var(--medico); color: var(--medico); }
.ev-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }

/* marcadores de exames */
.markers { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-top: 14px; }
.marker { text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: border-color .15s, transform .12s; }
.marker:hover { border-color: var(--accent); transform: translateY(-1px); }
.marker.is-bad { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.m-name { font-size: 13px; font-weight: 600; color: var(--muted); }
.m-val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 36px; display: block; margin: 4px 0; }
.m-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
tr.row-bad td { background: var(--danger-soft); }

/* =========================================================
   Fotos de evolução e check-in
   ========================================================= */
.photo-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.photo-slot .ph { width: 100%; aspect-ratio: 3 / 4; border: 1.5px dashed var(--border); border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); transition: border-color .15s; }
.photo-slot:hover .ph { border-color: var(--accent); }
.photo-slot.has .ph { border-style: solid; }
.photo-slot.busy .ph { opacity: .55; }
.photo-slot .ph img { width: 100%; height: 100%; object-fit: cover; }
.ph-plus { font-size: 28px; color: var(--muted); }
.photo-slot .pl { font-size: 13px; font-weight: 600; }
.pstatus { color: var(--muted); min-height: 16px; text-align: center; }
.ph-rm { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.photo-row { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-thumb { border: 1px solid var(--border); border-radius: 10px; padding: 0; overflow: hidden; background: none; cursor: pointer; color: var(--text); font: inherit; width: 96px; }
.photo-thumb img { width: 96px; height: 128px; object-fit: cover; display: block; }
.photo-thumb span { display: block; font-size: 12px; padding: 3px 0; }
.photo-big { display: flex; justify-content: center; }
.photo-big img { max-width: 100%; max-height: 70vh; border-radius: 10px; }
.compare .cmp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 12px; }
.compare select { margin-bottom: 8px; }
.cmp-img img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.cmp-cap { text-align: center; font-size: 13px; color: var(--muted); margin-top: 4px; }
.cmp-empty { aspect-ratio: 3 / 4; display: grid; place-items: center; border: 1.5px dashed var(--border); border-radius: 10px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg button { font: inherit; font-size: 13px; padding: 5px 12px; border: none; background: var(--surface); color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ck-banner { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; border-color: var(--accent); background: var(--accent-soft); }
.ck-banner.ok { border-color: var(--border); background: var(--surface); }

@media (max-width: 720px) {
  .photo-slots { gap: 6px; }
}

.ev-multi line { stroke: var(--muted); }
.ev tspan.ev-treino { fill: var(--treinador); } .ev tspan.ev-dieta { fill: var(--nutricionista); } .ev tspan.ev-protocolo { fill: var(--medico); }
.compare .cmp-grid { grid-template-columns: repeat(2, minmax(0, 320px)); justify-content: start; }
.photo-slots { max-width: 480px; }
@media (max-width: 720px) { .compare .cmp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* =========================================================
   Termo, notas, registro de cargas, Pix, WhatsApp, impressão
   ========================================================= */
.consent { max-width: 680px !important; }
.term { max-height: 46vh; overflow-y: auto; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.btn.wa { color: #1f9d55; border-color: color-mix(in srgb, #25d366 45%, var(--border)); padding: 4px 8px; text-decoration: none; }
.btn.wa:hover { background: color-mix(in srgb, #25d366 14%, var(--surface)); text-decoration: none; }
.attn li { display: flex; align-items: center; gap: 6px; }
.attn li > a:first-child { flex: 1; min-width: 0; }
.notes { display: grid; gap: 10px; margin-top: 14px; }
.note { padding: 14px 16px; }
.sx-list { display: grid; gap: 10px; margin: 12px 0; }
.sx { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.sx-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.sx-sets { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.sx-set { display: flex; align-items: center; gap: 6px; }
.sx-set input { width: 64px; padding: 6px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.pix { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.pix-qr { background: #fff; border-radius: 12px; padding: 6px; }
.pix-qr svg { width: 100%; height: auto; display: block; }
.pix-steps { margin: 0; padding-left: 18px; }
@media (max-width: 600px) { .pix { grid-template-columns: 1fr; } .pix-qr { max-width: 240px; margin: 0 auto; } }
.shop { list-style: none; margin: 0 0 6px; padding: 0; }
.shop li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.shop-cat { margin: 14px 0 4px; font-size: 13px; color: var(--accent); }
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }
.ana-sec { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.ana-sec:first-child { border-top: 0; padding-top: 0; }
.who-link { display: flex; align-items: center; gap: 8px; color: var(--text); border-radius: 10px; padding: 2px 6px 2px 2px; }
.who-link:hover { background: var(--surface-2); text-decoration: none; }

/* financeiro do mentorado */
.next-pay { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-color: var(--accent); }
.next-pay.late { border-color: var(--danger); background: var(--danger-soft); }
.next-pay.ok { border-color: var(--border); }
.btn.lg { padding: 11px 20px; font-size: 15px; }
.pix-wait { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.pix-wait .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.pix-ok { text-align: center; padding: 24px 8px; }
.pix-ok-ico { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; font-size: 32px; background: var(--accent-soft); color: var(--accent); }
