/* B2B brand: navy, light blue #D7F5FE, B2B blue #2557A7, seafoam accent #5FD3C6, Plus Jakarta Sans */
:root {
  --navy: #0B2545; --navy-2: #163A63; --light: #D7F5FE; --blue: #2557A7; --accent: #5FD3C6; --accent-ink: #0E6E64; --bg: #F5FAFC;
  --line: #E2ECF0; --input: #DCE7EC; --muted: #5B6B7E; --body: #33475C; --tint: #E4F0F5; --divider: #EEF3F6;
  --ok: #1D6B47; --ok-bg: #E3F5EC; --warn: #7A4B00; --warn-bg: #FFF1D6; --bad: #B4441B; --bad-bg: #FFF6F1;
  --radius: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--navy); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.mark { border-radius: 12px; background: var(--navy); color: var(--light); font-weight: 800; display: flex; align-items: center; justify-content: center; letter-spacing: 0.5px; flex-shrink: 0; }
.mark-coach { background: var(--blue); color: #fff; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-navy { background: var(--navy); color: #fff; border: none; }
.card-navy .muted { color: #C9DCEB; }
.card-light { background: var(--light); border: none; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--accent-ink); }
.card-navy .eyebrow { color: var(--accent); }

.btn { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--input); background: #fff; color: var(--navy); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; }
.btn-blue { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
.btn-light { background: var(--light); border-color: var(--light); font-weight: 700; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.link-btn { background: none; border: none; color: var(--blue); font-weight: 700; padding: 0 4px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.field-hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  min-height: 46px; border-radius: 12px; border: 1px solid var(--input); padding: 0 12px; font-size: 15px; background: #fff; width: 100%; color: var(--navy);
}
textarea { padding: 10px 12px; min-height: 80px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #8CC7F0; outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); flex-shrink: 0; margin-top: 1px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--input); background: #fff; font-size: 13px; font-weight: 600; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chips-small .chip { min-height: 34px; font-size: 12px; }

.scale-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scale-label { font-size: 14px; font-weight: 600; width: 72px; }
.scale { display: flex; gap: 6px; }
.scale-btn { width: 42px; height: 44px; border-radius: 12px; border: 1px solid var(--input); background: #fff; font-weight: 700; font-size: 14px; }
.scale-btn.on { background: var(--navy); border-color: var(--navy); color: #fff; }

.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; display: inline-block; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--tint); color: var(--navy); }
.badge-muted { background: var(--divider); color: var(--muted); }

.loading { padding: 40px; text-align: center; color: var(--muted); }
.error-box { background: var(--bad-bg); color: var(--bad); border-radius: 14px; padding: 12px 14px; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 50; box-shadow: 0 6px 24px rgba(11,37,69,0.25); }
.demo-banner { background: var(--warn-bg); color: var(--warn); font-size: 12px; font-weight: 600; text-align: center; padding: 6px 10px; }

.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--divider); font-size: 14px; }
.list-row:first-child { border-top: none; }

.bars { display: flex; align-items: flex-end; gap: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; height: 100%; }
.bar { width: 100%; background: #C9DCEB; border-radius: 6px 6px 3px 3px; }
.bar-hi { background: var(--navy); }
.bar-val, .bar-label { font-size: 10px; color: var(--muted); }

/* ---------- Client app (phone-first) ---------- */
.phone { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.phone-main { flex: 1; padding: 16px 20px 48px; display: flex; flex-direction: column; gap: 16px; }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 76px; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: center; padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--muted); text-decoration: none; min-width: 56px; background: none; border: none; }
.tab.on { color: var(--navy); font-weight: 700; }
.back-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--input); background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.seg { display: flex; gap: 4px; background: var(--tint); padding: 4px; border-radius: 12px; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg button.on { background: #fff; color: var(--navy); font-weight: 700; box-shadow: 0 1px 2px rgba(11,37,69,0.12); }
.slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot { min-height: 44px; border-radius: 12px; border: 1px solid var(--input); background: #fff; font-weight: 600; font-size: 14px; }
.slot.on { background: var(--accent); border-color: var(--accent); color: var(--navy); font-weight: 700; }
.day-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.day-btn { min-width: 50px; height: 62px; border-radius: 14px; border: 1px solid var(--input); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.day-btn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.day-btn .d1 { font-size: 11px; font-weight: 600; } .day-btn .d2 { font-size: 18px; font-weight: 800; }
.stat3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.stat b { display: block; font-size: 22px; font-weight: 800; }
.set-row { display: flex; align-items: center; gap: 8px; }
.set-row input { min-width: 0; flex: 1; }
.tick { width: 48px; height: 46px; border-radius: 12px; border: 1px solid var(--input); background: #fff; color: #9FB0BE; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tick.on { background: var(--accent); border-color: var(--accent); color: var(--navy); }
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 8px; border-radius: 4px; background: var(--input); }
.steps span.done { background: var(--accent); } .steps span.now { background: var(--navy); }
.auth-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 28px 0 8px; }

/* ---------- Coach app ---------- */
.coach { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 220px; max-width: 250px; background: #fff; border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 18px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-group { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.8px; text-transform: uppercase; padding: 10px 12px 4px; }
.side-link { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--body); text-decoration: none; font-weight: 500; font-size: 14px; }
.side-link.on { background: var(--light); color: var(--navy); font-weight: 700; }
.count { background: var(--blue); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.count-light { background: var(--tint); color: var(--navy); }
.main { flex: 999 1 560px; min-width: 0; padding: 26px 30px 48px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.kpi b { display: block; font-size: 28px; font-weight: 800; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.col-3 { flex: 3 1 460px; min-width: 0; } .col-2 { flex: 2 1 320px; min-width: 0; } .col-1 { flex: 1 1 260px; min-width: 0; }
.session-row { display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid var(--divider); }
.session-time { width: 74px; flex-shrink: 0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.week { display: flex; min-width: 680px; }
.week-hours { width: 48px; flex-shrink: 0; padding-top: 48px; }
.week-hour { height: 44px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-6px); }
.week-day { flex: 1; min-width: 88px; border-left: 1px solid var(--divider); }
.week-day-head { height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-bottom: 1px solid var(--divider); }
.week-grid { position: relative; background: repeating-linear-gradient(to bottom, #fff 0, #fff 43px, #F2F7FA 43px, #F2F7FA 44px); }
.blk { position: absolute; left: 4px; right: 4px; border-radius: 8px; font-size: 11px; padding: 4px 7px; overflow: hidden; display: flex; flex-direction: column; border: none; text-align: left; }
.blk-session { background: var(--navy); color: #fff; }
.blk-request { background: #EEF4FB; border: 2px dashed var(--blue); color: var(--navy); }
.blk-busy { background: repeating-linear-gradient(135deg, #F1F4F7 0, #F1F4F7 6px, #E3E8EC 6px, #E3E8EC 12px); border: 1px solid #CBD6DE; color: var(--body); }
.blk-avail { left: 0; right: 0; border-radius: 0; font-size: 10px; padding: 3px 6px; color: var(--body); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 8px 6px; }
.table td { padding: 8px 6px; border-top: 1px solid var(--divider); vertical-align: top; }
.table input { min-height: 38px; font-size: 13px; padding: 0 8px; border-radius: 8px; }
.client-pick { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--navy); }
.client-pick.on { background: var(--tint); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--light); font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.scroll-x { overflow-x: auto; }
@media (max-width: 720px) {
  .main { padding: 18px 16px 40px; }
  .side { max-width: none; flex-basis: 100%; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border-right: none; border-bottom: 1px solid var(--line); overflow-x: auto; position: sticky; top: 0; z-index: 20; }
  .side > .row > div:last-child, .side > .tiny { display: none; }
  .side-nav, .side-nav > div { flex-direction: row; display: flex; gap: 4px; }
  .side-group { display: none; }
  .side-link { white-space: nowrap; min-height: 38px; gap: 6px; }
  .page-head h1 { font-size: 21px; }
  .session-row { flex-wrap: wrap; gap: 10px; }
  .session-row .grow { flex-basis: calc(100% - 90px); }
}
.preview-bar ~ * .side { top: 48px; }

/* Preview switcher (preview build only) */
.preview-bar { position: sticky; top: 0; z-index: 30; display: flex; gap: 4px; justify-content: center; background: var(--navy); padding: 6px; }
.preview-bar button { min-height: 36px; padding: 0 16px; border-radius: 9px; border: 0; background: transparent; color: #C9DCEB; font-weight: 600; font-size: 13px; }
.preview-bar button.on { background: var(--light); color: var(--navy); font-weight: 700; }
.confirm-overlay { position: fixed; inset: 0; background: rgba(11,37,69,0.45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.confirm-box { background: #fff; border-radius: 18px; padding: 18px; max-width: 380px; width: 100%; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 12px 40px rgba(11,37,69,0.3); }
.confirm-box p { margin: 0; font-size: 15px; line-height: 1.5; }
.preview-bar { padding-top: calc(6px + env(safe-area-inset-top)); }

/* Coach Hub on desktop: light blue side menu */
@media (min-width: 721px) {
  .side { background: var(--light); border-right: 1px solid #BFE6F5; }
  .side-link { color: var(--navy); }
  .side-link:hover { background: rgba(255,255,255,0.55); }
  .side-link.on { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(11,37,69,0.08); }
  .side-group, .side .tiny.muted, .side .muted { color: #33516E; }
  .count-light { background: #fff; }
}

/* Logo */
.brand-mark, .brand-logo { display: block; flex-shrink: 0; }

/* Client app: header with logo and a menu that tucks away */
.app-head { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--light); border-bottom: 1px solid #BFE6F5; }
.preview-bar ~ * .app-head, .preview-bar + .phone .app-head { top: 48px; }
.app-head-title { flex: 1; font-weight: 700; font-size: 15px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid #BFE6F5; background: #fff; color: var(--navy); font-weight: 700; font-size: 14px; }
.menu-dot { position: absolute; top: 7px; right: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); border: 2px solid #fff; }
.menu-scrim { position: fixed; inset: 0; background: rgba(11,37,69,0.35); z-index: 35; }
.menu-panel { position: absolute; left: 12px; right: 12px; top: calc(100% + 6px); z-index: 45; background: #fff; border-radius: 18px; box-shadow: 0 16px 40px rgba(11,37,69,0.25); padding: 8px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 120px); overflow-y: auto; }
.menu-panel[hidden] { display: none; }
.menu-link { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 14px; border-radius: 12px; color: var(--navy); text-decoration: none; font-weight: 600; font-size: 15px; }
.menu-link:hover { background: var(--bg); }
.menu-link.on { background: var(--light); font-weight: 800; }
.menu-link-alert { color: var(--bad); }
.forms-alert { display: flex; align-items: center; gap: 12px; margin: 12px 20px 0; padding: 12px 14px; border-radius: 16px; background: var(--bad-bg); border: 1px solid #F3C9B6; color: var(--bad); text-decoration: none; line-height: 1.35; }
.forms-alert b { font-size: 15px; }
.forms-alert .small { color: #7A3414; }

/* Message threads */
.thread { display: flex; flex-direction: column; gap: 10px; }
.thread-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; min-height: 160px; overflow-y: auto; padding: 4px 2px; }
.bubble-row { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: 85%; }
.bubble-row.me { align-self: flex-end; align-items: flex-end; }
.bubble { background: var(--tint); color: var(--navy); padding: 10px 13px; border-radius: 16px 16px 16px 4px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.bubble-row.me .bubble { background: var(--navy); color: #fff; border-radius: 16px 16px 4px 16px; }
.thread-send { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--divider); padding-top: 10px; }
.thread-send textarea { flex: 1; min-height: 46px; resize: vertical; }

/* Weekly check-in photos */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.photo-slot img, .photo-empty { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: var(--tint); }
.photo-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); border: 1.5px dashed var(--input); }
.photo-label { font-size: 12px; font-weight: 700; }
.photo-slot .btn { width: 100%; cursor: pointer; }
.btn.disabled { opacity: 0.6; pointer-events: none; }
.photo-row { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-row img, .photo-missing { width: 96px; height: 128px; object-fit: cover; border-radius: 10px; background: var(--tint); display: flex; align-items: center; justify-content: center; }
.link-row { width: 100%; background: none; border: 0; padding: 4px 0; text-align: left; color: inherit; gap: 10px; }

/* Coach: share panel and program library */
.share-item { display: flex; gap: 14px; align-items: flex-start; border-top: 1px solid var(--divider); padding-top: 12px; }
.share-item:first-of-type { border-top: none; padding-top: 0; }
.share-qr { width: 112px; height: 112px; flex-shrink: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.share-qr svg { width: 100%; height: 100%; display: block; }
.share-link { font-weight: 700; word-break: break-all; }
.tpl-row { display: flex; align-items: center; gap: 6px; padding: 8px 6px; border-radius: 10px; }
.tpl-row:hover { background: var(--bg); }
@media (max-width: 420px) { .share-qr { width: 92px; height: 92px; } }

/* Rest timer */
.rest-card { position: sticky; top: 64px; z-index: 5; gap: 8px; }
.rest-left { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rest-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,0.16); overflow: hidden; }
.rest-bar span { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width 0.25s linear; }
.rest-chip { border: 1px solid var(--input); background: var(--tint); color: var(--navy); border-radius: 999px; padding: 2px 9px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.est-box { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; background: var(--tint); border-radius: 12px; padding: 10px 12px; }
.est-box b { font-size: 18px; color: var(--navy); }
