/* HYROX Coaches · Form Factory – čistý sportovní styl, mobile-first */
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(/fonts/barlow-condensed/barlow-condensed-latin-ext-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url(/fonts/barlow-condensed/barlow-condensed-latin-ext-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(/fonts/inter/inter-latin-ext-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url(/fonts/inter/inter-latin-ext-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(/fonts/inter/inter-latin-ext-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url(/fonts/inter/inter-latin-ext-700-normal.woff2) format("woff2"); }

:root {
  --ink: #0d0d0e; --ink-2: #2a2a2d; --muted: #6b6b72; --line: #e4e4e7; --bg: #f5f5f4; --card: #fff;
  --red: #d7141a; --red-ink: #a50f14; --red-soft: #fdecec;
  --green: #137a3f; --green-soft: #e6f4ec; --amber: #9a5b00; --amber-soft: #fdf3e1; --blue: #1d4ed8; --blue-soft: #e8eefc;
  --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--body); color: var(--ink); background: var(--bg); }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: 1.05; margin: 0 0 .5em; }
h1 { font-size: 32px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); } .small { font-size: 13px; } .nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Hlavička */
.top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.top .in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 19px; letter-spacing: .02em; white-space: nowrap; }
.brand .mark { width: 30px; height: 30px; border-radius: 7px; background: var(--red); display: grid; place-items: center; font-size: 16px; }
.brand small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .14em; color: #a1a1aa; margin-top: -3px; }
.nav { display: none; gap: 2px; margin-left: 8px; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 14px; color: #d4d4d8; }
.nav a:hover { background: #1f1f22; color: #fff; }
.nav a.on { color: #fff; background: #26262a; }
.nav .count { background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 6px; margin-left: 4px; font-weight: 700; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top .right form { margin: 0; }
.linkbtn { background: none; border: 0; color: #d4d4d8; font: inherit; font-size: 14px; cursor: pointer; padding: 6px 4px; }
.linkbtn:hover { color: #fff; text-decoration: underline; }
.subnav { background: #18181b; overflow-x: auto; scrollbar-width: none; }
.subnav .in { display: flex; gap: 2px; padding: 6px 12px; max-width: 1200px; margin: 0 auto; }
.subnav a { color: #d4d4d8; text-decoration: none; padding: 6px 12px; border-radius: 8px; white-space: nowrap; font-size: 14px; }
.subnav a.on { background: #2e2e33; color: #fff; }
@media (min-width: 900px) { .nav { display: flex; } .subnav { display: none; } }

/* Spodní lišta pro trenéra na mobilu */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { text-decoration: none; text-align: center; font-size: 11px; padding: 8px 2px 7px; color: var(--muted); font-weight: 500; }
.tabbar a svg { display: block; margin: 0 auto 2px; width: 22px; height: 22px; }
.tabbar a.on { color: var(--ink); }
.tabbar a.plus span { display: grid; place-items: center; width: 40px; height: 40px; margin: -14px auto 2px; border-radius: 50%; background: var(--red); color: #fff; font-size: 26px; line-height: 1; box-shadow: 0 4px 12px rgba(215,20,26,.35); }
body.has-tabbar { padding-bottom: 80px; }
@media (min-width: 900px) { .tabbar { display: none; } body.has-tabbar { padding-bottom: 0; } }

main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; }
.narrow { max-width: 720px; }
.auth { max-width: 440px; margin: 6vh auto; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; justify-content: space-between; margin-bottom: 16px; }
.pagehead h1 { margin: 0; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--muted); }

/* Karty, mřížky */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card .cardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card .cardhead h2, .card .cardhead h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; margin-top: 6px; }
.stat .v small { font-size: 16px; color: var(--muted); font-weight: 600; }
.stat.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat.dark .k { color: #a1a1aa; }
.stat a { text-decoration: none; }
.notset { font-family: var(--body) !important; font-size: 15px !important; font-weight: 600 !important; color: #a1a1aa; line-height: 1.3 !important; }

/* Tlačítka */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ink); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font: 600 14px/1.2 var(--body); text-decoration: none; cursor: pointer; min-height: 42px; }
.btn:hover { background: #26262a; }
.btn.red { background: var(--red); border-color: var(--red); } .btn.red:hover { background: var(--red-ink); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); } .btn.ghost:hover { border-color: #a1a1aa; }
.btn.green { background: var(--green); border-color: var(--green); }
.btn.amber { background: #fff; color: var(--amber); border-color: #e9c98f; }
.btn.danger { background: #fff; color: var(--red-ink); border-color: #f2b8ba; }
.btn.sm { padding: 6px 10px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }

/* Formuláře */
form.stack > * + * { margin-top: 14px; }
label, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.opt { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=url], input[type=tel], input[type=number], input[type=search], select, textarea {
  width: 100%; font: 16px/1.4 var(--body); padding: 10px 12px; border: 1px solid #d4d4d8; border-radius: 10px; background: #fff; color: var(--ink); min-height: 44px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
.field.err input, .field.err select, .field.err textarea { border-color: var(--red); }
.ferr { color: var(--red-ink); font-size: 13px; margin-top: 4px; font-weight: 500; }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.row2 { display: grid; gap: 12px; } @media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; gap: 3px; flex-wrap: wrap; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; border-radius: 7px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--red); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.filters .f { min-width: 140px; flex: 1 1 140px; }
.filters .f label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.filters .f input, .filters .f select { min-height: 40px; padding: 8px 10px; font-size: 14px; }
.filters .f.wide { flex: 2 1 220px; }
.drop { border: 2px dashed #d4d4d8; border-radius: var(--radius); padding: 22px 16px; text-align: center; background: #fafafa; cursor: pointer; display: block; }
.drop:hover, .drop.over { border-color: var(--ink); background: #fff; }
.drop input { display: block; margin: 10px auto 0; max-width: 100%; font-size: 14px; }
.drop strong { display: block; font-size: 16px; }
.progress { height: 10px; background: #ececec; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; width: 0; background: var(--red); transition: width .2s; }
.uploadstate { margin-top: 8px; font-size: 14px; font-weight: 500; }

/* Hlášky */
.flash { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-weight: 500; border: 1px solid; }
.flash.ok { background: var(--green-soft); border-color: #b7dfc8; color: #0d5a2e; }
.flash.err { background: var(--red-soft); border-color: #f2b8ba; color: var(--red-ink); }
.flash.info { background: var(--blue-soft); border-color: #c4d3f7; color: #1e3a8a; }
.flash.warn { background: var(--amber-soft); border-color: #ecd09a; color: #6b3f00; }

/* Štítky */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; border: 1px solid transparent; }
.b-draft { background: #f1f1f2; color: #52525b; }
.b-pending { background: var(--blue-soft); color: var(--blue); }
.b-returned { background: var(--amber-soft); color: var(--amber); }
.b-approved, .b-evaluated { background: var(--green-soft); color: var(--green); }
.b-rejected { background: var(--red-soft); color: var(--red-ink); }
.b-test { background: #fff7cc; color: #6b5800; border-color: #e8d36a; font-weight: 700; letter-spacing: .04em; }
.b-off { background: #f1f1f2; color: #71717a; }
.b-club { background: #f4f4f5; color: var(--ink-2); border-color: var(--line); }
.pts { font-family: var(--display); font-weight: 800; font-size: 20px; }
.pts.none { font-family: var(--body); font-weight: 500; font-size: 13px; color: var(--muted); }

/* Tabulky a seznamy */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafafa; }
table.t th a { text-decoration: none; }
table.t th a.on { color: var(--ink); }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click:hover td { background: #fafafa; }
table.t td.num, table.t th.num { text-align: right; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list a.item, .list .item { display: flex; gap: 12px; align-items: center; padding: 12px 18px; text-decoration: none; }
.list a.item:hover { background: #fafafa; }
.item .main { flex: 1; min-width: 0; }
.item .ttl { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.item .meta { font-size: 13px; color: var(--muted); }
.item .end { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; padding: 14px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; font-size: 14px; background: #fff; }
.pager .on { background: var(--ink); color: #fff; border-color: var(--ink); }
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 520px) { dl.kv { grid-template-columns: 1fr; gap: 0; } dl.kv dd { margin-bottom: 8px; } }
.note { background: #fafafa; border-left: 3px solid var(--ink); padding: 10px 12px; border-radius: 0 8px 8px 0; white-space: pre-wrap; }
.note.red { border-color: var(--red); background: var(--red-soft); }
.note.amber { border-color: #d08a12; background: var(--amber-soft); }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.timeline li { padding: 6px 0 6px 14px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: #a1a1aa; }
.pre { white-space: pre-wrap; }

/* Avatar */
.av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: #e4e4e7; color: var(--ink-2); overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.lg { width: 84px; height: 84px; font-size: 28px; }
.av.sm { width: 32px; height: 32px; font-size: 12px; }
.who { display: flex; align-items: center; gap: 10px; text-decoration: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #f4f4f5; border: 1px solid var(--line); border-radius: 99px; padding: 4px 4px 4px 12px; font-size: 14px; font-weight: 500; }
.chip form { margin: 0; }
.chip button { border: 0; background: #e4e4e7; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; color: var(--ink-2); }
.chip button:hover { background: var(--red); color: #fff; }

video.player { width: 100%; max-height: 70vh; background: #000; border-radius: 10px; display: block; }
.critrow { display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.critrow:last-of-type { border-bottom: 0; }
.selbar { position: sticky; bottom: 0; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; display: none; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.selbar.on { display: flex; }
.loading { position: relative; pointer-events: none; opacity: .7; }
.loading::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; margin-left: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.hide-sm { display: none; } @media (min-width: 760px) { .hide-sm { display: table-cell; } }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; } .mt { margin-top: 16px; }
footer.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 16px 30px; }
@media (max-width: 759px) { .grid.g4 { grid-template-columns: 1fr 1fr; gap: 10px; } .stat .v { font-size: 32px; } }
.frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Kreditní program */
.credits .bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.credits .bar span { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.credits.done .bar span { background: var(--green, #1f8f4e); }
.credits .big { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; }
.credits .big small { font-size: 18px; color: var(--muted); font-weight: 600; }
.credits ul.reqs { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.credits ul.reqs li { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.credits ul.reqs li .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--line); color: var(--muted); flex: none; }
.credits ul.reqs li.ok .ic { background: var(--green, #1f8f4e); color: #fff; }

/* Ořez profilové fotky */
.cropper { position: fixed; inset: 0; background: rgba(13,13,14,.72); display: grid; place-items: center; z-index: 100; padding: 16px; }
.cropper[hidden] { display: none; }
.cropbox { background: var(--card); border-radius: var(--radius); padding: 18px; width: min(420px, 100%); }
.cropview { position: relative; width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #111; touch-action: none; cursor: grab; margin-bottom: 10px; }
.cropview:active { cursor: grabbing; }
.cropview canvas { width: 100%; height: 100%; display: block; }
.cropview::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.45); pointer-events: none; }
.cropbox input[type=range] { width: 100%; }
