:root {
  --bg: #f3f5f7;
  --card: #ffffff;
  --surface: #f1f3f6;
  --ink: #111827;
  --muted: #667085;
  --line: #e6e9ee;
  --accent: #0f766e;
  --accent-hover: #0c5f59;
  --accent-soft: #e2f4f1;
  --accent-ink: #ffffff;
  --danger: #c4320a;
  --danger-soft: #fdece6;
  --ok: #15803d;
  --ok-soft: #e4f6ea;
  --warn: #b25e09;
  --warn-soft: #fdf1dd;
  --sev-low: #15803d;
  --sev-medium: #ca8a04;
  --sev-high: #ea580c;
  --sev-critical: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --glass: rgba(255, 255, 255, .88);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1014; --card: #161a20; --surface: #1f242c; --ink: #eef1f4; --muted: #98a2b3; --line: #272d36;
    --accent: #2dd4bf; --accent-hover: #5eead4; --accent-soft: #123532; --accent-ink: #06201d;
    --danger: #fb8a68; --danger-soft: #3a1c13; --ok: #4ade80; --ok-soft: #12301d; --warn: #fbbf5c; --warn-soft: #36280f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5); --glass: rgba(22, 26, 32, .88);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1014; --card: #161a20; --surface: #1f242c; --ink: #eef1f4; --muted: #98a2b3; --line: #272d36;
  --accent: #2dd4bf; --accent-hover: #5eead4; --accent-soft: #123532; --accent-ink: #06201d;
  --danger: #fb8a68; --danger-soft: #3a1c13; --ok: #4ade80; --ok-soft: #12301d; --warn: #fbbf5c; --warn-soft: #36280f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5); --glass: rgba(22, 26, 32, .88);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 .25rem; letter-spacing: -.022em; font-weight: 700; }
h2 { font-size: 1.05rem; margin: 1.75rem 0 .65rem; letter-spacing: -.01em; font-weight: 650; }
h3 { font-size: .78rem; margin: 1.1rem 0 .4rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
p { margin: .5rem 0; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small, small { font-size: .84rem; }
.danger { color: var(--danger); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.pre { white-space: pre-line; margin: .25rem 0; }
.break { display: block; word-break: break-all; margin-top: .35rem; }
.hp { position: absolute; left: -9999px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--card); padding: 8px; z-index: 3000; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Górny pasek */
.top {
  display: flex; align-items: center; gap: 1.25rem; height: 60px; padding: 0 1.25rem;
  background: var(--glass); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1100;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; letter-spacing: -.015em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(145deg, #14b8a6, #0f766e); color: #fff; flex: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.logo svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.nav { display: flex; gap: .25rem; overflow-x: auto; flex: 1 1 auto; scrollbar-width: none; }
.nav a { color: var(--muted); text-decoration: none; white-space: nowrap; padding: .35rem .7rem; border-radius: 8px; font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current] { color: var(--accent); background: var(--accent-soft); }
.top-right { display: flex; align-items: center; gap: 1rem; margin-left: auto; font-size: .92rem; white-space: nowrap; }
.top-right a:not(.btn), .top-right .link { color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 500; }
.top-right a:not(.btn):hover, .top-right .link:hover { color: var(--ink); }
.count { display: inline-block; min-width: 1.35em; padding: 0 .4em; margin-left: .35em; border-radius: 1em; background: var(--sev-critical); color: #fff; font-size: .72rem; line-height: 1.35rem; text-align: center; font-weight: 700; }
.count[hidden] { display: none; }

/* Układ panelu z bocznym menu */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.25rem; padding: 1.1rem .85rem; background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; }
.sidebar .brand { padding: 0 .45rem; }
.side-nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.side-nav a, .side-user a { display: flex; align-items: center; gap: .65rem; padding: .5rem .65rem; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 500; }
.side-nav a:hover, .side-user a:hover { background: var(--surface); color: var(--ink); }
.side-nav a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-user { display: flex; flex-direction: column; gap: .15rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.side-user .count { margin-left: auto; }
.side-who { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .85rem; padding: .5rem .65rem; font-size: .84rem; }
.side-who strong { flex-basis: 100%; font-weight: 600; }
.side-who form { margin: 0; }
.side-user .side-who a { display: inline; padding: 0; }
.has-demo .sidebar { height: calc(100vh - 32px); }
.has-demo .map-page { height: calc(100vh - 92px); height: calc(100dvh - 92px); }
.side-who .link { color: var(--muted); font-size: .84rem; }
.content { min-width: 0; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 1.75rem 1.5rem 3rem; }
.narrow { max-width: 440px; margin: 2.5rem auto; padding: 1.75rem; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
.narrow > h1 { font-size: 1.4rem; }
.narrow > .muted:last-child { margin-bottom: 0; }
.foot { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; padding: 1.25rem; font-size: .84rem; color: var(--muted); }
.foot a { color: var(--muted); }
.prose { max-width: 720px; padding: 1.75rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head > :only-child { margin-bottom: 0; }
.page-head p { margin: .15rem 0; }
.crumbs { margin: 0 0 .3rem; font-size: .84rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.badges { display: flex; gap: .4rem; flex-wrap: wrap; margin: .35rem 0; }
.toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.25rem; align-items: start; }
.split-even { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.stack-sm { display: flex; flex-direction: column; gap: .35rem; min-width: 150px; }

/* Karty */
.section, .panel, #event-form > section {
  padding: 1.25rem 1.35rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.section { margin-top: 1.25rem; }
.section > h2:first-of-type, .panel h2, #event-form > section > h2 { margin-top: 0; margin-bottom: 0; }
.panel summary { cursor: pointer; font-weight: 600; }
.panel[open] summary { margin-bottom: .85rem; }

/* Formularze */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 550; }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: .58rem .75rem; font: inherit; font-weight: 400; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { color: var(--muted); background: var(--surface); }
input[type="checkbox"], input[type="radio"] { width: 1.05rem; height: 1.05rem; flex: none; margin: .18rem 0 0; accent-color: var(--accent); box-shadow: none; }
.check { flex-direction: row; align-items: flex-start; gap: .55rem; font-weight: 400; }
fieldset.choice { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
fieldset.choice legend { padding: 0; margin-bottom: .35rem; font-size: .88rem; font-weight: 550; }
.row-2, .row-3 { display: grid; gap: .9rem; align-items: start; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }
.end { align-self: end; }
td.end { text-align: right; }
.search-row { display: flex; gap: .5rem; margin-bottom: .85rem; }
.search-row input { flex: 1; }
form.section .search-row, #event-form .search-row { margin-bottom: 0; }
.filters-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .85rem; }
.filters-bar input, .filters-bar select { width: auto; flex: 1 1 150px; min-width: 0; }
.inline { display: inline; }
.inline-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.inline-form select { width: auto; }
.qty { width: 90px; }
.code-input { font-size: 1.4rem; letter-spacing: .24em; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* Przyciski */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem;
  font: inherit; font-weight: 600; font-size: .92rem; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--sev-critical); border-color: var(--sev-critical); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: .32rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.1rem; width: 100%; white-space: normal; font-size: 1rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.top-right .link, .side-who .link { text-decoration: none; }
.link.danger { color: var(--danger); }
.actions { display: inline-flex; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; font-size: .86rem; }

/* Etykiety */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--surface); color: var(--muted); white-space: nowrap; }
.sev-low { color: var(--sev-low); background: var(--ok-soft); }
.sev-medium { color: var(--warn); background: var(--warn-soft); }
.sev-high { color: var(--sev-high); background: var(--warn-soft); }
.sev-critical { background: var(--sev-critical); color: #fff; }
.st-pending { color: var(--warn); background: var(--warn-soft); }
.st-assigned { color: var(--accent); background: var(--accent-soft); }
.st-checked_in { color: var(--ok); background: var(--ok-soft); }
.tag { display: inline-flex; align-items: center; gap: .35rem; padding: .08rem .5rem; margin: 0 .2rem .25rem 0; font-size: .76rem; background: var(--surface); border-radius: 6px; }
.tag-ok { color: var(--ok); background: var(--ok-soft); font-weight: 600; }
.tag-bad { color: var(--danger); text-decoration: line-through; }
.tag-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: .72rem; text-decoration: underline; }

/* Komunikaty */
.flashes { max-width: 1160px; margin: 1rem auto 0; padding: 0 1.5rem; display: flex; flex-direction: column; gap: .4rem; }
.full-map .flashes { position: fixed; top: 72px; z-index: 1200; left: 50%; transform: translateX(-50%); width: min(92%, 560px); margin: 0; padding: 0; }
.install-errors { padding: 0; margin: .75rem 0; }
.flash { padding: .65rem .95rem; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 500; }
.flash-success { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.flash-error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.notice { padding: .8rem 1rem; background: var(--surface); border-radius: var(--radius-sm); margin: .5rem 0; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.critical-banner { padding: .7rem 1.25rem; background: var(--sev-critical); color: #fff; font-weight: 600; }
.critical-banner a { color: #fff; }
.demo-banner { display: flex; align-items: center; justify-content: center; gap: .75rem; flex-wrap: wrap; padding: .4rem 1rem; background: var(--warn-soft); color: var(--warn); font-size: .85rem; font-weight: 600; text-align: center; }
.demo-banner form { margin: 0; }
.demo-banner .link { color: inherit; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.form-msg { margin: 0; font-size: .9rem; min-height: 1.3em; }
.form-msg.error { color: var(--danger); }
.form-msg.ok { color: var(--ok); }

/* Tabele */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section .table-wrap { box-shadow: none; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: .7rem .85rem; background: var(--surface); white-space: nowrap; }
td { padding: .8rem .85rem; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:first-child td { border-top: 0; }
thead + tbody tr:first-child td { border-top: 1px solid var(--line); }
tbody tr:hover td { background: color-mix(in srgb, var(--surface) 45%, transparent); }
td a { font-weight: 550; text-decoration: none; }
td a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.off td { color: var(--muted); }
.people .quals { min-width: 220px; }

/* Zakładki */
.tabs { display: flex; gap: .2rem; padding: .25rem; margin-bottom: 1.1rem; background: var(--surface); border-radius: 12px; overflow-x: auto; scrollbar-width: none; width: fit-content; max-width: 100%; }
.tabs a { padding: .38rem .85rem; color: var(--muted); text-decoration: none; white-space: nowrap; border-radius: 9px; font-weight: 550; font-size: .9rem; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); background: var(--card); box-shadow: var(--shadow); }

/* Liczniki */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .85rem; margin-bottom: 1.25rem; }
.kpi { padding: 1rem 1.15rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi strong { display: block; font-size: 1.85rem; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .82rem; color: var(--muted); }

/* Karty zdarzeń na pulpicie */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .85rem; }
.event-card { display: flex; flex-direction: column; gap: .65rem; padding: 1.1rem 1.2rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.event-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.event-card-head { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.event-card h3 { margin: 0; font-size: 1rem; text-transform: none; letter-spacing: -.01em; color: var(--ink); font-weight: 650; }
.event-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem; margin-top: auto; }
.event-stats div { display: flex; flex-direction: column; }
.event-stats strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.event-stats span { font-size: .72rem; color: var(--muted); }
.event-stats .hot strong { color: var(--sev-high); }
.progress { height: 6px; border-radius: 6px; background: var(--surface); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.progress-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: .3rem; }

/* Etapy udziału */
.stepper { display: flex; list-style: none; padding: 0; margin: 0 0 .25rem; }
.stepper li { flex: 1; position: relative; padding-top: 1.45rem; font-size: .78rem; color: var(--muted); text-align: center; }
.stepper li::before { content: ""; position: absolute; top: .3rem; left: 50%; width: .8rem; height: .8rem; margin-left: -.4rem; border-radius: 50%; background: var(--line); z-index: 1; }
.stepper li::after { content: ""; position: absolute; top: .6rem; left: -50%; width: 100%; height: 2px; background: var(--line); }
.stepper li:first-child::after { display: none; }
.stepper li.done { color: var(--ink); font-weight: 600; }
.stepper li.done::before, .stepper li.done::after { background: var(--accent); }
.stepper li.now::before { box-shadow: 0 0 0 4px var(--accent-soft); }

.bulk { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; padding: .65rem .75rem; margin-bottom: .85rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: .5rem; z-index: 500; }
.bulk select { width: auto; flex: 1 1 200px; min-width: 0; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 0; font-weight: 500; }
.plain { list-style: none; padding: 0; margin: .5rem 0; }
.plain li { padding: .15rem 0; word-break: break-word; }
.steps { padding-left: 1.25rem; color: var(--muted); }
.qr { display: flex; justify-content: center; margin: 1rem 0; }
.qr svg { max-width: 100%; height: auto; border-radius: 12px; }
.secret { display: block; padding: .5rem; background: var(--surface); border-radius: 8px; word-break: break-all; color: var(--ink); }
.codes { list-style: none; padding: 1rem; margin: 1rem 0; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; background: var(--surface); border-radius: var(--radius-sm); }
.qual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .4rem .85rem; }
.qual { display: flex; flex-direction: column; gap: .15rem; }
.valid-until { flex-direction: row; align-items: center; gap: .4rem; margin-left: 1.6rem; font-size: .76rem; font-weight: 400; color: var(--muted); white-space: nowrap; }
.valid-until input { padding: .1rem .3rem; font-size: .76rem; width: auto; }
.feed { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.feed:empty { display: none; }
.feed li { padding: .85rem 1.15rem; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; }
.feed li.unread { background: var(--accent-soft); }
.feed li.unread .feed-title { font-weight: 650; }
.feed li.critical { background: var(--danger-soft); }
.feed li.critical .feed-title, .feed li.critical .feed-title a { color: var(--danger); }

.chat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.chat-log { height: 380px; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .65rem; }
.chat-msg { max-width: 88%; align-self: flex-start; padding: .45rem .75rem; background: var(--surface); border-radius: 12px 12px 12px 3px; }
.chat-msg.staff { background: var(--accent-soft); }
.chat-meta { font-size: .72rem; color: var(--muted); }
.chat-msg.staff .chat-author { color: var(--accent); font-weight: 650; }
.chat-body { white-space: pre-line; word-break: break-word; }
.chat-msg.alert { background: var(--sev-critical); color: #fff; border-radius: 12px; max-width: 100%; align-self: stretch; }
.chat-msg.alert .chat-meta, .chat-msg.alert .chat-author { color: #fff; }
.chat-form { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid var(--line); }

/* Mapy */
.map { height: 360px; border-radius: var(--radius); background: var(--surface); z-index: 0; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.map-sm { height: 250px; box-shadow: none; }
.map-lg { height: 500px; }
.map.drawing { cursor: crosshair; }
.map-page { position: relative; height: calc(100vh - 60px); height: calc(100dvh - 60px); }
.map-main { position: absolute; inset: 0; z-index: 0; background: var(--surface); }
.map-side { position: absolute; z-index: 800; top: 1rem; left: 1rem; bottom: 1rem; width: 380px; display: flex; flex-direction: column; min-height: 0; background: var(--glass); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.map-side-head { padding: 1.15rem 1.15rem .75rem; }
.map-side-head h1 { font-size: 1.25rem; }
.map-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .75rem; }
.map-stats[hidden] { display: none; }
.map-stats div { padding: .45rem .6rem; background: var(--surface); border-radius: var(--radius-sm); }
.map-stats strong { display: block; font-size: 1.15rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.map-stats span { font-size: .7rem; color: var(--muted); }
.filters { display: flex; gap: .5rem; margin-top: .75rem; }
.event-list { flex: 1; overflow-y: auto; padding: 0 .6rem .6rem; display: flex; flex-direction: column; gap: .4rem; }
.event-item { display: block; width: 100%; padding: .75rem .8rem; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.event-item:hover, .event-item.active { border-color: var(--accent); box-shadow: var(--shadow); }
.event-item strong { display: flex; align-items: baseline; gap: .45rem; font-weight: 620; line-height: 1.3; }
.event-item .meta { display: block; font-size: .8rem; color: var(--muted); margin: .15rem 0 .4rem 1rem; }
.event-item .progress { margin-left: 1rem; height: 4px; }
.sev-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; flex: none; }
.side-foot { display: flex; gap: 1rem; flex-wrap: wrap; padding: .6rem 1.15rem; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); }
.side-foot a { color: var(--muted); }
.popup-title { font-weight: 650; display: block; margin-bottom: .15rem; }
.ev-marker { position: relative; display: block; width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.ev-marker.pulse::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: inherit; animation: pulse 1.8s ease-out infinite; z-index: -1; }
@keyframes pulse { from { transform: scale(1); opacity: .6; } to { transform: scale(3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ev-marker.pulse::after { animation: none; } .event-card, .btn { transition: none; } }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; padding: 0; margin: .65rem 0 1rem; list-style: none; }
.legend li { display: flex; align-items: center; gap: .35rem; }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; }
.dot-person { background: #15803d; }
.dot-out { background: #dc2626; }
.dot-pending { background: #ca8a04; }
.dot-sector { background: #0f766e; border-radius: 2px; }
.dot-resource { background: #6d4fc2; border-radius: 2px; }
.dot-request { background: #ea580c; transform: rotate(45deg); border-radius: 1px; }
.leaflet-container { font: inherit; font-size: .88rem; background: var(--surface); }
/* Stonowany podkład, aby na mapie wyróżniały się zdarzenia, a nie kolory terenu */
.leaflet-tile-pane { filter: saturate(.45) contrast(.95) brightness(1.04); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) saturate(.4) brightness(.9) contrast(.9); }
}
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: var(--shadow-lg); }
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow-lg) !important; border-radius: 10px !important; overflow: hidden; }

@media (max-width: 960px) {
  .shell { display: block; }
  .sidebar, .has-demo .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .6rem .85rem; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .side-nav { order: 3; flex: 1 0 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .side-nav a { white-space: nowrap; padding: .35rem .6rem; }
  .side-nav svg.icon { display: none; }
  .side-user { flex-direction: row; align-items: center; margin-left: auto; padding: 0; border: 0; }
  .side-user a { padding: .3rem .4rem; }
  .side-user a span.txt { display: none; }
  .side-who { display: flex; align-items: center; gap: .5rem; padding: 0 0 0 .3rem; }
  .side-who strong { display: none; }
}
@media (max-width: 860px) {
  .split, .split-even { grid-template-columns: minmax(0, 1fr); }
  .map-page, .has-demo .map-page { height: auto; display: flex; flex-direction: column; }
  .map-main { position: relative; height: 56vh; inset: auto; order: -1; flex: none; }
  .map-side { position: static; width: auto; border: 0; border-radius: 0; box-shadow: none; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; overflow: visible; }
  .event-list { overflow: visible; }
  .map-lg { height: 400px; }
}
@media (max-width: 600px) {
  .wrap { padding: 1.1rem 1rem 2.5rem; }
  .flashes { padding: 0 1rem; }
  .narrow { margin: 1rem auto; padding: 1.25rem; }
  .row-2, .row-3 { grid-template-columns: minmax(0, 1fr); }
  .top { height: auto; flex-wrap: wrap; gap: .4rem .75rem; padding: .6rem 1rem; position: static; }
  .nav { order: 3; flex-basis: 100%; }
  .codes { grid-template-columns: 1fr; }
  .bulk { position: static; }
  h1 { font-size: 1.4rem; }
  .event-grid { grid-template-columns: minmax(0, 1fr); }
  .filters-bar input[type="search"] { flex-basis: 100%; }
  /* Lista ochotników jako karty: status widoczny bez przewijania w bok */
  .people thead { display: none; }
  .people, .people tbody, .people tr, .people td { display: block; width: 100%; }
  .people tr { position: relative; padding: .75rem .85rem .75rem 2.6rem; border-top: 1px solid var(--line); }
  .people tbody tr:first-child { border-top: 0; }
  .people td, .people thead + tbody tr:first-child td { padding: .15rem 0; border: 0; }
  .people td:first-child { position: absolute; left: .85rem; top: .75rem; width: auto; }
  .people .quals { min-width: 0; }
}
