:root {
  --olive: #4a5a2a;
  --olive-dark: #323d1c;
  --olive-soft: #e3e8d3;
  --sand: #f3efe4;
  --paper: #fffdf8;
  --ink: #22261a;
  --muted: #6b6f5e;
  --line: #d6d0be;
  --warn: #a4372b;
  --warn-soft: #f7e3df;
  --ok: #2f6b3a;
  --amber: #9a6b00;
  --radius: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--sand); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--olive-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
small { color: var(--muted); font-size: .82em; }
[hidden] { display: none !important; }

main { margin: 0 auto; padding: 1.5rem 1rem 4rem; }
main.narrow { max-width: 760px; }
main.wide { max-width: 1120px; }
main.form-layout { max-width: 1160px; }
main.full { max-width: none; padding-inline: 1.25rem; }

.hero { margin: 1rem 0 1.5rem; }
.eyebrow { margin: 0 0 .3rem; text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--olive); }
.lead { margin: 0; color: var(--muted); }
.crumb { margin: 0 0 .5rem; font-size: .9rem; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .9rem; margin: .4rem 0 .8rem; }
.center { text-align: center; }
.req { color: var(--warn); }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.section-title { margin-top: 1.6rem; }
.flash { background: var(--olive-soft); border-left: 4px solid var(--olive); padding: .6rem .9rem; border-radius: var(--radius); }
.errors { background: var(--warn-soft); border-left: 4px solid var(--warn); padding: .7rem 1rem; border-radius: var(--radius); margin: 0 0 1rem; }
.errors ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.note { background: var(--olive-soft); padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: 0; }

/* formulářové prvky */
label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .8rem; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password], select, textarea {
  display: block; width: 100%; margin-top: .25rem; padding: .55rem .65rem; font: inherit; font-weight: 400;
  color: var(--ink); background: #fff; border: 1px solid #b9b39f; border-radius: 4px; min-height: 2.6rem;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid #9fb46a; outline-offset: 1px;
}
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 1rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--olive); flex: none; }
fieldset { border: 0; padding: 0; margin: .3rem 0 0; }
legend { font-size: .9rem; font-weight: 600; padding: 0; margin-bottom: .3rem; }
.radios { display: flex; flex-wrap: wrap; gap: .2rem 1.5rem; }
.radios label { margin-bottom: .2rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn { display: inline-block; font: inherit; font-weight: 700; padding: .65rem 1.2rem; border-radius: 4px; border: 2px solid var(--olive); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--olive); color: #fff; }
.btn.primary:hover { background: var(--olive-dark); border-color: var(--olive-dark); }
.btn.secondary { background: transparent; color: var(--olive-dark); }
.btn.secondary:hover { background: var(--olive-soft); }
.btn.danger { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.small { padding: .35rem .75rem; font-size: .88rem; font-weight: 600; }
.btn:disabled { opacity: .6; cursor: progress; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--olive-dark); text-decoration: underline; cursor: pointer; }
button.link.danger { color: var(--warn); font-size: .88rem; }

/* veřejný formulář */
#reg-form { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.summary { position: sticky; top: 1rem; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .5rem 2rem; }
.price-grid ul { margin: 0; padding-left: 1.1rem; font-size: .92rem; }
.price-grid h3 small { font-weight: 400; }
.person { border-left: 4px solid var(--olive); }
.person-head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .7rem; }
.person-head h3 { margin: 0; }
.badge { font-size: .78rem; padding: .12rem .55rem; border-radius: 99px; background: var(--olive-soft); color: var(--olive-dark); }
.badge.half, .badge.free { background: #f2e6c4; color: #6a4b00; }
.grow { grid-column: span 2; }
.sum-person { padding-bottom: .7rem; margin-bottom: .7rem; border-bottom: 1px solid var(--line); }
.sum-person strong, .sum-person small { display: block; }
.sum-line { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; font-variant-numeric: tabular-nums; }
.sum-total .sum-line.big { font-weight: 700; font-size: 1.05rem; margin-top: .5rem; }
.sum-total small { display: block; }

/* potvrzení */
.pay { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: center; border-left: 4px solid var(--olive); }
.pay-data { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1.2rem; margin: .8rem 0; }
.pay-data dt { color: var(--muted); }
.pay-data dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.pay-data dd.amount { font-size: 1.5rem; color: var(--olive-dark); }
.qr { text-align: center; }
.qr svg { width: 210px; height: 210px; display: block; margin: 0 auto .3rem; border: 1px solid var(--line); }
.qr-missing { width: 210px; height: 210px; display: grid; place-items: center; padding: 1rem; border: 2px dashed var(--line); color: var(--muted); font-size: .9rem; border-radius: var(--radius); }

/* tabulky */
.scroll { overflow-x: auto; }
.scroll.tall { max-height: 72vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); margin-bottom: 1.2rem; }
table.grid { border-collapse: collapse; width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.grid th, table.grid td { border: 1px solid var(--line); padding: .4rem .55rem; text-align: right; vertical-align: middle; }
table.grid th { background: var(--olive-soft); font-weight: 600; text-align: center; font-size: .82rem; }
table.grid .l { text-align: left; }
table.grid tfoot td { font-weight: 700; background: #eee9da; }
table.grid tbody tr:hover td { background: #f8f5ea; }
table.sheet { font-size: .82rem; white-space: nowrap; border-collapse: separate; border-spacing: 0; }
table.sheet th, table.sheet td { border-width: 0 1px 1px 0; padding: .3rem .45rem; }
table.sheet thead th { position: sticky; top: 0; z-index: 2; white-space: normal; max-width: 6.5rem; }
table.sheet thead tr:nth-child(2) th { top: 1.75rem; }
table.sheet thead tr:nth-child(3) th { top: 3.5rem; }
table.sheet thead tr:first-child th { height: 1.75rem; }
table.sheet thead tr:nth-child(2) th { height: 1.75rem; }
table.sheet tfoot td { position: sticky; bottom: 0; z-index: 1; }
table.sheet .meal { min-width: 1.9rem; text-align: center; padding-inline: .2rem; }
table.sheet .zero { color: #c3bda9; }
table.sheet .d0 { border-left: 2px solid #a9a38d; }
table.sheet .fam { min-width: 11rem; font-weight: 600; }
table.sheet .strong, tr.strong th, tr.strong td { font-weight: 700; }
table.sheet tr.section td { background: var(--olive); color: #fff; font-weight: 700; letter-spacing: .04em; }
table.sheet .paid.ok { background: #dcebd9; color: var(--ok); font-weight: 700; }
table.sheet .paid.part { background: #f6ebc8; color: var(--amber); font-weight: 700; }
table.sheet .paid.none { background: var(--warn-soft); }
table.kitchen { max-width: 620px; font-size: 1rem; }
table.kitchen td { text-align: center; }
table.kitchen .num { font-size: 1.3rem; font-weight: 700; }
table.kitchen .off { color: var(--line); background: #f6f3ea; }
table.children tr.newgroup td { border-top: 3px solid var(--olive); }
table.kv { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
table.kv th { text-align: left; font-weight: 400; padding: .25rem 0; }
table.kv td { text-align: right; padding: .25rem 0 .25rem 1rem; white-space: nowrap; }
table.kv tr + tr th, table.kv tr + tr td { border-top: 1px solid var(--line); }
.blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }

/* administrace */
.adminbar { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.1rem; background: var(--olive-dark); color: #fff; padding: .6rem 1.25rem; font-size: .92rem; }
.adminbar a, .adminbar button.link { color: #e8edd8; text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.adminbar a.on { border-color: #c6d69a; color: #fff; }
.adminbar a:hover, .adminbar button.link:hover { color: #fff; text-decoration: underline; }
.adminbar strong { margin-right: .6rem; }
.adminbar form { margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-bottom: .8rem; }
.toolbar h1 { font-size: 1.4rem; margin: 0 .5rem 0 0; }
.pill { background: var(--paper); border: 1px solid var(--line); border-radius: 99px; padding: .15rem .7rem; font-size: .85rem; }
.login { max-width: 360px; margin: 12vh auto 0; }
.settings label { max-width: 440px; }
.danger-zone summary { cursor: pointer; color: var(--warn); font-weight: 600; }

@media (max-width: 860px) {
  #reg-form { grid-template-columns: 1fr; }
  .summary { position: static; }
  .pay { grid-template-columns: 1fr; }
  .grow { grid-column: auto; }
  h1 { font-size: 1.55rem; }
}
@media print {
  .adminbar, .btn, .hint.center { display: none; }
  body { background: #fff; }
  .card { border-color: #999; break-inside: avoid; }
}
