/* Senior app – styl podle tjbilovice.cz (modrá #1DA1F2, tmavý text, šedé pozadí). */
/* Work Sans (variabilní, latin + latin-ext kvůli češtině), hostovaný lokálně. */
@font-face {
    font-family: "Work Sans";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("fonts/work-sans-latin-ext-wght-normal.woff2") format("woff2");
    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: "Work Sans";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("fonts/work-sans-latin-wght-normal.woff2") format("woff2");
    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 {
    --blue: #1DA1F2;
    --blue-dark: #0F7CC0;
    --blue-light: #E4F4FE;
    --text: #323B42;
    --muted: #6B757D;
    --bg: #F5F5F5;
    --panel: #EDEDED;
    --line: #E2E2E2;
    --white: #FFFFFF;
    --red: #D93838;
    --green: #2E9E5B;
    --team-m: #1DA1F2;
    --team-s: #323B42;
    --tap: 52px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--blue-dark); }

/* ---------- Hlavička ---------- */
.site-header {
    background: var(--white);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    max-width: 1200px;
    margin: 0 auto;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
    color: var(--text);
}
.avatar {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--white), 0 0 0 3px var(--line);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-name { font-size: 17px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; }
.brand-name b { font-weight: 700; }
.brand-name .tjb { text-transform: none; font-weight: 700; }
.brand-name .sep { color: var(--blue); font-weight: 400; }
.brand-user { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key-mini { flex: 0 0 auto; width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }

/* Logo klubu přesně uprostřed hlavičky */
.club-logo { display: block; line-height: 0; }
.club-logo img { width: 44px; height: 44px; }

.tools { display: flex; justify-content: flex-end; align-items: center; gap: 2px; }
.tools form { margin: 0; }
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}
.icon-btn:hover, .icon-btn:focus-visible { background: var(--blue-light); color: var(--blue-dark); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Na úzkém displeji se logo TjB skryje (nedá se hezky vystředit). */
@media (max-width: 559px) {
    .site-header { grid-template-columns: 1fr auto; padding: 8px 8px 8px 12px; gap: 4px; }
    .brand-name { font-size: 15px; letter-spacing: .5px; }
    .club-logo { display: none; }
    .icon-btn { width: 40px; height: 40px; }
}

/* ---------- Taby (menu) ---------- */
.tabs { background: var(--white); border-bottom: 1px solid var(--line); }
.tabs-inner {
    position: relative;
    display: flex;
    justify-content: center;
    max-width: 920px;
    margin: 0 auto;
}
.tabs a {
    position: relative;
    padding: 14px 18px 13px;
    color: var(--muted);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
    transition: color .2s;
}
.tabs a:hover, .tabs a.active { color: var(--text); }
/* Bez JS: zvýraznění přímo pod aktivním tabem. Se JS ho nahradí jezdící proužek. */
.tabs a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: var(--blue);
}
.tab-indicator {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--blue);
    opacity: 0;
    transition: left .3s ease, width .3s ease, opacity .2s;
    pointer-events: none;
}
.tabs-js .tabs a.active::after { display: none; }
.tabs-js .tab-indicator { opacity: 1; }
.tabs-js .tab-indicator.no-anim { transition: none; }

@media (max-width: 559px) {
    .tabs-inner { justify-content: space-between; }
    .tabs a { flex: 1 1 auto; text-align: center; padding: 13px 2px 12px; font-size: 11px; letter-spacing: .3px; }
}

/* ---------- Stránka ---------- */
.page { max-width: 920px; margin: 0 auto; padding: 20px 12px 40px; }

.page-title {
    position: relative;
    margin: 0 0 20px;
    padding-top: 14px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-top: 1px solid var(--line);
}
.page-title::before {
    content: "";
    position: absolute;
    top: -3px;
    left: 0;
    width: 130px;
    height: 5px;
    background: var(--blue);
}
.page-title small { font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }

h2 { font-size: 18px; font-weight: 600; margin: 24px 0 10px; }

.flash { background: var(--blue-light); border-left: 5px solid var(--blue); padding: 10px 14px; }
.warn { background: #FFF4E0; border-left: 5px solid #F0A020; padding: 10px 14px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 13px; }

/* ---------- Boxy (jako „Program | Muži“) ---------- */
.box { background: var(--white); margin-bottom: 20px; }
.box-head {
    background: var(--panel);
    text-align: center;
    font-size: 19px;
    padding: 12px 10px;
    margin: 0;
    font-weight: 400;
}
.box-body { padding: 14px 16px; }
.box-body > :first-child { margin-top: 0; }
.box-body > :last-child { margin-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; background: var(--line); }
.stat { background: var(--white); padding: 12px; text-align: center; }
.stat b { display: block; font-size: 24px; color: var(--blue-dark); }
.stat span { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }

/* ---------- Tabulky ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--white); font-size: 15px; }
.table th {
    background: var(--bg);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    text-align: left;
    padding: 8px 10px;
}
.table td { padding: 10px; border-bottom: 1px solid var(--line); }
.table .num { text-align: right; white-space: nowrap; }
.table tr.highlight td { background: linear-gradient(90deg, var(--blue-light), var(--white)); font-weight: 600; }
.table a.rowlink { display: block; color: inherit; text-decoration: none; }

/* ---------- Tlačítka ---------- */
.btn {
    display: inline-block;
    min-height: 44px;
    padding: 12px 18px;
    border: 0;
    border-radius: 0;
    background: var(--blue);
    color: var(--white);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--blue-dark); }
.btn-secondary { background: var(--white); color: var(--text); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--panel); }
.btn-block { display: block; width: 100%; text-align: center; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }

/* ---------- Formuláře ---------- */
label.field { display: block; margin-bottom: 14px; font-weight: 600; }
input[type=password], input[type=text], input[type=date], input[type=number], select {
    display: block;
    width: 100%;
    min-height: 48px;
    margin-top: 6px;
    padding: 10px 12px;
    font: inherit;
    border: 1px solid #C9CED2;
    border-radius: 0;
    background: var(--white);
}
input:focus, select:focus, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.login { max-width: 420px; margin: 20px auto; }

/* ---------- Status termínů ---------- */
.status { display: inline-block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; }
.status-odehrany { background: var(--blue-light); color: var(--blue-dark); }
.status-planovany { background: var(--panel); color: var(--text); }
.status-neodehrany { background: var(--bg); color: var(--muted); }
.status-zruseny { background: #FBE3E3; color: var(--red); text-decoration: line-through; }
.lock { font-size: 13px; color: var(--muted); }

/* ---------- Večer ---------- */
.evening-nav { display: flex; align-items: stretch; gap: 8px; margin-bottom: 12px; }
.evening-nav .arrow {
    flex: 0 0 var(--tap);
    display: flex; align-items: center; justify-content: center;
    background: var(--white); border: 1px solid var(--line);
    font-size: 22px; text-decoration: none; color: var(--text);
}
.evening-nav .arrow.disabled { visibility: hidden; }
.evening-nav .current { flex: 1; text-align: center; background: var(--white); padding: 6px; }
.evening-nav .current b { display: block; font-size: 22px; }

.summary {
    position: sticky; top: 0; z-index: 5;
    display: flex; justify-content: center; gap: 14px;
    background: var(--text); color: var(--white);
    padding: 10px; font-size: 17px; margin-bottom: 14px;
}
.summary b { font-size: 20px; }

.team-group { margin-bottom: 18px; }
.team-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 0 0 6px; }

.players { list-style: none; margin: 0; padding: 0; }
.player {
    display: flex; align-items: stretch;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    border-left: 5px solid transparent;
}
.player.present { background: var(--blue-light); border-left-color: var(--blue); }
.player label {
    flex: 1;
    display: flex; align-items: center; gap: 12px;
    min-height: var(--tap);
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    font-size: 17px;
}
.player input[type=checkbox] { width: 26px; height: 26px; accent-color: var(--blue); flex: 0 0 auto; }
.player.inactive label { color: var(--muted); }
.team-btn {
    flex: 0 0 var(--tap);
    min-height: var(--tap);
    border: 0; border-left: 1px solid var(--line);
    font: inherit; font-weight: 700; font-size: 17px;
    color: var(--white); cursor: pointer;
}
.team-btn.team-M, .badge.team-M { background: var(--team-m); }
.team-btn.team-S, .badge.team-S { background: var(--team-s); }
.player:not(.present) .team-btn { visibility: hidden; }
.badge { display: inline-block; min-width: 26px; text-align: center; color: var(--white); font-weight: 700; font-size: 13px; padding: 2px 6px; }

.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.teams ul { list-style: none; margin: 0; padding: 0; background: var(--white); }
.teams li { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.teams h3 { margin: 0; padding: 8px 12px; color: var(--white); font-size: 15px; }
.teams .team-M h3 { background: var(--team-m); }
.teams .team-S h3 { background: var(--team-s); }

.save-bar { position: sticky; bottom: 0; padding: 10px 0; background: var(--bg); }
.js .save-bar { display: none; }
.saving { opacity: .6; }
.error-text { color: var(--red); }

.who-btn {
    flex: 1; display: flex; align-items: center; gap: 12px;
    min-height: var(--tap); padding: 8px 12px;
    border: 0; background: transparent; font: inherit; font-size: 17px; text-align: left; color: var(--text);
    cursor: pointer;
}
.my-total { font-size: 20px; }
.my-total b { color: var(--blue-dark); font-size: 26px; white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.season-pick { max-width: 260px; }

.site-footer { text-align: center; font-size: 12px; color: var(--muted); padding: 20px; }
.footer-title { color: #0070bb; font-size: 14px; font-weight: 600; margin-bottom: 2px; }

@media (max-width: 420px) {
    .page { padding-left: 8px; padding-right: 8px; }
    .table { font-size: 14px; }
    .table td, .table th { padding: 8px 6px; }
}

/* ---------- Administrace ---------- */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 16px; }
.subnav a {
    padding: 8px 12px;
    background: var(--white);
    border: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
}
.subnav a.active { background: var(--text); border-color: var(--text); color: var(--white); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.card { display: block; background: var(--white); padding: 16px; text-decoration: none; color: var(--text); border-left: 5px solid var(--blue); }
.card b { display: block; font-size: 18px; margin-bottom: 4px; }
.card span { font-size: 14px; color: var(--muted); }
.card:hover { background: var(--blue-light); }

.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-list li {
    display: flex; align-items: center; gap: 10px;
    min-height: var(--tap);
    padding: 4px 8px 4px 14px;
    border-bottom: 1px solid var(--line);
}
.admin-list li.inactive { opacity: .6; }
.admin-list a.grow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--text); text-decoration: none; padding: 8px 0; }
.admin-list a.grow:hover { color: var(--blue-dark); }
.grow { flex: 1 1 auto; min-width: 0; }
.chevron { font-size: 24px; color: var(--muted); padding: 0 6px; }
.move { display: flex; gap: 2px; margin: 0; }
.small-btn { width: 40px; height: 40px; font-size: 13px; color: var(--muted); }
.small-btn:disabled { opacity: .25; cursor: default; background: transparent; }

.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 12px; }
.form-row .field { flex: 1 1 160px; }
.form-row .grow { flex: 3 1 220px; }
.form-row > .btn { margin-bottom: 14px; }
.team-pick { border: 0; padding: 0; margin: 0 0 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.team-pick legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.team-pick label, label.check {
    display: flex; align-items: center; gap: 10px;
    min-height: 48px; padding: 0 14px;
    background: var(--white); border: 1px solid #C9CED2; cursor: pointer;
}
label.check { margin-bottom: 8px; border-color: var(--line); }
.team-pick input, label.check input { width: 22px; height: 22px; accent-color: var(--blue); margin: 0; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #B42828; }
input:disabled { background: var(--bg); color: var(--muted); }

.filter { margin: 0 0 12px; }
.nowrap { white-space: nowrap; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 6px; margin-right: 4px; background: var(--panel); white-space: nowrap; }
.tag-ucast-pridan { background: #DDF3E5; color: var(--green); }
.tag-ucast-odebran { background: #FBE3E3; color: var(--red); }
.tag-ucast-tym { background: var(--blue-light); color: var(--blue-dark); }
.admin-link { font-size: 14px; }

/* ---------- Vyúčtování ---------- */
.billing tfoot th { background: var(--panel); font-size: 14px; text-transform: none; }
.billing td { vertical-align: middle; }
.billing .badge { min-width: 20px; padding: 1px 4px; font-size: 11px; }
.paid-cell { white-space: nowrap; }
.paid-yes { color: var(--green); font-weight: 600; }
.paid-check { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; vertical-align: middle; cursor: pointer; }
.paid-check input { width: 24px; height: 24px; accent-color: var(--green); margin: 0; }
.billing input[type=date] { display: inline-block; width: auto; min-height: 36px; margin: 0; padding: 4px 6px; font-size: 14px; vertical-align: middle; }
.my-billing { border-left: 5px solid var(--blue); }
.actions form { margin: 0; }
@media (max-width: 559px) {
    /* Na telefonu jen zaškrtávátko; datum zůstane (nebo se doplní dnešní). */
    .billing input[type=date] { display: none; }
}

/* ---------- Zamčený večer ---------- */
.lock-banner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
    background: var(--panel); border-left: 5px solid var(--text); padding: 10px 14px; margin-bottom: 14px;
}
.lock-banner form { margin: 0; }
.lock-form { margin: 24px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.btn-lock { background: var(--text); }
.btn-lock:hover { background: #1E252A; }
.js .nojs-only { display: none; }
