/* Rozložení stránek map.php a admin.php nad komponentami z podzemi.css.
   Barvy jen z tokenů v podzemi.css. */

html, body { background: var(--bg-000); }
body { min-height: 100vh; }
.pp { min-height: 100vh; }
.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.pp-btn { text-decoration: none; }
.pp a:focus-visible, .pp button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── map.php ─────────────────────────────────────── */
.map-page { max-width: 1280px; margin: 0 auto; padding: 28px 32px 32px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; }
.map-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.map-top__title { display: grid; gap: 8px; }
.map-top__title h1 { margin: 0; font: 800 52px/.95 var(--font-display); text-transform: uppercase; letter-spacing: .01em; }
.map-top__title .pp-eyebrow { color: var(--brass); }
.back { color: var(--ink-muted); text-decoration: none; font: 600 13px/1 var(--font-sans); display: inline-flex; gap: 6px; align-items: center; margin-bottom: 10px; justify-self: start; border-radius: var(--radius-sm); }
.back:hover { color: var(--ink); }
.map-top__right { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }

.pp-dates { min-width: 0; position: relative; }
a.pp-day { text-decoration: none; }

.map-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.plan-wrap { min-width: 0; position: relative; overflow: hidden; }
.plan-wrap .pp-plan { transform-origin: 0 0; box-sizing: border-box; }
.empty-area { position: absolute; border: 1.5px dashed var(--line); border-radius: var(--radius-lg); display: grid; place-items: center;
  font: 700 11px/14px var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }

.map-panel h2 { margin: 0; font: 700 32px/1 var(--font-display); }
.map-stat { display: flex; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.map-stat b { display: block; font: 700 30px/1 var(--font-display); }
.map-stat b.free { color: var(--free); }
.map-stat span { font: 500 12px/1.4 var(--font-sans); color: var(--ink-muted); }
button.pp-list__row { width: 100%; background: transparent; color: var(--ink); text-align: left; font-family: var(--font-sans); }
.row-title { display: block; font: 700 15px/20px var(--font-sans); }
.row-sub { display: block; font: 500 13px/18px var(--font-sans); color: var(--ink-muted); }
.detail { background: var(--bg-200); border-radius: var(--radius-md); padding: 16px; display: grid; gap: 12px; }
.detail p { margin: 0; font: 400 14px/20px var(--font-sans); color: var(--ink-muted); }
.detail p strong { color: var(--ink); }
.detail .pp-btn { justify-content: center; width: 100%; height: 46px; font-size: 15px; }
.detail .pp-btn[hidden] { display: none; }
.full-note { margin: 0; font: 500 13px/18px var(--font-sans); color: var(--ink-muted); padding: 8px 12px; }

@media (max-width: 960px) {
  .map-main { grid-template-columns: minmax(0, 1fr); }
  .map-top { flex-direction: column; align-items: flex-start; }
  .map-top__right { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .map-page { padding: 20px 16px 24px; gap: 16px; }
  .map-top__title h1 { font-size: 40px; }
  .pp-plan { padding: 0; }
}

/* ── admin.php ───────────────────────────────────── */
.pp-topbar { position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .pp-eyebrow { color: var(--ink-muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-right form { margin: 0; }
.topbar-right .pp-btn { height: 34px; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 32px 32px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.pp-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pp-nav a { white-space: nowrap; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.head h1 { margin: 6px 0 0; font: 800 52px/.95 var(--font-display); text-transform: uppercase; }
.head .pp-btn { height: 44px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--bg-100); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.stat b { font: 700 30px/1 var(--font-display); }
.stat b.brass { color: var(--brass); }
.stat b.warn { color: var(--taken); }
.stat span { font: 500 12px/1.3 var(--font-sans); color: var(--ink-muted); }
.tools { display: flex; gap: 12px; align-items: center; }
.tools .pp-input { flex: 1; min-width: 0; }
.section-label { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.list { display: grid; gap: 14px; }
.list [hidden] { display: none !important; }
.who-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.empty { text-align: center; padding: 40px; color: var(--ink-muted); font: 500 14px/1.4 var(--font-sans); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.alert { padding: 12px 16px; border-radius: var(--radius-md); background: var(--free-bg); color: var(--free); font: 600 14px/1.4 var(--font-sans); border: 1px solid var(--free); }
.pp-res__guests small svg { vertical-align: -1px; }
.pp-res--confirm { grid-template-columns: 64px 1fr auto; }
.pp-res--confirm .pp-res__name { white-space: normal; }
.pp-res--confirm .pp-btn { height: 36px; }
.pp-btn--danger { border-color: var(--taken); color: var(--taken); }
.pp-btn--danger:hover { border-color: var(--taken); background: var(--taken-bg); }
.pp-res form { margin: 0; display: contents; }

/* Modal */
.pp-backdrop { position: fixed; z-index: 50; overflow-y: auto; }
.pp-backdrop[hidden] { display: none; }
.pp-dialog { max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.pp-dialog__body { overflow-y: auto; }
.pp-dialog .x { width: 38px; height: 38px; }
.when { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.when input { color-scheme: dark; height: 36px; font-size: 14px; }
.row3 { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; }
.pp-text[hidden], .pp-hint[hidden] { display: none; }
.pp-dialog__foot .sum strong { color: var(--ink); }
.dlg-err { margin: 0; }

/* Login */
.login-page { display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 360px; background: var(--bg-100); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 32px 28px; display: grid; gap: 16px; }
.login h1 { margin: 0; font: 800 34px/1 var(--font-display); text-transform: uppercase; }
.login .pp-btn { justify-content: center; height: 46px; }

@media (max-width: 760px) {
  .pp-topbar { padding: 0 12px; gap: 6px; }
  .pp-topbar .pp-nav { gap: 0; }
  .pp-topbar .pp-nav a { padding: 8px 8px; font-size: 13px; }
  .topbar-right .pp-btn { padding: 0 8px; }
  .pp-topbar .brand .pp-eyebrow { display: none; }
  .wrap { padding: 20px 16px 40px; }
  .head h1 { font-size: 40px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .tools { flex-direction: column; align-items: stretch; }
  .tools .pp-input { flex: none; }
  .pp-seg { display: flex; }
  .pp-seg button { flex: 1; justify-content: center; padding: 9px 8px; }
  .pp-day-group__head { flex-wrap: wrap; padding: 14px 16px; gap: 10px 12px; }
  .pp-day-group__meta { flex: 1 1 auto; flex-wrap: wrap; }
  .pp-occ { order: 3; }
  .pp-day-group__head .pp-link { order: 4; margin-left: auto; }
  /* Řádek: čas + jméno nahoře, stůl / osoby / akce pod tím */
  .pp-res { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "time who who" "table guests actions"; gap: 10px 12px; padding: 12px 16px; }
  .pp-res__time { grid-area: time; }
  .pp-res__who { grid-area: who; }
  .pp-res__table { grid-area: table; }
  .pp-res__guests { grid-area: guests; }
  .pp-res__actions { grid-area: actions; }
  .pp-res__table .pp-res__room { display: none; }
  .pp-res--confirm { grid-template-columns: 56px 1fr; grid-template-areas: "time who" "actions actions"; }
  .pp-res--confirm .pp-res__name { grid-area: who; }
  .pp-res--confirm .pp-res__actions { grid-area: actions; }
}
@media (max-width: 600px) {
  .pp-backdrop { padding: 0; place-items: end stretch; }
  .pp-dialog { max-width: none; max-height: 100vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .pp-dialog__head, .pp-dialog__body { padding-left: 16px; padding-right: 16px; }
  .pp-dialog__foot { flex-wrap: wrap; padding: 12px 16px; }
  .pp-dialog__foot .sum { flex: 1 0 100%; }
  .pp-dialog__foot .pp-btn { flex: 1; justify-content: center; }
  .when { grid-template-columns: 1fr; }
  .pp-room-row { grid-template-columns: 1fr; gap: 6px; }
  .pp-tpick { width: 66px; }
}

/* Login — Zapamatovat zařízení */
.remember { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font: 600 14px/20px var(--font-sans); color: var(--ink); }
.remember input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brass); flex: none; }
.remember input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.remember small { display: block; font: 500 12px/16px var(--font-sans); color: var(--ink-muted); }

/* Kvíz */
.head__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.head__actions .pp-btn { height: 44px; }
.alert--err { background: var(--taken-bg); color: var(--taken); border-color: var(--taken); }
.quiz-dialog { max-width: 520px; }
.quiz-info { margin: 0; font: 400 15px/22px var(--font-sans); color: var(--ink-muted); }
.quiz-info strong { color: var(--ink); }
.quiz-time { max-width: 160px; color-scheme: dark; }
.quiz-sum { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; font: 500 14px/20px var(--font-sans); color: var(--ink-muted); }
.quiz-sum b { font: 700 20px/1 var(--font-display); color: var(--ink); margin-right: 4px; }
.quiz-sum b.free { color: var(--free); }
.quiz-sum b.warn { color: var(--taken); }
.quiz-conf { display: block; font-size: 12px; line-height: 18px; margin-top: 2px; }
@media (max-width: 760px) {
  .head { flex-wrap: wrap; }
  .head__actions { width: 100%; }
  .head__actions .pp-btn { flex: 1; justify-content: center; }
}

/* Průchod mezi místnostmi: podlaha přes mezeru a stěny */
.passage { position: absolute; background: var(--bg-200); }
.passage--h { border-top: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); }
.passage--v { border-left: 1.5px solid var(--line-strong); border-right: 1.5px solid var(--line-strong); }

/* ── Mobil: admin pohodlně na palec ─────────────────── */
.fab { display: none; }
.logout-ico { display: none; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { min-width: 0; overflow-wrap: anywhere; }
.pp-seg button { min-width: 0; }

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 12px; }
  .stat b { font-size: 26px; }
  .pp-seg { width: 100%; }
  .pp-seg button { flex: 1 1 0; padding: 10px 4px; font-size: 13px; height: 40px; }
  .pp-input, .when input, .quiz-time { font-size: 16px; }   /* iOS nepřibližuje stránku při psaní */
  .pp-input { height: 44px; }
  .pp-icon-btn { width: 44px; height: 44px; }
  .pp-res__actions { gap: 2px; }
  .pp-day-group__head .pp-link { padding: 10px 8px; }
  .wrap { padding-bottom: 96px; }   /* místo pro plovoucí tlačítko */
  .head__actions { display: none; }   /* Přidat rezervaci nahrazuje plovoucí +, kvíz jen na počítači */
  .fab { display: grid; place-items: center; position: fixed; z-index: 40; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
    width: 56px; height: 56px; padding: 0; border-radius: 50%; box-shadow: var(--shadow-panel), 0 0 0 1px var(--brass); }
  /* Dialog: osoby na vlastním řádku, krokovač přes celou šířku */
  .row3 { grid-template-columns: 1fr; gap: 14px; }
  .row3 > .pp-field:last-child { order: -1; justify-items: stretch !important; }
  .row3 .pp-step { width: 100%; height: 50px; }
  .row3 .pp-step button { flex: 1; width: auto; }
  .row3 .pp-step output { flex: 1; }
  .pp-pick { height: 40px; }
}
@media (max-width: 600px) {
  .pp-dialog { max-height: 100dvh; }
  .pp-backdrop { padding-top: 0; }
}
@media (max-width: 480px) {
  .nav-long, .nav-web, .logout-txt { display: none; }
  .logout-ico { display: block; }
  .topbar-right .pp-btn { width: 40px; padding: 0; justify-content: center; }
  .pp-topbar { height: 56px; }
}
@media (max-width: 340px) {
  .wrap { padding-left: 10px; padding-right: 10px; }
  .head h1 { font-size: 34px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .pp-seg button { font-size: 12px; gap: 3px; }
  .pp-day-group__head, .pp-res { padding-left: 10px; padding-right: 10px; }
  .pp-res { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px; }
  .pp-dialog__head, .pp-dialog__body { padding-left: 12px; padding-right: 12px; }
  .pp-tpick { width: 58px; }
}
