/* DDM docházka – vzhled podle webu DDM Světlá: duha, zaoblení, písmo Outfit.
   Administrace je střídmá (barva jen pro akce a stavy), formulář vedoucího
   a přihlášení jsou hravější. */

@font-face {
  font-family: "Outfit Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/outfit-latin-ext-wght-normal.woff2) format("woff2-variations");
  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: "Outfit Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/outfit-latin-wght-normal.woff2) format("woff2-variations");
  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 {
  /* Značka (odečteno z webu DDM Světlá) */
  --pink: #ec6283;
  --orange: #f7a126;
  --yellow: #ffe749;
  --green: #79bb54;
  --sky: #6dcaff;
  --blue: #4167af;
  --navy: #02228b;
  --slate: #3e424f;
  --cloud: #d9f7fe;
  --cream: #fffbe5;
  --rainbow: linear-gradient(90deg, var(--pink), var(--orange) 20%, var(--yellow) 40%, var(--green) 60%, var(--sky) 80%, var(--blue));

  /* Použití */
  --fg: #1d2130;
  --muted: #5f6675;
  --line: #e3e7ee;
  --bg: #f6f8fb;
  --card: #fff;
  --focus: 0 0 0 3px rgba(2, 34, 139, 0.28);
  --ok-fg: #2f6b17;
  --ok-bg: #e9f5e1;
  --warn-fg: #8a4b00;
  --warn-bg: #fff1dc;
  --danger: #c7254e;
  --danger-bg: #fde8ee;
  --info-bg: #e7f6ff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 60, 0.05), 0 6px 20px rgba(20, 30, 60, 0.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.55 "Outfit Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--fg);
  background: var(--bg);
}
h1, h2, h3 { line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; margin: 0 0 1.25rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 0.75rem; }
a { color: var(--navy); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-size: 0.9rem; }
[hidden] { display: none !important; }

/* ---------- Kostra ---------- */

.rainbow { height: 6px; background: var(--rainbow); }

.site-header { background: var(--card); box-shadow: 0 1px 0 var(--line); }
.site-header .inner {
  max-width: 72rem; margin: 0 auto; padding: 0.6rem 1rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.75rem; color: inherit; text-decoration: none; margin-right: auto; }
.brand img { height: 44px; width: auto; }
.brand .title { display: flex; flex-direction: column; line-height: 1.15; }
.brand .title strong { font-size: 1.1rem; }
.brand .title span { font-size: 0.85rem; color: var(--muted); }
.user { display: flex; align-items: center; gap: 0.75rem; font-size: 0.95rem; }
.user a { color: var(--fg); text-decoration: none; font-weight: 500; }

.tabs { background: var(--card); border-bottom: 1px solid var(--line); }
.tabs nav {
  max-width: 72rem; margin: 0 auto; padding: 0 1rem;
  display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none;
}
.tabs a {
  padding: 0.75rem 0.9rem; color: var(--muted); text-decoration: none; font-weight: 500;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--fg); font-weight: 700; border-bottom-color: var(--navy); }

main { max-width: 72rem; margin: 0 auto; padding: 1.75rem 1rem 4rem; }
.page-head { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.back { display: inline-block; margin-bottom: 0.75rem; text-decoration: none; font-weight: 500; }

/* Veřejné stránky: formulář vedoucího, přihlášení */
body.public { background: #fff; }
.public-header { text-align: center; padding: 1.25rem 1rem 0; }
.public-header img { height: 64px; }
body.public main { max-width: 56rem; }
body.auth { background: linear-gradient(180deg, #fff 0%, var(--cloud) 100%); min-height: 100vh; }
body.auth main { padding-top: 3rem; }

/* ---------- Karty, dlaždice ---------- */

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem;
}
.card > h2:first-child { margin-top: 0; }
.narrow { max-width: 28rem; margin: 0 auto; }
.auth-card { padding: 0; overflow: hidden; }
.auth-card .rainbow { height: 8px; }
.auth-card .body { padding: 1.75rem 1.75rem 1.5rem; }
.auth-card .logo { display: block; height: 72px; margin: 0 auto 1rem; }
.auth-card h1 { text-align: center; font-size: 1.5rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.25rem; border-top: 5px solid var(--line);
}
.stat strong { display: block; font-size: 1.9rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 0.95rem; }
.stat.ok { border-top-color: var(--green); }
.stat.warn { border-top-color: var(--orange); }
.stat.danger { border-top-color: var(--pink); }
.stat.info { border-top-color: var(--sky); }

.month-nav { margin-bottom: 1.25rem; }
.month-nav-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.month-nav-row form { display: flex; align-items: center; gap: 0.5rem; }
.month-nav-row label { display: inline; margin: 0; }
.month-nav-row select { width: auto; min-height: 38px; }
.month-links { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.month-link { text-decoration: none; color: var(--fg); padding: 0.3rem 0.75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 0.95rem; }
.month-link:hover { border-color: var(--navy); }
.month-link.current { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }


/* ---------- Tabulky ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
  font-weight: 600; background: #fafbfd;
}
tbody tr:last-child > * { border-bottom: none; }
tbody tr:hover { background: #fafcff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Formuláře ---------- */

label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.field { margin-bottom: 1.1rem; }
.field .hint { font-size: 0.87rem; color: var(--muted); margin-top: 0.25rem; }
.field .error { margin-top: 0.25rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], select {
  font: inherit; color: inherit; min-height: 44px; padding: 0.5rem 0.75rem; width: 100%; max-width: 26rem;
  border: 1px solid #cfd5df; border-radius: var(--radius-sm); background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus { outline: none; border-color: var(--navy); box-shadow: var(--focus); }
input[aria-invalid="true"] { border-color: var(--danger); }
.checkbox { display: flex; gap: 0.6rem; align-items: center; font-weight: 400; }
input[type="checkbox"] { width: 1.2rem; height: 1.2rem; accent-color: var(--navy); margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.row .field { margin-bottom: 0; }
.row input, .row select { width: auto; }
.inline { display: inline; }
.inline-label { margin: 0; font-weight: 500; }
input.short { width: 6rem; }
.term-row { margin-bottom: 1.1rem; }
/* Pevný sloupec dne, ať pole času začíná u všech termínů stejně, i když je popisek delší. */
.term-row .field:first-child { flex: 0 0 10rem; }
.term-row input[type="number"] { width: 6rem; }
.term-row input[type="time"] { width: 8rem; }
.spaced { margin-top: 0.75rem; }
.year-switcher { margin-bottom: 1.25rem; }
details.by-day { margin-top: 1rem; }
details.by-day summary { cursor: pointer; font-weight: 600; color: var(--navy); margin-bottom: 0.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; align-items: center; }
.actions form, td form { margin: 0; }
td .row { align-items: center; flex-wrap: nowrap; }
td button, td .button { min-height: 36px; padding: 0.3rem 0.9rem; font-size: 0.92rem; }
td input[type="text"],
td input[type="number"] { min-height: 36px; }

/* ---------- Tlačítka ---------- */

button, .button {
  font: inherit; font-weight: 600; min-height: 44px; padding: 0.55rem 1.25rem; border-radius: 999px;
  border: 2px solid var(--navy); background: var(--navy); color: #fff; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}
button:hover, .button:hover { background: #0a2fa8; }
button:active, .button:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
button.secondary, .button.secondary { background: #fff; color: var(--navy); }
button.secondary:hover, .button.secondary:hover { background: #f0f3fb; }
button.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
button.danger:hover { background: var(--danger-bg); }
button.small, .button.small { min-height: 36px; padding: 0.3rem 0.9rem; font-size: 0.92rem; }
button.link { background: none; border: none; color: var(--navy); padding: 0; min-height: 0; font-weight: 500; font-size: 0.95rem; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { background: none; text-decoration-thickness: 2px; }

/* ---------- Štítky a hlášky ---------- */

.badge {
  display: inline-block; font-size: 0.82rem; font-weight: 600; padding: 0.15rem 0.65rem; border-radius: 999px;
  background: #eef1f6; color: var(--muted); white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: #0b5a86; }

.flash {
  padding: 0.85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem;
  border-left: 5px solid; background: var(--card); box-shadow: var(--shadow);
}
.flash.success { border-color: var(--green); background: var(--ok-bg); color: var(--ok-fg); }
.flash.error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.flash.warning { border-color: var(--orange); background: var(--warn-bg); color: var(--warn-fg); }
.mail-alert {
  padding: 0.85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem;
  border-left: 5px solid var(--danger); background: var(--danger-bg); color: var(--danger); box-shadow: var(--shadow);
}
.mail-alert p { margin: 0; }
.mail-alert p + p { margin-top: 0.4rem; }
.mail-alert a { color: inherit; text-decoration: underline; }
.completion-alert {
  padding: 0.85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem;
  border-left: 5px solid var(--orange); background: var(--warn-bg); color: var(--warn-fg); box-shadow: var(--shadow);
}
.completion-alert p { margin: 0; }
.completion-alert a { color: inherit; text-decoration: underline; }
.flash ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

/* ---------- Formulář výkazu ---------- */

.report-head { text-align: center; margin-bottom: 1.5rem; }
.report-head h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.report-head .who { font-size: 1.1rem; }
.deadline { display: inline-block; margin-top: 0.5rem; background: var(--cream); border: 1px solid #f3e3a0; color: #6b5300; border-radius: 999px; padding: 0.25rem 0.9rem; font-weight: 600; }

/* Jeden úzký sloupec; kroužek je <details>, den jeden blok se zaměstnanci pod sebou (design D5, D6). */
.report-form { max-width: 42rem; }
body.public .report-form { margin: 0 auto; }
.form-state { margin-bottom: 1rem; }
.form-state .instruction { margin: 0 0 0.5rem; color: var(--muted); }
.month-state { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.pill { font-size: 0.85rem; font-weight: 600; padding: 0.15rem 0.65rem; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill.warn { background: var(--warn-bg); color: var(--warn-fg); }

details.club {
  border: 1px solid var(--line); border-top: 6px solid var(--club, var(--green));
  border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); margin: 0 0 1rem;
}
details.club:nth-of-type(5n + 1) { --club: var(--green); }
details.club:nth-of-type(5n + 2) { --club: var(--orange); }
details.club:nth-of-type(5n + 3) { --club: var(--sky); }
details.club:nth-of-type(5n + 4) { --club: var(--pink); }
details.club:nth-of-type(5n + 5) { --club: var(--blue); }
details.club > summary {
  list-style: none; cursor: pointer; padding: 0.9rem 1.1rem;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 0.75rem; align-items: center;
}
details.club > summary::-webkit-details-marker { display: none; }
details.club > summary::after { content: "upravit"; grid-column: 1; font-size: 0.85rem; font-weight: 600; color: var(--navy); }
details.club[open] > summary::after { content: "sbalit"; }
.club-name { font-weight: 700; font-size: 1.2rem; line-height: 1.25; }
.part-label { grid-column: 1; font-weight: 600; font-size: 0.9rem; }
.club-meta { grid-column: 1; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
details.club > summary .pill { grid-column: 2; grid-row: 1 / span 3; }
.club-body { border-top: 1px solid var(--line); padding: 0.25rem 1.1rem 1rem; }
.self-reporter { background: var(--info-bg); border-radius: var(--radius-sm); padding: 0.55rem 0.75rem; margin: 0.75rem 0 0.25rem; font-size: 0.92rem; }

.report-form .day { padding: 0.75rem 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.report-form .day > * { flex: 1 0 100%; min-width: 0; }
/* Odkazy „Jiné hodiny“ a „Poznámka“ vedle sebe, dokud jsou zavřené. */
.report-form .day > details:not([open]) { flex: 0 0 auto; }
.report-form .day:last-child { border-bottom: none; }
.report-form .day.has-error { background: var(--danger-bg); margin: 0 -1.1rem; padding: 0.75rem 1.1rem; }
.day-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; min-height: 2rem; }
.day-label { font-weight: 700; font-variant-numeric: tabular-nums; }
.day-head .badge { background: var(--warn-bg); color: var(--warn-fg); }
.day-head .activate { margin-left: auto; min-height: 36px; padding: 0.25rem 0.9rem; font-size: 0.92rem; background: #fff; color: var(--navy); }
.day-head .deactivate { margin-left: auto; font-size: 0.9rem; }
.report-form .day[data-inactive="true"] .day-label { color: var(--muted); }
.report-form .people { display: grid; gap: 0.35rem; }
.person {
  display: flex; align-items: center; gap: 0.4rem; min-height: 48px; padding-right: 0.35rem;
  border: 2px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  transition: border-color 0.15s, background 0.15s;
}
.person:has(input:checked) { border-color: var(--navy); background: #eef2fc; }
.person-pick { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 0; margin: 0; padding: 0.35rem 0.6rem; font-weight: 500; cursor: pointer; align-self: stretch; }
.person-pick input { flex: none; }
.person-name { display: grid; gap: 0.1rem; justify-items: start; min-width: 0; line-height: 1.2; }
/* Hodiny jen u zaškrtnutých; funguje i bez skriptu (design D6). */
.person select.hours { width: auto; max-width: 8.5rem; min-height: 38px; padding: 0.25rem 0.4rem; font-variant-numeric: tabular-nums; }
.person:not(:has(input[type="checkbox"]:checked)) :is(.hours-control, select.hours) { display: none; }
/* Příprava ve formuláři správce: jen u zaškrtnutých, jako hodiny. Třída `preparation` patří detailu kroužku. */
.day-preparation { display: flex; align-items: center; gap: 0.4rem; flex: none; margin: 0; font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.day-preparation select { width: auto; min-height: 38px; padding: 0.25rem 0.4rem; font-variant-numeric: tabular-nums; }
.person:not(:has(input[type="checkbox"]:checked)) .day-preparation { display: none; }
.hours-control { display: flex; align-items: center; flex: none; border: 1px solid #cfd5df; border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.hours-control select.hours { border: none; border-radius: 0; text-align: center; text-align-last: center; appearance: none; -webkit-appearance: none; background: #fff; min-width: 4.6rem; padding: 0.25rem 0.1rem; font-size: 0.92rem; }
.hours-control select.preparation { border: none; border-radius: 0; text-align: center; text-align-last: center; appearance: none; -webkit-appearance: none; background: #fff; width: auto; min-width: 9rem; }
/* Mimo řádek výkazu není obal položkou flex řádku; bez inline-flex by se roztáhl na celou šířku buňky. */
.hours-control:has(select.preparation) { display: inline-flex; vertical-align: middle; }
.hours-control.differs, .person select.hours.differs { border-color: var(--warn-fg); }
.hours-control.differs select.hours, .person select.hours.differs { color: var(--warn-fg); background: var(--warn-bg); font-weight: 700; }
.stepper { min-height: 38px; min-width: 34px; padding: 0; border: none; border-radius: 0; font-size: 1.15rem; background: #fff; color: var(--navy); }
.stepper:hover { background: #f0f3fb; }

.report-form .day details > summary {
  display: inline-block; cursor: pointer; color: var(--navy); font-size: 0.9rem; font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; list-style: none;
}
.report-form .day details > summary::-webkit-details-marker { display: none; }
.report-form .day details[open] > summary { text-decoration: none; font-weight: 600; margin-bottom: 0.3rem; }
.report-form .day details > summary.required { color: var(--warn-fg); font-weight: 700; text-decoration: none; }
.report-form .day:has(summary.required) .note input { border-color: var(--warn-fg); background: var(--warn-bg); }
.report-form .note input { max-width: none; min-height: 42px; }
.report-form .row-error { color: var(--danger); font-size: 0.92rem; margin: 0; font-weight: 600; }
.report-form input[type="date"] { max-width: 11rem; min-height: 40px; }
.report-form .add-day { margin-top: 0.75rem; }
.club-states { list-style: none; margin: 0.35rem 0 0; padding: 0; font-size: 0.88rem; color: var(--muted); }
.report-form .saved-by { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--muted); }
.submit-bar {
  position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(4px); border-top: 1px solid var(--line);
  padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom, 0px));
}
.submit-bar button { white-space: nowrap; flex: none; }

.report-review .review-club h2 { margin-top: 0; }
.report-review tbody.unusual > tr > * { background: var(--info-bg); }
.report-review tbody.unusual.cancelled > tr > * { background: var(--warn-bg); }
.report-review tbody + tbody > tr:first-child > * { border-top: 2px solid var(--line); }
.review-totals { margin: 0.75rem 0 0; color: var(--muted); }
.report-review td .badge { margin-left: 0.4rem; }
.report-review td[rowspan], .report-review th[rowspan] { vertical-align: top; }
.review-month { margin: 1rem 0; }
.review-month h2 { margin-top: 0; }

.done { text-align: center; border-top: 6px solid var(--green); }
.done .check {
  width: 3rem; height: 3rem; border-radius: 50%; background: var(--green); color: #fff; font-size: 1.6rem;
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 0.5rem;
}

/* ---------- Úpravy na místě (ADR-0018): hodnota jako text, vedle odkaz „Upravit“ ---------- */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
a.link { color: var(--navy); font-weight: 500; font-size: 0.95rem; text-decoration: underline; text-underline-offset: 3px; }
a.link:hover { text-decoration-thickness: 2px; }
.link.danger-link { color: var(--danger); }
.btns { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; }
.head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; margin-bottom: 0.75rem; }
.head h1, .head h2 { margin: 0; }
.head .meta { color: var(--muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.head .act { margin-left: auto; }
.title-head { margin-bottom: 0.25rem; }
.title-head .act { margin-left: 0; }
.page-sub { margin: 0 0 2rem; }
main > section { margin-bottom: 2.25rem; }
.card.editing { background: #f5f8ff; border-color: #c9d4f0; }
.card.empty { color: var(--muted); }

/* Název v úpravě */
.name-edit {
  display: flex; flex-wrap: wrap; gap: 0.6rem 0.75rem; align-items: center; background: #f5f8ff;
  border: 1px solid #c9d4f0; border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 0.4rem;
}
.name-edit input[type="text"] { font-size: 1.35rem; font-weight: 700; flex: 1 1 18rem; min-width: 0; max-width: none; width: auto; }
.name-edit .error { flex-basis: 100%; }

/* Rozvrh v klidu: týden po–pá */
.card.week-read { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.week-read .d { padding: 0.85rem 1rem; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.15rem; }
.week-read .d:last-child { border-right: none; }
.week-read .dn { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.week-read .dn abbr { text-decoration: none; }
.week-read .t { font-weight: 600; font-variant-numeric: tabular-nums; }
.week-read .len { font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-read .d.off .t { color: #a3a9b5; font-weight: 500; }
.week-read .d.on { background: linear-gradient(180deg, #f3f6ff, #fff 70%); }

/* Rozvrh v úpravě */
.week { display: grid; grid-template-columns: 8rem auto minmax(0, 1fr); align-items: center; column-gap: 1rem; }
.week > div { padding: 0.5rem 0; border-bottom: 1px solid #dfe5f3; min-height: 3.5rem; display: flex; align-items: center; }
.week > .week-error { grid-column: 1 / -1; min-height: 0; padding: 0 0 0.5rem; margin-top: -0.25rem; font-weight: 600; }
.week .day { font-weight: 600; }
.week .day.off { color: var(--muted); font-weight: 500; }
.times { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.6rem; }
.times input[type="time"] { min-height: 40px; padding: 0.3rem 0.6rem; width: 7.5rem; font-variant-numeric: tabular-nums; }
.times input[aria-invalid="true"] { box-shadow: 0 0 0 3px rgba(199, 37, 78, 0.15); }
.times .dash { color: var(--muted); }
.times .chg { color: var(--muted); font-size: 0.9rem; }
.times .chg:empty { display: none; }
.times .dur.err { color: var(--danger); font-weight: 600; }
.times input.changed { border-color: var(--navy); background: #fff; }
.times input:disabled { opacity: 0.45; }
.times .dur { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3.5rem; }
.switch { position: relative; display: inline-flex; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.switch input[type="checkbox"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.switch span { flex: 1; border-radius: 999px; background: #cfd5df; transition: background 0.15s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s;
}
.switch input:checked + span { background: var(--navy); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.week-foot { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; justify-content: space-between; padding-top: 1rem; }
.summary { font-variant-numeric: tabular-nums; }

/* Tabulka členů: řádek v úpravě, potvrzení odebrání, nový člen */
td.row-actions { text-align: right; white-space: nowrap; }
td.row-actions .btns { justify-content: flex-end; flex-wrap: nowrap; }
tr.editing select, tr.adding select { min-height: 36px; padding: 0.3rem 0.6rem; width: auto; }
tr.confirming button.danger, .confirm-box button.danger { background: var(--danger); color: #fff; }
tr.confirming button.danger:hover, .confirm-box button.danger:hover { background: #a91d41; }
tr.editing, tr.editing:hover, tr.adding, tr.adding:hover { background: #f5f8ff; }
tr.confirming, tr.confirming:hover { background: var(--danger-bg); }
tr.confirming td { color: var(--danger); }
tr.adding .row-note, tr.editing .row-note { font-size: 0.87rem; color: var(--muted); }
tr.editing label.checkbox { margin-top: 0.4rem; font-size: 0.95rem; }

/* Pole s vyhledáváním zaměstnance (employee-picker.js) */
.employee-picker { position: relative; display: inline-block; vertical-align: middle; max-width: 100%; }
input.employee-picker-input { width: 16rem; max-width: 100%; min-height: 36px; padding: 0.3rem 0.6rem; }
.employee-picker-list {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; min-width: 100%; max-width: calc(100vw - 2rem);
  max-height: 16rem; overflow-y: auto; margin: 0; padding: 0.25rem 0; list-style: none;
  border: 1px solid #cfd5df; border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow);
}
.employee-picker-list[hidden] { display: none; }
.employee-picker-list li { padding: 0.4rem 0.75rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.employee-picker-list li:hover { background: #f0f3fb; }
.employee-picker-list li[aria-selected="true"] { background: var(--navy); color: #fff; }
.employee-picker-list li.employee-picker-empty { color: var(--muted); cursor: default; }
.employee-picker-list li.employee-picker-empty:hover { background: none; }
/* Otevřená nabídka přesahuje tabulku; jinak by ji ořízl posun .table-wrap. Na telefonu je nabídka v toku buňky. */
@media (min-width: 641px) {
  .table-wrap:has(.employee-picker-list:not([hidden])) { overflow: visible; }
}

/* Vyplňující kroužku */
.filler-edit { display: flex; flex-wrap: wrap; gap: 0.6rem 0.75rem; align-items: center; }
.filler-edit select { width: auto; min-height: 36px; padding: 0.3rem 0.6rem; }
.filler-edit .error, .filler-edit .row-note { flex-basis: 100%; }
.filler-edit .row-note { font-size: 0.87rem; color: var(--muted); }

/* Smazání kroužku */
.delete-zone { border-top: 1px solid var(--line); padding-top: 1.25rem; margin-top: 1rem; }
.delete-zone > p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.confirm-box { background: var(--danger-bg); border: 1px solid #f3c2cf; border-radius: var(--radius); padding: 1rem 1.25rem; display: grid; gap: 0.75rem; }
.confirm-box p { color: var(--danger); margin: 0; }

/* ---------- Mobil ---------- */

@media (max-width: 640px) {
  h1 { font-size: 1.45rem; }
  main { padding-top: 1.25rem; }
  .card:not(.auth-card) { padding: 1rem 1.1rem; }
  .auth-card .body { padding: 1.5rem 1.25rem 1.25rem; }
  input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="time"], select { max-width: none; }

  /* Souhrn a detail výkazu: každý den (a patička, měsíc) jako blok, řádek lektora je řádek bloku. */
  .report-review .table-wrap { border: none; box-shadow: none; overflow: visible; }
  .report-review table, .report-review tbody, .report-review td, .report-review th { display: block; }
  .report-review thead { display: none; }
  .report-review tbody { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; }
  .report-review tbody { display: grid; grid-template-columns: auto auto 1fr; gap: 0.1rem 0.75rem; }
  .report-review .review-month tbody { grid-template-columns: auto auto auto 1fr; }
  .report-review tr { display: contents; }
  .report-review td, .report-review th { border: none !important; padding: 0.1rem 0; text-align: left; }
  .report-review .day { grid-column: 1 / -1; font-weight: 700; }
  .report-review .lecturer { grid-column-start: 1; }
  .report-review td[data-label]::before { content: attr(data-label) " "; color: var(--muted); }
  .report-review td[data-label]:empty { display: none; }
  .report-review td.note { grid-column: 1 / -1; order: 1; font-style: italic; color: var(--muted); }
  .report-review td.note:empty { display: none; }
  .report-review tbody.unusual { background: var(--info-bg); }
  .report-review tbody.unusual.cancelled { background: var(--warn-bg); }
  .report-review tbody.unusual > tr > *, .report-review tbody.unusual.cancelled > tr > * { background: none; }
  .submit-bar { margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; }
  .submit-bar button { padding-left: 1rem; padding-right: 1rem; }
  .club-body { padding-left: 0.9rem; padding-right: 0.9rem; }
  details.club > summary { padding: 0.8rem 0.9rem; }
}

/* Volby nedokončeného zaměstnance (employee-form.js) */
fieldset.field { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
fieldset.field legend { padding: 0; font-weight: 600; margin-bottom: 0.25rem; }
fieldset.field[hidden] { display: none; }
