/* ---------- Kolory i odstępy (jasny motyw; ciemny niżej) ---------- */
:root {
 --brand: #0b4a8f;
 --brand-2: #1565c0;
 --brand-soft: #e7f0fb;
 --btn-1: #1565c0;
 --btn-2: #0b4a8f;
 --okb-1: #16a374;
 --okb-2: #12805c;
 --dgb-1: #e0483d;
 --dgb-2: #c8372d;
 --ok: #12805c;
 --ok-2: #16a374;
 --ok-soft: #e3f5ee;
 --danger: #c8372d;
 --danger-2: #e0483d;
 --danger-soft: #fdecea;
 --warn: #b25e09;
 --warn-soft: #fff4e0;
 --text: #14202e;
 --muted: #5d6b7a;
 --border: #d8dee6;
 --bg: #f2f5f9;
 --surface: #ffffff;
 --surface-2: #f6f8fb;
 --shadow: 0 1px 2px rgba(16, 32, 56, .06), 0 4px 16px rgba(16, 32, 56, .06);
 --shadow-lg: 0 12px 40px rgba(16, 32, 56, .22);
 --radius: 14px;
 --radius-sm: 10px;
 --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px;
 --ease: cubic-bezier(.2, .8, .2, 1);
 color-scheme: light;
}
@media (prefers-color-scheme: dark) {
 :root {
  --brand: #5aa2ff;
  --brand-2: #79b4ff;
  --brand-soft: #1a2b42;
  --btn-1: #2b7de0;
  --btn-2: #1a5fbf;
  --okb-1: #1f9e70;
  --okb-2: #15805a;
  --dgb-1: #d9463b;
  --dgb-2: #b9342b;
  --ok: #2fbf8a;
  --ok-2: #3fd29c;
  --ok-soft: #12302a;
  --danger: #ef5b50;
  --danger-2: #ff6f64;
  --danger-soft: #3a1c1b;
  --warn: #f0a440;
  --warn-soft: #382a14;
  --text: #e6ecf3;
  --muted: #95a3b3;
  --border: #2c3846;
  --bg: #0f151c;
  --surface: #17202a;
  --surface-2: #1d2733;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
  color-scheme: dark;
 }
}

/* ---------- Podstawa ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
 margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", system-ui, sans-serif;
 font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h2 { font-size: 19px; font-weight: 700; margin: 0 0 var(--s3); letter-spacing: -.01em; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.muted { color: var(--muted); font-size: 14px; }
.warn { color: var(--warn); font-weight: 600; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Nagłówek ---------- */
header {
 position: sticky; top: 0; z-index: 10;
 display: flex; align-items: center; gap: 12px;
 padding: 12px var(--s3); padding-top: calc(12px + env(safe-area-inset-top));
 background: linear-gradient(135deg, #0b4a8f, #1565c0 60%, #1e7ad6);
 color: #fff; box-shadow: 0 2px 12px rgba(11, 74, 143, .25);
}
header .logo { width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
header h1 { font-size: 19px; font-weight: 700; margin: 0; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.hdr-right { margin-left: auto; flex: 0 0 auto; }
header button.link {
 color: #fff; text-decoration: none; font-weight: 600; font-size: 14px;
 padding: 8px 14px; min-height: 0; border-radius: 999px; background: rgba(255, 255, 255, .15);
 transition: background .2s;
}
header button.link:hover { background: rgba(255, 255, 255, .28); }

main { padding: var(--s3); max-width: 1180px; margin: 0 auto; animation: fadeUp .35s var(--ease) both; }
section { margin-bottom: var(--s4); }

/* ---------- Formularze ---------- */
input, select, button { font: inherit; color: inherit; }
input, select {
 padding: 10px 12px; min-height: 44px;
 background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
 transition: border-color .15s, box-shadow .15s;
}
select {
 appearance: none; -webkit-appearance: none; padding-right: 36px;
 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238595a6' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
 background-repeat: no-repeat; background-position: right 12px center;
}
input:hover, select:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--brand); }

/* ---------- Przyciski ---------- */
button {
 cursor: pointer; min-height: 44px; padding: 10px 16px;
 border: 1.5px solid transparent; border-radius: var(--radius-sm);
 background: var(--surface-2); color: var(--text); font-weight: 600;
 transition: transform .12s var(--ease), box-shadow .2s, background .2s, filter .2s, opacity .2s;
 touch-action: manipulation; user-select: none;
}
button:hover:not(:disabled) { filter: brightness(1.06); }
button:active:not(:disabled) { transform: scale(.97); }
button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
button.primary { background: linear-gradient(180deg, var(--btn-1), var(--btn-2)); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 35%, transparent); }
button.ok { background: linear-gradient(180deg, var(--okb-1), var(--okb-2)); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--ok) 35%, transparent); }
button.danger { background: linear-gradient(180deg, var(--dgb-1), var(--dgb-2)); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--danger) 30%, transparent); }
button.secondary { background: var(--surface); border-color: var(--border); }
button.secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); filter: none; }
button:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; filter: grayscale(.4); }
button.big { width: 100%; padding: 16px; font-size: 18px; font-weight: 700; border-radius: var(--radius); }
button.link { background: none; border: none; padding: 0; min-height: 0; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
button.loading { position: relative; color: transparent !important; pointer-events: none; }
button.loading::after {
 content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px;
 border: 3px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}

/* ---------- Plakietki, statusy, komunikaty ---------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; vertical-align: middle; }
.pill.online { background: var(--ok-soft); color: var(--ok); }
.pill.offline { background: var(--danger-soft); color: var(--danger); }
.pill.pending { background: var(--warn-soft); color: var(--warn); animation: breathe 2s ease-in-out infinite; }
.status-working, .status-off { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.status-working { color: var(--ok); }
.status-off { color: var(--muted); font-weight: 500; }
.status-working::before, .status-off::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.status-working::before { background: var(--ok); animation: pulse 2s ease-out infinite; }
.status-off::before { background: var(--border); }
.flash {
 display: flex; gap: 10px; align-items: flex-start; margin: 0 0 var(--s3); padding: 12px 16px;
 background: var(--brand-soft); color: var(--text); border-radius: var(--radius-sm);
 border-left: 4px solid var(--brand); box-shadow: var(--shadow); animation: slideDown .3s var(--ease) both;
}
.flash::before { content: "ℹ"; font-weight: 800; color: var(--brand); }
.flash.error { background: var(--danger-soft); border-color: var(--danger); }
.flash.error::before { content: "!"; color: var(--danger); }

/* ---------- Układ rzędów ---------- */
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.row > * { flex: 0 1 auto; }
.row .row { margin-bottom: 0; }
.row > div { min-width: 0; }
.row select { min-width: 170px; }
.grow { flex: 1 1 200px; }
.grow select, .grow input { width: 100%; }
.search { width: 100%; max-width: 420px; }
input[type=search].search {
 padding-left: 40px;
 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%238595a6' stroke-width='2.2'/%3E%3Cpath d='M20 20l-4-4' stroke='%238595a6' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
 background-repeat: no-repeat; background-position: 13px center;
}
label.radio {
 display: inline-flex; gap: 8px; align-items: center; margin: 0; padding: 8px 14px; min-height: 44px;
 font-weight: 600; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--border);
 cursor: pointer; transition: background .2s, border-color .2s, color .2s;
}
label.radio input { width: 18px; height: 18px; margin: 0; }
label.radio:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

/* ---------- Ekran brygadzisty ---------- */
section.compact {
 margin-bottom: var(--s3); padding: var(--s3); background: var(--surface);
 border-radius: var(--radius); box-shadow: var(--shadow); animation: fadeUp .4s var(--ease) both;
}
section.compact + section.compact { animation-delay: .06s; }
section.compact h2 { margin-bottom: 12px; }
section.compact select, section.compact .search { width: 100%; max-width: none; }
.selbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; padding: 4px; background: var(--surface-2); border-radius: var(--radius-sm); }
.selbar button { min-height: 38px; padding: 6px; font-size: 14px; background: transparent; border: none; box-shadow: none; }
.selbar button:hover { background: var(--surface); }
#searchCount:empty { display: none; }
#searchCount { margin: 8px 0 0; }
ul.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
ul.people li { border-radius: var(--radius-sm); }
ul.people li.muted { padding: var(--s4) var(--s3); text-align: center; background: var(--surface-2); border: 1.5px dashed var(--border); }
ul.people label {
 display: flex; gap: 14px; align-items: center; margin: 0; padding: 12px 14px;
 font-weight: 400; cursor: pointer; border-radius: var(--radius-sm);
 background: var(--surface-2); border: 1.5px solid transparent;
 transition: background .2s, border-color .2s, transform .12s var(--ease);
}
ul.people label:active { transform: scale(.985); }
ul.people li:has(input:checked) label { background: var(--brand-soft); border-color: var(--brand); }
ul.people .name { font-weight: 700; font-size: 16px; }
ul.people input[type=checkbox] {
 appearance: none; -webkit-appearance: none; flex: 0 0 auto; margin: 0;
 width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--border); background: var(--surface);
 display: grid; place-content: center; transition: background .2s, border-color .2s;
}
ul.people input[type=checkbox]::after {
 content: ""; width: 12px; height: 7px; border: 3px solid #fff; border-top: 0; border-right: 0;
 transform: rotate(-45deg) scale(0); margin-top: -3px; transition: transform .2s var(--ease);
}
ul.people input[type=checkbox]:checked { background: var(--brand); border-color: var(--brand); animation: pop .25s var(--ease); }
ul.people input[type=checkbox]:checked::after { transform: rotate(-45deg) scale(1); }
ul.people input[type=checkbox]:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: var(--s3) 0 0; }

/* ---------- Panel administratora ---------- */
nav.tabs {
 display: flex; gap: 4px; margin-bottom: var(--s3); padding: 5px;
 background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
 overflow-x: auto; scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button {
 flex: 0 0 auto; white-space: nowrap; border: none; background: transparent; color: var(--muted);
 border-radius: var(--radius-sm); padding: 10px 16px; min-height: 42px;
}
nav.tabs button:hover { color: var(--brand); background: var(--surface-2); filter: none; }
nav.tabs button[aria-selected=true] { background: linear-gradient(180deg, var(--btn-1), var(--btn-2)); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 35%, transparent); }
section[data-panel] {
 padding: var(--s4); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
 animation: fadeUp .3s var(--ease) both;
}
section[data-panel] h2 + form, section[data-panel] form + h2 { margin-top: 0; }
section[data-panel] form + h2 { padding-top: var(--s3); border-top: 1px solid var(--border); }
.chips { gap: 6px; }
.chips button.link { text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); font-size: 14px; transition: background .2s; }
.chips button.link:hover { background: color-mix(in srgb, var(--brand) 20%, var(--surface)); }

/* ---------- Tabele ---------- */
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
thead th:first-child { border-top-left-radius: var(--radius-sm); }
thead th:last-child { border-top-right-radius: var(--radius-sm); }
tbody tr { transition: background .15s; animation: fadeIn .3s var(--ease) both; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td button { min-height: 36px; padding: 6px 12px; font-size: 14px; margin: 2px 4px 2px 0; }
td select { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.scroll-x { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.grid th, table.grid td { padding: 6px 10px; white-space: nowrap; border-right: 1px solid var(--border); font-variant-numeric: tabular-nums; }
table.grid thead th { text-transform: none; letter-spacing: 0; border-radius: 0; }
table.grid .sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; text-align: left; }
table.grid thead .sticky, table.grid tfoot .sticky { background: var(--surface-2); z-index: 2; }
table.grid .weekend { background: color-mix(in srgb, var(--border) 35%, transparent); }
table.grid .total { font-weight: 700; background: var(--brand-soft); border-left: 2px solid var(--brand); }
table.grid tfoot th { border-top: 2px solid var(--brand); background: var(--surface-2); }
.gps { font-size: 13px; line-height: 1.45; }
.gps > div + div { margin-top: var(--s1); padding-top: var(--s1); border-top: 1px dashed var(--border); }
.gps-label { font-weight: 600; }

/* ---------- Logowanie ---------- */
.login {
 min-height: 100vh; max-width: none; display: grid; place-items: center; padding: var(--s3);
 background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 55%),
  radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--ok) 16%, transparent), transparent 50%), var(--bg);
}
.login-card {
 width: 100%; max-width: 380px; padding: 32px 28px; background: var(--surface);
 border-radius: 22px; box-shadow: var(--shadow-lg); animation: rise .5s var(--ease) both;
}
.login-card:has(.flash.error) { animation: rise .5s var(--ease) both, shake .45s .5s; }
.logo-lg { display: block; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 16px; box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 35%, transparent); animation: pop .6s .15s var(--ease) both; }
.login h1 { text-align: center; font-size: 22px; margin: 0 0 4px; letter-spacing: -.02em; }
.login .subtitle { text-align: center; margin: 0 0 var(--s4); }
.login input { width: 100%; margin-bottom: var(--s3); }
.login button.big { margin-top: var(--s2); }

/* ---------- Okna dialogowe ---------- */
.dlg-backdrop {
 position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--s3);
 background: rgba(8, 16, 28, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
 animation: fadeIn .18s ease both;
}
.dlg {
 width: 100%; max-width: 420px; padding: var(--s4); background: var(--surface);
 border-radius: 18px; box-shadow: var(--shadow-lg); animation: dlgIn .25s var(--ease) both;
}
.dlg h3 { margin: 0 0 8px; font-size: 18px; }
.dlg p { margin: 0 0 var(--s3); color: var(--muted); overflow-wrap: anywhere; }
.dlg-input { width: 100%; margin-bottom: var(--s3); }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; }
.dlg-actions button { min-width: 110px; }
.dlg-backdrop.closing { animation: fadeOut .16s ease both; }
.dlg-backdrop.closing .dlg { animation: dlgOut .16s ease both; }

/* ---------- Animacje ---------- */
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes dlgIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes dlgOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: .55; } }
@keyframes pulse {
 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
 70%, 100% { box-shadow: 0 0 0 7px transparent; }
}
@media (prefers-reduced-motion: reduce) {
 *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Telefon ---------- */
@media (max-width: 700px) {
 header { padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); }
 header h1 { font-size: 17px; }
 header .logo { width: 30px; height: 30px; }
 main { padding: 12px; }
 h2 { font-size: 17px; }
 section { margin-bottom: var(--s3); }
 section[data-panel] { padding: var(--s3); }
 label { margin-bottom: 4px; }
 .row { flex-direction: column; align-items: stretch; }
 .row > * { flex: 0 0 auto; }
 .row > *, .row input, .row select, .row button { width: 100%; }
 .row label.radio { width: auto; }
 .row.chips, #nFilter { flex-direction: row; flex-wrap: wrap; gap: 6px; }
 .row.chips > *, #nFilter > * { width: auto; }
 .search { max-width: none; }
 table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
 table.cards thead { display: none; }
 table.cards tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; padding: 12px 14px; background: var(--surface); box-shadow: var(--shadow); }
 table.cards tbody tr:hover { background: var(--surface); }
 table.cards td { border: none; padding: 4px 0; white-space: normal; text-align: left; }
 table.cards td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
 table.cards td:empty { display: none; }
 table.cards td:first-child { font-size: 17px; font-weight: 700; }
 table.cards td:first-child::before { display: none; }
 table.cards td button { margin: 6px 6px 0 0; }
 .gps { white-space: normal; }
 ul.people label { padding: 12px; gap: 12px; }
 .actions {
  position: sticky; bottom: 0; z-index: 5; gap: 8px; margin: var(--s3) calc(-1 * var(--s3)) calc(-1 * var(--s3));
  padding: 12px var(--s3) calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
 }
 button.big { font-size: 17px; padding: 15px 8px; }
 .login-card { padding: 28px 20px; }
 .dlg-backdrop { place-items: end center; padding: 0; }
 .dlg { max-width: none; border-radius: 20px 20px 0 0; padding-bottom: calc(var(--s4) + env(safe-area-inset-bottom)); animation-name: sheetIn; }
 .dlg-backdrop.closing .dlg { animation-name: sheetOut; }
 .dlg-actions button { flex: 1; }
}
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }

/* ---------- Daty na iPhonie (Safari ignoruje szerokość natywnego pola daty) ---------- */
input[type=date] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; text-align: left; }
input[type=date]::-webkit-date-and-time-value { text-align: left; min-height: 1.45em; }
input[type=date]::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }

/* ---------- Nieobecności w raporcie (U — urlop, Z — zwolnienie) ---------- */
.abs { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 5px; border-radius: 6px; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; vertical-align: middle; }
.abs-U { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent); }
.abs-Z { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 35%, transparent); }
table.grid td.cell-edit { cursor: pointer; transition: background .15s, box-shadow .15s; }
table.grid td.cell-edit:hover, table.grid td.cell-edit:focus-visible { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); outline: none; }
.dlg-choices { display: grid; gap: 8px; margin-bottom: var(--s3); }
.dlg-choices button { width: 100%; justify-content: center; }

/* ---------- Lokalizacje: formularz + mapa ---------- */
.loc-form { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: var(--s3); margin-bottom: var(--s4); }
.loc-fields { display: flex; flex-direction: column; gap: 14px; }
.loc-fields input:not([type=hidden]) { width: 100%; }
.loc-search-box { display: flex; gap: 8px; }
.loc-search-box input { flex: 1 1 auto; min-width: 0; max-width: none; }
.loc-search-box button { flex: 0 0 auto; }
.loc-results {
 list-style: none; margin: 6px 0 0; padding: 4px; max-height: 260px; overflow-y: auto;
 background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
 animation: slideDown .2s var(--ease) both;
}
.loc-results li.muted { padding: 10px 12px; }
.loc-results button {
 display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 0;
 padding: 8px 10px; text-align: left; background: transparent; border: none; border-radius: 8px; font-weight: 400;
}
.loc-results button:hover, .loc-results button:focus-visible { background: var(--brand-soft); filter: none; }
.loc-results strong { font-weight: 700; }
.loc-results span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.loc-pin-info { margin: 0; }
.loc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.loc-map {
 min-height: 380px; border-radius: var(--radius); overflow: hidden; z-index: 0;
 background: var(--surface-2); border: 1.5px solid var(--border);
}
.loc-map .map-off { padding: var(--s4); }
.map-pin-icon { background: none; border: none; }
.map-pin-wrap { width: 28px; height: 28px; }
.map-pin-wrap.new { animation: pinDrop .45s var(--ease) both; }
.map-pin {
 position: relative; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
 background: var(--btn-2); border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
}
.map-pin::after { content: ""; position: absolute; top: 7px; left: 7px; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.map-pin-wrap.new .map-pin { background: var(--dgb-2); }
.map-pin-wrap.existing .map-pin { transform: rotate(-45deg) scale(.8); }
@keyframes pinDrop { 0% { transform: translateY(-28px); opacity: 0; } 60% { transform: translateY(3px); opacity: 1; } 100% { transform: none; } }
.leaflet-container { font: inherit; }
.leaflet-tooltip { font-weight: 600; border-radius: 8px; }
button.secondary.loading::after { border-color: color-mix(in srgb, var(--brand) 25%, transparent); border-top-color: var(--brand); }
@media (prefers-color-scheme: dark) {
 .loc-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9); }
 .leaflet-bar a { background: var(--surface); color: var(--text); border-color: var(--border); }
 .leaflet-control-attribution { background: rgba(23, 32, 42, .8) !important; color: var(--muted); }
}
@media (max-width: 700px) {
 .loc-form { grid-template-columns: 1fr; }
 .loc-map { min-height: 300px; }
}

/* ---------- Pobieranie aplikacji na Androida ---------- */
.app-download { margin: var(--s4) 0 0; animation: fadeUp .35s var(--ease) both; }
section[data-panel] .app-download { margin: 0 0 var(--s4); }
.app-dl {
 display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px;
 background: var(--ok-soft); border: 1.5px solid color-mix(in srgb, var(--ok) 35%, transparent); border-radius: var(--radius-sm);
}
.app-dl-icon { width: 30px; height: 30px; color: #3ddc84; flex: 0 0 auto; }
.app-dl-text { display: flex; flex-direction: column; flex: 1 1 140px; min-width: 0; line-height: 1.3; }
.app-dl-text .muted { font-size: 13px; }
.app-dl-btn {
 display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px;
 border-radius: var(--radius-sm); background: linear-gradient(180deg, var(--okb-1), var(--okb-2)); color: #fff;
 font-weight: 700; text-decoration: none; box-shadow: 0 2px 8px color-mix(in srgb, var(--ok) 30%, transparent);
 transition: transform .12s var(--ease), filter .2s;
}
.app-dl-btn:hover { filter: brightness(1.06); }
.app-dl-btn:active { transform: scale(.97); }
.app-dl .app-dl-copy { min-height: 40px; padding: 8px 14px; }
.app-dl-note { margin: 8px 2px 0; font-size: 12.5px; line-height: 1.45; }
.app-dl-note code { font-size: 12px; overflow-wrap: anywhere; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

/* ---------- Mapa wpisu: budowa (B), wejście (WE), wyjście (WY) ---------- */
.map-btn { display: inline-flex; margin-top: 8px; min-height: 34px; padding: 5px 12px; font-size: 13px; }
.dlg.dlg-map { max-width: 760px; padding: var(--s3); }
.dlg-map-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dlg-map-head h3 { flex: 1 1 auto; margin: 0; }
.dlg-map-head button { min-height: 36px; min-width: 36px; padding: 4px 10px; }
.dlg-map-canvas { height: 460px; min-height: 260px; border-radius: var(--radius-sm); overflow: hidden; border: 1.5px solid var(--border); background: var(--surface-2); }
.map-legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.map-legend li { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.35; }
.map-legend li > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.map-legend a { font-size: 13px; white-space: nowrap; }
.map-tag { flex: 0 0 auto; display: inline-grid; place-items: center; min-width: 32px; height: 24px; padding: 0 6px; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 800; }
.map-tag.site, .map-pin-wrap.tagged.site .map-pin { background: var(--btn-2); }
.map-tag.in, .map-pin-wrap.tagged.in .map-pin { background: var(--okb-2); }
.map-tag.out, .map-pin-wrap.tagged.out .map-pin { background: var(--dgb-2); }
.map-pin-wrap.tagged { width: 34px; height: 34px; animation: pinDrop .45s var(--ease) both; }
.map-pin-wrap.tagged.in { animation-delay: .1s; }
.map-pin-wrap.tagged.out { animation-delay: .2s; }
.map-pin-wrap.tagged .map-pin { width: 34px; height: 34px; }
.map-pin-wrap.tagged .map-pin::after { display: none; }
.map-pin-wrap.tagged .map-pin span { position: absolute; inset: 0; display: grid; place-items: center; transform: rotate(45deg); color: #fff; font-size: 11px; font-weight: 800; }
.leaflet-interactive.acc-in { stroke: var(--okb-2); fill: var(--okb-2); }
.leaflet-interactive.acc-out { stroke: var(--dgb-2); fill: var(--dgb-2); }
.leaflet-interactive.line-in { stroke: var(--okb-2); }
.leaflet-interactive.line-out { stroke: var(--dgb-2); }
.leaflet-tooltip.dist-tip { padding: 1px 7px; font-size: 12px; font-weight: 700; border-radius: 999px; box-shadow: var(--shadow); }
.leaflet-tooltip.dist-tip::before { display: none; }
@media (prefers-color-scheme: dark) { .dlg-map-canvas .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9); } }
@media (max-width: 700px) {
 .dlg.dlg-map { padding: var(--s3); padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom)); }
 .dlg-map-canvas { height: 340px; }
}
