/* Rezervace areálu – vzhled podle futsalbrno.cz */
:root {
  --blue: #2974b3;
  --blue-dark: #1f5e95;
  --blue-soft: #e3eef8;
  --grey: #76747b;
  --grey-2: #8a888f;
  --page-bg: #2a78b7;
  --panel: #ebebf0;
  --card: #f6f6f8;
  --line: #d2d2d9;
  --text: #111;
  --muted: #5b5a60;
  --amber: #f3c13a;
  --amber-ink: #3d2f00;
  --red: #c8372d;
  --green: #2e8b57;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: 'Bai Jamjuree', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
body.noscroll { overflow: hidden; }
a { color: var(--blue); }
button { font-family: inherit; }
[hidden] { display: none !important; }

.page {
  position: relative;
  max-width: 1216px;
  margin: 0 auto;
  background: var(--panel);
  min-height: 100vh;
  padding-bottom: 24px;
}

/* ---------- hlavička */
.site-header {
  background: #fff;
  display: flex;
  align-items: center;
  min-height: 120px;
  padding: 16px 32px 16px 220px;
}
.logo {
  position: absolute;
  left: 32px;
  top: 10px;
  width: 160px;
  z-index: 2;
}
.logo img { width: 100%; height: auto; display: block; }
.brand-title { font-size: 48px; font-weight: 700; line-height: 1; letter-spacing: .5px; }
.brand-sub { font-size: 18px; letter-spacing: 3.5px; margin-top: 8px; }

.site-nav {
  background: #d4d4da;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 32px 12px 220px;
  min-height: 76px;
  align-items: center;
}

.btn-black, .btn-grey, .btn-blue, .btn-red, .btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 4px;
  padding: 12px 18px;
  font: 700 15px/1.1 'Bai Jamjuree', sans-serif;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.btn-black { background: #111; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.btn-black:hover { background: #2b2b2b; }
.btn-grey { background: var(--grey); }
.btn-grey:hover { background: var(--grey-2); }
.btn-blue { background: var(--blue); }
.btn-blue:hover { background: var(--blue-dark); }
.btn-red { background: var(--red); }
.btn-line { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn-black:disabled, .btn-grey:disabled, .btn-blue:disabled, .btn-red:disabled { opacity: .45; cursor: default; }
.btn-black.big, .btn-blue.big, .btn-red.big { width: 100%; padding: 16px; font-size: 17px; }
.link { background: none; border: 0; color: var(--blue); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; padding: 2px 4px; }

/* ---------- záložky prostorů */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px 24px 0;
}
.tab {
  border: 0;
  border-radius: 3px;
  background: var(--grey);
  color: #fff;
  font: 700 15px/1 'Bai Jamjuree', sans-serif;
  text-transform: uppercase;
  padding: 12px 8px;
  cursor: pointer;
  position: relative;
}
.tab:hover { background: var(--grey-2); }
.tab.on { background: var(--blue); }
/* veřejné záložky: velké hřiště hlavní, ostatní menší */
/* hlavní prostory vlevo přes 2/3, ostatní menší vpravo */
#tabs { grid-template-columns: 2fr 1fr; grid-auto-flow: row dense; gap: 6px 10px; }
#tabs .tab.main { grid-column: 1; font-size: 19px; padding: 14px 8px; }
#tabs .tab.minor { grid-column: 2; font-size: 13px; padding: 9px 6px; background: #a3a1a8; }
#tabs .tab.minor:hover { background: var(--grey); }
#tabs .tab.minor.on { background: var(--blue); }
#tabs .tab.main:not(.on) { background: var(--grey); }
.tab .badge { margin-left: 6px; }

/* ---------- panel */
.panel {
  margin: 12px 24px 0;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 28px 36px 24px;
}
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; }
.panel h1 { font-size: 34px; font-weight: 700; text-transform: uppercase; margin: 0 0 6px; line-height: 1.1; }
.panel h2 { font-size: 24px; margin: 0 0 12px; text-transform: uppercase; }
.lead { margin: 0; color: #222; max-width: 560px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 16px; height: 16px; border-radius: 3px; display: inline-block; border: 1px solid var(--line); }
.lg.free { background: #fff; }
.lg.pending { background: var(--amber); border-color: #d9a816; }
.lg.approved { background: var(--blue); border-color: var(--blue); }
.lg.blocked { background: repeating-linear-gradient(135deg, var(--grey) 0 4px, var(--grey-2) 4px 8px); border-color: var(--grey); }

.weekbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.weekbar-mid { text-align: center; display: flex; flex-direction: column; align-items: center; }
.weekbar-mid strong { font-size: 20px; }

.loading { padding: 48px 12px; text-align: center; color: var(--muted); }

/* ---------- kalendář – desktop */
.cal-grid {
  display: grid;
  grid-template-columns: 58px repeat(7, minmax(0, 1fr));
  grid-template-rows: 40px repeat(var(--rows), 34px) 12px;
  gap: 2px;
}
.cg-corner { grid-row: 1; grid-column: 1; }
.cg-day {
  grid-row: 1;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 14px; background: #fff; border: 1px solid var(--line); border-radius: 3px;
}
.cg-day.is-today { background: var(--blue); color: #fff; border-color: var(--blue); }
.cg-time {
  /* čas stojí přesně na čáře, kde ta hodina začíná */
  grid-column: 1; position: relative; align-self: start;
  transform: translateY(calc(-50% - 1px));
  font-size: 14px; line-height: 1; color: var(--muted); text-align: right; padding: 0 9px 0 0;
}
.cg-time::after { content: ''; position: absolute; right: 0; top: 50%; width: 6px; height: 1px; background: #b9b8bf; }
.cg-time.half { font-size: 12px; color: #a3a1a8; }
.cg-time.end { font-weight: 700; color: var(--text); }
.cg-time.end::after { background: var(--text); height: 2px; margin-top: -1px; }
.hours { margin: 0 0 6px; font-weight: 600; color: var(--blue); }
.daylist-end { text-align: center; font-size: 14px; font-weight: 700; color: var(--muted); padding: 6px 0 2px; border-top: 2px solid var(--line); margin-top: 4px; }
.cg-cell { border-radius: 3px; }
.cg-cell.free {
  background: #fff; border: 1px solid var(--line); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
.cg-cell.free span { color: var(--blue); font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .12s; }
.cg-cell.free.nostart { cursor: default; background: #fbfbfc; }
.cg-cell.free.nostart:hover { background: #fbfbfc; border-color: var(--line); }
.cg-cell.free:hover, .cg-cell.free:focus-visible { background: var(--blue-soft); border-color: var(--blue); outline: none; }
.cg-cell.free:hover span, .cg-cell.free:focus-visible span { opacity: 1; }
.cg-cell.past { background: #e2e2e7; }
.cg-item {
  z-index: 1;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 14px;
  line-height: 1.25;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.cg-item.short { flex-direction: row; gap: 6px; align-items: center; white-space: nowrap; }
.cg-item .t { font-weight: 700; }
.cg-item .l { overflow: hidden; text-overflow: ellipsis; }
.cg-item[role=button] { cursor: pointer; }
.cg-item[role=button]:hover { filter: brightness(1.08); }
.st-approved { background: var(--blue); color: #fff; }
.st-pending { background: var(--amber); color: var(--amber-ink); }
.st-blocked { background: repeating-linear-gradient(135deg, var(--grey) 0 8px, var(--grey-2) 8px 16px); color: #fff; }

/* ---------- kalendář – mobil */
.cal-mobile { display: none; }
.daychips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 0;
  display: flex; flex-direction: column; align-items: center; cursor: pointer; color: var(--text);
}
.chip small { font-size: 12px; color: var(--muted); }
.chip b { font-size: 17px; }
.chip.today { border-color: var(--blue); border-width: 2px; }
.chip.full b { color: var(--grey-2); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.on small { color: #dbe9f6; }
.chip.on.full b { color: #fff; }
.daylist-title { font-weight: 700; text-transform: uppercase; margin: 4px 0 8px; font-size: 15px; }
.row {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 14px; margin-bottom: 6px; border-radius: 6px;
  font: 500 16px/1.2 'Bai Jamjuree', sans-serif; text-align: left;
  border: 1px solid transparent;
}
.row .t { font-weight: 700; white-space: nowrap; }
.row .l { text-align: right; overflow: hidden; text-overflow: ellipsis; }
.row.free { background: #fff; border-color: var(--line); color: var(--text); cursor: pointer; }
.row.free .l { color: var(--blue); font-weight: 700; }
.row.free:active { background: var(--blue-soft); }
.row.past { background: #e2e2e7; color: #8d8c92; }
.row[role=button] { cursor: pointer; }

/* ---------- modal */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 22, 38, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
}
.modal-box {
  position: relative;
  background: #fff;
  width: 100%; max-width: 470px;
  max-height: calc(100vh - 24px); overflow: auto;
  border-radius: 8px;
  padding: 26px 24px 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.modal-box.wide { max-width: 560px; }
.modal-box h2 { margin: 0 0 6px; font-size: 24px; text-transform: uppercase; }
.modal-x { position: absolute; top: 8px; right: 10px; background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.hint { font-size: 13px; color: var(--muted); margin: -6px 0 14px; }
.m-sum { background: var(--blue-soft); border-left: 4px solid var(--blue); padding: 10px 12px; margin: 10px 0 16px; border-radius: 0 4px 4px 0; }
form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
form label small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px;
  font: 400 16px/1.3 'Bai Jamjuree', sans-serif;
  padding: 11px 12px; border: 1px solid #c4c4cc; border-radius: 4px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
textarea { resize: vertical; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.m-err { color: var(--red); font-weight: 600; min-height: 1.2em; margin: 4px 0 10px; }
.done-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; font-size: 38px; display: flex; align-items: center; justify-content: center; margin: 4px auto 14px; }
#m-done { text-align: center; }
#m-done p { margin: 8px 0 20px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.btnrow > * { flex: 1 1 auto; }

/* ---------- správa */
.badge { display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--red); color: #fff; font-size: 13px; align-items: center; justify-content: center; }
.admin-tabs { grid-template-columns: repeat(3, 1fr); }
.req-list { display: grid; gap: 12px; }
.req {
  background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--amber);
  border-radius: 6px; padding: 14px 16px;
  display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center;
}
.req-when { font-size: 19px; font-weight: 700; }
.req-space { display: inline-block; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; margin-right: 6px; vertical-align: 2px; }
.req-who { margin-top: 4px; }
.req-who a { font-weight: 700; text-decoration: none; }
.req-note { margin-top: 6px; color: var(--muted); font-size: 14px; white-space: pre-wrap; }
.req-meta { font-size: 12px; color: var(--grey-2); margin-top: 4px; }
.req-actions { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: 6px; padding: 32px 16px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.space-select { display: flex; gap: 6px; flex-wrap: wrap; }
.space-select .tab { padding: 10px 14px; font-size: 14px; }
.kind-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 14px; }
.kind-switch label { margin: 0; }
.kind-switch input { position: absolute; opacity: 0; pointer-events: none; }
.kind-switch span { display: block; text-align: center; padding: 10px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-weight: 700; text-transform: uppercase; font-size: 14px; }
.kind-switch input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.kind-switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.info { background: var(--card); border-radius: 4px; padding: 10px 12px; margin-bottom: 12px; }
.info dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; font-weight: 600; word-break: break-word; }
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.result { margin-top: 10px; padding: 10px 12px; border-radius: 4px; background: #eaf6ee; color: #1d5b37; font-size: 14px; white-space: pre-wrap; }
.result.warn { background: #fdf3dc; color: #6b4b00; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: #111; color: #fff; padding: 12px 18px; border-radius: 6px; z-index: 80;
  font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.3); max-width: calc(100% - 24px);
}
.login { max-width: 380px; margin: 40px auto; }

/* ---------- mobil */
@media (max-width: 860px) {
  .site-header { min-height: 0; padding: 10px 16px; gap: 12px; }
  .logo { position: static; width: 58px; flex: none; }
  .brand-title { font-size: 26px; }
  .brand-sub { font-size: 12px; letter-spacing: 2px; margin-top: 4px; }
  .site-nav { padding: 8px 12px; min-height: 0; gap: 6px; flex-wrap: nowrap; }
  .site-nav .btn-black { flex: 1 1 auto; padding: 10px 8px; font-size: 12.5px; white-space: nowrap; }
  .tabs { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 10px 12px 0; }
  #tabs { grid-template-columns: 2fr 1fr; gap: 5px 6px; }
  #tabs .tab.main { font-size: 15px; padding: 12px 6px; }
  #tabs .tab.minor { font-size: 11.5px; padding: 9px 2px; }
  .admin-tabs { grid-template-columns: repeat(3, 1fr); }
  .tab { font-size: 13px; padding: 11px 4px; }
  .panel { margin: 10px 12px 0; padding: 18px 14px; }
  .panel h1 { font-size: 26px; }
  .lead { font-size: 15px; }
  .weekbar-mid strong { font-size: 17px; }
  .cal-grid { display: none; }
  .cal-mobile { display: block; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-box { max-width: none; border-radius: 14px 14px 0 0; max-height: 94vh; padding: 22px 16px calc(18px + env(safe-area-inset-bottom)); }
  .modal-box.wide { max-width: none; }
  .req { grid-template-columns: 1fr; }
  .req-actions { flex-direction: row; min-width: 0; }
  .req-actions > * { flex: 1; padding: 13px 6px; }
  .hide-s { display: none; }
}
@media (max-width: 380px) {
  .brand-title { font-size: 22px; }
  .site-nav .btn-black { font-size: 11.5px; padding: 10px 6px; }
}
