@font-face {
  font-family: "Manrope";
  src: url("manrope-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  src: url("manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --black: #0d0d0d;
  --ink: #17181c;
  --ink-2: #4c505a;
  --ink-3: #7a7f8a;
  --paper: #ffffff;
  --steel-50: #f4f5f7;
  --steel-100: #e9ebef;
  --steel-200: #d6d9df;
  --steel-300: #b9bdc6;
  --yellow: #f2a916;
  --yellow-soft: #fdf1d3;
  --yellow-ink: #6a4a00;
  --lamp-green: #14a24a;
  --green-soft: #dff5e6;
  --green-ink: #0b5e2b;
  --lamp-red: #e0362b;
  --red-soft: #fde4e1;
  --red-ink: #8c1b13;
  --lamp-white: #fff6cf;
  --radius: 6px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--steel-50); color: var(--ink);
  font: 500 15px/1.45 var(--font); font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 10px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.boot { padding: 60px 20px; text-align: center; color: var(--ink-3); }
[hidden] { display: none !important; }

/* ---------- okvir ---------- */
.topbar {
  background: var(--black); color: #fff; position: sticky; top: 0; z-index: 20;
  border-bottom: 3px solid var(--yellow);
}
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.brand { font-weight: 800; font-size: 18px; color: var(--yellow); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.topbar .spacer { flex: 1; }
.topbar select {
  background: #1f1f1f; color: #fff; border: 1px solid #3a3a3a; border-radius: var(--radius); padding: 6px 8px; font-weight: 600; font-size: 14px;
  width: auto; flex: none; min-height: 34px;
}
.who { font-size: 13px; color: #c9c9c9; white-space: nowrap; }
.linkbtn { background: none; border: 0; padding: 4px 2px; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; }
.topbar .linkbtn { color: #fff; font-size: 13px; }

.nav { background: var(--black); position: sticky; top: 0; z-index: 19; }
.nav-in { max-width: 1240px; margin: 0 auto; padding: 0 10px; display: flex; gap: 2px; }
.nav a {
  color: #bdbdbd; text-decoration: none; padding: 10px 14px 9px; font-weight: 700; font-size: 14px;
  border-bottom: 3px solid transparent; margin-bottom: -3px; position: relative;
}
.nav a:hover { color: #fff; }
.nav a.on { color: var(--yellow); border-bottom-color: var(--yellow); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--lamp-red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 800; }

.main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 90px; }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.head h1 { margin-right: auto; }
.sub { display: flex; gap: 6px; margin: -4px 0 16px; flex-wrap: wrap; }
.panel { background: var(--paper); border: 1px solid var(--steel-200); border-radius: var(--radius); }
.panel-pad { padding: 16px; }
.stack > * + * { margin-top: 16px; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- gumbi i polja ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 14px;
  border: 1px solid var(--steel-300); border-radius: var(--radius); background: var(--paper); font-weight: 700; font-size: 14px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--black); }
.btn.primary:hover { background: #ffb928; border-color: #ffb928; }
.btn.dark { background: var(--black); border-color: var(--black); color: #fff; }
.btn.danger { color: var(--red-ink); border-color: #efb1ab; }
.btn.sm { min-height: 30px; padding: 3px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.seg { max-width: 100%; overflow-x: auto; display: inline-flex; border: 1px solid var(--steel-300); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.seg button { flex: none; white-space: nowrap; border: 0; background: none; padding: 7px 13px; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 36px; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--steel-300); }
.seg button.on { background: var(--black); color: #fff; }

input[type=text], input[type=date], input[type=month], input[type=number], input[type=password], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--steel-300); border-radius: var(--radius); background: var(--paper);
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
label.f { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); }
label.f > input, label.f > select, label.f > textarea { margin-top: 4px; font-weight: 500; color: var(--ink); }
.hint { font-size: 12.5px; color: var(--ink-3); font-weight: 500; margin-top: 3px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--black); }
.filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { width: 220px; }
.filters select { width: auto; }

.chip { display: inline-block; padding: 1px 7px; border-radius: 4px; background: var(--steel-100); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.chip.w-M { background: var(--black); color: var(--yellow); }
.chip.w-F { background: var(--yellow); color: var(--black); }
.chip.ok { background: var(--green-soft); color: var(--green-ink); }
.chip.bad { background: var(--red-soft); color: var(--red-ink); }
.chip.warn { background: var(--yellow-soft); color: var(--yellow-ink); }
.chip button { border: 0; background: none; padding: 0 0 0 4px; cursor: pointer; font-weight: 800; color: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- tablice ---------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th, .t td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--steel-100); vertical-align: middle; }
.t th { font-size: 12.5px; font-weight: 700; color: var(--ink-2); background: var(--steel-50); white-space: nowrap; position: sticky; top: 0; }
.t td.num, .t th.num { text-align: right; }
.t td.c, .t th.c { text-align: center; }
.t td.right { text-align: right; }
.t tr:last-child td { border-bottom: 0; }
.t tfoot td { font-weight: 800; background: var(--steel-50); border-top: 2px solid var(--steel-200); }
.t .grp td { background: var(--black); color: #fff; font-weight: 800; font-size: 13px; padding: 6px 10px; }
.t .name { font-weight: 700; white-space: nowrap; }
.t .stick { position: sticky; left: 0; background: var(--paper); z-index: 1; }
.t th.stick { background: var(--steel-50); z-index: 2; }
.t tfoot .stick { background: var(--steel-50); }
.t tr.inactive td { color: var(--ink-3); }
.code { font-weight: 700; letter-spacing: .06em; font-size: 13.5px; user-select: all; }

/* ---------- kalendar ---------- */
.month { margin-top: 22px; }
.month:first-child { margin-top: 0; }
/* naslov mjeseca: crta kao linija na pisti */
.month-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.month-h h2 { text-transform: capitalize; }
.month-h::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--ink) 0 28px, var(--steel-200) 28px); align-self: center; }
.comp {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 4px 14px; align-items: center; width: 100%; text-align: left;
  padding: 10px 14px; border: 0; border-bottom: 1px solid var(--steel-100); background: var(--paper); cursor: pointer;
}
.comp:last-child { border-bottom: 0; }
.comp:hover { background: #fffbef; }
.comp.past { color: var(--ink-3); }
.comp.past .comp-name { color: var(--ink-2); }
.comp-date { font-weight: 800; font-size: 14px; line-height: 1.25; }
.comp-date small { display: block; font-weight: 600; font-size: 12px; color: var(--ink-3); }
.comp-date:empty { display: none; }
.comp-name { font-weight: 700; }
.comp-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.comp-side { text-align: right; font-size: 13px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.comp-side .n { font-weight: 800; font-size: 14px; }
div.comp { cursor: default; }
div.comp:hover { background: var(--paper); }

/* ---------- evidencija treninga: lampice kao na aparatu ---------- */
.att-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.att-date { display: inline-flex; align-items: center; gap: 4px; }
.att-date input { width: 160px; font-weight: 700; }
.att-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--steel-100); }
.att-row:last-child { border-bottom: 0; }
.att-row .nm { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lamp {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 12px 6px 8px; border-radius: 22px;
  border: 1px solid var(--steel-200); background: var(--steel-50); font-weight: 700; font-size: 13.5px; color: var(--ink-2); cursor: pointer;
}
.lamp .s { display: none; }
.lamp i { width: 22px; height: 22px; border-radius: 50%; background: #c9cdd4; box-shadow: inset 0 -2px 3px rgba(0,0,0,.18); flex: none; }
.lamp.p.on { background: var(--green-soft); border-color: var(--lamp-green); color: var(--green-ink); }
.lamp.p.on i { background: var(--lamp-green); box-shadow: 0 0 0 3px rgba(20,162,74,.22), 0 0 12px rgba(20,162,74,.75); }
.lamp.e.on { background: var(--lamp-white); border-color: var(--yellow); color: var(--yellow-ink); }
.lamp.e.on i { background: #fff; box-shadow: 0 0 0 3px rgba(242,169,22,.3), 0 0 12px rgba(242,169,22,.9); }
.att-count { font-weight: 700; color: var(--ink-2); font-size: 14px; }
.att-count b { color: var(--ink); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--steel-200); vertical-align: -1px; }
.dot.P { background: var(--lamp-green); }
.dot.E { background: #fff; border: 2px solid var(--yellow); }

/* ---------- članarine ---------- */
.fee { text-align: right; white-space: nowrap; font-weight: 700; }
.fee.paid { background: var(--green-soft); color: var(--green-ink); }
.fee.covered { background: #eefaf2; color: var(--green-ink); font-weight: 600; }
.fee.partial { background: var(--yellow-soft); color: var(--yellow-ink); }
.fee.due { background: var(--red-soft); color: var(--red-ink); }
.fee.pending { background: var(--yellow-soft); color: var(--yellow-ink); font-weight: 600; }
.fee.future, .fee.na { color: var(--steel-300); font-weight: 500; }
button.cell { all: unset; display: block; width: 100%; cursor: pointer; text-align: right; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); padding: 10px 14px; border-top: 1px solid var(--steel-100); }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--c); border: 1px solid rgba(0,0,0,.08); }
.pos { color: var(--green-ink); } .neg { color: var(--red-ink); }

.pay { display: grid; grid-template-columns: 92px 1fr auto; gap: 2px 14px; padding: 11px 14px; border-bottom: 1px solid var(--steel-100); align-items: start; }
.pay:last-child { border-bottom: 0; }
.pay-date { font-weight: 700; font-size: 13.5px; }
.pay-amt { font-weight: 800; font-size: 15px; }
.pay-who { font-weight: 700; }
.pay-desc { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.pay-note { font-size: 13px; color: var(--yellow-ink); margin-top: 3px; }
.pay-to { font-size: 13.5px; margin-top: 3px; }
.pay-act { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.statline { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.statline button { border: 1px solid var(--steel-300); background: var(--paper); border-radius: 18px; padding: 5px 12px; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.statline button.on { background: var(--black); color: #fff; border-color: var(--black); }
.statline button b { font-weight: 800; margin-left: 4px; }

/* ---------- dijalog ---------- */
dialog.dlg { border: 0; border-radius: 10px; padding: 0; width: min(560px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); box-shadow: 0 20px 60px rgba(0,0,0,.35); color: var(--ink); }
dialog.dlg.wide { width: min(900px, calc(100vw - 20px)); }
dialog.dlg::backdrop { background: rgba(13,13,13,.55); }
.dlg-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--steel-100); position: sticky; top: 0; background: var(--paper); z-index: 3; }
.dlg-h h2 { flex: 1; }
.dlg-x { border: 0; background: var(--steel-100); width: 34px; height: 34px; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; font-weight: 700; }
.dlg-b { padding: 16px 18px; }
.dlg-b > * + * { margin-top: 12px; }
.dlg-f { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--steel-100); position: sticky; bottom: 0; background: var(--paper); }
.dlg-f .left { margin-right: auto; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--ink-3); font-weight: 600; } .kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.note { background: var(--yellow-soft); color: var(--yellow-ink); border-radius: var(--radius); padding: 9px 12px; font-size: 13.5px; font-weight: 600; }
.note.bad { background: var(--red-soft); color: var(--red-ink); }
.note.plain { background: var(--steel-50); color: var(--ink-2); }

.toasts { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 24px); }
.toast { background: var(--black); color: #fff; padding: 10px 16px; border-radius: 22px; font-weight: 700; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.toast.err { background: var(--lamp-red); }

/* ---------- prijava ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; background: var(--black); padding: 20px; }
.gate-box { width: min(420px, 100%); background: var(--paper); border-radius: 10px; padding: 28px 24px 24px; border-top: 6px solid var(--yellow); }
.gate-box h1 { margin-bottom: 4px; }
.gate-box form > * + * { margin-top: 14px; }
.gate-box .btn { width: 100%; min-height: 46px; font-size: 16px; }
.gate-code { font-size: 20px !important; font-weight: 700; letter-spacing: .08em; text-align: center; min-height: 52px !important; }

/* ---------- pogled za sportaša ---------- */
.me-head { margin-bottom: 14px; }
.me-head p { margin: 2px 0 0; color: var(--ink-2); font-weight: 600; }
.mrow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--steel-100); }
.mrow:last-child { border-bottom: 0; }
.mrow .m { font-weight: 700; text-transform: capitalize; }
.bar { width: 110px; height: 10px; border-radius: 5px; background: var(--steel-100); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--lamp-green); }

/* ---------- mobitel ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  h1 { font-size: 22px; }
  .main { padding: 14px 10px 96px; }
  .topbar-in { padding: 8px 12px; gap: 10px; }
  .who { display: none; }
  .nav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; border-top: 3px solid var(--yellow); padding-bottom: env(safe-area-inset-bottom); }
  .nav-in { padding: 0; justify-content: space-around; }
  .nav a { flex: 1; text-align: center; padding: 13px 2px 12px; font-size: 12.5px; border-bottom: 0; margin: 0; }
  .nav .badge { position: absolute; top: 4px; margin-left: 2px; }
  .comp { grid-template-columns: 74px 1fr; padding: 10px 12px; }
  .comp-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; text-align: left; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .att-row { padding: 7px 10px; gap: 6px; }
  .lamp { padding: 6px 10px 6px 7px; gap: 6px; }
  .lamp .l { display: none; }
  .lamp .s { display: inline; }
  .pay { grid-template-columns: 1fr auto; }
  .pay-date { grid-column: 1 / -1; display: flex; gap: 10px; align-items: baseline; }
  .pay-act { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; margin-top: 6px; }
  .filters input[type=search] { width: 100%; }
  .t th, .t td { padding: 7px 8px; }
  .mrow .bar { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .lamp i { transition: background .12s, box-shadow .12s; }
}
@media print {
  .topbar, .nav, .filters, .head .btn, .sub, .toasts { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; }
}
