/* Field Service Manager · Connect Group
   Kolory, czcionka i kształty jak na nowej stronie cnnt.com.pl (specyfikacja, sekcja „Wygląd”). */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-opsz-normal.084b211fc382.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-opsz-normal.4b73e2ff3024.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root,
:root[data-theme="dark"] {
  --bg: #070b14;
  --surface: #0e1728;
  --surface-2: #13203a;
  --border: #1f2c46;
  --text: #e8edf5;
  --text-2: #a7b3c6;
  --action: #2563eb;
  --action-hover: #1d4fd8;
  --action-text: #ffffff;
  --accent: #5b95ff;
  --accent-2: #8db6ff;
  --warn: #ffb224;
  --success: #3ddc97;
  --danger: #ff6170;
  --hold: #8b9bb8;
  --warn-bg: rgba(255, 178, 36, 0.12);
  --danger-bg: rgba(255, 97, 112, 0.13);
  --success-bg: rgba(61, 220, 151, 0.12);
  --accent-bg: rgba(91, 149, 255, 0.14);
  --hold-bg: rgba(139, 155, 184, 0.14);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f4f6fb;
  --surface-2: #e9eef7;
  --border: #d9e0ec;
  --text: #0b1630;
  --text-2: #4a5872;
  --action: #2563eb;
  --action-hover: #1d4fd8;
  --accent: #1d4fd8;
  --accent-2: #2563eb;
  --warn: #a86400;
  --success: #0f8a5a;
  --danger: #c8283a;
  --hold: #5b6a85;
  --warn-bg: #fff4dc;
  --danger-bg: #ffe8eb;
  --success-bg: #e2f7ee;
  --accent-bg: #e6eeff;
  --hold-bg: #eceff5;
  --shadow: 0 10px 30px rgba(11, 22, 48, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 650; }
h2 { font-size: 18px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 620; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* --- układ ------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--action); color: #fff; font-weight: 750; font-size: 18px;
}
.brand small { display: block; color: var(--text-2); font-weight: 500; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a {
  color: var(--text-2); padding: 8px 12px; border-radius: 999px; font-weight: 550; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--accent-bg); }
.count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 650;
  display: inline-grid; place-items: center; background: var(--surface-2); color: var(--text);
}
.count.hot { background: var(--warn); color: #1a1100; }
.userbox { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; white-space: nowrap; }
.env-banner { background: var(--warn); color: #1a1100; text-align: center; font-size: 13px; font-weight: 600; padding: 4px; }
main { padding: 24px; max-width: 1480px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) {
  .grid-2, .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  main { padding: 16px; }
}

/* --- karty ------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
dl.facts { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 14px; margin: 0; }
dl.facts dt { color: var(--text-2); font-size: 13px; padding-top: 1px; }
dl.facts dd { margin: 0; word-break: break-word; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 24px; font-weight: 650; }

/* --- przyciski --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  background: var(--action); color: var(--action-text); font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--action-hover); color: var(--action-text); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-link { background: none; border: 0; color: var(--accent); padding: 0; min-height: 0; font: inherit; cursor: pointer; }
.btn-link:hover { text-decoration: underline; background: none; color: var(--accent-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
form.inline { display: inline; }

/* --- formularze -------------------------------------------------------- */
label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 4px; font-weight: 550; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit;
}
textarea { min-height: 80px; resize: vertical; }
select[multiple] { min-height: 120px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--action); vertical-align: middle; }
.field { margin-bottom: 14px; }
.field .help { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.field .errors, .errorlist { color: var(--danger); font-size: 13px; margin: 4px 0 0; padding: 0; list-style: none; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.radio-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.radio-list label { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 15px; }
div.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 16px; }
div.check-list label { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 15px; margin: 0; }

.filters { display: grid; grid-template-columns: 2fr repeat(6, minmax(120px, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }
.filters .field { margin: 0; }
@media (max-width: 1200px) { .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .filters { grid-template-columns: 1fr; } }
.status-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.status-tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 550; }
.status-tabs a.active, .status-tabs a:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }

/* --- tabele ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); font-weight: 600; background: var(--surface); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
tr.level-warn td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
tr.level-late td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
tr.level-hold td:first-child { box-shadow: inset 4px 0 0 var(--hold); }
.wait-warn { color: var(--warn); font-weight: 600; }
.wait-late { color: var(--danger); font-weight: 650; }
.wait-hold { color: var(--hold); }
td .title { font-weight: 580; color: var(--text); }
td .sub { font-size: 13px; color: var(--text-2); }
.row-link { color: inherit; }
.row-link:hover { text-decoration: none; }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--text-2); font-size: 14px; }

/* --- etykiety ---------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 620; white-space: nowrap; background: var(--surface-2); color: var(--text-2);
}
.badge-accent { background: var(--accent-bg); color: var(--accent); }
.badge-info { background: var(--accent-bg); color: var(--accent-2); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-hold { background: var(--hold-bg); color: var(--hold); }
.badge-muted { background: var(--surface-2); color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--accent); }
.dot-new { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }

/* --- komunikaty -------------------------------------------------------- */
.flash { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.flash li { padding: 12px 16px; border-radius: 10px; background: var(--accent-bg); color: var(--text); border: 1px solid var(--border); }
.flash li.success { background: var(--success-bg); }
.flash li.error { background: var(--danger-bg); }
.flash li.warning { background: var(--warn-bg); }
.notice { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 12px; font-size: 14px; }
.notice.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.notice.danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.notice.success { background: var(--success-bg); }

/* --- historia i maile ---------------------------------------------------- */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; font-size: 14px; }
.timeline .when { color: var(--text-2); font-size: 12px; padding-top: 2px; }
.timeline .what { white-space: pre-wrap; word-break: break-word; }
.timeline .comment .what { background: var(--surface-2); padding: 8px 12px; border-radius: 10px; }
.mail { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--bg); }
.mail-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-2); margin-bottom: 8px; flex-wrap: wrap; }
.mail-body { max-height: 320px; overflow: auto; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.mail.out { border-left: 4px solid var(--accent); }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attachments a { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* --- okno dialogowe ---------------------------------------------------- */
dialog#modal {
  border: 1px solid var(--border); border-radius: 14px; padding: 0; width: min(640px, 94vw);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
dialog#modal::backdrop { background: rgba(3, 6, 12, 0.6); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 20px; max-height: 75vh; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* --- wybór lokalizacji -------------------------------------------------- */
.loc-picker { position: relative; }
.loc-current { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; }
.loc-results { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); max-height: 260px; overflow: auto; }
.loc-results li button { width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; }
.loc-results li button:hover { background: var(--surface-2); }

/* --- logowanie --------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: min(420px, 100%); padding: 28px; }
.auth .brand { margin-bottom: 22px; }
.qr svg { width: 220px; height: 220px; background: #fff; padding: 10px; border-radius: 10px; }

/* --- widok technika (domyślnie jasny, czytelny w słońcu) ---------------- */
.tech main { max-width: 760px; }
.tech-card { display: block; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.tech-card:hover { text-decoration: none; border-color: var(--accent); color: var(--text); }
.tech-card .row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.tech-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.tech-stats .card { padding: 14px; }
.tech-stats .card + .card { margin-top: 0; }
.stat-late b { color: var(--danger); }
.tech-section { margin: 22px 0 10px; }
.tech-card.level-warn { box-shadow: inset 4px 0 0 var(--warn); }
.tech-card.level-late { box-shadow: inset 4px 0 0 var(--danger); }
.tech-card.level-hold { box-shadow: inset 4px 0 0 var(--hold); }
.tech-card .row + .row { margin-top: 4px; }
.tech-done { padding: 4px 16px; }
.tech-done-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.tech-done-row:last-child { border-bottom: 0; }
.tech-done-row:hover { text-decoration: none; color: var(--accent); }
.tech-done-row .right { text-align: right; white-space: nowrap; }
ul.comments { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
ul.comments li { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
ul.comments li.mine { border: 1px solid var(--border); background: transparent; }
@media (max-width: 700px) { .tech-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.big-actions .btn { width: 100%; }

/* --- drobne elementy kart i formularzy --------------------------------- */
.head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; }
.prose { white-space: normal; word-break: break-word; }
.mail-subject { margin-bottom: 6px; }
.mail-actions { margin-top: 10px; align-items: center; }
.mail-body.tall { max-height: 640px; }
.alert-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.visit { padding: 10px 0; border-bottom: 1px solid var(--border); display: grid; gap: 2px; }
.visit:last-child { border-bottom: 0; }
dl.facts.compact { grid-template-columns: 130px minmax(0, 1fr); font-size: 14px; margin-top: 10px; }
.comment-form { margin-bottom: 16px; display: grid; gap: 8px; }
.upload-form { display: grid; gap: 8px; margin-top: 12px; }
.upload-form input[type=file] { font-size: 13px; color: var(--text-2); }
.card.narrow { max-width: 560px; margin: 0 auto; }
.wide-btn { width: 100%; }
.tab-sep { width: 1px; background: var(--border); margin: 0 4px; }
.table-wrap.flat { border: 0; border-radius: 0; background: transparent; }
.stats-row { margin-top: 16px; }
.stats a.card, a.card.stat { color: var(--text); }
a.card.stat:hover { border-color: var(--accent); text-decoration: none; }
.grid + .card, .notice + .grid { margin-top: 16px; }
.modal-inner .modal-body { max-height: 75vh; }
.loc-empty { padding: 8px 10px; }
.actions.bar { margin-top: 12px; justify-content: flex-end; }
.timeline.compact li { grid-template-columns: 90px minmax(0, 1fr); font-size: 13px; }
.radio-list > div { display: grid; gap: 6px; }
.radio-list label { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 15px; margin: 0; }
details summary { cursor: pointer; }
aside .card:first-child, .grid-2 > div > .card:first-child { margin-top: 0; }
@media (max-width: 700px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  dl.facts { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; }
  .userbox { width: 100%; justify-content: flex-end; }
}
.grid > .card + .card { margin-top: 0; }

/* Podpowiedź technika w oknie przydziału */
.suggestions { margin-bottom: 16px; }
.suggestions table.compact td, .suggestions table.compact th { padding: 6px 8px; }
@media (max-width: 600px) { .suggestions .hide-narrow { display: none; } }

/* Rozliczenia: podlink w menu kierownika */

/* == rozliczenia: technik == */
.settle-card { margin-bottom: 4px; }
.settle-card h2 { margin: 0; }
.settle-total { margin: 6px 0 4px; }
.settle-total b { font-size: 26px; font-weight: 680; letter-spacing: -0.01em; }
dl.settle-lines { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 14px; margin: 10px 0 14px; font-size: 14px; }
dl.settle-lines dt { color: var(--text-2); }
dl.settle-lines dd { margin: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.settle-row-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--text); margin-top: 12px; }
.settle-row-card:hover { text-decoration: none; border-color: var(--accent); color: var(--text); }
.todo-card .btn { margin-top: 10px; }
.todo-card { box-shadow: inset 4px 0 0 var(--warn); }
.tech-done-row .badge { margin-top: 4px; }

/* karta pracy na karcie zlecenia */
.cost-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cost-row:last-of-type { border-bottom: 0; }
.cost-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; white-space: nowrap; }
.cost-more { margin: 10px 0 0; }

/* formularz: km, godziny, koszty dodatkowe; pasek z kwotą przyklejony do dołu ekranu */
.costs-form .card + .card { margin-top: 12px; }
.costs-form .card h2 { margin-bottom: 4px; }
.costs-form .field { margin-bottom: 10px; }
.costs-form input[inputmode] { font-size: 18px; font-variant-numeric: tabular-nums; }
.costs-form input[name=km], .costs-form input[name=hours], .costs-form input[name=helper_hours] { max-width: 180px; min-height: 48px; }
.costs-form .check { min-height: 40px; }
.costs-partner { margin: 8px 0 0; }
/* sposób dojazdu: trzy pigułki, jedno dotknięcie (przy 390 px łamią się najwyżej w dwie linie) */
.travel-role { margin: 4px 0 6px; }
.travel-role-label { font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 550; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { position: relative; display: inline-flex; margin: 0; }
.pill input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pill span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14px; font-weight: 560; white-space: nowrap;
}
.pill input:checked + span { border-color: var(--accent); background: var(--accent-bg); box-shadow: inset 0 0 0 1px var(--accent); }
.pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.costs-helper summary { display: inline-flex; align-items: center; min-height: 40px; color: var(--accent); font-size: 14px; font-weight: 560; list-style: none; }
.costs-helper summary::-webkit-details-marker { display: none; }
.costs-helper[open] summary { display: none; }
.costs-per-diem-other { margin: 4px 0 0; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 12px; }
.chip {
  min-height: 40px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; font-size: 14px; font-weight: 560; cursor: pointer;
}
.chip:hover, .chip:active { border-color: var(--accent); background: var(--accent-bg); }
.extras { display: grid; gap: 8px; margin-bottom: 10px; }
.extra-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 32px; gap: 8px; align-items: start; }
.extra-row input { min-height: 48px; }
.extra-row .errors { margin: 4px 0 0; padding: 0; list-style: none; color: var(--danger); font-size: 13px; }
.extra-remove { min-height: 48px; font-size: 16px; color: var(--text-2); }
.pieces { display: grid; gap: 8px; margin-bottom: 10px; }
.piece-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px 32px; gap: 8px; align-items: start; }
.piece-row select { width: 100%; min-width: 0; min-height: 48px; text-overflow: ellipsis; }
.piece-row input { min-height: 48px; }
.piece-row .errors { margin: 4px 0 0; padding: 0; list-style: none; color: var(--danger); font-size: 13px; }
.piece-prices { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 14px; }
.piece-prices li { display: flex; justify-content: space-between; gap: 12px; }
.piece-prices li span:first-child { word-break: normal; overflow-wrap: break-word; }
.piece-prices li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
dl.facts dd.facts-wide { grid-column: 1 / -1; }
.costs-rates { margin: 4px 0 12px; }
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.costs-bar {
  position: sticky; bottom: 0; z-index: 10; margin: 12px -16px -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
}
.costs-bar .btn { min-width: 120px; }
.costs-sum { display: grid; line-height: 1.25; min-width: 0; }
.costs-sum b { font-size: 22px; font-weight: 680; font-variant-numeric: tabular-nums; }
.costs-sum span:last-child { overflow-wrap: anywhere; }
#costs-month .notice { margin: 6px 0 0; }
#costs-month p { margin: 2px 0 0; }

/* operator: karta pracy w oknie „Wykonane” */
fieldset.work-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px 4px; margin: 0 0 14px; }
fieldset.work-card legend { padding: 0 6px; font-weight: 620; }
fieldset.work-card > p { margin: 0 0 10px; }
.work-card-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 120px; gap: 0 12px; align-items: end; }
.work-card-name { padding-bottom: 24px; font-weight: 560; }
@media (max-width: 560px) { .work-card-row { grid-template-columns: 1fr 1fr; } .work-card-name { grid-column: 1 / -1; padding-bottom: 4px; } }

/* zestawienie miesiąca (ekran i druk) */
.statement-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.statement-head h2 { margin: 2px 0; }
.statement-status { text-align: right; }
.statement-draft { padding: 6px 10px; border: 1px dashed var(--warn); color: var(--warn); border-radius: 8px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.statement-rates { margin: 0 0 10px; }
table.statement-table { font-size: 14px; margin-bottom: 12px; }
table.statement-table th { position: static; background: transparent; }
table.statement-table tbody tr:hover { background: transparent; }
table.statement-table td, table.statement-table th { padding: 8px; }
table.statement-table th:first-child, table.statement-table td:first-child { padding-left: 0; }
table.statement-table th:last-child, table.statement-table td:last-child { padding-right: 0; }
.statement-sum { border-top: 1px solid var(--border); padding-top: 10px; }
.statement-sum .statement-total { font-weight: 680; font-size: 16px; color: var(--text); }
@media (max-width: 600px) {
  table.statement-table thead { display: none; }
  table.statement-table, table.statement-table tbody, table.statement-table tr { display: block; }
  table.statement-table tr { display: grid; grid-template-columns: auto repeat(3, auto) 1fr; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  table.statement-table td { display: block; border: 0; padding: 0; text-align: left; }
  table.statement-table td.statement-what { grid-column: 2 / -1; grid-row: 1; }
  table.statement-table td:first-child { grid-row: 1; font-weight: 600; }
  table.statement-table td[data-label="km"] .statement-km::after { content: " km"; }  /* przy liczbie, nie pod rolą */
  table.statement-table td[data-label="km"] .statement-role { white-space: normal; }
  table.statement-table td[data-label="h"]::after { content: " h"; }
  table.statement-table td[data-label="Kwota"] { grid-column: -2 / -1; text-align: right; }
  table.statement-table td[data-label="Dodatkowe"]::before { content: "inne "; color: var(--text-2); }
  table.statement-table td[data-label="Montaż"] { display: none; }  /* kwoty montażu są przy pozycjach */
  table.statement-table td:empty { display: none; }
  table.statement-adj tr { grid-template-columns: auto 1fr auto; }
  table.statement-adj td.statement-what { grid-column: 2; }
}
.print-actions { margin-bottom: 16px; }
@media print {
  .topbar, .env-banner, .flash, .no-print, .costs-bar { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .tech main, main { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; background: #fff; }
  .badge { border: 1px solid #999; background: #fff; color: #000; }
  .muted, .small.muted { color: #444; }
  table.statement-table thead { display: table-header-group; }
  table.statement-table { display: table; width: 100%; }
  table.statement-table tbody { display: table-row-group; }
  table.statement-table tr { display: table-row; }
  table.statement-table td, table.statement-table td:empty { display: table-cell; border: 0; padding: 4px 6px; }
  table.statement-table tr { border-bottom: 1px solid #ccc; }
  table.statement-table td::before, table.statement-table td::after { content: none !important; }
  a { color: #000; }
}

/* == rozliczenia: kierownik == */
.stl-month-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stl-month-nav h1 { margin: 0; }
.stl-month-nav .btn-sm { min-width: 40px; padding: 0 10px; }
.stl-disabled { opacity: .35; pointer-events: none; }
.stl-table th, .stl-table td { padding: 9px 10px; }
.stl-table th { white-space: nowrap; }
.stl-table th.th-wrap { white-space: normal; }  /* długi nagłówek nad wąską kolumną: w dwóch liniach, gdy brakuje miejsca */
.stl-table td { font-size: 14px; }
.stl-table tfoot td { border-top: 2px solid var(--border); border-bottom: 0; background: var(--surface-2); font-size: 14px; }
.stl-table td .btn-sm + .btn-sm { margin-left: 4px; }
.stl-entries th, .stl-entries td { padding-left: 8px; padding-right: 8px; }  /* do 13 kolumn (pomocnik, dieta): przycisk „Popraw” mieści się przy 1440 px */
.stl-neg { color: var(--danger); }
.stl-foot-note { margin-top: 10px; }
.stl-flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.stl-flags li { display: flex; gap: 8px; align-items: baseline; }
.stl-flags .badge { flex: none; }
.stl-flag-list { margin: 6px 0 4px; padding-left: 18px; }
.stl-plain { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.stl-sum dd b { font-size: 18px; }
.stl-rate + .stl-rate { padding-top: 10px; border-top: 1px solid var(--border); }
.stl-links { margin-top: 12px; }
.stl-extra { font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.stl-extra span:first-child { color: var(--text-2); }
.stl-pieces { min-width: 220px; }
.stl-notes { max-width: 260px; font-size: 13px; }
.stl-notes .badge { margin: 2px 0; white-space: normal; text-align: left; }
.stl-history .what .sub { display: block; font-size: 12px; color: var(--text-2); }
.stl-inactive td { opacity: .7; }
/* okno: zatwierdzenie, korekta, poprawka */
.stl-approve-total { display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--accent-bg); margin-bottom: 12px; }
.stl-approve-total b { font-size: 26px; font-weight: 650; }
.stl-lead { margin: 0 0 12px; font-size: 14px; }
.stl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.stl-chip { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.stl-chip:hover { border-color: var(--accent); }
.stl-extras { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 8px; margin: 0 0 14px; }
.stl-extras legend { font-size: 13px; color: var(--text-2); font-weight: 550; padding: 0 4px; }
.stl-extra-rows { display: grid; gap: 6px; margin-bottom: 6px; }
.stl-extra-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 6px; }
.stl-extra-row .errors { grid-column: 1 / -1; color: var(--danger); }
.stl-piece-rows { display: grid; gap: 6px; margin-bottom: 6px; }
.stl-piece-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px; gap: 6px; }
.stl-piece-row select { min-width: 0; width: 100%; }
.stl-piece-row .errors { grid-column: 1 / -1; color: var(--danger); }
.stl-piece-prices summary { cursor: pointer; color: var(--text-2); }
.stl-piece-prices .piece-prices { font-size: 13px; }
.stl-modal .modal-foot .btn[disabled] { opacity: .5; cursor: not-allowed; }
/* zestawienie do druku */
.stl-print { background: #fff; color: #0b1630; padding: 24px; }
.stl-print-bar { display: flex; gap: 8px; justify-content: space-between; max-width: 1000px; margin: 0 auto 16px; }
.stl-statement { max-width: 1000px; margin: 0 auto; }
.stl-statement h1 { margin: 2px 0 4px; }
.stl-statement-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid #0b1630; padding-bottom: 12px; margin-bottom: 12px; }
.stl-big { font-size: 26px; font-weight: 650; }
.stl-draft { border: 2px dashed var(--warn); color: var(--warn); font-weight: 650; text-align: center; padding: 6px; margin-bottom: 12px; border-radius: 8px; }
.stl-print-table { font-size: 13px; }
.stl-print-table th, .stl-print-table td { padding: 6px 8px; border-bottom: 1px solid #d9e0ec; }
.stl-print-table th { position: static; background: transparent; color: #4a5872; }
.stl-print-table tfoot td { border-top: 2px solid #0b1630; border-bottom: 0; }
.stl-print-table tbody tr:hover { background: transparent; }
@media print {
  .stl-print { padding: 0; }
  .stl-print-bar { display: none; }
  .stl-print-table tr { break-inside: avoid; }
  @page { size: A4 landscape; margin: 12mm; }
}
.stl-print-scroll { overflow-x: auto; }
@media print { .stl-print-scroll { overflow: visible; } }
@media (max-width: 700px) {
  .stl-print { padding: 16px; }
  .stl-statement-head { flex-direction: column; }
  .stl-statement-head .right { text-align: left; }
}
.stl-top { margin-bottom: 16px; align-items: start; }
.stl-sub-head { margin: 14px 0 6px; font-size: 14px; }
.stl-rate { margin-bottom: 10px; }
