/* Nutri Logic Coach. A working tool read at a desk between sessions: quiet
   surfaces, one accent, and colour kept for meaning — on target, under, over. */
:root {
  --bg: #f4f6f8; --surface: #ffffff; --sunk: #eaeef2;
  --ink: #0a1628; --muted: #5a6878; --line: #d7dee6;
  --accent: #2d6a10; --accent-ink: #ffffff; --accent-soft: #e6f2dc;
  --on: #3f8f1b; --under: #c98a16; --over: #c7423f;
  --on-soft: #e4f1dc; --warn-soft: #fbf0d9; --alert-soft: #fbe3e2;
  --blue: #2f6fb8; --cell-ink: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1628; --surface: #0f2040; --sunk: #0c1a33;
    --ink: #eef6ff; --muted: #8aa3bf; --line: #1e3050;
    --accent: #a8ff3e; --accent-ink: #0a1628; --accent-soft: #18301a;
    --on: #8fe03a; --under: #ffb347; --over: #ff6b76;
    --on-soft: #17301a; --warn-soft: #33270f; --alert-soft: #3a1519;
    --blue: #6fb1ff; --cell-ink: #0a1628;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1 { font-size: 1.6rem; line-height: 1.15; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h2 { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 1rem; margin: 18px 0 12px; }
p { margin: 0 0 10px; }
.dim { color: var(--muted); } .small { font-size: .82rem; } .r { text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
b { font-weight: 650; }

.brand { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; white-space: nowrap; }
.brand b { color: var(--accent); }

/* shell */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 72rem; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; }
.tab { font: inherit; font-weight: 600; background: none; border: 0; color: var(--muted); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.tab.is-on { background: var(--sunk); color: var(--ink); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .85rem; }
.gym { font-weight: 650; }
.seats { background: var(--sunk); border-radius: 99px; padding: 2px 10px; font-variant-numeric: tabular-nums; }
.seats.is-full { background: var(--warn-soft); color: var(--under); }
.main { max-width: 72rem; margin: 0 auto; padding: 24px 16px 64px; display: flex; flex-direction: column; gap: 18px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.back { align-self: flex-start; }

/* controls */
.btn { font: inherit; font-weight: 650; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 9px 16px; cursor: pointer; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-danger { background: var(--over); border-color: var(--over); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-danger { color: var(--over); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; width: 100%; min-width: 0; }
textarea { resize: vertical; }
.segs { display: flex; background: var(--sunk); border-radius: 10px; padding: 3px; }
.seg { font: inherit; font-size: .85rem; font-weight: 600; border: 0; background: none; color: var(--muted); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg.is-on { background: var(--surface); color: var(--ink); }
.seg-n { margin-left: 6px; font-variant-numeric: tabular-nums; opacity: .7; }

/* notes */
.note { border-radius: 10px; padding: 10px 14px; display: flex; gap: 12px; justify-content: space-between; align-items: baseline; margin: 0; }
.note-demo { background: var(--warn-soft); color: var(--under); }
.note-error { background: var(--alert-soft); color: var(--over); }
.note-ok { background: var(--on-soft); color: var(--on); }

/* chips */
.chip { display: inline-block; font-size: .75rem; font-weight: 650; border-radius: 99px; padding: 2px 10px; white-space: nowrap; }
.chip-ok { background: var(--on-soft); color: var(--on); }
.chip-warn { background: var(--warn-soft); color: var(--under); }
.chip-alert { background: var(--alert-soft); color: var(--over); }
.chip:empty { display: none; }

/* the 7- and 14-day strip: one square per day, colour = how the day went */
.strip { display: flex; gap: 4px; }
.cell { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 0; padding: 0; flex: none; vertical-align: -3px; }
.cell-on { background: var(--on); } .cell-under { background: var(--under); } .cell-over { background: var(--over); }
.cell-logged { background: var(--muted); }
.cell-none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
button.cell { width: auto; flex: 1; height: 38px; min-width: 0; cursor: pointer; display: grid; place-items: center; }
.cell-d { font-size: .72rem; font-weight: 700; color: var(--cell-ink); font-variant-numeric: tabular-nums; }
.cell-none .cell-d { color: var(--muted); }
.cell.is-picked { outline: 2px solid var(--ink); outline-offset: 2px; }
.legend { margin: 10px 0 0; } .legend .cell { width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-left: 8px; }

/* client rows */
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(0, 1.5fr) 150px minmax(0, 1fr) minmax(0, 1fr) minmax(0, .9fr); gap: 16px; align-items: center; width: 100%; padding: 13px 16px; font: inherit; color: inherit; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); cursor: pointer; font-variant-numeric: tabular-nums; }
.row:hover { background: var(--sunk); }
.row-head { cursor: default; border-top: 0; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding-block: 9px; }
.row-head:hover { background: none; }
.row > span { min-width: 0; }
.c-name { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.c-week { display: flex; flex-direction: column; gap: 4px; }
.trend { font-weight: 650; }
.trend-good { color: var(--on); } .trend-bad { color: var(--over); } .trend-neutral { color: var(--muted); }
@media (max-width: 760px) {
  .row-head { display: none; }
  .row { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .c-name { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .c-today { display: none; }
}

/* panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; min-width: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 860px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.empty { color: var(--muted); padding: 18px 0; margin: 0; }
.add { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.add input { flex: 1 1 12rem; width: auto; }
.invites, .team, .thread { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.invites li { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.invites li > span:first-child { flex: 1 1 12rem; min-width: 0; }
.code { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .14em; background: var(--sunk); border-radius: 7px; padding: 3px 10px; }

/* day view */
.bar { margin-bottom: 10px; }
.bar-top { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.bar-track { height: 7px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; }
.f-cal { background: var(--ink); } .f-pro { background: var(--on); } .f-carb { background: var(--blue); } .f-fat { background: var(--under); }
.scroll { overflow-x: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 6px; border-bottom: 1px solid var(--line); }
th.r { text-align: right; }
td { padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: .9rem; }
tbody tr:last-child td { border-bottom: 0; }

/* weight */
.wchart { display: flex; align-items: flex-end; gap: 4px; height: 96px; }
.wbar { flex: 1; background: var(--on); border-radius: 3px 3px 0 0; min-width: 0; opacity: .85; }
.wrow { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; margin: 8px 0 0; font-variant-numeric: tabular-nums; }

/* thread */
.thread { margin: 0 0 14px; }
.msg { background: var(--sunk); border-radius: 10px; padding: 10px 12px; }
.msg-client { background: var(--accent-soft); }
.msg-meta { margin: 0 0 3px; } .msg-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.end { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding-top: 6px; }

/* sign in */
.auth { max-width: 24rem; margin: 0 auto; padding: 12vh 16px 48px; display: flex; flex-direction: column; gap: 14px; }
.auth form { display: flex; flex-direction: column; gap: 12px; }
.auth label { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; font-weight: 600; }
@media (prefers-reduced-motion: no-preference) { .row, .tab, .seg { transition: background .12s; } }

/* joining */
.panel-hot { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.reqs { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; }
.reqs li { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.reqs li:first-child { border-top: 0; padding-top: 0; }
.req-who { flex: 1 1 12rem; min-width: 0; display: flex; flex-direction: column; }
.sel { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.codebox { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.codebox-l { margin: 0 0 4px; }
.code-big { font-size: 1.9rem; font-weight: 700; letter-spacing: .22em; padding: 8px 16px; display: inline-block; }
.codebox-new { margin: 10px 0 0; }
.how { margin: 0 0 12px; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 4px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* plan */
.price { font-size: 1.05rem; } .price b { font-size: 1.5rem; letter-spacing: -.01em; }
.seat-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.seat-row label { font-weight: 600; margin-right: 6px; }
.seats-in { width: 5.5rem; text-align: center; font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.step { width: 42px; padding: 8px 0; font-size: 1.1rem; }
.seat-total { margin-left: 10px; font-weight: 650; font-variant-numeric: tabular-nums; }
.warn-text { color: var(--over); font-weight: 600; }
.divider { height: 1px; background: var(--line); margin: 6px 0; }
.note .btn { flex: none; }

/* packs and seat changes */
.chip-pack { background: var(--accent-soft); color: var(--accent); }
.chip-none { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.h3 { font-size: .95rem; margin: 18px 0 6px; }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.seat-l { display: block; font-weight: 600; font-size: .9rem; margin-right: 6px; }
.seat-row .seat-l { display: inline; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin: 14px 0; }
.stats > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stats b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stats span { color: var(--muted); font-size: .85rem; }
.seat-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seat-edit { border-top: 1px solid var(--line); padding-top: 12px; }
.packs { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.packs li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.packs li.is-past { opacity: .6; }
.pk-name { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pk-use { font-variant-numeric: tabular-nums; text-align: right; }
.pack-form { margin-top: 6px; }
.pack-grid { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end; margin: 8px 0; }
.pack-grid label { display: block; }
.date-in { width: auto; min-width: 10.5rem; }
.pack-sum { font-variant-numeric: tabular-nums; }
.sel[hidden] { display: none; }
@media (max-width: 640px) {
  .packs li { grid-template-columns: 1fr; gap: 4px; }
  .pk-use { text-align: left; }
}
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* team */
.team li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.team li.is-past { opacity: .6; }
.confirm { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* poster: always black on white, whatever the dashboard theme */
.poster { max-width: 820px; margin: 0 auto; padding: 16px; }
.poster-bar { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.sheet { background: #fff; color: #0a1628; border: 1px solid #d7dee6; border-radius: 12px; padding: 44px 48px; }
.sheet .p-brand { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; color: #2d6a10; margin: 0 0 14px; }
.sheet h1 { font-size: 2.5rem; line-height: 1.1; margin: 0 0 14px; letter-spacing: -.02em; }
.sheet .p-lead { font-size: 1.15rem; line-height: 1.5; margin: 0 0 26px; color: #2a3a4c; }
.p-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.p-steps li { counter-increment: s; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-top: 2px solid #e6ebf0; }
.p-steps li > div { display: grid; gap: 4px; padding-left: 58px; position: relative; }
.p-steps li > div::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 42px; height: 42px; border-radius: 50%; background: #2d6a10; color: #fff; font-weight: 800; font-size: 1.3rem; display: grid; place-items: center; }
.p-steps b { font-size: 1.35rem; }
.p-steps span { color: #3d4d5f; font-size: 1rem; }
.p-qr { width: 150px; height: 150px; flex: none; }
.p-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 2.6rem; font-weight: 800; letter-spacing: .14em; border: 3px solid #0a1628; border-radius: 12px; padding: 8px 18px; flex: none; }
.sheet .p-small { margin: 22px 0 0; font-size: .9rem; color: #4a5a6c; border-top: 2px solid #e6ebf0; padding-top: 16px; }
@media (max-width: 640px) {
  .sheet { padding: 24px 20px; } .sheet h1 { font-size: 1.8rem; }
  .p-steps li { flex-wrap: wrap; } .p-code { font-size: 1.8rem; } .p-qr { width: 120px; height: 120px; }
}
@media print {
  @page { size: A4; margin: 14mm; }
  html, body { background: #fff !important; }
  .no-print, .top, .note { display: none !important; }
  .poster { max-width: none; padding: 0; }
  .sheet { border: 0; border-radius: 0; padding: 0; }
  .p-steps li { break-inside: avoid; padding: 26px 0; }
  .sheet .p-brand { font-size: 1rem; margin-bottom: 20px; }
  .sheet h1 { font-size: 3.3rem; margin-bottom: 20px; }
  .sheet .p-lead { font-size: 1.4rem; margin-bottom: 34px; }
  .p-steps b { font-size: 1.75rem; }
  .p-steps span { font-size: 1.15rem; }
  .p-steps li > div { padding-left: 70px; }
  .p-steps li > div::before { width: 52px; height: 52px; font-size: 1.6rem; }
  .p-qr { width: 210px; height: 210px; }
  .p-code { font-size: 3.4rem; padding: 10px 22px; }
  .sheet .p-small { font-size: 1.05rem; margin-top: 30px; }
}

/* trial */
.note-trial { background: var(--accent-soft); color: var(--ink); align-items: center; }
.note-trial b { color: var(--accent); }
.panel-trial { border-color: var(--accent); }
