:root {
  --bg: #f4f6fa;
  --fg: #0f172a;
  --card: #ffffff;
  --muted: #64748b;
  --muted-bg: #eef1f6;
  --line: #dde3ec;
  --primary: #1c3f8f;
  --primary-h: #17357a;
  --primary-soft: #e8eef8;
  --ok: #16794a;
  --ok-soft: #e3f5ec;
  --warn: #b5650a;
  --warn-soft: #fdf1dc;
  --bad: #d12f2f;
  --bad-h: #b52626;
  --bad-soft: #fdeaea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --fg: #eef2f8; --card: #121a2c; --muted: #94a3b8; --muted-bg: #1a2338;
    --line: #26314a; --primary: #5b8def; --primary-h: #79a3f3; --primary-soft: #1b2847;
    --ok: #3cc98a; --ok-soft: #12291f; --warn: #f2a93b; --warn-soft: #2b2010;
    --bad: #ef5b5b; --bad-h: #f27a7a; --bad-soft: #2d1416; --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.ic { width: 16px; height: 16px; flex-shrink: 0; }

/* Layout */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 20px; }
.narrow { max-width: 640px; margin: 0 auto; width: 100%; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between.top { align-items: flex-start; flex-wrap: nowrap; }
.row-center { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.center { text-align: center; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 24px; }
.mb { margin: 0 0 12px; }
.minw0 { min-width: 0; }
.measure { max-width: 380px; margin-left: auto; margin-right: auto; }

/* Typo */
.h1 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.h2 { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.h3 { font-size: 15px; font-weight: 700; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; } .xs { font-size: 12px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); }

/* Header */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.brand-link:hover { text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); }
.brand-logo { width: 40px; height: 40px; border-radius: 11px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.brand-logo .ic { width: 20px; height: 20px; }
.brand-name { font-weight: 700; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); }
.who { display: flex; align-items: center; gap: 12px; }
.who form { margin: 0; }
.who-text { display: flex; flex-direction: column; text-align: right; color: var(--fg); font-size: 14px; line-height: 1.25; }
.who-text span { font-size: 12px; color: var(--muted); }
.who-text:hover { text-decoration: none; }
@media (max-width: 520px) { .who-text { display: none; } }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--muted-bg); }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--fg); text-decoration: none; }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.card-pad-sm { padding: 16px; }
.card-pad-x { padding-left: 20px; padding-right: 20px; }
.pt { padding-top: 20px; }
@media (min-width: 640px) { .card-pad { padding: 32px; } }
.card-live { border: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); }
.empty { border: 1px dashed var(--line); border-radius: 12px; padding: 32px; text-align: center; color: var(--muted); font-size: 14px; }

/* Auth pages */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth { width: 100%; max-width: 440px; }
.auth-wide { max-width: 620px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 28px; }
.terms { background: var(--muted-bg); border-radius: 12px; padding: 16px 18px; font-size: 14px; line-height: 1.6; }
.terms p { margin: 0 0 8px; } .terms p:last-child { margin: 8px 0 0; }
.terms ul { margin: 0; padding-left: 20px; }
.check-row { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; font-size: 14px; }
.check-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); flex-shrink: 0; }
.round-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; }
.round-icon .ic { width: 24px; height: 24px; }
.round-icon.warn { background: var(--warn-soft); color: var(--warn); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { font-size: 13px; font-weight: 500; color: var(--muted); padding: 0; }
.filters .field > span { font-size: 12px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--fg); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.sm { min-height: 36px !important; padding: 6px 10px !important; font-size: 14px !important; width: auto !important; }
select.sm { padding-right: 30px !important; }
textarea { resize: vertical; }

.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 520px) { .choices { grid-template-columns: repeat(3, 1fr); } }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.choice span { display: block; text-align: center; padding: 12px 8px; border: 1px solid var(--line); border-radius: 12px; font-weight: 600; font-size: 14px; background: var(--card); transition: .15s; }
.choice:hover span { background: var(--muted-bg); }
.choice input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 600; border-radius: 10px; padding: 10px 16px; min-height: 42px; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-success { background: var(--ok); color: #fff; }
.btn-success:hover { filter: brightness(.93); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { background: var(--muted-bg); }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 16px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.is-disabled { opacity: .5; pointer-events: none; }
.btn-hero {
  margin: 16px auto 0; display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; max-width: 380px; padding: 24px; border: 0; border-radius: 18px; cursor: pointer;
  background: var(--primary); color: #fff; font: inherit; font-size: 21px; font-weight: 800;
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--primary) 60%, transparent); transition: transform .1s, background .15s;
}
.btn-hero .ic { width: 24px; height: 24px; }
.btn-hero:hover { background: var(--primary-h); }
.btn-hero:active { transform: scale(.99); }
.btn-hero[disabled] { opacity: .75; cursor: wait; }
.btn-hero.btn-danger { background: var(--bad); max-width: none; box-shadow: none; font-size: 18px; padding: 20px; }
.btn-hero.btn-danger:hover { background: var(--bad-h); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Live meeting */
.live { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--primary); }
.live.ok { color: var(--ok); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 60%, transparent); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.timer { font-size: 40px; font-weight: 800; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 14px; }
.loc { display: inline-flex; align-items: center; gap: 5px; }
.loc.ok { color: var(--ok); } .loc.warn { color: var(--warn); }
.loc .ic { width: 15px; height: 15px; }

/* History */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list-item { padding: 16px; }
.note { margin: 8px 0 0; font-size: 14px; }

/* Badges */
.badge { display: inline-block; flex-shrink: 0; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-uzavreno { background: var(--ok-soft); color: var(--ok); }
.badge-nabidka { background: var(--primary-soft); color: var(--primary); }
.badge-pokracuje { background: var(--warn-soft); color: var(--warn); }
.badge-odmitnuto { background: var(--bad-soft); color: var(--bad); }
.badge-nedostupny, .badge-muted { background: var(--muted-bg); color: var(--muted); }
.badge-jine { background: var(--muted-bg); color: var(--fg); }

/* Alerts */
.alert { border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-top: 12px; border: 1px solid transparent; }
.main > .alert { margin-top: 0; }
.alert-error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }

/* Filters */
.grid-5 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-5 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-5 { grid-template-columns: repeat(5, 1fr); } }
.filters-foot { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 500; color: var(--fg); }
.chip:hover { background: var(--muted-bg); text-decoration: none; }
.chip.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chip-ghost { border-color: transparent; color: var(--muted); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 1000px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 16px 18px; }
.stat-accent { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.stat-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.stat-value { font-size: 28px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-accent .stat-value { color: var(--primary); }
.stat-value.warn { color: var(--warn); }
.stat-sub { font-size: 12px; color: var(--muted); }
.split { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .split { grid-template-columns: 2fr 3fr; } }
.split > .card:last-child .h3 { padding-top: 20px; }
.bars { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.bar { height: 8px; border-radius: 999px; background: var(--muted-bg); overflow: hidden; margin-top: 4px; }
.bar > div { height: 100%; border-radius: 999px; }
.bar-def { background: var(--primary); } .bar-ok { background: var(--ok); } .bar-bad { background: var(--bad); } .bar-warn { background: var(--warn); }

/* Tables */
.table-wrap { overflow-x: auto; margin-top: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wide { min-width: 880px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--muted-bg); padding: 8px 12px; white-space: nowrap; }
.table td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .r { text-align: right; }
.table tbody tr:hover { background: color-mix(in srgb, var(--muted-bg) 50%, transparent); }
.empty-cell { text-align: center; color: var(--muted); padding: 32px !important; }
.note-cell { max-width: 320px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.link:hover { text-decoration: underline; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 500; }
