/* Marin Coach — dizajn sustav (tamni, neutralni zinc + limeta naglasak) */
:root {
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #18181b;
  --surface-3: #202024;
  --border: #232327;
  --border-2: #313137;
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --accent: #d7f23c;
  --accent-fg: #0a0a0a;
  --accent-soft: rgba(215, 242, 60, .10);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .10);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .10);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, .10);
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -12px rgba(0,0,0,.6);
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01", "ss03"; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }
.num { font-variant-numeric: tabular-nums; }
.t2 { color: var(--text-2); } .t3 { color: var(--text-3); }
.xs { font-size: 12px; } .sm { font-size: 13px; } .md { font-size: 15px; }
.b { font-weight: 600; } .bb { font-weight: 700; }
.acc { color: var(--accent); }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.wrapf { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt0{margin-top:0}.mt4{margin-top:4px}.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mt32{margin-top:32px}
.hidden, [hidden] { display: none !important; }

/* tipografija */
.h1 { font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; margin: 0; }
.h2 { font-size: 18px; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; margin: 0; }
.h3 { font-size: 15px; font-weight: 600; margin: 0; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 10px; }

/* površine */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; }
.card.flat { background: transparent; }
.card.tight { padding: 0; overflow: hidden; }
.list > * + * { border-top: 1px solid var(--border); }
.li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; text-align: left; }
button.li:active, a.li:active { background: var(--surface-2); }
.li .meta { margin-left: auto; text-align: right; flex: none; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* gumbi */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: var(--r);
  font-weight: 600; font-size: 15px; border: 1px solid transparent; transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap; }
.btn.block { width: 100%; }
.btn.primary { background: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: #e2fa5a; }
.btn.secondary { background: var(--surface-2); border-color: var(--border-2); }
.btn.secondary:hover { background: var(--surface-3); }
.btn.ghost { color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(248,113,113,.25); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.icon { width: 40px; padding: 0; height: 40px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.whop { background: #ff6243; color: #fff; }
.btn.whop:hover { background: #ff7458; }

/* forme */
.field { display: block; margin-top: 14px; }
.field > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.input, select.input, textarea.input { width: 100%; height: 44px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r);
  padding: 0 12px; outline: none; transition: border-color .15s, box-shadow .15s; font-size: 16px; }
textarea.input { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--text-3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* izbor (velike opcije) */
.opts { display: grid; gap: 8px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opts.four { grid-template-columns: repeat(4, 1fr); }
.opt { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border-2);
  text-align: left; transition: border-color .15s, background .15s; }
.opt .dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-2); flex: none; display: grid; place-items: center; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt.on .dot { border-color: var(--accent); background: var(--accent); }
.opt.on .dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-fg); }
.opt.center { justify-content: center; font-weight: 600; }
.opt small { display: block; color: var(--text-3); font-size: 12.5px; }

/* segmentirani */
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { flex: 1; height: 32px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; padding: 0 10px; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.4); }

/* scroll traka (dani, tjedni) */
.scroller { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; scroll-snap-type: x proximity; }
.scroller::-webkit-scrollbar { display: none; }
.pill { flex: none; scroll-snap-align: start; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface);
  color: var(--text-2); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.pill.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.pill.locked { color: var(--text-3); border-style: dashed; }
.daypill { flex: none; width: 48px; height: 58px; border-radius: 14px; border: 1px solid var(--border-2); background: var(--surface); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.daypill b { font-size: 16px; color: var(--text); letter-spacing: 0; }
.daypill.on { background: var(--accent); border-color: var(--accent); color: rgba(0,0,0,.6); }
.daypill.on b { color: var(--accent-fg); }

/* oznake */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }

/* statistika */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; }
.stat .v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.bar { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* avatar */
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-2); display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: var(--text-2); flex: none; }
.av.lg { width: 48px; height: 48px; font-size: 16px; }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font-weight: 800; font-size: 11px; letter-spacing: -.02em; flex: none; }

/* app ljuska — mobilna */
.app { max-width: 600px; margin: 0 auto; padding: 0 16px calc(96px + var(--safe-b)); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 58px; margin: 0 -16px; padding: 0 16px;
  background: rgba(9,9,11,.82); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar .title { font-weight: 650; font-size: 15px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(12,12,14,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border); padding-bottom: var(--safe-b); }
.tabbar .in { max-width: 600px; margin: 0 auto; display: flex; }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 10px; color: var(--text-3); font-size: 11px; font-weight: 600; }
.tabbar button.on { color: var(--text); }
.tabbar button.on svg { color: var(--accent); }

/* sheet (donji modal) */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; opacity: 0; transition: opacity .2s; }
.scrim.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92dvh; overflow-y: auto; background: var(--surface); border-top: 1px solid var(--border-2);
  border-radius: 20px 20px 0 0; padding: 8px 16px calc(24px + var(--safe-b)); transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  max-width: 600px; margin: 0 auto; }
.sheet.show { transform: none; }
.sheet .grab { width: 36px; height: 4px; border-radius: 4px; background: var(--border-2); margin: 4px auto 12px; }
.sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
@media (min-width: 700px) { .sheet { bottom: auto; top: 50%; left: 50%; right: auto; width: 560px; border-radius: 20px; border: 1px solid var(--border-2);
  transform: translate(-50%, -46%); opacity: 0; transition: transform .2s, opacity .2s; } .sheet.show { transform: translate(-50%, -50%); opacity: 1; } }

/* toast */
.toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -8px); opacity: 0; z-index: 90;
  background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text); padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.5); transition: all .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { color: var(--accent); }

/* stanja */
.empty { text-align: center; padding: 36px 16px; color: var(--text-2); }
.empty .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; margin: 0 auto 12px; color: var(--text-2); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.spin { width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.25); border-top-color: currentColor; border-radius: 50%; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.note { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); }
.callout.warn { background: var(--warn-soft); border-color: rgba(251,191,36,.25); color: #fde68a; }
.callout.acc { background: var(--accent-soft); border-color: rgba(215,242,60,.25); color: var(--text); }
.callout svg { flex: none; margin-top: 1px; }
.err { color: var(--danger); font-size: 13.5px; margin-top: 10px; }
.check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--border-2); display: grid; place-items: center; flex: none; }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.done-text { text-decoration: line-through; color: var(--text-3); }
video { width: 100%; border-radius: var(--r); background: #000; display: block; }
.kbd { font-size: 11px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border-2); color: var(--text-3); }

/* prekidač */
.switch { position: relative; width: 40px; height: 24px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-2); flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-2); transition: transform .18s, background .15s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { transform: translateX(16px); background: var(--accent-fg); }

/* trenerska app ljuska */
.c-shell { min-height: 100dvh; }
.c-side { display: none; }
.c-main { padding: 0 16px calc(96px + var(--safe-b)); max-width: 760px; margin: 0 auto; }
.split-list { display: block; }
.split-detail { display: block; }
@media (min-width: 1000px) {
  .c-shell { display: grid; grid-template-columns: 248px 1fr; }
  .c-side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--border); padding: 16px 12px; background: #0b0b0d; }
  .c-side .nav { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 9px; color: var(--text-2); font-weight: 550; font-size: 14px; width: 100%; text-align: left; }
  .c-side .nav:hover { background: var(--surface-2); color: var(--text); }
  .c-side .nav.on { background: var(--surface-2); color: var(--text); }
  .c-side .nav.on svg { color: var(--accent); }
  .c-side .nav .cnt { margin-left: auto; font-size: 12px; color: var(--text-3); }
  .c-main { max-width: none; margin: 0; padding: 0 32px 48px; }
  .c-main .topbar { margin: 0 -32px; padding: 0 32px; }
  .tabbar.coach { display: none; }
  .split { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
  .split .split-list { position: sticky; top: 70px; max-height: calc(100dvh - 86px); overflow-y: auto; padding-bottom: 12px; }
  .split .split-detail { min-width: 0; }
  .only-mobile { display: none !important; }
  .actionbar { left: 248px !important; }
}
@media (max-width: 999px) {
  .split.has-detail .split-list { display: none; }
  .split:not(.has-detail) .split-detail { display: none; }
  .only-desktop { display: none !important; }
}
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: 12px 16px calc(12px + var(--safe-b)); background: rgba(12,12,14,.94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border); }
.actionbar .in { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.clirow { display: flex; gap: 12px; align-items: flex-start; padding: 14px; width: 100%; text-align: left; border-radius: 14px; border: 1px solid transparent; }
.clirow:hover { background: var(--surface); }
.clirow.on { background: var(--surface); border-color: var(--border-2); }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 0; }
.dl > div { padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.dl > div:nth-child(-n+2) { border-top: 0; }
.dl .k { color: var(--text-3); }
.mealcard { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; padding: 12px 14px; }
.mealcard select.input { height: 40px; font-size: 14px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface-2); height: 40px; }
.stepper button { width: 34px; height: 38px; display: grid; place-items: center; color: var(--text-2); }
.stepper span { min-width: 42px; text-align: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vcard { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); text-align: left; }
.vcard video { border-radius: 0; aspect-ratio: 16/10; object-fit: cover; pointer-events: none; }
.vcard .cap { padding: 8px 10px; font-size: 12.5px; }
.loadlines > div { display: flex; gap: 10px; align-items: center; padding: 8px 0; color: var(--text-3); font-size: 14px; transition: color .3s; }
.loadlines > div.on { color: var(--text); }
.loadlines > div.done { color: var(--text-2); }
.split-list .scroller { margin: 0; padding: 2px 0 4px; }
.sheet video { max-height: 46vh; object-fit: contain; }
