/* TaskInn — mobile-first; desktop (≥960px) dla kierowników */
:root {
  --ink: #0e2a38;          /* nocny granat (logo TaskInn) */
  --accent: #f5a524;       /* bursztyn: akcent na ciemnym */
  --accent-d: #c97a00;     /* bursztyn ciemny: akcent na jasnym */
  --ink-2: #1b4258;
  --paper: #f7f3ea;           /* krem */
  --card: #ffffff;
  --line: #e3dccb;
  --text: #0e2a38;
  --muted: #3e505b;
  --focus: #c97a00;
  --urgent: #c2352b;
  --high: #c97a00;
  --normal: #3a6b85;
  --low: #8a8f90;
  --done: #2c7a4b;
  --radius: 10px;
  --nav-h: 64px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 16px/1.5 var(--font); color: var(--text); background: var(--paper);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
}
body.guest { padding-bottom: 0; }
h1, h2 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 600; }
a { color: var(--ink-2); }
.muted { color: var(--muted); }
small { font-size: .82rem; }
.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- górny pasek ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--ink); color: #fff;
}
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #fff; color: var(--ink); }
.brand-mark.big { width: 52px; height: 52px; border-radius: 14px; background: var(--ink); color: #fff; }
.brand-mark.big .ico { width: 28px; height: 28px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.whoami { display: none; font-size: .9rem; }
.whoami small { opacity: .7; margin-left: 4px; }
.langs { display: flex; gap: 2px; background: rgba(255,255,255,.12); border-radius: 8px; padding: 2px; }
.langs a { color: #fff; text-decoration: none; font-size: .78rem; font-weight: 600; padding: 4px 8px; border-radius: 6px; opacity: .75; }
.langs a.on { background: #fff; color: var(--ink); opacity: 1; }
.langs-login { justify-content: center; background: var(--line); margin: 24px auto 0; width: max-content; }
.langs-login a { color: var(--ink); }

/* ---------- nawigacja: dół na telefonie ---------- */
.mainnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--card); border-top: 1px solid var(--line);
}
.mainnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 500; min-width: 0;
}
.mainnav a .ico { width: 22px; height: 22px; }
.mainnav a.on { color: var(--ink); font-weight: 700; }
.mainnav .nav-report { color: var(--ink); }
.mainnav .nav-report .ico {
  width: 46px; height: 46px; padding: 11px; margin-top: -22px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 4px 12px rgba(201,122,0,.35); border: 3px solid var(--card);
}
.mainnav .nav-report span { color: var(--ink); font-weight: 700; }

/* ---------- treść ---------- */
.content { max-width: 1240px; margin: 0 auto; padding: 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.lead { margin: -6px 0 16px; max-width: 70ch; }
.flash { padding: 12px 14px; border-radius: var(--radius); margin: 0 0 14px; font-weight: 500; }
.flash-ok { background: #e3f2e8; color: #1d5a35; }
.flash-err { background: #fbe6e4; color: #8c231b; }

/* ---------- przyciski i formularze ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 600 .95rem var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); }
.btn-done { background: var(--done); border-color: var(--done); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 1.05rem; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 8px 4px; color: var(--muted); font: 500 .9rem var(--font); text-decoration: underline; cursor: pointer; }
.linkbtn.danger { color: var(--urgent); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.form-narrow { max-width: 560px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .92rem; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
label.check input { width: 22px; height: 22px; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--text); font: 400 16px var(--font); /* 16px = brak auto-zoomu na iOS */
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(201,122,0,.25); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: .92rem; margin-bottom: 8px; padding: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 24px; }

/* kafelki wyboru */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; font-weight: 500; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; min-height: 0; }
.chip span { display: block; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.chips-prio .chip-urgent input:checked + span { background: var(--urgent); border-color: var(--urgent); }
.chips-prio .chip-high input:checked + span { background: var(--high); border-color: var(--high); }
.chips-prio .chip-low input:checked + span { background: var(--low); border-color: var(--low); }

/* zdjęcia — najważniejszy element formularza zgłoszenia */
.photo-drop { position: relative; display: block; cursor: pointer; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; height: 100%; }
.photo-drop-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  min-height: 150px; padding: 18px; border: 2px dashed #cfc6b0; border-radius: 14px; background: #f1ece0; color: var(--ink);
}
.photo-drop-inner .ico { width: 40px; height: 40px; }
.photo-drop-inner small { color: var(--muted); font-weight: 400; }
.photo-drop.small .photo-drop-inner { min-height: 84px; flex-direction: row; gap: 10px; }
.photo-drop.small .ico { width: 26px; height: 26px; }
.photo-drop input:focus-visible + .photo-drop-inner { outline: 3px solid var(--focus); outline-offset: 2px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs:empty { display: none; }
.thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- zakładki i filtry ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; }
.tabs a {
  flex: none; padding: 9px 14px; border-radius: 999px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; white-space: nowrap;
}
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #ebe5d6; color: var(--ink); font-size: .75rem; text-align: center; }
.tabs a.on .count { background: rgba(255,255,255,.2); color: #fff; }
.count-warn { background: var(--urgent) !important; color: #fff !important; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.filters input[type=search] { grid-column: 1 / -1; }

/* ---------- lista zgłoszeń ---------- */
.tlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tlist-head { display: none; }
.tcard { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--normal); border-radius: var(--radius); }
.tcard > a {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; padding: 12px 14px;
  grid-template-areas: "id title status" "loc loc when" "who who who";
  color: inherit; text-decoration: none;
}
.prio-edge-urgent { border-left-color: var(--urgent); }
.prio-edge-high { border-left-color: var(--high); }
.prio-edge-low { border-left-color: var(--low); }
.t-id { grid-area: id; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.t-title { grid-area: title; font-weight: 600; min-width: 0; }
.t-cat { display: block; font-weight: 400; color: var(--muted); }
.t-status { grid-area: status; }
.t-loc { grid-area: loc; display: flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink); }
.t-when { grid-area: when; color: var(--muted); font-size: .85rem; text-align: right; }
.t-who { grid-area: who; font-size: .85rem; color: var(--muted); }
.overdue { color: var(--urgent) !important; font-weight: 600; }
.tag-rec, .tag-photo { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: var(--muted); font-size: .8rem; font-weight: 500; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.st-new { background: #fde8d7; color: #8a4a0f; }
.st-assigned { background: #e2ecf5; color: #1f4f78; }
.st-in_progress { background: #e6ece9; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.st-done { background: #e1f1e6; color: #1d5a35; }
.st-cancelled { background: #ece6d6; color: #55605f; }
.st-rec { background: #ece8f5; color: #4a3b78; }
.prio { font-weight: 600; font-size: .8rem; }
.prio-urgent { color: var(--urgent); }
.prio-high { color: var(--high); }
.prio-normal { color: var(--normal); }
.prio-low { color: var(--low); }

.empty { text-align: center; padding: 48px 16px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty p { margin: 0 0 16px; color: var(--muted); }

/* ---------- szczegóły zgłoszenia ---------- */
.backlink { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; text-decoration: none; font-weight: 500; }
.ticket { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--normal); border-radius: var(--radius); padding: 16px; }
.ticket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.ticket-loc { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; }
.ticket-desc { white-space: normal; margin: 14px 0 0; max-width: 70ch; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 14px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 0; }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.resolution { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.resolution p { margin: 6px 0 0; }
.actions { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.panel > summary { list-style: none; }
.panel > summary::-webkit-details-marker { display: none; }
.panel[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.panel > form { background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 14px; }
.inline-form { display: flex; align-items: flex-end; gap: 8px; }
.inline-form label { flex: 1; }
.quiet-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.history { margin-top: 24px; }
.timeline { list-style: none; margin: 10px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 10px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink-2); }
.timeline time { font-size: .8rem; color: var(--muted); }
.timeline p { margin: 2px 0 0; }
.log-note { display: block; margin-top: 4px; padding: 8px 10px; background: var(--paper); border-radius: 8px; }

/* ---------- zadania cykliczne ---------- */
.rlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rcard { display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.rcard.is-off { opacity: .6; }
.r-main { display: flex; flex-direction: column; gap: 2px; }
.r-every { display: inline-flex; align-items: center; gap: 4px; font-size: .88rem; color: #4a3b78; font-weight: 500; }
.r-dates { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .9rem; }
.r-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- raporty ---------- */
.range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 18px; }
.range label { flex: 1 1 140px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; }
.kpi b { font-size: 1.7rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi span { font-weight: 600; font-size: .88rem; margin-top: 4px; }
.kpi small { color: var(--muted); }
.kpi-warn b { color: var(--high); }
.kpi-bad { border-color: #efb8b3; }
.charts { display: grid; gap: 12px; margin-bottom: 18px; }
.chart { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.chart figcaption { font-weight: 600; margin-bottom: 8px; }
.chart-box { position: relative; height: 240px; }
.tables { display: grid; gap: 12px; }
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.table-card h2 { margin-bottom: 8px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.is-off td { color: var(--muted); }

/* ---------- logowanie ---------- */
.login { max-width: 400px; margin: 8vh auto 0; padding: 0 4px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login h1 { font-size: 1.8rem; }

/* ---------- tablet ---------- */
@media (min-width: 640px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .filters input[type=search] { grid-column: auto; }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .rcard { grid-template-columns: 1fr auto; }
  .r-actions { grid-column: 1 / -1; }
}

/* ---------- desktop: panel kierownika ---------- */
@media (min-width: 960px) {
  body { padding-bottom: 0; padding-left: 220px; }
  body.guest { padding-left: 0; }
  .whoami { display: block; }
  .topbar { margin-left: -220px; padding-left: 20px; }
  .mainnav {
    top: 0; bottom: 0; left: 0; right: auto; width: 220px; height: auto; z-index: 25;
    flex-direction: column; justify-content: flex-start; gap: 2px;
    padding: 70px 12px 16px; border-top: 0; border-right: 1px solid var(--line);
  }
  .mainnav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: .95rem; }
  .mainnav a.on { background: #efe9db; }
  .mainnav .nav-report { color: var(--ink); background: var(--accent); margin: 6px 0 10px; }
  .mainnav .nav-report .ico { width: 22px; height: 22px; padding: 0; margin: 0; border: 0; box-shadow: none; background: none; }
  .mainnav .nav-report span { color: var(--ink); }
  .mainnav .nav-out { margin-top: auto; }
  .content { padding: 24px 32px; }
  h1 { font-size: 1.75rem; }

  .tlist { gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .tlist-head, .tcard > a {
    display: grid; grid-template-columns: 64px minmax(0, 2.2fr) minmax(0, 1.1fr) 130px 160px 130px; gap: 12px; align-items: center;
    grid-template-areas: none; padding: 11px 16px;
  }
  .tlist-head { font-size: .78rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--paper); }
  .tcard { border: 0; border-left: 4px solid var(--normal); border-radius: 0; border-bottom: 1px solid var(--line); }
  .tcard:last-child { border-bottom: 0; }
  .tcard > a > * { grid-area: auto; }
  .tcard > a:hover { background: #fbf8f1; }
  .t-when { text-align: left; }
  .t-who { font-size: .92rem; color: var(--text); }
  .prio-edge-urgent { border-left-color: var(--urgent); }
  .prio-edge-high { border-left-color: var(--high); }
  .prio-edge-low { border-left-color: var(--low); }

  .kpis { grid-template-columns: repeat(6, 1fr); }
  .charts { grid-template-columns: 1fr 1fr; }
  .chart-wide { grid-column: 1 / -1; }
  .chart-box { height: 280px; }
  .tables { grid-template-columns: 1.2fr 1fr 0.8fr; align-items: start; }
  .presets { width: auto; margin-right: 12px; }
  .range label { flex: 0 0 170px; }

  .ticket, .actions, .history { max-width: 860px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- powiadomienia ---------- */
.bell { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: #fff; }
.bell .ico { width: 22px; height: 22px; }
.bell.on, .bell:hover { background: rgba(255,255,255,.15); }
.push-banner {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 12px 14px;
  border-radius: var(--radius); background: #fff4e5; color: #7a4608; text-decoration: none; font-weight: 600;
}
.push-banner .ico { width: 22px; height: 22px; }
.push-state { font-weight: 600; margin: 0; }
.push-state.is-on { color: var(--done); }
.push-state.is-bad { color: var(--urgent); font-weight: 500; }
.push-msg:empty { display: none; }
.push-info { margin-top: 20px; }
.push-info ul { padding-left: 20px; margin: 8px 0 12px; }
.push-info li { margin-bottom: 4px; }
.push-info summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
[hidden] { display: none !important; }

/* ---------- menu „Więcej” (telefon) ---------- */
.mainnav .nav-desk { display: none; }
.more-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.more-list a { display: flex; align-items: center; gap: 12px; padding: 16px; color: var(--text); text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); }
.more-list li:last-child a { border-bottom: 0; }
.more-list .ico { width: 22px; height: 22px; color: var(--ink-2); }
.more-list a.is-out, .more-list a.is-out .ico { color: var(--urgent); }

/* ---------- strefy ---------- */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 5px 1px; vertical-align: middle; flex: none; }
.zone-tag { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.zone-tag i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.ticket-zone { margin: 6px 0 0; }
.chip-zone span { display: inline-flex; align-items: center; gap: 6px; }
.chip-zone span i { width: 10px; height: 10px; border-radius: 50%; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; inset: 0; min-height: 0; margin: 0; cursor: pointer; }
.swatch span { display: block; width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--ink); }

/* ---------- wyszukiwarka miejsca ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-weight: 600; font-size: .92rem; }
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  max-height: 300px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(14,42,56,.18);
}
.combo-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 8px; cursor: pointer; }
.combo-list li small { color: var(--muted); }
.combo-list li:hover, .combo-list li.on { background: #efe9db; }
.combo-list .combo-empty { color: var(--muted); cursor: default; }
.combo-msg { margin: 4px 0 0; color: var(--urgent); font-size: .88rem; font-weight: 500; }
.combo-msg:empty { display: none; }
.combo.is-invalid .combo-input { border-color: var(--urgent); }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .9rem; }

/* ---------- mapa hotelu ---------- */
.zone-tabs .dot { margin: 0 2px 1px 0; }
.map-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.map-search { flex: 1; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .82rem; }
.legend .mini { min-width: 0; min-height: 0; width: 16px; height: 16px; padding: 0; display: inline-block; margin-left: 8px; }
.legend .mini:first-child { margin-left: 0; }
.zone-block { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--zone); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.zone-block h2 { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.zone-block h2 .dot { background: var(--zone); margin: 0; }
.zone-add { margin-left: auto; color: var(--muted); display: inline-flex; }
.floor { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.floor-label { font-weight: 600; font-size: .82rem; color: var(--muted); }
.tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.tile {
  min-width: 58px; min-height: 44px; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--ink);
  background: #f3eee2; border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; line-height: 1.2; position: relative;
}
.tile b { font-size: .9rem; font-weight: 600; }
.tile small { font-size: .72rem; color: var(--muted); }
.tile:hover { border-color: var(--ink-2); }
.tile.heat-1 { background: #fdf0e0; border-color: #f2d3ab; }
.tile.heat-2 { background: #fbdcc0; border-color: #eeb680; }
.tile.heat-3 { background: #f6b99a; border-color: #e58f6a; }
.tile.heat-4 { background: #d9604a; border-color: #c2352b; color: #fff; }
.tile.heat-4 small { color: #fff; }
.tile.has-open { box-shadow: inset 0 -4px 0 var(--urgent); }
.tile.is-off { opacity: .45; text-decoration: line-through; }
.tile.pick { cursor: pointer; padding-left: 30px; }
.tile.pick input { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; min-height: 0; margin: 0; }
.tile.pick:has(input:checked) { outline: 3px solid var(--ink); outline-offset: 1px; }
.bulk-bar {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 8px); z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--ink); color: #fff; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.bulk-bar select { width: auto; min-height: 36px; flex: 1 1 160px; }
.bulk-bar .btn:not(.btn-primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.bulk-bar .btn-primary { background: #fff; color: var(--ink); }
.match-row { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.btn-row.center { justify-content: center; }

@media (min-width: 640px) {
  .floor { grid-template-columns: 150px 1fr; align-items: start; }
  .floor-label { padding-top: 12px; }
  .match-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; align-items: end; }
  .filters { grid-template-columns: 2fr repeat(4, 1fr); }
}
@media (min-width: 960px) {
  .mainnav .nav-desk { display: flex; }
  .mainnav .nav-more { display: none; }
  .bulk-bar { bottom: 12px; }
  .tile { min-width: 66px; }
}

/* ---------- konta ---------- */
.center { text-align: center; }
.temp-pass { border: 2px solid var(--done); }
.temp-pass h2 { display: flex; align-items: center; gap: 8px; color: var(--done); }
.mono.big { font-size: 1.35rem; font-weight: 700; letter-spacing: .04em; color: var(--ink); }
.acc-active { background: #e1f1e6; color: #1d5a35; }
.acc-invited { background: #e2ecf5; color: #1f4f78; }
.acc-invite_expired, .acc-temp_password { background: #fff0d6; color: #7a4608; }
.acc-inactive { background: #ece6d6; color: #55605f; }
.error-page { text-align: center; }
.error-code { font: 700 1.6rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; color: var(--urgent); }
.w-active { background: #e1f1e6; color: #1d5a35; }
.s-overdue { background: #fbe6e4; color: #8c231b; }
.badge .ico { width: 1em; height: 1em; }

/* ---------- logi i stan systemu ---------- */
.health { margin-bottom: 18px; }
.health h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.hcheck { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--done); font-size: .88rem; }
.hcheck span { color: var(--muted); overflow-wrap: anywhere; }
.hcheck.h-warn { border-left-color: var(--high); }
.hcheck.h-bad { border-left-color: var(--urgent); background: #fdf3f2; }
.log-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.log-filters input[type=search] { grid-column: 1 / -1; }
.loglist { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.log { border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
.log:last-child { border-bottom: 0; }
.log.lv-warning { border-left-color: var(--high); }
.log.lv-error { border-left-color: var(--urgent); }
.log.lv-critical { border-left-color: var(--urgent); background: #fdf3f2; }
.log summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; cursor: pointer; list-style: none; font-size: .9rem; }
.log summary::-webkit-details-marker { display: none; }
.log-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .82rem; }
.log-ch { font-size: .78rem; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.log-msg { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.log-code { font-weight: 700; color: var(--urgent); background: #fbe6e4; padding: 1px 6px; border-radius: 4px; }
.lvb-info { background: #ece6d6; color: #55605f; }
.lvb-warning { background: #fff0d6; color: #7a4608; }
.lvb-error, .lvb-critical { background: #fbe6e4; color: #8c231b; }
.log-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 0; padding: 0 12px 8px; font-size: .85rem; }
.log-meta dt { color: var(--muted); font-size: .75rem; }
.log-meta dd { margin: 0; overflow-wrap: anywhere; }
.log-ctx { margin: 0 12px 12px; padding: 10px; background: #f7f3ea; border-radius: 8px; font-size: .78rem; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- kopie zapasowe ---------- */
.two-col { display: grid; gap: 14px; margin-bottom: 14px; }
.two-col > .card-form { margin-bottom: 0; }
.cloud-help { background: var(--paper); border-radius: 8px; padding: 10px 12px; font-size: .9rem; }
.cloud-help summary { font-weight: 600; cursor: pointer; }
.cloud-help ol { margin: 8px 0 0; padding-left: 20px; }
.cloud-help li { margin-bottom: 4px; }
.table-card details { margin-top: 12px; }
.table-card summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }

@media (min-width: 960px) {
  .two-col { grid-template-columns: 1fr 1fr; align-items: start; }
  .log-filters { grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; }
  .log-filters input[type=search] { grid-column: auto; }
}

/* ---------- ostrzeżenie o wylogowaniu ---------- */
.idle-bar {
  position: fixed; z-index: 60; left: 12px; right: 12px; top: 12px; margin: 0 auto; max-width: 560px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
  background: var(--ink); color: #fff; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 600;
}
.idle-bar .btn { background: #fff; color: var(--ink); border-color: #fff; flex: none; }

/* ---------- konta: status, usuwanie, Root ---------- */
.btn-danger { background: var(--urgent); border-color: var(--urgent); color: #fff; }
.btn-danger:hover { background: #a62c23; border-color: #a62c23; }
.danger-zone { border-color: #efb8b3; }
.danger-zone h3 { font-size: 1rem; margin: 6px 0 0; }
.erase-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.badge-root { background: var(--ink); color: #fff; }
.acc-erased { background: #ece6d6; color: #55605f; font-style: italic; }

/* ---------- aparat w aplikacji ---------- */
.thumbs .thumb { position: relative; display: inline-block; }
.thumb-x { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--card);
  background: var(--urgent); color: #fff; font: 700 16px/1 var(--font); cursor: pointer; padding: 0; }
.thumbs.is-busy { min-height: 76px; background: repeating-linear-gradient(90deg, #f1ece0 0 20px, #f7f3ea 20px 40px); border-radius: 8px; }
.cam-gallery { align-self: center; margin-top: -8px; }
html.cam-open, html.cam-open body { overflow: hidden; }
.cam { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; display: flex; flex-direction: column; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: camflash .25s ease-out; }
@keyframes camflash { from { opacity: .8; } to { opacity: 0; } }
.cam-top, .cam-bottom { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.cam-top { padding-top: calc(14px + env(safe-area-inset-top, 0px)); background: linear-gradient(rgba(0,0,0,.55), transparent); }
.cam-bottom { margin-top: auto; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.cam-bottom > * { flex: 1; display: flex; justify-content: center; }
.cam-btn { min-width: 48px; height: 48px; border-radius: 24px; border: 0; background: rgba(0,0,0,.45); color: #fff; font: 600 1.05rem var(--font); padding: 0 14px; cursor: pointer; }
.cam-btn.on { background: #ffd54a; color: #000; }
.cam-done { background: #fff; color: var(--ink); }
.cam-count { font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.cam-shutter { flex: none !important; width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,.25); cursor: pointer; }
.cam-shutter:active { background: #fff; }
.cam-shutter:disabled { opacity: .35; }
.cam-strip { position: relative; z-index: 2; display: flex; gap: 6px; padding: 0 16px; overflow-x: auto; margin-top: auto; }
.cam-strip + .cam-bottom { margin-top: 0; }
.cam-strip img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; border: 2px solid #fff; flex: none; }
.cam-msg { position: relative; z-index: 3; margin: auto 20px; padding: 18px; background: var(--card); color: var(--text); border-radius: var(--radius); text-align: center; }
.cam-msg p { margin: 0 0 12px; }

/* ---------- dwa przyciski zdjęć ---------- */
.photo-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.photo-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; padding: 10px 12px;
  border: 2px dashed #cfc6b0; border-radius: 14px; background: #f1ece0; color: var(--ink); font: 600 1rem var(--font); cursor: pointer;
}
.photo-btn .ico { width: 28px; height: 28px; }
.photo-btn-cam { background: var(--ink); color: #fff; border: 2px solid var(--ink); }
.photo-btn:disabled { opacity: .45; }
.photo-actions.small .photo-btn { min-height: 52px; font-size: .92rem; }
.photo-hint { grid-column: 1 / -1; text-align: center; }

/* ---------- matryca uprawnień ---------- */
.perm-table th, .perm-table td { white-space: normal; vertical-align: middle; }
.perm-table thead th { text-align: center; }
.perm-table thead th:first-child { min-width: 220px; }
.perm-name { font-weight: 400; min-width: 220px; }
.perm-name b { display: block; font-weight: 600; color: var(--text); font-size: .92rem; }
.perm-name small { display: block; margin-top: 2px; }
.perm-group th { background: var(--paper); color: var(--ink-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.perm-col { text-align: center; min-width: 120px; }
.perm-col select { min-height: 38px; font-size: .88rem; padding: 6px 8px; }
.perm-col.is-override { background: #fff6e6; }
.perm-col.is-override select { border-color: var(--high); font-weight: 600; }
.perm-locked { background: #f7f3ea; color: var(--muted); }
.perm-yes { color: var(--done); font-weight: 700; font-size: 1.1rem; }
.perm-check { display: inline-flex; position: relative; cursor: pointer; }
.perm-check input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; min-height: 0; cursor: pointer; }
.perm-check span { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--line); background: var(--card); display: grid; place-items: center; }
.perm-check input:checked + span { background: var(--done); border-color: var(--done); }
.perm-check input:checked + span::after { content: "✓"; color: #fff; font-weight: 700; }
.perm-check input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.perm-save { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 8px); padding-top: 12px; }
.perm-summary { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.perm-summary li { display: flex; gap: 8px; align-items: center; }
.perm-summary li span { width: 20px; text-align: center; font-weight: 700; }
.perm-summary li.yes span { color: var(--done); }
.perm-summary li.no { color: var(--muted); }
@media (min-width: 960px) { .perm-save { bottom: 12px; } }

/* ---------- eksport z wyborem statusów, usuwanie anulowanych ---------- */
.export-box { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin: 0 0 18px; padding: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.export-box fieldset { flex: 1 1 320px; }
.export-box .chip span { padding: 8px 12px; font-size: .9rem; }
.chip input[type=checkbox]:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.cancel-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 12px;
  padding: 10px 14px; border-radius: var(--radius); background: #fdf3f2; border: 1px solid #efb8b3; color: #8c231b; font-weight: 500; }

/* ---------- urządzenia i przeglądy ---------- */
:root { --ok: #2c7a4b; --warn: #b8730f; --bad: #c2352b; }
section.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
section.panel h2 { font-size: 1.02rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h2 { margin: 0 !important; }
.asset-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.asset-grid > section.panel { margin: 0; }
.crumbs { margin: 0 0 6px; font-size: .9rem; }
.crumbs a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.h1 { font-size: 1.5rem; margin: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: .94rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.strong, .strong a { font-weight: 700; }
.note { background: var(--paper); border-radius: 8px; padding: 10px 12px; margin: 12px 0 0; font-size: .92rem; }
.hint-box { background: #fff6e5; border-left: 4px solid var(--warn); padding: 10px 12px; border-radius: 6px; margin: 10px 0 0; font-size: .92rem; }
.small-line { font-size: .88rem; margin: -6px 0 12px; }
.code-sample { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: .82rem; white-space: pre-wrap; margin: 0; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mini-list li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mini-list form.inline { display: inline; margin-left: auto; }
.subtabs { display: flex; gap: 16px; margin: -4px 0 14px; border-bottom: 1px solid var(--line); }
.subtabs a { padding: 6px 2px 10px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subtabs a.on { color: var(--ink); border-color: var(--ink); }

/* plakietki: gwarancja, termin przeglądu, rodzaj, wynik */
.wbadge, .pbadge, .kbadge, .rbadge { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.wbadge small, .pbadge small { font-weight: 500; opacity: .85; }
.w-active { background: #e3f3ea; color: var(--ok); }
.w-expiring { background: #fff1d9; color: var(--warn); }
.w-expired { background: #ece6d6; color: var(--muted); }
.w-none { background: transparent; color: var(--muted); padding-left: 0; font-weight: 500; }
.p-ok { background: #e3f3ea; color: var(--ok); }
.p-soon { background: #fff1d9; color: var(--warn); }
.p-overdue { background: #fde5e3; color: var(--bad); }
.p-none { color: var(--muted); }
.k-mandatory { background: #fde5e3; color: var(--bad); }
.k-warranty { background: #e6effa; color: #2a5f9e; }
.k-planned { background: #ece6d6; color: var(--ink-2); }
.k-repair { background: #fff1d9; color: var(--warn); }
.k-other { background: #ece6d6; color: var(--muted); }
.r-ok { background: #e3f3ea; color: var(--ok); }
.r-remarks { background: #fff1d9; color: var(--warn); }
.r-failed { background: #fde5e3; color: var(--bad); }
.chip-r-ok input:checked + span { background: var(--ok); border-color: var(--ok); }
.chip-r-remarks input:checked + span { background: var(--warn); border-color: var(--warn); }
.chip-r-failed input:checked + span { background: var(--bad); border-color: var(--bad); }
.big-status { font-size: 1.1rem; margin: 0 0 6px; }
.big-status .wbadge { font-size: .95rem; padding: 6px 12px; }
section.panel-w.w-active, section.panel-w.w-expiring, section.panel-w.w-expired, section.panel-w.w-none { background: var(--card); color: inherit; }
section.panel-w.w-active { border-left: 5px solid var(--ok); }
section.panel-w.w-expiring { border-left: 5px solid var(--warn); }
.panel-contact a[href^="tel:"] { font-weight: 600; }

/* lista urządzeń */
.alist, .plist, .clist, .dlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alist-head { display: none; }
.acard > a { display: grid; gap: 4px 12px; grid-template-columns: 1fr auto; padding: 12px 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); color: inherit; text-decoration: none; }
.acard > a:hover { border-color: var(--ink-2); }
.a-name { grid-column: 1 / -1; display: flex; flex-direction: column; }
.a-name small { font-size: .84rem; }
.a-loc { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; }
.a-loc .ico { width: 15px; height: 15px; color: var(--muted); }
.a-w { text-align: right; }
.a-s { display: none; }
.pcard, .ccard { display: grid; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.pcard.is-off, .ccard.is-off { opacity: .6; }
.pcard.ps-overdue { border-left: 5px solid var(--bad); }
.pcard.ps-soon { border-left: 5px solid var(--warn); }
.p-main { display: flex; flex-direction: column; gap: 2px; }
.p-main > b { font-size: 1rem; }
.p-main .kbadge { align-self: flex-start; margin-bottom: 2px; }
.p-main a { color: inherit; }
.p-main .ico, .c-contact .ico { width: 15px; height: 15px; vertical-align: -2px; margin-right: 3px; }
.p-due { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.p-act { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-sum { background: var(--paper); border-radius: 8px; padding: 10px 12px; margin: 0; }
.c-name { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.c-contact { display: flex; gap: 10px; flex-wrap: wrap; font-size: .92rem; }
.c-stats { font-size: .84rem; }
.dlist li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dlist li:last-child { border-bottom: 0; }
.dlist a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; overflow-wrap: anywhere; }
.dlist form { margin-left: auto; }
.doc-upload, .scope-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.doc-upload input[type=file] { flex: 1 1 200px; min-width: 0; }
.scope-add select, .scope-add input { flex: 1 1 140px; min-width: 0; }
.asset-strip { border: 1px solid var(--line); border-left: 5px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 14px; }
.asset-strip.w-active { border-left-color: var(--ok); background: var(--card); color: inherit; }
.asset-strip.w-expiring { border-left-color: var(--warn); background: var(--card); color: inherit; }
.asset-strip.w-expired, .asset-strip.w-none { background: var(--card); color: inherit; padding-left: 14px; }
.asset-strip p { margin: 2px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.asset-pick[hidden] { display: none; }
.kpis-4 .kpi { text-decoration: none; color: inherit; }
@media (max-width: 639px) {
  .table-resp thead { display: none; }
  .table-resp tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .table-resp td { border: 0; padding: 0; }
}
@media (min-width: 640px) {
  .asset-grid { grid-template-columns: 1fr 1fr; }
  .asset-grid > section.panel:first-child { grid-column: 1 / -1; }
  .pcard { grid-template-columns: 1fr auto; align-items: center; }
  .p-act { grid-column: 1 / -1; }
  .ccard { grid-template-columns: 1.3fr 1.5fr auto; align-items: center; }
  .kpis.kpis-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 960px) {
  .asset-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .asset-grid > section.panel:first-child { grid-column: auto; }
  .alist { gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .alist-head, .acard > a { display: grid; grid-template-columns: 2.2fr 1.4fr 1.3fr 1.3fr 1.4fr; gap: 12px; align-items: center; padding: 10px 14px; }
  .alist-head { font-size: .78rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--paper); }
  .acard > a { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); }
  .acard:last-child > a { border-bottom: 0; }
  .a-name { grid-column: auto; }
  .a-w { text-align: left; }
  .a-s { display: block; font-size: .88rem; }
  .pcard { grid-template-columns: 1fr 180px auto; }
  .p-act { grid-column: auto; justify-content: flex-end; }
}
section.panel > form { background: none; border: 0; border-radius: 0; padding: 0; }
section.panel > form.doc-upload, section.panel > form.scope-add { padding-top: 12px; border-top: 1px dashed var(--line); }
.doc-upload select { flex: 0 1 220px; }
.pbadge { white-space: normal; }
@media (min-width: 960px) { .pcard { grid-template-columns: 1fr 240px auto; } }
.row2 input[type=date] { min-width: 0; width: 100%; }
/* menu: krótka etykieta w dolnym pasku telefonu, pełna na komputerze */
.mainnav .lbl-long { display: none; }
@media (min-width: 960px) { .mainnav .lbl-long { display: inline; } .mainnav .lbl-short { display: none; } }
.p-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 2px; }
.p-tags .kbadge { margin: 0 !important; }
.perf { display: inline-flex; align-items: center; gap: 4px; font-size: .76rem; font-weight: 600; color: var(--muted); }
.perf .ico { width: 14px; height: 14px; }
.perf-internal { color: var(--ink-2); }

/* ---------- przegląd masowy: lista do odhaczania ---------- */
.runbar { display: flex; height: 8px; border-radius: 999px; background: #e8e2d3; overflow: hidden; width: 100%; }
.runbar i { display: block; height: 100%; }
.rb-done { background: var(--ok); }
.rb-remarks { background: var(--warn); }
.rb-skipped { background: #a39f92; }
.run-strip { display: grid; gap: 6px; padding: 12px 14px; margin: 0 0 14px; border: 1px solid var(--line); border-left: 5px solid var(--ink-2);
  border-radius: var(--radius); background: var(--card); color: inherit; text-decoration: none; }
.run-strip span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.run-mini { display: grid; gap: 4px; margin-top: 6px; color: var(--muted); font-size: .84rem; text-decoration: none; max-width: 360px; }
.run-head { margin-bottom: 12px; }
.run-head h1 { margin: 4px 0; }
.run-head .ico { width: 15px; height: 15px; vertical-align: -2px; }
.run-progress { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; }
.run-pct { font-size: 2rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; min-width: 3.2ch; }
.run-progress-main { flex: 1; display: grid; gap: 6px; min-width: 0; }
.run-progress .runbar { height: 12px; }
.run-legend { font-size: .86rem; color: var(--muted); }
.lg { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.lg-remarks { background: var(--warn); }
.lg-skipped { background: #a39f92; }
.run-search { width: 100%; margin-bottom: 10px; }
.ilist { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.icard { display: grid; grid-template-columns: 1fr; gap: 8px; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; scroll-margin-top: 80px; }
.icard.is-claimed { border-left-color: var(--focus); }
.icard.is-mine { background: #eef6fc; }
.icard.is-done { border-left-color: var(--ok); }
.icard.is-remarks { border-left-color: var(--warn); }
.icard.is-skipped { border-left-color: #a39f92; }
.icard.is-done .i-main b, .icard.is-remarks .i-main b { color: var(--muted); }
.i-main { display: flex; flex-direction: column; min-width: 0; }
.i-main b { font-size: 1.02rem; }
.i-note { font-size: .86rem; background: var(--paper); border-radius: 6px; padding: 4px 8px; margin-top: 4px; }
.i-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.i-act form { margin: 0; }
.i-act .btn { min-height: 40px; }
.i-more { flex-basis: 100%; }
.i-more[open] { background: var(--paper); border-radius: 8px; padding: 8px; }
.i-more > summary { list-style: none; display: inline-flex; }
.i-more > summary::-webkit-details-marker { display: none; }
.i-more form { margin-top: 8px; }
.i-busy .ico { width: 20px; height: 20px; color: var(--focus); }
.linkish { background: none; border-color: transparent; color: var(--muted); }
.run-close { margin-top: 8px; }
.run-tabs { margin-bottom: 10px; }
@media (min-width: 640px) {
  .icard { grid-template-columns: 1fr auto; align-items: center; }
  .i-more { flex-basis: auto; position: relative; }
  .i-more[open] form { position: absolute; right: 0; top: 46px; z-index: 5; width: 320px; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
  .i-more[open] { background: none; padding: 0; }
}

/* wybór pomieszczeń w planie */
.scope-box { margin-top: 10px; padding: 12px; background: var(--paper); border-radius: var(--radius); }
.room-pick-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.room-pick-head input { flex: 1; min-width: 0; }
.room-group { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.room-group > summary { padding: 8px 10px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.room-group > summary .check { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.room-grid { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 10px; }
.room-chip { position: relative; }
.room-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; min-height: 0; }
.room-chip span { display: block; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.room-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.room-chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }

/* części do zamówienia */
.parts-needed { background: #fde5e3; color: var(--bad); }
.parts-ordered { background: #fff1d9; color: var(--warn); }
.parts-arrived { background: #e3f3ea; color: var(--ok); }
.parts-box { border: 1px solid var(--line); border-left: 5px solid var(--warn); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 14px; background: var(--card); color: inherit; }
.parts-box.parts-needed { border-left-color: var(--bad); }
.parts-box.parts-arrived { border-left-color: var(--ok); }
.parts-box p { margin: 2px 0; }
.parts-box .ico { width: 16px; height: 16px; vertical-align: -3px; }
.igroup { list-style: none; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 10px 2px 2px; }
.icard { grid-template-columns: 1fr auto; align-items: center; }
.icard.is-done, .icard.is-remarks, .icard.is-skipped { padding-top: 6px; padding-bottom: 6px; }
.icard .i-act { justify-content: flex-end; }
.icard .i-more { flex-basis: 100%; order: 3; }
@media (max-width: 639px) {
  .icard.is-todo, .icard.is-claimed { grid-template-columns: 1fr; }
  .icard.is-todo .i-act, .icard.is-claimed .i-act { justify-content: flex-start; }
}
.icard .i-more { flex-basis: auto; order: 0; }
.icard .i-more[open] { flex-basis: 100%; }
@media (max-width: 639px) {
  .icard.is-skipped { grid-template-columns: 1fr; }
  .icard.is-skipped .i-act { justify-content: flex-start; }
  .icard.is-busy { grid-template-columns: 1fr auto; }
}
.room-group > summary { justify-content: flex-start; }
.room-group > summary input[type=checkbox] { width: 20px; height: 20px; min-height: 0; flex: none; margin: 0 4px 0 0; padding: 0; }
.room-group > summary b { font-weight: 600; }

/* ---------- majątek ---------- */
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 479px) { .row3 { grid-template-columns: 1fr 1fr; } }
.obadge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #e6effa; color: #2a5f9e; font-size: .76rem; font-weight: 600; }
.sel-bar { position: sticky; top: 8px; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ink); color: #fff;
  border-radius: var(--radius); padding: 8px 12px; margin-bottom: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.sel-bar .btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
.alist-inv .acard { display: flex; align-items: stretch; gap: 0; }
.alist-inv .acard > a { flex: 1; min-width: 0; }
.a-sel { display: flex; align-items: center; padding: 0 4px 0 10px; }
.a-sel input, .alist-head input[type=checkbox] { width: 20px; height: 20px; min-height: 0; margin: 0; }
.a-q, .a-v { font-variant-numeric: tabular-nums; }
.a-q small { color: var(--muted); }
@media (min-width: 960px) {
  .alist-inv .alist-head, .alist-inv .acard > a { grid-template-columns: 2.4fr 1.4fr .8fr 1fr 1.2fr .9fr; }
  .alist-inv .alist-head { grid-template-columns: 34px 2.4fr 1.4fr .8fr 1fr 1.2fr .9fr; }
  .alist-inv .acard { border-bottom: 1px solid var(--line); }
  .alist-inv .acard > a { border-bottom: 0; }
  .alist-inv .acard:last-child { border-bottom: 0; }
  .alist-inv .a-sel { width: 34px; padding: 0 0 0 14px; }
  .alist-inv.no-costs .alist-head, .alist-inv.no-costs .acard > a { grid-template-columns: 2.4fr 1.4fr .8fr 1.2fr .9fr; }
}
.inv-grid { grid-template-columns: 1fr; }
@media (min-width: 640px) { .inv-grid { grid-template-columns: 1fr 220px !important; } .inv-grid > section.panel:first-child { grid-column: auto !important; } }
.inv-main { display: grid; gap: 10px; }
.inv-photo img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 8px; display: block; }
.inv-qty b { font-size: 2rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.inv-qty span { font-weight: 600; }
.inv-qty small { display: block; }
.inv-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.qr-box svg { display: block; width: 140px; height: 140px; }
.qr-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .06em; margin: 0; }
.inv-act { display: grid; gap: 8px; }
@media (min-width: 640px) { .inv-act { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; } }
.moves li { font-size: .9rem; }
.dispose-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dispose-form input { flex: 1 1 240px; min-width: 0; }
.fmt-list { display: grid; gap: 8px; }
@media (min-width: 640px) { .fmt-list { grid-template-columns: 1fr 1fr; } }
.fmt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--card); }
.fmt input { width: 18px; height: 18px; min-height: 0; margin-top: 3px; flex: none; }
.fmt span { display: flex; flex-direction: column; }
.fmt:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(14,42,56,.15); }
.label-preview li { gap: 10px; }
.label-preview svg { flex: none; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.imp-errors { background: #fdeceb; border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.imp-errors summary { cursor: pointer; }
/* spis z natury */
.scan-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.scan-bar input { flex: 1 1 160px; min-width: 0; text-transform: uppercase; }
.scan-bar video { flex-basis: 100%; width: 100%; max-height: 50vh; border-radius: var(--radius); background: #000; object-fit: cover; }
.st-line .i-main { gap: 2px; }
.st-note { margin-top: 6px; font-size: .88rem; padding: 6px 8px; min-height: 34px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper input { width: 84px; text-align: center; font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper .btn { width: 42px; height: 42px; font-size: 1.3rem; padding: 0; }
.st-yn { flex-wrap: nowrap; }
.st-actions { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 8px); display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: 0 -4px 16px rgba(0,0,0,.08); margin-top: 10px; z-index: 5; }
@media (min-width: 960px) { .st-actions { bottom: 12px; } }
.stb { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: #ece6d6; }
.stb-ok { background: #e3f3ea; color: var(--ok); }
.stb-shortage { background: #fde5e3; color: var(--bad); }
.stb-surplus { background: #fff1d9; color: var(--warn); }
.stb-moved, .stb-moved_from { background: #e6effa; color: #2a5f9e; }
.stb-not_counted { color: var(--muted); }
@media (min-width: 960px) {
  .alist-inv.alist-tech .acard > a { grid-template-columns: 2.2fr 1.4fr 1.3fr 1.3fr 1.4fr; }
  .alist-inv.alist-tech .alist-head { grid-template-columns: 34px 2.2fr 1.4fr 1.3fr 1.3fr 1.4fr; }
  .alist-inv.no-costs:not(.alist-tech) .alist-head { grid-template-columns: 34px 2.4fr 1.4fr .8fr 1.2fr .9fr; }
}
.scan-bar input::placeholder { text-transform: none; }
.print-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.print-actions .is-dim { opacity: .45; }
.zebra-status { margin: 0; padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.zebra-status.ok { background: #e3f3ea; color: var(--ok); }
.zebra-status.bad { background: #fde5e3; color: var(--bad); }
.lbl-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: #fff1d9; color: var(--warn); }

/* rozmieszczenie egzemplarzy w pomieszczeniach */
.dist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; padding: 0 10px 10px; }
.dist-cell { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font-size: .85rem; font-variant-numeric: tabular-nums; }
.dist-cell span { font-weight: 600; }
.dist-cell input { width: 100%; min-height: 36px; padding: 4px 6px; text-align: center; }
.dist-cell.on { border-color: var(--ink); background: var(--soft, #f1ece0); }
.dist-sum { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dist-sum.bad { color: var(--bad, #b42318); }
.room-group > summary .linkish { margin-left: auto; }
.room-group > summary .linkish + .linkish { margin-left: 0; }
.dist-items { max-height: 260px; overflow: auto; }
.linkish { background: none; border: 0; color: var(--muted, #666); text-decoration: underline; padding: 2px 4px; min-height: 0; font-weight: 500; }
.plain { list-style: none; padding: 0; margin: 6px 0; } .plain li { padding: 3px 0; border-bottom: 1px solid var(--line); }
.dist .room-pick-head { flex-wrap: wrap; }
.dist .room-pick-head input { flex: 1 1 180px; }
.dist .dist-sum { flex: 1 1 100%; white-space: normal; }
.dist-cell input { box-sizing: border-box; min-width: 0; }
.dist-cell { min-width: 0; }
.room-group > summary .linkish { white-space: nowrap; flex: none; }
.dist .room-group > summary { flex-wrap: nowrap; }
.rg-title { flex: 1 1 auto; min-width: 0; }

/* skaner QR */
.scan-top { color: inherit; }
.scan .scan-title { flex: 1; text-align: center; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-aim { position: absolute; z-index: 1; left: 50%; top: 42%; width: min(62vw, 62vh, 300px); aspect-ratio: 1; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); border-radius: 14px; pointer-events: none; transition: box-shadow .2s; }
.scan-aim i { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; }
.scan-aim i:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.scan-aim i:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.scan-aim i:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.scan-aim i:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.scan.flash-ok .scan-aim i { border-color: #4ade80; } .scan.flash-warn .scan-aim i { border-color: #fbbf24; } .scan.flash-err .scan-aim i { border-color: #f87171; }
.scan-hint { position: absolute; z-index: 2; left: 16px; right: 16px; top: calc(42% + min(31vw, 31vh, 150px) + 14px); margin: 0; text-align: center; font-size: .9rem; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.scan-log { position: relative; z-index: 2; list-style: none; margin: auto 12px 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.scan-log li { background: rgba(255,255,255,.95); color: var(--text); border-radius: 10px; padding: 8px 12px; border-left: 6px solid var(--ok); display: flex; flex-direction: column; }
.scan-log li + li { opacity: .7; }
.scan-log .scan-warn { border-left-color: var(--warn); } .scan-log .scan-err { border-left-color: var(--bad); }
.scan-log small { color: var(--muted, #555); }
.scan-manual { position: relative; z-index: 2; display: flex; gap: 8px; padding: 0 12px; }
.scan-manual input { flex: 1; min-width: 0; background: rgba(255,255,255,.92); border-radius: 24px; text-transform: uppercase; padding: 0 16px; height: 48px; border: 0; font-size: 1rem; }
.scan .cam-bottom { margin-top: 0; padding-top: 10px; }
.scan-count { font-weight: 700; justify-content: flex-start !important; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.scan .cam-msg { position: absolute; left: 0; right: 0; top: 30%; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.fact { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: #eef6f0; color: var(--ok); text-decoration: none; border: 1px solid transparent; }
.fact .ico { width: 15px; height: 15px; }
.fact.f-bad { background: #fde5e3; color: var(--bad); } .fact.f-warn { background: #fdf0d9; color: var(--warn); } .fact.f-muted { background: var(--card); color: var(--muted, #555); border-color: var(--line); font-variant-numeric: tabular-nums; }
.scan-next { margin-bottom: 12px; }
.q-photo { max-width: 100%; max-height: 220px; border-radius: 8px; display: block; margin: 8px 0; object-fit: cover; }
.scan .cam-done { align-items: center; }
.scan-aim { top: 36%; }
.scan-hint { top: calc(36% + min(31vw, 31vh, 150px) + 14px); }
.scan-log:not(:empty) ~ * .scan-hint, .scan.has-log .scan-hint { display: none; }
.scan-log li:nth-child(n+3) { display: none; }
.scan-manual input::placeholder { text-transform: none; }

/* spis z natury: ustawienia, zespół, dokumenty */
.st-info { margin: 8px 0; font-size: .92rem; }
.st-docs { margin: 8px 0 12px; }
.chips-wrap { flex-wrap: wrap; }
.field-label { margin: 8px 0 4px; font-weight: 600; }
.pcard.is-cancelled { opacity: .65; }
.pcard.is-cancelled b { text-decoration: line-through; }
.st-admin { margin-top: 16px; }
.st-admin > summary { cursor: pointer; padding: 4px 0; }
.st-admin > form { margin-top: 14px; }
.danger-zone { border-top: 1px solid #efb8b3; padding-top: 12px; }
.danger-zone h3 { margin: 0; font-size: 1rem; color: var(--bad); }
.badge.st-cancelled { background: #ece6d6; color: #55605f; }
@media (max-width: 640px) {
  .st-info { display: block; }
  .st-info dt { font-size: .8rem; color: var(--muted, #667); margin-top: 6px; }
  .st-info dd { margin: 0; font-weight: 600; }
}

/* zgłoś błąd lub pomysł */
.app-foot { text-align: center; padding: 8px 16px calc(84px + env(safe-area-inset-bottom, 0px)); }
.app-foot .linkbtn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.app-foot .ico { width: 16px; height: 16px; }
@media (min-width: 900px) { .app-foot { padding-bottom: 24px; } }
.fb-dialog { border: 0; border-radius: 14px; padding: 18px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.3); color: var(--text); background: var(--card); }
.fb-dialog::backdrop { background: rgba(10,25,35,.5); }
.fb-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fb-head h2 { margin: 0; font-size: 1.15rem; }
.fb-x { background: none; border: 0; font-size: 1.3rem; cursor: pointer; min-width: 44px; min-height: 44px; color: var(--muted); }
.fb-where { margin: 0; font-size: .9rem; color: var(--muted); }
.fb-where b { color: var(--text); }
.fb-count { display: block; text-align: right; }
.fb-ctx { white-space: pre-wrap; font-size: .75rem; background: #f4efe4; padding: 8px; border-radius: 6px; max-height: 180px; overflow: auto; }
.fb-msg-out { margin: 0; padding: 8px 10px; border-radius: 8px; font-weight: 600; }
.fb-msg-out.is-ok { background: #eef6f0; color: var(--ok); } .fb-msg-out.is-bad { background: #fde5e3; color: var(--bad); }
.fb-list .fb-msg { font-weight: 500; white-space: normal; }
.fb-shot { display: block; max-width: 220px; max-height: 160px; border-radius: 6px; margin: 6px 0; border: 1px solid var(--line); }
.badge.fb-bug { background: #fde5e3; color: var(--bad); } .badge.fb-idea { background: #e6f0fb; color: #1d5a9e; } .badge.fb-question, .badge.fb-other { background: #ece6d6; color: #55605f; }
.pcard.is-done { opacity: .6; }
.company-logo-prev { max-height: 60px; max-width: 200px; display: block; margin-bottom: 6px; }
.company-prev { background: #f4efe4; border-radius: 8px; padding: 10px 12px; font-size: .9rem; }
.row-postal { grid-template-columns: 7.5em 1fr; }
.perm-fs { border: 0; padding: 0; margin: 0; min-width: 0; } .perm-fs:disabled { opacity: .75; }
/* przycisk „Zgłoś błąd lub pomysł” w górnym pasku (zawsze widoczny) */
button.bell { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.brand { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .topbar-right { gap: 6px; } }
@media (max-width: 400px) { .brand-name { display: none; } }

/* okienko nad stroną */
dialog.modal { border: 0; border-radius: 14px; padding: 0 18px 18px; width: min(640px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.3); color: var(--text); background: var(--card); }
dialog.modal::backdrop { background: rgba(10,25,35,.5); }
.modal-head { position: sticky; top: 0; z-index: 1; background: var(--card); display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.modal-head h2 { margin: 0; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
dialog.modal .st-admin, dialog.st-admin { margin-top: 0; }
dialog.modal fieldset { min-width: 0; }
dialog.modal .row2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
dialog.modal input, dialog.modal select, dialog.modal textarea { min-width: 0; max-width: 100%; box-sizing: border-box; }
dialog.modal input[type=date] { width: 100%; }

/* marka, wersja */
.brand-name { display: inline-flex; flex-direction: column; line-height: 1.1; }
.brand-site { font-size: .72rem; font-weight: 500; opacity: .8; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.login-site { margin: 4px 0 0; color: var(--muted); font-weight: 600; }
.app-ver { display: block; margin-top: 6px; font-size: .78rem; color: var(--muted); text-decoration: none; }
.app-ver:hover { text-decoration: underline; }
.ver-badge { font-size: .9rem; vertical-align: middle; background: var(--soft, #efe9db); color: var(--ink); border-radius: 999px; padding: 2px 10px; font-weight: 600; }
.mig-list { list-style: none; padding: 0; margin: 8px 0 14px; display: grid; gap: 4px; }
.mig-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: .9rem; }
.mig-list li > span { width: 1.2em; font-weight: 700; }
.mig-list .is-ok > span { color: var(--ok); } .mig-list .is-bad > span, .mig-list .is-bad code { color: var(--bad); font-weight: 700; } .mig-list .is-unk > span { color: var(--warn); }
.ok-box { background: #eef6f0; color: var(--ok); }
.chlog h3 { margin: 14px 0 4px; font-size: 1rem; }
.chlog ul { margin: 0; padding-left: 1.2em; }
.mig-warn a { color: inherit; font-weight: 700; }
.ver-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom, 0px)); z-index: 90; background: var(--ink); color: #fff; border-radius: 12px;
  padding: 12px 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 8px 30px rgba(0,0,0,.25); width: min(460px, calc(100vw - 24px)); font-size: .92rem; }
.ver-toast a { color: #fff; font-weight: 700; white-space: nowrap; }
.ver-toast button { background: none; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; min-width: 36px; min-height: 36px; }
@media (min-width: 900px) { .ver-toast { bottom: 24px; } }
/* desktop: marka (TaskInn + nazwa obiektu) nad panelem menu, nie pod nim */
@media (min-width: 960px) { .topbar { position: sticky; z-index: 30; } }

/* spisy z natury: spisy z działu zalogowanego kierownika */
.pcard.is-mine { border-left: 5px solid var(--normal); background: #eef5fa; }
.badge-dept { background: var(--normal); color: #fff; }
@media (prefers-color-scheme: dark) { .pcard.is-mine { background: #16293a; } }

/* ===== checkboxy / radio: jedna spójna reguła w całym systemie ===== */
input:where([type=checkbox], [type=radio]) {
  appearance: auto; -webkit-appearance: auto; flex: none; box-sizing: border-box;
  width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0;
  accent-color: var(--ink); cursor: pointer; vertical-align: middle;
}
label.check input { width: 22px; height: 22px; }
label.check { align-items: center; }
/* label jest domyślnie kolumną – w wierszach tabel/list musi być rzędem i wyśrodkowany w pionie */
.a-sel { flex-direction: row; align-items: center; justify-content: center; align-self: stretch; gap: 0; }
.alist-head > span:has(> input[type=checkbox]) { display: flex; align-items: center; }
.alist-head > span:has(> input[type=checkbox]) input { margin: 0; }

/* strefy: zawijanie do kolejnych wierszy (zamiast przewijania poziomego i ucinania) */
.zone-tabs { flex-wrap: wrap; overflow-x: visible; margin: 0 0 14px; padding: 0; gap: 8px; }
.zone-tabs a { white-space: nowrap; }

/* filtry list: podpis nad każdym polem, żeby było jasne, co wybieramy */
.flt { gap: 4px; min-width: 0; }
.flt > span { font-size: .78rem; font-weight: 600; color: var(--muted); padding-left: 2px; }
.filters { align-items: end; }

/* ---------- logowanie: panel marki (login, aktywacja, reset hasła) ---------- */
.gpanel { display: none; }
body.guest:has(.gpanel):has(.login) { display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
body.guest:has(.gpanel):has(.login) .gpanel {
  display: block; position: relative; overflow: hidden; background: #0e2a38; color: #f7f3ea; padding: 20px 24px;
}
.gp-logo { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.gp-logo svg { display: block; }
.gp-deco { display: none; }
.gp-copy { display: none; }
.gp-copy h2 { margin: 0; }
.gp-copy p { display: none; }
body.guest:has(.gpanel):has(.login) .gp-copy { display: block; position: relative; z-index: 1; margin-top: 14px; }
.gp-copy h2 { font-size: 1rem; font-weight: 600; color: #d9d3c4; }
body.guest:has(.gpanel):has(.login) .content { padding: 28px 20px 32px; }
body.guest:has(.gpanel):has(.login) .login { margin: 0 auto; width: 100%; }
.login > h1 { margin: 0 0 10px; letter-spacing: -.02em; }
@media (min-width: 900px) {
  body.guest:has(.gpanel):has(.login) { grid-template-columns: minmax(400px, 5fr) 6fr; grid-template-rows: 1fr; }
  body.guest:has(.gpanel):has(.login) .gpanel {
    display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 52px 56px;
    background: radial-gradient(800px 520px at 100% 108%, rgba(245,165,36,.2), transparent 62%), #0e2a38;
  }
  .gp-copy { display: block; position: relative; z-index: 1; max-width: 420px; }
  .gp-copy h2 { font-size: 2.2rem !important; color: #f7f3ea !important; line-height: 1.18; letter-spacing: -.02em; margin: 0 0 16px; font-weight: 700; color: #f7f3ea; overflow-wrap: anywhere; }
  .gp-copy p { display: block !important; margin: 0; color: #d9d3c4; font-size: 1.05rem; }
  .gp-deco { display: block; position: absolute; right: 48px; top: 150px; width: 300px; height: 300px; pointer-events: none; }
  body.guest:has(.gpanel):has(.login) .content { display: flex; align-items: center; justify-content: center; padding: 48px; max-width: none; margin: 0; }
  body.guest:has(.gpanel):has(.login) .login { max-width: 400px; }
}
