:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --ink: #1d1d1b;
  --muted: #6b6a66;
  --line: #e4e2dc;
  --accent: #141414;
  --accent-ink: #ffffff;
  --accent-soft: #efede8;
  --danger: #b3261e;
  --danger-soft: #fbeae8;
  --ok-soft: #e6f3ea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, .display { font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .4rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
p { margin: 0 0 1rem; }
code { background: #efede8; padding: .1em .35em; border-radius: 6px; font-size: .9em; }

.wrap { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }
.narrow { max-width: 440px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.logo {
  width: 40px; height: 40px; border-radius: 10px; object-fit: contain;
  background: #fff; border: 1px solid var(--line); flex: none;
}
.logo-lg { width: 88px; height: 88px; border-radius: 18px; }
.logo-ph {
  display: inline-grid; place-items: center; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border: 0;
}

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 6px; }
.field { margin-bottom: 14px; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: 12px 14px; font: inherit; color: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink);
}
.btn:disabled { opacity: .6; cursor: default; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-sm { padding: 7px 12px; font-size: .875rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }

.msg { padding: 10px 12px; border-radius: 10px; font-size: .9rem; margin: 0 0 14px; background: var(--danger-soft); color: var(--danger); }
.msg-ok { background: var(--ok-soft); color: #1d5b33; }
.msg-info { background: var(--accent-soft); color: var(--accent); }

.invite {
  display: flex; gap: 8px; align-items: center;
  background: var(--accent-soft); border-radius: 10px; padding: 10px 12px;
  word-break: break-all; font-size: .95rem;
}
.code { font: 700 1.4rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }

.stats { display: flex; gap: 24px; flex-wrap: wrap; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.list li:first-child { border-top: 0; }
.list .who { flex: 1; min-width: 160px; }
.list .who b { display: block; }
.badge { font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: #efede8; color: var(--muted); }

.loading { padding: 64px 16px; text-align: center; color: var(--muted); }
.tabs { display: flex; gap: 4px; background: #efede8; padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* ---- etapa 2: formulare, calculatorul antrenorului ---- */
.narrow-md { max-width: 640px; }
input[type=number], input[type=search], select {
  width: 100%; padding: 12px 14px; font: inherit; color: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input:disabled { background: #f3f1ec; color: var(--muted); }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 440px) { .row3 { gap: 8px; } .row3 label { font-size: .8rem; } }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 8px 14px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink); }
.seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.linkbtn.small { font-size: .82rem; }

.who-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.who-btn:hover b { color: var(--accent); }
.who-btn .badge { margin-top: 4px; }
.badge-ok { background: var(--ok-soft); color: #1d5b33; }
.badge-warn { background: #fff4e0; color: #7a4d00; }

.pill { display: inline-block; margin: 12px 0 0; padding: 6px 12px; border-radius: 10px; font-size: .88rem; font-weight: 600; }
.pill-ok { background: var(--ok-soft); color: #1d5b33; }
.pill-warn { background: #fff4e0; color: #7a4d00; }
.card-alert { border-color: #f0c77a; background: #fffaf0; }
.prop + .prop { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.facts span { display: block; font-size: .78rem; color: var(--muted); }
.facts b { font-size: .95rem; }
.sug { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: #f3f1ec; border-radius: 12px; padding: 12px; margin: 4px 0 10px; }
.sug span { display: block; font-size: .74rem; color: var(--muted); }
.sug b { font-size: .98rem; }
.sug-m { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); }
.kcal-row { display: flex; gap: 8px; align-items: center; }
.kcal-row input { flex: 1; text-align: center; font-weight: 700; font-size: 1.1rem; }
.tsum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: #f3f1ec; border-radius: 12px; padding: 12px; margin: 4px 0 14px; }
.tsum b { display: block; font-size: 1.1rem; }
.tsum span { font-size: .72rem; color: var(--muted); line-height: 1.3; display: block; }
.tsum .t-p b { color: #2f6fdb; } .tsum .t-c b { color: #d98a1c; } .tsum .t-f b { color: #c8463b; }
@media (max-width: 460px) { .tsum { grid-template-columns: 1fr 1fr; } }
.msg-warn { background: #fff4e0; color: #7a4d00; }

/* ---- grafic + check-in ---- */
.chart { display: block; width: 100%; height: auto; margin: 6px 0 4px; }
.chart-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 6px; }
.chart-stats b { display: block; font-size: 1.05rem; }
.chart-stats span { font-size: .74rem; color: var(--muted); }
.ck-poses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.ck-pose { position: relative; aspect-ratio: 3 / 4; border: 1.5px dashed var(--line); border-radius: 12px; background: #faf9f6; display: grid; place-items: center; text-align: center; cursor: pointer; overflow: hidden; font-size: .82rem; color: var(--muted); }
.ck-pose img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ck-pose b { display: block; color: var(--ink); font-size: .88rem; }
.ck-pose.has { border-style: solid; }
.ck-pose .x { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 99px; width: 26px; height: 26px; font: inherit; cursor: pointer; z-index: 1; }
.ck-ms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ck-ms .field { margin-bottom: 8px; }
@media (max-width: 420px) { .ck-ms { grid-template-columns: repeat(2, 1fr); } }
.ck-list { list-style: none; padding: 0; margin: 12px 0 0; }
.ck-list > li { border-top: 1px solid var(--line); padding: 12px 0; }
.ck-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ck-thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ck-thumbs a { display: block; width: 76px; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: #efede8; }
.ck-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ck-vals { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.ck-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 12px; }
.ck-compare figure { margin: 0; }
.ck-compare img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: #efede8; display: block; }
.ck-compare figcaption { font-size: .78rem; color: var(--muted); margin-top: 4px; text-align: center; }
.ck-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 6px; }
.ck-table th, .ck-table td { text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.ck-table th:first-child, .ck-table td:first-child { text-align: left; }
.ck-table td.down { color: #1d5b33; } .ck-table td.up { color: #7a4d00; }
textarea { width: 100%; padding: 12px 14px; font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 10px; background: #fff; resize: vertical; min-height: 70px; }

/* ---- meniul făcut de antrenor ---- */
.me .mp-slot { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.me-meal { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 12px; }
.me-mhead { margin-bottom: 8px; }
.me input.me-name { width: 100%; border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; padding: 4px 0; font: inherit; font-weight: 600; font-size: 1rem; background: transparent; }
.me input.me-name:focus { outline: none; border-bottom-color: var(--accent); }
.me-items { list-style: none; margin: 0 0 8px; padding: 0; border-top: 1px solid var(--line); }
.me-items li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.me-iname { flex: 1; min-width: 0; }
.me-iname em { font-style: normal; font-size: .78rem; }
.me-g { display: flex; align-items: center; gap: 4px; font-weight: 400; color: var(--muted); font-size: .85rem; margin: 0; }
.me-g input { width: 72px; padding: 6px 8px; text-align: right; }
.me-k { width: 68px; text-align: right; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.me-del { border: 0; background: none; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; }
.me-del:hover { color: var(--danger); }
.me-tot { font-size: .85rem; line-height: 1.5; }
.me-diff { display: inline-block; font-size: .76rem; font-weight: 600; padding: 1px 8px; border-radius: 99px; margin-left: 4px; }
.me-ok { background: var(--ok-soft); color: #1d5b33; }
.me-near { background: #fff4e0; color: #7a4d00; }
.me-off { background: var(--danger-soft); color: var(--danger); }
.me-res { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; margin: 0 0 6px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink); }
.me-res:hover { border-color: var(--accent); }
.me-res small { color: var(--muted); font-size: .76rem; }
.me-own { background: #f3f1ec; border-radius: 10px; padding: 12px; margin-top: 6px; }
.me-own .field { margin-bottom: 8px; }
.me-own-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.me-own-row label { font-size: .75rem; color: var(--muted); font-weight: 400; display: flex; flex-direction: column; gap: 3px; margin: 0; }
.me-own-row input { padding: 7px 8px; min-width: 0; }
.me-note { margin-top: 10px; }
.me-note summary { cursor: pointer; font-size: .88rem; color: var(--accent); }
.me-note textarea { width: 100%; margin-top: 6px; font: inherit; font-size: .9rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.me-sum { border-top: 1px solid var(--line); padding: 10px 0; }
.me-sum ul { list-style: none; margin: 4px 0; padding: 0; font-size: .92rem; }
.me-sum li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.me-sum li span:last-child { color: var(--muted); white-space: nowrap; }

/* ---- chat ---- */
.chat-list { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 8px; }
.chat-empty { margin: 4px 0 8px; }
.chat-m { display: flex; flex-direction: column; align-items: flex-start; max-width: 85%; }
.chat-m.me { align-self: flex-end; align-items: flex-end; }
.chat-b { background: #f3f1ec; border-radius: 14px 14px 14px 4px; padding: 9px 12px; font-size: .94rem; line-height: 1.4; overflow-wrap: anywhere; }
.chat-m.me .chat-b { background: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px; }
.chat-t { font-size: .72rem; color: var(--muted); margin: 3px 4px 0; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.chat-form textarea { flex: 1; font: inherit; font-size: .94rem; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; resize: vertical; min-height: 44px; }

/* ---- lista antrenorului: respectare, alerte ---- */
.cl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge-bad { background: var(--danger-soft); color: var(--danger); }
.badge-msg { background: var(--accent); color: #fff; }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert-row { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 1px solid #f0c77a; background: #fffaf0; border-radius: 12px; padding: 10px 12px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink); }
.alert-row b { flex: none; }
.alert-row span { flex: 1; color: #7a4d00; }

/* ---- abonament ---- */
.bill-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.bill-bar .grow { flex: 1; min-width: 200px; }
.meter { height: 8px; border-radius: 99px; background: #efede8; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter.full i { background: var(--danger); }
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
@media (max-width: 900px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } }
.plan { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: #fff; }
.plan.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan.cur { background: var(--accent-soft); }
.plan h3 { margin: 0; }
.plan .price { font-size: 1.7rem; font-weight: 700; }
.plan .price small { font-size: .85rem; font-weight: 400; color: var(--muted); }
.plan ul { margin: 4px 0 8px; padding-left: 18px; font-size: .9rem; }
.plan .btn { margin-top: auto; }
.plan-tag { align-self: flex-start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--accent); color: #fff; padding: 3px 8px; border-radius: 99px; }
.paywall { border-color: #f0c77a; background: #fffaf0; }

/* planul la cerere (peste 50 de clienți) */
.plan.custom { background: #141414; color: #fff; border-color: #141414; }
.plan.custom .muted, .plan.custom .price small { color: #bdbab3; }
.plan.custom .btn, .plan.custom .btn-ghost { background: #fff; color: #141414; border-color: #fff; }

/* marca CoachMeal: „coach” gros, „meal” subțire, „o” e o farfurie */
.pt-brand { display: inline-block; color: var(--ink); text-decoration: none; font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif; font-size: 1.45rem; letter-spacing: -.04em; line-height: 1; white-space: nowrap; }
.pt-brand b { font-weight: 800; }
.pt-brand span { font-weight: 500; }
.pt-brand .pt-o { width: .6em; height: .6em; vertical-align: -.03em; margin: 0 .01em; }
.pt-brand.lg { font-size: 2.1rem; }
.pt-powered { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); text-decoration: none; margin: 18px 0 8px; }
.pt-powered svg { width: 14px; height: 14px; }
.plans { padding-top: 12px; }
.plan { position: relative; }
.plan .plan-tag { position: absolute; top: -11px; left: 16px; }
