:root {
  --brand: #054B90;
  --brand-dark: #03396d;
  --brand-soft: #e8f0f9;
  --accent: #f5b800;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #6b7686;
  --line: #e2e7ee;
  --ok: #1f8a4c;
  --ok-soft: #e6f5ec;
  --warn: #b26a00;
  --warn-soft: #fff4dc;
  --err: #c0392b;
  --err-soft: #fdecea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}
[hidden] { display: none !important; }
a { color: var(--brand); }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- Horná lišta ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px; height: 60px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--brand); flex-shrink: 0; }
.brand img { height: 26px; }
.brand span { font-weight: 600; font-size: 13px; padding-left: 12px; border-left: 1px solid var(--line); white-space: nowrap; }
#nav { display: flex; gap: 2px; flex: 1; }
#nav a {
  padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap;
}
#nav a:hover { background: var(--bg); color: var(--text); }
#nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; white-space: nowrap; }
.nav-more { position: relative; }
.nav-more summary {
  list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary:hover { background: var(--bg); color: var(--text); }
.nav-more summary.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; z-index: 30; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 24, 40, .15);
  display: flex; flex-direction: column;
}
.user-menu .nav-menu { left: auto; right: 0; min-width: 180px; }
.nav-menu a, .nav-menu button {
  display: block; text-align: left; padding: 9px 12px; border-radius: 6px; text-decoration: none; color: var(--text);
  background: none; border: 0; cursor: pointer; font: inherit; font-weight: 500;
}
.nav-menu a:hover, .nav-menu button:hover { background: var(--bg); }
.nav-menu a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.who .role { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; font-size: 22px; color: var(--brand); cursor: pointer; }

@media (max-width: 960px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .nav-toggle { display: block; }
  #nav, .who { display: none; width: 100%; }
  .topbar.open #nav { display: flex; flex-direction: column; }
  .topbar.open .who { display: flex; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line); }
  .brand span { display: none; }
  /* Na mobile sú vnorené menu rozbalené priamo v zozname */
  .nav-more summary { display: none; }
  .nav-more .nav-menu { position: static; display: flex; box-shadow: none; border: 0; padding: 0; min-width: 0; }
  .user-menu .nav-menu { flex-direction: row; }
}

/* ---------- Obsah ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 60px; }
@media (max-width: 600px) { main { padding: 16px; } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 700; color: var(--brand); margin-top: 4px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Tabuľky ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: #fafbfc; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--brand-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--brand-soft); color: var(--brand); }
.badge.off { background: #eef0f3; color: var(--muted); }

/* ---------- Formuláre ---------- */
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cfd6df; border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { min-height: 70px; resize: vertical; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); font-weight: 500; }
.check input { width: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: #fff; color: var(--brand); border-color: #cfd6df; }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.ghost { background: none; color: var(--muted); padding: 6px 10px; }
.btn.ghost:hover { color: var(--text); background: var(--bg); }
.btn.danger { background: var(--err); }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.alert.err { background: var(--err-soft); color: var(--err); }
.alert.warn { background: var(--warn-soft); color: #7a4a00; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--brand-soft); color: var(--brand-dark); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Prihlásenie ---------- */
.auth-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .logo { display: block; width: 220px; max-width: 80%; margin: 0 auto 6px; }
.auth-card .subtitle { text-align: center; color: var(--muted); margin-bottom: 22px; font-weight: 500; }
.auth-card .btn { width: 100%; justify-content: center; }

/* ---------- Modálne okno ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 620px; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-head .x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }

.dl { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; margin: 0 0 16px; }
.dl dt { color: var(--muted); font-size: 12px; font-weight: 600; padding-top: 1px; }
.dl dd { margin: 0; word-break: break-word; }
@media (max-width: 600px) { .dl { grid-template-columns: 1fr; } .dl dd { margin-bottom: 6px; } }
.section-title { font-size: 13px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 10px; }

.secret { font-family: var(--mono); font-size: 18px; background: var(--brand-soft); color: var(--brand-dark); padding: 12px; border-radius: 8px; text-align: center; letter-spacing: .05em; user-select: all; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: 8px; box-shadow: var(--shadow); font-weight: 500;
}
.toast.err { background: var(--err); }

.status-banner { padding: 14px 16px; border-radius: 8px; font-size: 16px; font-weight: 700; margin-bottom: 16px; text-align: center; }
.status-banner.ok { background: var(--ok-soft); color: var(--ok); }
.status-banner.info { background: var(--brand-soft); color: var(--brand); }
.status-banner.warn { background: var(--warn-soft); color: var(--warn); }
.status-banner.err { background: var(--err-soft); color: var(--err); }
.auth-card .back-link { margin-top: 8px; color: var(--muted); }
.ticket-code { text-align: center; font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--brand); letter-spacing: .06em; margin: -4px 0 16px; }
.ticket-name { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 4px; }

/* ---------- Verejná stránka eventu ---------- */
body.public { background: var(--surface); }
body.public main { max-width: none; padding: 0; }
.pub-top { max-width: 1040px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pub-top img { height: 28px; display: block; }
.hero { background: var(--brand); color: #fff; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: var(--accent); }
.hero::after {
  content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 184, 0, .22), rgba(245, 184, 0, 0) 70%);
}
.hero-inner { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; padding: 64px 20px 70px; }
.hero .eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { font-size: clamp(32px, 6vw, 54px); font-weight: 800; line-height: 1.08; margin: 10px 0 12px; max-width: 760px; }
.hero .tagline { font-size: 18px; opacity: .92; max-width: 640px; margin: 0 0 26px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.fact { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; padding: 10px 14px; }
.fact small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.fact strong { font-weight: 600; font-size: 15px; }
.fact a { color: #fff; }
.btn.cta { background: var(--accent); color: #1c2430; font-size: 16px; padding: 14px 26px; border-radius: 10px; }
.btn.cta:hover { background: #ffc81a; }
.closed-note { display: inline-block; background: rgba(255, 255, 255, .12); padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.pub-section { max-width: 1040px; margin: 0 auto; padding: 44px 20px 0; }
.pub-section h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.pub-section h2::before { content: ''; width: 4px; height: 16px; background: var(--accent); border-radius: 2px; }
.pub-section p { font-size: 16px; line-height: 1.65; max-width: 760px; margin: 0 0 14px; }
.program { list-style: none; padding: 0; margin: 0; max-width: 760px; }
.program li { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.program li .time { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.program li.no-time { grid-template-columns: 1fr; }
@media (max-width: 600px) { .program li { grid-template-columns: 1fr; gap: 2px; } }
.pub-cta { max-width: 1040px; margin: 44px auto 0; padding: 0 20px; }
.pub-cta .box { background: var(--brand-soft); border-radius: 14px; padding: 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pub-cta .box strong { font-size: 18px; color: var(--brand-dark); }
.pub-footer { max-width: 1040px; margin: 50px auto 0; padding: 22px 20px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pub-footer a { color: var(--muted); }

.reg-wrap { max-width: 680px; margin: 0 auto; padding: 10px 20px 60px; }
.reg-wrap h1 { font-size: 26px; margin: 8px 0 4px; }
.reg-wrap .lead { color: var(--muted); margin: 0 0 22px; }
.reg-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
.reg-card input { padding: 11px 12px; font-size: 15px; }
.companion { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 0; margin-bottom: 12px; position: relative; }
.companion .remove { position: absolute; top: 6px; right: 6px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text); font-weight: 400; line-height: 1.5; margin: 6px 0 18px; }
.consent input { width: auto; margin-top: 3px; flex-shrink: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.req { color: var(--err); }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 34px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }

/* ---------- Vstup (skener) ---------- */
.checkin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .checkin-grid { grid-template-columns: 1fr; } }
.counter { font-size: 15px; font-weight: 600; }
.counter strong { font-size: 22px; color: var(--brand); }
.scanner { position: relative; background: #0d1520; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .frame { position: absolute; inset: 18%; border: 3px solid rgba(245, 184, 0, .9); border-radius: 14px; pointer-events: none; }
.scanner .placeholder { color: #c9d3df; text-align: center; padding: 20px; }
.result { border-radius: 12px; padding: 18px; margin-bottom: 14px; border: 2px solid transparent; }
.result.ok { background: var(--ok-soft); border-color: var(--ok); }
.result.warn { background: var(--warn-soft); border-color: var(--warn); }
.result.err { background: var(--err-soft); border-color: var(--err); }
.result .verdict { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.result.ok .verdict { color: var(--ok); }
.result.warn .verdict { color: var(--warn); }
.result.err .verdict { color: var(--err); }
.result .who-name { font-size: 22px; font-weight: 700; }
.party { margin-top: 12px; border-top: 1px solid rgba(0, 0, 0, .08); padding-top: 10px; }
.party-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.guest-list { display: flex; flex-direction: column; }
.guest-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.guest-row:last-child { border-bottom: 0; }
.copy-row { display: flex; gap: 10px; flex-wrap: wrap; }
.copy-row input { flex: 1; min-width: 220px; font-family: var(--mono); }
.settings-form textarea { min-height: 110px; }
.persons-reg { margin-top: 12px; font-size: 15px; }
.stepper-label { margin-top: 14px; font-weight: 600; font-size: 13px; }
.stepper { display: flex; gap: 8px; align-items: stretch; margin-top: 6px; max-width: 260px; }
.stepper .btn { font-size: 24px; width: 56px; justify-content: center; padding: 6px 0; }
.stepper input { text-align: center; font-size: 24px; font-weight: 700; padding: 6px; }
.persons-diff { margin-top: 6px; color: var(--warn); font-weight: 600; }
.ticket-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.ticket-actions .confirm { font-size: 16px; padding: 12px 20px; }
.partners { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.partner { background: #fff; border: 1px solid var(--line); border-radius: 12px; width: 200px; height: 120px; display: flex; align-items: center; justify-content: center; padding: 18px; }
.partner img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
@media (max-width: 600px) { .partner { width: calc(50% - 8px); height: 100px; padding: 14px; } }.partners.other .partner { width: 160px; height: 90px; padding: 14px; }
@media (max-width: 600px) { .partners.other .partner { width: calc(50% - 8px); height: 80px; padding: 12px; } }