/* Faberbit TMS — styl zgodny z makietą */
/* Czcionka Inter jest w programie (static/fonts, licencja OFL) — wygląda tak samo na każdym komputerze, także bez internetu */
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Regular.3a7b195cdd4b.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Medium.7942ff0d09ee.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-SemiBold.e6398321afd2.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Bold.3ab2a3e33db9.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../fonts/InterDisplay-Bold.7df99cc26d29.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../fonts/InterDisplay-ExtraBold.adc79abc8e9c.woff") format("woff"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  /* motyw „Cement i pomarańcz” (0.10.2): mocniejszy kontrast tła, ramek i nagłówków tabel */
  --bg: #DEDBD5; --card: #FFFFFF; --line: #BFB9AE; --line-soft: #E0DCD5; --field: #A39C90; --field-hover: #7F786D;
  --ink: #141618; --muted: #44494E;
  --side: #17191B; --side-ink: #D2D5D8; --side-muted: #8E9399; --side-active: #2E3236; --side-hover: #23262A; --side-mark: #FF7A2E;
  --side-line: #3A3F44;
  --accent: #CF4A0C; --accent-ink: #A93A06; --accent-dark: #842D04; --accent-soft: #FFE9DA; --accent-border: #F5B98F; --accent-chart: #E1600F;
  --blue: #23558A;
  --ok-bg: #D0EDDB; --ok: #13633A; --ok-border: #8FCDA9; --warn-bg: #FAE3A8; --warn: #684100; --warn-border: #E2BC5C;
  --bad-bg: #F7D3CC; --bad: #9C2213; --bad-border: #E39586; --info-bg: #D6E4F4; --info: #1D477A; --info-border: #9DBCE0;
  --gray-bg: #E7E4DF; --gray: #33373B; --purple-bg: #F3DDEC; --purple: #74235C;
  --thead-bg: #2A2D31; --thead-ink: #F3F1EE; --tfoot-bg: #EFECE7; --row-alt: #F7F5F2; --row-hover: #FFF4EC; --row-own: #FFF1E7;
  --tabs-bg: #CCC7BF; --tab-on: #17191B; --tab-on-ink: #FFFFFF; --bar-bg: #E7E4DF; --grid-line: #E4E0DA; --chart-axis: #A39C90;
  --notice-bg: #EFECE7; --up: #12793B; --down: #B0230F; --shadow: 0 1px 0 rgba(0, 0, 0, .06);
  --accent-hover: #A93A06;
}
/* tryb ciemny (Moje konto → Wygląd programu): ciemny zawsze albo „jak w systemie” */
:root[data-theme="dark"] {
  --bg: #121416; --card: #1B1E21; --line: #363B40; --line-soft: #272B2F; --field: #4D545B; --field-hover: #6E757C;
  --ink: #E9EAEB; --muted: #A4AAB0;
  --side: #0B0C0D; --side-ink: #C9CDD1; --side-muted: #80878E; --side-active: #25292D; --side-hover: #181B1E; --side-mark: #FF7A2E;
  --side-line: #2F3439;
  --accent: #E35D16; --accent-ink: #FF9A5C; --accent-dark: #FFB585; --accent-hover: #C94F10; --accent-soft: #33200F;
  --accent-border: #7A3D14; --accent-chart: #F07A2E; --blue: #5B9BE0;
  --ok-bg: #11301F; --ok: #6FD29B; --ok-border: #24603F; --warn-bg: #33290C; --warn: #F2C55C; --warn-border: #6B5516;
  --bad-bg: #3A1813; --bad: #FF8E7E; --bad-border: #7A2F25; --info-bg: #142A44; --info: #8EC2FF; --info-border: #2D5684;
  --gray-bg: #272B2F; --gray: #C9CDD1; --purple-bg: #351E31; --purple: #E9A8DA;
  --thead-bg: #0B0C0D; --thead-ink: #D9DCDF; --tfoot-bg: #212427; --row-alt: #1F2225; --row-hover: #2A231D; --row-own: #2B1F15;
  --tabs-bg: #0E1012; --tab-on: #363B40; --tab-on-ink: #FFFFFF; --bar-bg: #2A2E32; --grid-line: #25292D; --chart-axis: #4D545B;
  --notice-bg: #22262A; --up: #6FD29B; --down: #FF8E7E; --shadow: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
  --bg: #121416; --card: #1B1E21; --line: #363B40; --line-soft: #272B2F; --field: #4D545B; --field-hover: #6E757C;
  --ink: #E9EAEB; --muted: #A4AAB0;
  --side: #0B0C0D; --side-ink: #C9CDD1; --side-muted: #80878E; --side-active: #25292D; --side-hover: #181B1E; --side-mark: #FF7A2E;
  --side-line: #2F3439;
  --accent: #E35D16; --accent-ink: #FF9A5C; --accent-dark: #FFB585; --accent-hover: #C94F10; --accent-soft: #33200F;
  --accent-border: #7A3D14; --accent-chart: #F07A2E; --blue: #5B9BE0;
  --ok-bg: #11301F; --ok: #6FD29B; --ok-border: #24603F; --warn-bg: #33290C; --warn: #F2C55C; --warn-border: #6B5516;
  --bad-bg: #3A1813; --bad: #FF8E7E; --bad-border: #7A2F25; --info-bg: #142A44; --info: #8EC2FF; --info-border: #2D5684;
  --gray-bg: #272B2F; --gray: #C9CDD1; --purple-bg: #351E31; --purple: #E9A8DA;
  --thead-bg: #0B0C0D; --thead-ink: #D9DCDF; --tfoot-bg: #212427; --row-alt: #1F2225; --row-hover: #2A231D; --row-own: #2B1F15;
  --tabs-bg: #0E1012; --tab-on: #363B40; --tab-on-ink: #FFFFFF; --bar-bg: #2A2E32; --grid-line: #25292D; --chart-axis: #4D545B;
  --notice-bg: #22262A; --up: #6FD29B; --down: #FF8E7E; --shadow: none;
  color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 Inter, "Segoe UI", system-ui, sans-serif;
       font-variant-numeric: tabular-nums; }
a { color: var(--accent-ink); } a:hover { color: var(--accent-dark); }
button.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); text-decoration: underline; cursor: pointer; }
button.linklike:hover { color: var(--accent-dark); }
h1, h2, h3 { margin: 0; }
h1 { font-family: "Inter Display", Inter, "Segoe UI", system-ui, sans-serif; font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; }

.app { display: flex; min-height: 100vh; }
.side { width: 240px; flex-shrink: 0; background: var(--side); color: var(--side-ink); padding: 24px 16px;
        display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh;
        overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--side-active) transparent; }
.side > * { flex-shrink: 0; }   /* niskie okno: menu się przewija zamiast ucinać */
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: #fff; text-decoration: none; }
.brand .logo { width: 36px; height: 36px; border-radius: 8px; background: var(--accent); display: grid; place-items: center;
               font-family: "Inter Display", Inter, "Segoe UI", sans-serif; font-weight: 800; }
.brand b { font-family: "Inter Display", Inter, "Segoe UI", sans-serif; font-size: 17px; display: block; }
.brand small { color: var(--side-muted); font-size: 12px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; height: 44px; padding: 0 12px; border-radius: 8px; color: var(--side-ink);
              text-decoration: none; font-weight: 500; }
.side nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--side-mark); font-weight: 600; }
.side nav a:hover { background: var(--side-hover); color: #fff; }
.side .spacer { flex-grow: 1; }
.side .user { padding: 0 8px; font-size: 13px; }
.side .user b { color: #fff; display: block; }
.side .user a { color: var(--side-muted); }

.main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 12px 32px; background: var(--card);
          border-bottom: 1px solid var(--line); }
.topbar .titles { flex-grow: 1; min-width: 0; }
.topbar > .btn, .topbar > .toolbar { white-space: nowrap; flex-shrink: 0; }   /* przyciski w nagłówku nie łamią się */
.crumb { font-size: 12px; color: var(--muted); }
/* 0.24: na telefonie nad stroną zostają tylko jej własne przyciski — odnośniki powtarzające menu (.in-menu) znikają */
@media (max-width: 820px) { .topbar .btn.in-menu { display: none; } }
/* 0.24: raporty na telefonie — lista raportów w jednym przewijanym wierszu, żeby dane były od razu na ekranie */
@media (max-width: 820px) {
  .report-nav { display: flex !important; flex-wrap: nowrap; overflow-x: auto; gap: 6px !important; padding-bottom: 6px; scrollbar-width: thin; }
  .report-nav .btn { flex: 0 0 auto; white-space: nowrap; }
}
/* 0.24: Do zafakturowania — klient w jednym wierszu, pozycje po rozwinięciu */
details.bill > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
details.bill > summary::-webkit-details-marker { display: none; }
details.bill > summary::before { content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px 2px 0; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .12s ease; }
details.bill[open] > summary::before { transform: rotate(45deg); }
details.bill > summary h2 { margin: 0; flex: 1 1 220px; }
details.bill > summary .bill-net { font-variant-numeric: tabular-nums; white-space: nowrap; }
details.bill.none > summary h2, details.bill.none > summary .bill-net { color: var(--muted); font-weight: 500; }
details.bill[open] > summary { border-bottom: 1px solid var(--line-soft); }
.bill-sum { margin-right: auto; align-self: center; font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { details.bill > summary::before { transition: none; } }
/* 0.24: ścieżka z menu + dalsza część strony + dopisek; znaki rozdzielające tylko między niepustymi częściami */
.crumb-path + .crumb-more:not(:empty)::before { content: " › "; white-space: pre; }
.crumb-path ~ .crumb-note:not(:empty)::before, .crumb-more:not(:empty) + .crumb-note:not(:empty)::before { content: " · "; white-space: pre; }
.content { padding: 24px 32px; display: flex; flex-direction: column; gap: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px;
       border-radius: 8px; border: 1px solid var(--field); background: var(--card); color: var(--ink); font: inherit;
       font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--field-hover); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.danger { color: var(--bad); border-color: var(--bad-border); }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow-x: auto; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { flex-grow: 1; font-weight: 700; }
.card > .card-head:first-child { padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.card.flush > .card-head:first-child { border-bottom: 0; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }

.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kpi .value { font-family: "Inter Display", Inter, "Segoe UI", sans-serif; font-size: 28px; font-weight: 700; }
.kpi .sub { font-size: 13px; color: var(--muted); }
.up { color: var(--up); font-weight: 600; } .down { color: var(--down); font-weight: 600; }

table.data { border-collapse: collapse; width: 100%; }
table.data th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--thead-ink);
                padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--thead-bg); white-space: nowrap; }
table.data th a, table.data th .muted { color: inherit; }
table.data tbody tr:nth-child(even) > td { background: var(--row-alt); }
table.data tbody tr:hover > td { background: var(--row-hover); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data tr.selected td { background: var(--accent-soft); }
table.data tfoot td { font-weight: 700; background: var(--tfoot-bg); border-top: 2px solid var(--line); }
.num { text-align: right !important; white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.neg { color: var(--down); }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap;
        background: var(--gray-bg); color: var(--gray); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.pill.purple { background: var(--purple-bg); color: var(--purple); }
.pill.wrap { white-space: normal; border-radius: 8px; max-width: 22ch; line-height: 1.35; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--tabs-bg); border-radius: 10px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500; }
.tabs a.active { background: var(--tab-on); color: var(--tab-on-ink); font-weight: 600; }
.tabs a.active .muted { color: inherit; opacity: .7; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .grow { flex-grow: 1; }

form .field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
form .field.wide { grid-column: 1 / -1; }
/* 0.24: pole na pół albo trzy czwarte wiersza (adres obok miejscowości) i pole, od którego zaczyna się nowy wiersz */
form .field.span2 { grid-column: span 2; }
form .field.span3 { grid-column: span 3; }
form .field.row-start { grid-column-start: 1; }
@media (max-width: 1100px) { form .field.span2, form .field.span3 { grid-column: 1 / -1; } }
/* część formularza zwinięta do jednego wiersza (np. podwykonawca w zleceniu) */
details.card.fold > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; cursor: pointer; list-style: none; }
details.card.fold > summary::-webkit-details-marker { display: none; }
details.card.fold > summary h2 { margin: 0; font-size: 15px; }
form .card > h2.field { font-size: 15px; font-weight: 600; color: var(--ink); }
details.card.fold > summary::after { content: "rozwiń"; margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
details.card.fold[open] > summary::after { content: "zwiń"; }
details.card.fold[open] > summary { margin-bottom: 16px; }
input[type=text], input[type=number], input[type=email], input[type=date], input[type=datetime-local], input[type=search],
input[type=time], input[type=month], input[type=tel], input[type=url],
input[type=password], input[type=file], select, textarea {
  font: inherit; color: var(--ink); min-height: 42px; padding: 8px 10px; border: 1px solid var(--field);
  border-radius: 8px; background: var(--card); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-border); outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 84px; resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--field);
                border-radius: 999px; color: var(--ink); font-size: 13px; }
.errorlist { margin: 0; padding: 0; list-style: none; color: var(--bad); font-size: 12px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

.notice { padding: 12px 14px; border-radius: 4px 10px 10px 4px; font-size: 13px; background: var(--notice-bg); border-left: 4px solid var(--field); }
.notice.ok { background: var(--ok-bg); color: var(--ok); border-left-color: currentColor; } .notice.warn { background: var(--warn-bg); color: var(--warn); border-left-color: currentColor; }
.notice.bad { background: var(--bad-bg); color: var(--bad); border-left-color: currentColor; }
.notice.accent { background: var(--accent-soft); border: 1px solid var(--accent-border); border-left: 4px solid var(--accent); }
.messages { display: flex; flex-direction: column; gap: 8px; }

.bar { height: 10px; background: var(--bar-bg); border-radius: 5px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent-chart); border-radius: 5px; }
.bar.red > span { background: var(--down); }
.kv { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; white-space: pre-line; }
.timeline { display: flex; flex-direction: column; }
.timeline .ev { display: grid; grid-template-columns: 80px 12px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0;
                border-bottom: 1px solid var(--line-soft); align-items: start; }
.timeline .dot { width: 10px; height: 10px; border-radius: 5px; margin-top: 5px; background: var(--accent); }
.dark-card { background: var(--side); color: #fff; border-radius: 12px; padding: 20px; }
.dark-card .big { font-family: "Inter Display", Inter, "Segoe UI", sans-serif; font-size: 36px; font-weight: 800; }
.suggest { background: var(--side-hover); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px;
           font-size: 13px; color: var(--side-ink); }
.suggest .head { color: var(--side-mark); font-weight: 600; font-size: 12px; }
.chart-bars { display: flex; align-items: flex-end; justify-content: space-around; height: 200px;
              border-bottom: 1px solid var(--chart-axis); gap: 8px; }
.chart-bars .group { display: flex; align-items: flex-end; gap: 4px; height: 100%; }
.chart-bars .b { width: 26px; border-radius: 4px 4px 0 0; min-height: 2px; }
.chart-labels { display: flex; justify-content: space-around; font-size: 12px; color: var(--muted); padding-top: 6px; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; }
.login { width: 380px; }
.login.wide { width: 520px; }
/* !important: kilka ekranów ustawia szerokości kolumn w samym szablonie — na wąskim oknie też mają iść jedna pod drugą */
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr !important; } }
@media (max-width: 1680px) { .split.stack-early { grid-template-columns: 1fr; } }
.notice.banner { margin-bottom: 14px; }
.notice.banner a { color: inherit; font-weight: 600; }
.side .user .small { display: block; margin-top: 4px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--accent); }
.tile b { font-size: 15px; }
.tile .count { font-size: 24px; font-weight: 700; }
form .field.check { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink); }
form .field.check input { width: auto; }
.wizard-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.wizard-steps li a { display: block; padding: 8px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.wizard-steps li.done a { color: var(--ok); border-color: var(--ok); }
.wizard-steps li.now a { background: var(--accent); border-color: var(--accent); color: #fff; }
details.danger-zone summary { cursor: pointer; color: var(--bad); font-weight: 600; }
[hidden] { display: none !important; }

/* ---------- telefon i mały tablet: menu wysuwane, jedna kolumna, tabele przewijane w bok ---------- */
.mbar, .side-overlay { display: none; }
.board-list { display: none; }
@media (max-width: 820px) {
  .mbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; padding: 10px 16px;
          background: var(--side); color: #fff; }
  .mbar .brand { padding: 0; }
  .mbar .brand .logo { width: 30px; height: 30px; font-size: 13px; }
  .menu-btn { min-height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--side-line); background: transparent;
              color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
  .app { display: block; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; height: 100%; width: 270px; max-width: 85vw; overflow-y: auto;
          transform: translateX(-100%); transition: transform .2s ease; }
  .side.open { transform: none; }
  .side-overlay:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15, 20, 25, .45); }
  body.menu-open { overflow: hidden; }
  .topbar { min-height: 0; padding: 12px 16px; flex-wrap: wrap; }
  .topbar .titles { flex-basis: 100%; }
  .topbar h1 { font-size: 20px; }
  .content { padding: 14px 16px 24px; }
  .cols-2, .cols-3, .cols-4, .split { grid-template-columns: 1fr !important; }
  .card { padding: 14px; }
  .card.flush { padding: 0; overflow-x: auto; }
  table.data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data th, table.data td { padding: 8px 10px; }
  .toolbar { flex-wrap: wrap; }
  .tabs { display: flex; overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
  .tabs a { white-space: nowrap; }
  input, select, textarea { font-size: 16px; }      /* iPhone nie powiększa ekranu przy wpisywaniu */
  .login, .login.wide { width: min(380px, calc(100vw - 32px)); }
  .board-timeline { display: none; }
  .board-list { display: block; }
  .kpi .value { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
.board-list .lane { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.board-list .job { display: flex; gap: 10px; align-items: center; padding: 8px 10px; margin-top: 6px; border-radius: 8px;
                   text-decoration: none; border: 1px solid var(--line); }
.board-list .job b { font-size: 14px; }
.board-list .job .t { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 46px; }
@media (max-width: 820px) { .cols-4:has(> .kpi) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
select { max-width: 100%; }
@media (max-width: 820px) { .toolbar select, .toolbar input[type=search] { width: 100% !important; flex: 1 1 100%; } }

/* ---------- Pomoc (instrukcja obsługi) ---------- */
.help { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.help-toc { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.help-toc a { padding: 7px 10px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 14px; }
.help-toc a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.help-toc a:hover { background: var(--gray-bg); }
.help-body { max-width: 860px; line-height: 1.6; }
.help-body h2 { font-size: 20px; margin: 28px 0 8px; }
.help-body h2:first-child { margin-top: 0; }
.help-body h3 { font-size: 16px; margin: 20px 0 6px; }
.help-body p, .help-body li { max-width: 72ch; }
.help-body ol, .help-body ul { padding-left: 22px; }
.help-body li { margin: 4px 0; }
.help-body figure { margin: 14px 0 18px; }
.help-body figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px;
                        box-shadow: 0 1px 3px rgba(20, 25, 30, .06); }
.help-body figure.phone img { max-width: 300px; }
.help-body figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.help-body .tip { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 12px 0; }
.help-body .warn { border-left: 3px solid var(--warn-border); background: var(--warn-bg); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 12px 0; }
.help-body kbd { font: 600 12px ui-monospace, Consolas, monospace; background: var(--gray-bg); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.help-body table.data { margin: 10px 0; }
.help-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.phones { display: flex; gap: 14px; flex-wrap: wrap; }
.phones figure { margin: 0; }
@media (max-width: 820px) { .help { grid-template-columns: 1fr; } .help-toc { position: static; flex-direction: row; flex-wrap: wrap; } }

/* pola obowiązkowe */
.req { color: var(--bad); font-weight: 700; }
.field.missing input, .field.missing select, .field.missing textarea,
label.missing input, label.missing select, label.missing textarea { border-color: var(--bad); box-shadow: 0 0 0 2px rgba(140, 47, 33, .12); }
.req-legend { margin: 0; grid-column: 1 / -1; }
.form-summary { margin: 0; }
.idle-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; gap: 12px;
            align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-width: calc(100% - 32px); }

/* oferta: poprawki pozycji, propozycje klienta, historia */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.edit-row td { background: var(--gray-bg); }
.item-edit { padding: 6px 0; }
.proposal.open { border-color: var(--warn-border); box-shadow: 0 0 0 2px rgba(233, 196, 106, .25); }
.msg-quote { background: var(--gray-bg); border-radius: 10px; padding: 10px 12px; font-style: italic; }
table.data.compact td, table.data.compact th { padding: 6px 8px; }
.changelog summary { cursor: pointer; list-style: none; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.timeline li { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; }
.chg { display: inline-block; margin: 2px 10px 2px 0; }
.chg s { color: var(--muted); }
.outlook-done { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.outlook-done > div { flex: 1 1 320px; }
.pos { color: var(--ok); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 12px 0; }
.edit-row td { white-space: normal; }
.item-edit { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; max-width: 900px; }
/* flota: terminy, warsztat */
.deadline { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 13px; margin-bottom: 4px; background: var(--gray-bg); }
.deadline.bad { background: var(--bad-bg); color: var(--bad); } .deadline.warn { background: var(--warn-bg); color: var(--warn); }
.deadline.soon { background: color-mix(in srgb, var(--warn-bg) 45%, var(--card)); }
a.btn.is-off { opacity: .45; cursor: not-allowed; }      /* zestawienie dla klienta: nic nie zaznaczono */
/* kartoteka auta: szybkie dodawanie wyposażenia pod tabelą */
.equip-add { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.equip-add .field { flex: 1 1 130px; min-width: 0; } .equip-add .field.grow { flex: 2 1 200px; } .equip-add .field.qty { flex: 0 0 76px; }
.equip-add .btn { min-height: 42px; }
.equip-add .form-summary { flex: 1 1 100%; order: -1; }     /* „uzupełnij pola” nad polami, na całą szerokość */
.points-parts { max-width: 520px; } .points-parts .deadline:last-child { margin-bottom: 0; }   /* punkty karne: pozycje z datą anulowania */
.checklist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.checklist li.done { background: var(--ok-bg); border-color: var(--ok-border); }
.checklist .tick { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--field); background: var(--card); font-weight: 700; color: var(--ok); cursor: pointer; display: grid; place-items: center; font-size: 16px; }
.checklist li.done .tick { border-color: var(--ok); }
.checklist .grow, .toolbar input.grow { flex: 1; }
.qr { display: grid; place-items: center; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.qr svg { width: min(280px, 100%); height: auto; aspect-ratio: 1; shape-rendering: crispEdges; }
.crumbs-files { font-size: 15px; margin: 0 0 4px; }
.pdf-text { white-space: pre-wrap; font-size: 12px; max-height: 420px; overflow: auto; background: var(--gray-bg); padding: 12px; border-radius: 10px; }
/* mapa floty */
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; height: calc(100vh - 230px); min-height: 460px; }
#map { height: 100%; border-radius: 14px 0 0 14px; }
.map-list { border-left: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; }
.map-list input { margin: 10px; }
.map-list button { text-align: left; border: 0; border-bottom: 1px solid var(--line-soft); background: none; padding: 8px 12px; cursor: pointer; font: inherit; }
.map-list button:hover { background: var(--gray-bg); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 2px; vertical-align: middle; }
@media (max-width: 820px) { .map-wrap { grid-template-columns: 1fr; height: auto; } #map { height: 60vh; border-radius: 14px 14px 0 0; } .map-list { max-height: 40vh; border-left: 0; } }
table.data tbody tr.row-ok > td, tr.row-ok td { background: var(--ok-bg); }
table.data tbody tr.row-own > td, tr.row-own td { background: var(--row-own); }

/* ---------- plan dyspozytora: kolory statusów (zamiast kolorów wpisanych w kodzie) ---------- */
.st-new { --st-bg: var(--card); --st-fg: var(--gray); --st-bd: var(--field); }
.st-plan { --st-bg: var(--card); --st-fg: var(--ink); --st-bd: var(--field); }
.st-load { --st-bg: var(--accent-soft); --st-fg: var(--accent-ink); --st-bd: var(--accent-border); }
.st-road { --st-bg: var(--info-bg); --st-fg: var(--info); --st-bd: var(--info-border); }
.st-done { --st-bg: var(--ok-bg); --st-fg: var(--ok); --st-bd: var(--ok-border); }
.st-cancel { --st-bg: var(--gray-bg); --st-fg: var(--muted); --st-bd: var(--line); }
.st-issue { --st-bg: var(--bad-bg); --st-fg: var(--bad); --st-bd: var(--bad-border); }
.job-box { background: var(--st-bg); color: var(--st-fg); border-color: var(--st-bd); }
.job-box.sel { border-color: var(--ink); }
.pill.st { background: var(--st-bg); color: var(--st-fg); }
.board-head { background: var(--thead-bg); color: var(--thead-ink); }
.board-track { background-image: linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); }
.side nav .navsep { height: 1px; background: var(--side-active); margin: 6px 4px; }
a.notice { color: var(--ink); text-decoration: none; }
a.notice:hover { text-decoration: underline; }

/* zabezpieczenia: wysyłany formularz, okno potwierdzenia */
.is-busy { opacity: .6; cursor: progress; }
dialog.confirm-dialog { max-width: min(480px, calc(100vw - 32px)); color: var(--ink); background: var(--card); border: 1px solid var(--line); }
dialog.confirm-dialog::backdrop { background: rgba(10, 12, 14, .5); }
.soft-warnings { display: grid; gap: 8px; }
.soft-warnings ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- 0.14.0: podmenu floty, stan OK / UWAGA / PROBLEM, kalendarz nieobecności, pliki, zdjęcia ---------- */
.subnav { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: -6px 0 2px; }
.subnav a { padding: 8px 12px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600;
            border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); }
.subnav a.active { color: var(--ink); border-bottom-color: var(--accent); }
@media (max-width: 700px) { .subnav { flex-wrap: nowrap; overflow-x: auto; } .subnav a { white-space: nowrap; } }
.status-pill { letter-spacing: .02em; cursor: help; }
.status-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.status-list li.bad { color: var(--bad); } .status-list li.warn { color: var(--warn); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chips a { text-decoration: none; }
.chips a.on .pill { outline: 2px solid var(--ink); outline-offset: 1px; }
.cal-wrap { overflow-x: auto; }
table.cal { border-collapse: collapse; font-size: 12px; min-width: 100%; }
table.cal th, table.cal td { border: 1px solid var(--line-soft); padding: 0; text-align: center; height: 30px; min-width: 26px; }
table.cal th.name, table.cal td.name { text-align: left; padding: 0 10px; white-space: nowrap; min-width: 170px; position: sticky; left: 0; background: var(--card); z-index: 1; }
table.cal thead th { background: var(--thead-bg); color: var(--thead-ink); font-weight: 600; }
table.cal td.we { background: var(--gray-bg); }
table.cal thead th.name { background: var(--thead-bg); color: var(--thead-ink); }
table.cal td.today { background: color-mix(in srgb, var(--accent-soft) 75%, transparent); }
table.cal thead th.today { background: var(--accent); color: #fff; }
table.cal td button.day { width: 100%; height: 30px; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; padding: 0; }
table.cal td button.day:hover { background: var(--accent-soft); }
table.cal .ab { display: block; height: 30px; line-height: 30px; font-weight: 700; font-size: 11px; text-decoration: none; }
.ab-vacation { background: var(--info-bg); color: var(--info); } .ab-sick { background: var(--bad-bg); color: var(--bad); }
.ab-unpaid { background: var(--warn-bg); color: var(--warn); } .ab-special { background: var(--purple-bg); color: var(--purple); }
.ab-training { background: var(--ok-bg); color: var(--ok); } .ab-other { background: var(--gray-bg); color: var(--muted); }
table.cal .ab.conflict { box-shadow: inset 0 -4px 0 var(--bad); }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.files li { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--line-soft); border-radius: 10px; font-size: 13px; }
.files li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.files li form { margin: 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photos a { display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--gray-bg); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos a.doc { display: grid; place-items: center; font-size: 12px; color: var(--ink); text-decoration: none; padding: 8px; text-align: center; }
.answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.answers li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 10px; font-size: 13px; }
.answers li.nok { background: var(--bad-bg); border-color: var(--bad-border); }
.answers li.head { border: 0; padding: 8px 0 0; font-weight: 700; display: block; }
.answers .photos { grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(90px, 120px)); }
.notice.info { background: var(--info-bg); color: var(--info); border-left-color: currentColor; }
.notice.info a { color: inherit; }

/* 0.18.0: grafik (auta / kierowcy na osi dni) */
.grafik-wrap { overflow-x: auto; }
table.grafik { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
table.grafik th, table.grafik td { border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft);
  padding: 6px; vertical-align: top; }
table.grafik thead th { position: sticky; top: 0; background: var(--card); font-weight: 600; text-align: center;
  white-space: nowrap; z-index: 2; }
table.grafik thead th a { color: inherit; text-decoration: none; }
table.grafik th.who { position: sticky; left: 0; background: var(--card); text-align: left; z-index: 1; }
table.grafik thead th.who { z-index: 3; }
table.grafik { table-layout: fixed; min-width: 820px; }
table.grafik th.who { width: 112px; }
table.grafik th.sum { width: 86px; }
table.grafik.week td { overflow: hidden; }
table.grafik.month { min-width: 980px; }
table.grafik.month td { text-align: center; padding: 4px 1px; }
table.grafik.month thead th:not(.who):not(.sum) { padding: 4px 1px; font-size: 11px; white-space: normal; }
table.grafik .d { color: var(--muted); font-weight: 500; }
table.grafik .gr-weekend { background: var(--gray-bg); }
table.grafik .gr-today { box-shadow: inset 0 0 0 2px var(--accent); }
table.grafik td.gr-busy { background: var(--info-bg); }
table.grafik td.gr-off { background: var(--warn-bg); }
table.grafik td.gr-down { background: var(--bad-bg); }
.gr-tag { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 0 5px; margin-bottom: 2px; }
.gr-tag.down { color: var(--bad); } .gr-tag.off { color: var(--warn); }
.gr-job { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-mark { color: var(--purple); font-size: 11px; }
table.grafik .sum { text-align: left; }
@media print {
  .side, .side-overlay, .mbar, .subnav, .toolbar, .topbar .btn, .notice.banner { display: none !important; }
  .grafik-wrap { overflow: visible; box-shadow: none; border: 0; }
  table.grafik { font-size: 10px; }
  table.grafik.week td { min-width: 0; }
}

/* ---------- „Jak liczymy”: bloki wyliczeń z pozycjami źródłowymi ---------- */
.calc-eq { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.calc-eq .op, .calc-flow .op { font-size: 20px; font-weight: 700; color: var(--muted); }
.calc-eq .chip { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--line);
                 border-radius: 10px; background: var(--card); color: var(--ink); text-decoration: none; min-width: 120px; }
.calc-eq .chip span { font-size: 12px; color: var(--muted); }
.calc-eq a.chip:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.calc-eq .chip.total { border-width: 2px; }
.calc-eq .chip.result { border: 2px solid var(--accent); background: var(--accent-soft); }
.calc-eq .chip.result.neg b { color: var(--down); }
.calc-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); align-items: start; }
.calc-block { scroll-margin-top: 16px; }
.calc-block:target { box-shadow: 0 0 0 2px var(--accent); }
.calc-head { display: flex; align-items: baseline; gap: 10px; }
.calc-head h2 { flex-grow: 1; font-weight: 700; }
.calc-amount { font-family: "Inter Display", Inter, "Segoe UI", sans-serif; font-size: 22px; font-weight: 700; white-space: nowrap; }
.calc-rule { margin: 6px 0 10px; font-size: 13px; color: var(--muted); }
.calc-rows { margin-bottom: 8px; }
.calc-note { margin: 6px 0 0; }
.calc-src summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); margin-top: 6px; }
.calc-src .table-wrap { margin-top: 8px; max-height: 360px; overflow-y: auto; }
.calc-section { margin: 8px 0 -4px; font-weight: 700; }
.calc-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.calc-flow .card { display: flex; flex-direction: column; gap: 2px; flex: 1 1 200px; }
.calc-flow .label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.calc-flow b { font-size: 20px; }
@media (max-width: 820px) { .calc-eq .chip { flex: 1 1 40%; } .calc-flow .op { display: none; } }
@media print { .calc-src { display: block; } .calc-src summary { display: none; } }

/* pliki klienta: folder, nad którym trzyma się przeciągany plik */
tr[data-doc] { cursor: grab; }
[data-drop].drop-over > td, a[data-drop].drop-over { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: -2px; }


/* ================================================================================================================
   Dopracowanie interfejsu (cała aplikacja): obsługa z klawiatury, pola i przyciski, wąskie ekrany, menu boczne.
   Wszystko na zmiennych motywu — działa tak samo w trybie jasnym i ciemnym.
   ================================================================================================================ */

/* --- klawiatura: wyraźna ramka na elemencie z fokusem (tylko przy przechodzeniu klawiszem Tab, nie po kliknięciu) --- */
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
a:not(.btn):not(.card):focus-visible, summary:focus-visible { border-radius: 4px; }
.side a:focus-visible, .side button:focus-visible, .mbar :focus-visible { outline-color: var(--side-mark); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- przyciski: płynna reakcja na mysz, wciśnięcie, stan wyłączony --- */
.btn { transition: background-color .12s ease, border-color .12s ease, color .12s ease; }
.btn:not(.primary):hover { background: color-mix(in srgb, var(--card) 93%, var(--ink)); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }

/* --- pola formularzy: reakcja na mysz, pola wyłączone, podpowiedź w polu --- */
input[type=text]:hover:not(:focus):not(:disabled), input[type=number]:hover:not(:focus):not(:disabled),
input[type=email]:hover:not(:focus):not(:disabled), input[type=date]:hover:not(:focus):not(:disabled),
input[type=search]:hover:not(:focus):not(:disabled), input[type=password]:hover:not(:focus):not(:disabled),
input[type=time]:hover:not(:focus):not(:disabled), input[type=month]:hover:not(:focus):not(:disabled),
input[type=tel]:hover:not(:focus):not(:disabled), input[type=url]:hover:not(:focus):not(:disabled),
select:hover:not(:focus):not(:disabled), textarea:hover:not(:focus):not(:disabled) { border-color: var(--field-hover); }
input:disabled, select:disabled, textarea:disabled { background: var(--gray-bg); color: var(--muted); cursor: not-allowed; }
::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); opacity: 1; }
/* pola wyboru: większe (łatwiej trafić myszą i palcem), w kolorze programu */
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0;
  vertical-align: middle; cursor: pointer; }
label:has(> input[type=checkbox]), label:has(> input[type=radio]) { cursor: pointer; }
@media (pointer: coarse) { input[type=checkbox], input[type=radio] { width: 22px; height: 22px; } }   /* ekran dotykowy */
/* wybór pliku: przycisk w stylu programu zamiast systemowego */
input[type=file] { padding: 5px 8px; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-size: 13px; font-weight: 500; margin: 0 10px 0 0; padding: 5px 12px;
  min-height: 30px; border: 1px solid var(--field); border-radius: 6px; background: var(--gray-bg); color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--field-hover); }

/* --- układ: nic nie rozpycha strony w poziomie --- */
/* kolumny siatki mogą być węższe niż ich najszersza zawartość; szeroka tabela przewija się wtedy w swojej karcie */
.grid > *, .split > * { min-width: 0; }
.card { overflow-wrap: break-word; }
.card:has(table.data) { overflow-x: auto; }
.table-wrap { overflow-x: auto; }
.card.flush, .table-wrap, .card:has(table.data) { scrollbar-width: thin; scrollbar-color: var(--field) transparent; }
.files { grid-template-columns: minmax(0, 1fr); }
.files li { flex-wrap: wrap; }
.pill { max-width: 100%; }
/* nagłówek strony: gdy przyciski się nie mieszczą, schodzą do drugiego wiersza */
.topbar { flex-wrap: wrap; row-gap: 8px; justify-content: flex-end; }
.topbar .titles { flex: 1 1 220px; }      /* tytuł ustępuje miejsca przyciskom (opis nad nim zawija się), zanim te zejdą niżej */
.topbar > .toolbar { flex-wrap: wrap; }
/* wykres słupkowy na pulpicie: słupki zwężają się na wąskim ekranie zamiast wychodzić poza kartę */
.chart-bars { min-width: 0; }
.chart-bars .group { flex: 0 1 auto; min-width: 0; }
.chart-bars .b { flex: 0 1 26px; min-width: 5px; }
/* ostatni wiersz tabeli bez kreski pod spodem (karta ma własną ramkę) */
.card.flush table.data tbody:last-child > tr:last-child > td { border-bottom: 0; }

/* --- odnośnik do sekcji (#wyposazenie, #pliki, #punkty…): płynne przewinięcie i podświetlenie sekcji --- */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar, 0px) + 16px); }
section:target, form.card:target, details.card:target { box-shadow: 0 0 0 2px var(--accent-border), var(--shadow); }

/* --- komunikaty po zapisie: delikatne pojawienie się --- */
@keyframes notice-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.messages .notice { animation: notice-in .2s ease-out; }
h1 { text-wrap: balance; }

/* --- menu boczne: nazwa programu i użytkownik zawsze widoczni, przewija się tylko lista pozycji --- */
.side { overflow: hidden; }
.side > nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
              scrollbar-color: var(--side-active) transparent; margin-right: -8px; padding-right: 8px; }
.side nav a { flex-shrink: 0; height: 42px; transition: background-color .12s ease, color .12s ease; }
.side .spacer { display: none; }
/* użytkownik: imię i rola po lewej, „Wyloguj” po prawej — jedna zwarta belka na dole menu */
.side .user { border-top: 1px solid var(--side-line); padding: 14px 8px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto;
              column-gap: 10px; align-items: center; }
.side .user > b, .side .user > span { grid-column: 1; overflow: hidden; text-overflow: ellipsis; }
.side .user > b { white-space: nowrap; }
.side .user form { margin: 0; grid-column: 2; grid-row: 1 / span 2; }
.side .user .btn { background: transparent; color: var(--side-ink); border-color: var(--side-line); }
.side .user .btn:hover { background: var(--side-hover); color: #fff; border-color: var(--side-muted); }
/* są jeszcze pozycje niżej — dół listy łagodnie zanika (klasę ustawia skrypt w szablonie) */
.side > nav.more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent);
                   mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); }
.side > nav.above { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40px);
                    mask-image: linear-gradient(to bottom, transparent, #000 40px); }
.side > nav.above.more { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40px, #000 calc(100% - 40px), transparent);
                         mask-image: linear-gradient(to bottom, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
/* niskie okno (laptop 1366×768): ciaśniejsze menu, żeby zmieściło się jak najwięcej pozycji */
@media (max-height: 820px) and (min-width: 821px) {
  .side { padding: 16px; gap: 14px; }
  .side .brand small { display: none; }
  .side nav a { height: 38px; }
  .side .user { padding-top: 12px; }
}
/* bardzo niskie okno (telefon poziomo): przewija się całe menu, żeby lista pozycji nie została za mała */
@media (max-height: 560px) { .side { overflow-y: auto; } .side > nav { flex: 0 0 auto; overflow: visible; margin-right: 0; padding-right: 0; } }

/* --- długie formularze (dane pojazdu, kierowcy, klienta, ustawienia): „Zapisz” zawsze pod ręką na dole okna --- */
@media (min-height: 600px) {
  .content > form.grid:not(.card) > .form-actions { position: sticky; bottom: 0; z-index: 5; margin: 0 -32px; padding: 12px 32px;
    background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    border-top: 1px solid var(--line); }
}

/* --- telefon i mały tablet --- */
@media (max-width: 820px) {
  html { scroll-padding-top: 70px; }
  .content > form.grid:not(.card) > .form-actions { margin: 0 -16px; padding: 10px 16px; }                       /* pod przyklejonym paskiem z menu */
  .kv { grid-template-columns: minmax(92px, 38%) minmax(0, 1fr); }
  .topbar { justify-content: flex-start; }
  .topbar .titles { flex-basis: 100%; }                    /* tytuł w osobnym wierszu, przyciski pod nim */
  .card-head { flex-wrap: wrap; }
  .card-head .pill { white-space: normal; border-radius: 10px; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 auto; }
  .btn { min-height: 44px; }                               /* wygodny cel dla palca */
  .btn.small { min-height: 38px; }
  .subnav a { padding: 10px 12px; }
  .tabs a { padding: 9px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .side nav a { transition: none; }
  .btn:active { transform: none; }
  .messages .notice { animation: none; }
}
@media print { html { scroll-behavior: auto; } .card:has(table.data), .table-wrap, .card.flush { overflow: visible; }
               .content > form.grid:not(.card) > .form-actions { position: static; } }


/* ================================================================================================================
   Długie listy: szukanie, sortowanie, zakładki, przyklejony nagłówek (static/js/tables.js)
   ================================================================================================================ */
.filtered-out { display: none !important; }
/* nagłówki do sortowania: strzałka pokazuje kierunek, kursor i podświetlenie — że da się kliknąć */
table.data th[data-sort] { cursor: pointer; user-select: none; -webkit-user-select: none; }
table.data th[data-sort]:hover { background: color-mix(in srgb, var(--thead-bg) 82%, var(--thead-ink)); }
table.data th[data-sort]::after { content: "↕"; display: inline-block; margin-left: 5px; opacity: .35; font-size: 11px; }
table.data th[aria-sort="ascending"]::after { content: "▲"; opacity: 1; font-size: 9px; }
table.data th[aria-sort="descending"]::after { content: "▼"; opacity: 1; font-size: 9px; }
table.data th[data-sort]:focus-visible { outline: 2px solid var(--side-mark); outline-offset: -2px; }
/* nagłówek tabeli przyklejony do góry okna — gdy tabela mieści się w karcie (klasę „fits” ustawia skrypt) */
.card.flush.sticky-head.fits, .card.flush.sticky-head.fits > .table-wrap { overflow: visible; }
.sticky-head.fits table.data thead th { position: sticky; top: 0; z-index: 3; }
.sticky-head.fits table.data tbody:last-child > tr:last-child > td:first-child { border-bottom-left-radius: 11px; }
.sticky-head.fits table.data tbody:last-child > tr:last-child > td:last-child { border-bottom-right-radius: 11px; }
/* pasek nad listą: zakładki, szukanie, filtry stanu */
.list-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.list-bar input[type=search] { width: auto; flex: 1 1 220px; max-width: 340px; }
.list-bar .chips { margin-left: auto; }
#plan-filtr .chips { margin-left: 0; } #plan-filtr input[type=search] { margin-left: auto; }
.tabs .count { opacity: .7; font-weight: 500; margin-left: 2px; }
.chip-btn { font: inherit; font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line);
            background: var(--card); color: var(--ink); cursor: pointer; white-space: nowrap; }
.chip-btn:hover { border-color: var(--field-hover); }
.chip-btn.on { background: var(--tab-on); color: var(--tab-on-ink); border-color: var(--tab-on); }
.chip-btn b { font-weight: 700; opacity: .75; margin-left: 3px; }
.chip-btn.bad:not(.on) { color: var(--bad); border-color: var(--bad-border); }

/* --- lista floty --- */
table.fleet td { vertical-align: middle; }
table.fleet .veh { white-space: nowrap; min-width: 190px; }      /* numer i naczepa zawsze w jednej linii */
table.fleet .veh > div.small { white-space: normal; }
table.fleet .due { max-width: 260px; }
table.fleet .due .pill { margin: 1px 0; }
table.fleet a.quiet { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--field); }
table.fleet a.quiet:hover { color: var(--accent-ink); border-bottom-color: currentColor; }
[data-tab-panel] { scroll-margin-top: 150px; }                 /* po wejściu z odnośnika #naczepy widać też zakładki */
[data-tab-panel]:target { box-shadow: var(--shadow); }
.bar.mini { height: 4px; margin-top: 4px; min-width: 64px; }
@media (max-width: 820px) { .list-bar .chips { margin-left: 0; } .list-bar input[type=search] { max-width: none; flex-basis: 100%; } }

/* --- plan dnia dyspozytora --- */
/* zgłoszenia od kierowców: jedna karta, jeden wiersz na zgłoszenie */
.issues { list-style: none; margin: 0; padding: 0; max-height: 292px; overflow-y: auto; scrollbar-width: thin; }
.issues li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 16px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.issues li .what { flex: 1 1 320px; min-width: 0; }
.issues li .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.issues li form { margin: 0; }
.issues-card > .card-head { margin-bottom: 8px; }
/* do przydzielenia: lista zadań dyspozytora nad planem — zlecenie, auto, kierowca i „Przydziel” w jednym wierszu */
#live-unassigned:not(:has(section)) { display: none; }
.todo-card > .card-head { margin-bottom: 8px; }
.todo-card { border-color: var(--warn-border); }
.assign-list { max-height: 412px; overflow-y: auto; scrollbar-width: thin; }
.assign-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px 210px auto; gap: 8px; align-items: center; padding: 7px 16px;
              border-top: 1px solid var(--line-soft); margin: 0; }
.assign-row .what { color: inherit; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.assign-row .what:hover b { text-decoration: underline; }
.assign-row .what .t { font-weight: 600; margin-right: 4px; }
.assign-row select { min-height: 36px; padding: 4px 8px; font-size: 13px; }
@media (max-width: 1100px) { .assign-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .assign-row .what { grid-column: 1 / -1; white-space: normal; }
                             .assign-row .btn { grid-column: 1 / -1; } .assign-list { max-height: none; } }
/* tory aut: auto i kierowca po lewej (trzy zwarte linijki), oś czasu po prawej */
.board-card { --lane-w: 232px; overflow: visible !important; }
.board-card .board-head, .lane-row { display: grid; grid-template-columns: var(--lane-w) minmax(0, 1fr); }
.board-card .board-head { position: sticky; top: 0; z-index: 4; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600;
                          border-radius: 11px 11px 0 0; }
.board-card .board-head > span { padding: 9px 14px; }
.board-card .board-head .hours { display: grid; padding: 9px 0; }
.lane-row { border-bottom: 1px solid var(--line-soft); min-height: 56px; }
.lane-row:hover .lane-info { background: var(--row-hover); }
.lane-info { padding: 7px 14px; min-width: 0; font-size: 13px; line-height: 1.35; }
.lane-info .top { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.lane-info .top > b { flex-shrink: 0; }
.lane-info .top > .small { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lane-info .top .mark { margin-left: auto; font-size: 12px; flex-shrink: 0; font-weight: 600; }
.lane-info .line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--muted); }
.lane-info .line.who { color: var(--ink); }
.board-track { position: relative; }
.job-bar { position: absolute; top: 7px; bottom: 7px; padding: 2px 8px; border-radius: 8px; border: 2px solid; text-decoration: none; overflow: hidden;
           display: flex; flex-direction: column; justify-content: center; transition: box-shadow .12s ease; }
.job-bar:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); z-index: 2; }
.job-bar b { font-size: 12px; white-space: nowrap; } .job-bar span { font-size: 11px; white-space: nowrap; }
/* pionowa kreska „teraz” przez wszystkie tory */
.board-timeline { position: relative; }
.now-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--accent); z-index: 3; pointer-events: none;
            left: calc(var(--lane-w) + (100% - var(--lane-w)) * var(--now)); }
.now-line::before { content: attr(data-time); position: sticky; top: 36px; display: block; transform: translateX(-50%); width: max-content; margin-left: -1px;
                    background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
/* szczegóły zlecenia: zawsze w oknie, gdy przewijasz plan */
@media (min-width: 1101px) {
  #szczegoly { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; }
}
.board-list .lane[hidden] { display: none; }
@media (max-width: 820px) { .board-card { --lane-w: 0px; } .now-line { display: none; } }
@media print { .board-card .board-head, #szczegoly { position: static; max-height: none; } .list-bar, .now-line { display: none !important; } }

/* protokół przekazania auta: podpisy i odpowiedzi w biurze */
.sig-view { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.sig-view:last-child { border-bottom: 0; }
.sig-view img { max-width: 100%; height: 90px; object-fit: contain; object-position: left; background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; }
.ho-rows { display: grid; gap: 6px; }
.ho-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 6px 10px; border: 1px solid var(--line-soft); border-radius: 10px; }
.ho-row.missing { background: var(--bad-bg); border-color: var(--bad-border); }
.ho-row .opts { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.ho-row .opts label { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; }
.ho-row .opts label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.ho-row .opts input { margin: 0; }
.ho-row input[type=text] { grid-column: 1 / -1; } .ho-row input[hidden] { display: none; }
.ho-unit { font-weight: 700; font-size: 13px; padding-top: 6px; }
@media (max-width: 640px) { .ho-row { grid-template-columns: minmax(0, 1fr); } }

/* długi znacznik w nagłówku karty (np. „przekroczony limit kupiecki… faktury po terminie…”) zawija się, a nie wypycha strony */
.card-head { min-width: 0; }
.card-head > .pill { white-space: normal; min-width: 0; text-align: left; border-radius: 12px; }

/* ---------- 0.23: menu z grupami (rozwijane) ---------- */
.side .navfind { height: 36px; border-radius: 8px; border: 1px solid var(--side-line); background: transparent; color: #fff;
  padding: 0 10px; font-size: 14px; width: 100%; }
.side .navfind::placeholder { color: var(--side-muted); }
.side .navfind:focus { outline: 2px solid var(--side-mark); outline-offset: 1px; }
.side nav a[hidden], .side nav details[hidden] { display: none; }
.side nav .navgroup { display: flex; flex-direction: column; flex-shrink: 0; }
.side nav .navgroup > summary { display: flex; align-items: center; height: 42px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  color: var(--side-ink); font-weight: 600; list-style: none; user-select: none; }
.side nav .navgroup > summary::-webkit-details-marker { display: none; }
.side nav .navgroup > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--side-muted);
  border-bottom: 2px solid var(--side-muted); transform: rotate(-45deg); transition: transform .12s ease; }
.side nav .navgroup[open] > summary::after { transform: rotate(45deg); }
.side nav .navgroup > summary:hover { background: var(--side-hover); color: #fff; }
.side nav .navgroup[data-current] > summary { color: #fff; }
.side nav .navgroup > a { height: 36px; padding-left: 26px; font-size: 14px; }
.side nav .navgroup[open] { padding-bottom: 6px; }
.side nav a.navtop { font-weight: 600; }
.side nav .navnone { color: var(--side-muted); padding: 8px 12px; margin: 0; }
.side nav .navnone a { color: #fff; }
@media (prefers-reduced-motion: reduce) { .side nav .navgroup > summary::after { transition: none; } }
@media (max-height: 760px) { .side nav .navgroup > summary { height: 38px; } .side nav .navgroup > a { height: 34px; } }
/* spis funkcji („Dane podstawowe”) — lista w grupach zamiast kafelków */
.sitemap { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.sitemap .card { padding: 14px 16px; }
.sitemap h2 { margin: 0 0 6px; font-size: 15px; }
.sitemap ul { list-style: none; margin: 0; padding: 0; }
.sitemap li a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 7px 8px; margin: 0 -8px; border-radius: 8px;
  color: var(--ink); text-decoration: none; }
.sitemap li a:hover { background: var(--gray-bg); }
.sitemap li a b { font-weight: 600; }
.sitemap li a .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.sitemap li a .small { flex-basis: 100%; }
/* ---------- 0.23: sortowanie po kolumnach i filtry list ---------- */
table.data th a.sortlink { color: inherit; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
table.data th a.sortlink:hover { color: var(--ink); text-decoration: underline; }
table.data th a.sortlink.on { color: var(--ink); }
.toolbar.filters { align-items: flex-end; }
.toolbar .filter { display: flex; flex-direction: column; gap: 2px; color: var(--muted); }
.toolbar .filter select, .toolbar .filter input { min-width: 130px; }
/* ---------- 0.23: uwagi na pulpicie w grupach ---------- */
.alertgroup { border-top: 1px solid var(--line-soft); padding: 8px 0; }
.alertgroup:first-of-type { border-top: 0; }
.alertgroup > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; }
.alertgroup > summary::-webkit-details-marker { display: none; }
.alertgroup > summary::before { content: "▸"; color: var(--muted); width: 12px; }
.alertgroup[open] > summary::before { content: "▾"; }
.alertgroup > summary .count { margin-left: auto; }
.alertgroup .alertlist { gap: 8px; margin-top: 8px; max-height: 420px; overflow-y: auto; }
/* ---------- 0.23: kalendarz kierowców — dni pracy (karta drogowa) ---------- */
table.cal .ab.ab-work, .pill.ab-work { background: var(--ok-bg); color: var(--ok); font-weight: 700; text-decoration: none; }
table.cal .ab.ab-work { display: block; height: 100%; line-height: 30px; }
table.cal .ab.ab-work.done { background: var(--ok); color: #fff; }
table.cal .ab.ab-work:hover { outline: 2px solid var(--ok); outline-offset: -2px; }

/* ---------- 0.23: menu u góry strony (szeroki ekran) — grupy rozwijają listę z opisami pozycji ---------- */
:root { --bar: 0px; }
.side .navsearch { position: relative; }
.side nav .navpanel { display: flex; flex-direction: column; gap: 2px; }
.side nav .navpanel a { height: 36px; padding-left: 26px; font-size: 14px; }
.side nav .navpanel a small { display: none; }
.side .navhits { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.side .navhits a { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink);
  text-decoration: none; }
.side .navhits a { flex-direction: column; align-items: flex-start; gap: 0; }
.side .navhits a b { font-weight: 600; }
.side .navhits a small { color: var(--side-muted); font-size: 12px; line-height: 1.3; }
/* 0.24: wyniki z danych programu — nagłówki rodzajów (Klienci, Pojazdy…) i podpowiedź pod spodem */
.side .navhits .hits-head { padding: 8px 10px 2px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--side-muted); }
.side .navhits .hits-tip { padding: 6px 10px; font-size: 12px; line-height: 1.35; color: var(--side-muted); }
.side .navhits a.on, .side .navhits a:hover { background: var(--side-active); color: #fff; }
/* okno pośrednie (tablet, pół ekranu): menu wysuwane jak na telefonie — poziomy pasek by się nie zmieścił */
@media (min-width: 821px) and (max-width: 1279px) {
  :root { --bar: 58px; }
  .mbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; padding: 10px 16px;
          background: var(--side); color: #fff; }
  .mbar .brand { padding: 0; }
  .mbar .brand .logo { width: 30px; height: 30px; font-size: 13px; }
  .menu-btn { min-height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--side-line); background: transparent;
              color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
  .app { display: block; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; height: 100%; width: 290px; max-width: 85vw;
          transform: translateX(-100%); transition: transform .2s ease; }
  .side.open { transform: none; }
  .side-overlay:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15, 20, 25, .45); }
  body.menu-open { overflow: hidden; }
}
@media (min-width: 1280px) {
  :root { --bar: 56px; }
  .app { display: block; }
  /* pasek: logo | grupy menu | szukanie | nowe zlecenie | użytkownik */
  .side { width: auto; height: var(--bar); position: sticky; top: 0; z-index: 30; display: grid; align-items: center;
          grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 12px; padding: 0 20px; overflow: visible; }
  .side .brand { grid-column: 1; grid-row: 1; padding: 0; }
  .side .brand .logo { width: 32px; height: 32px; font-size: 13px; }
  .side .brand small { display: none; }
  .side .brand b { font-size: 16px; white-space: nowrap; }
  .side > nav { grid-column: 2; grid-row: 1; min-width: 0; flex-direction: row; align-items: center; gap: 2px; overflow: visible;
                margin: 0; padding: 0; -webkit-mask-image: none; mask-image: none; }
  .side nav a.navtop, .side nav .navgroup > summary { height: 38px; padding: 0 10px; white-space: nowrap; font-size: 14px;
                                                       font-weight: 600; }
  .side nav a.navtop.active { box-shadow: inset 0 -3px 0 var(--side-mark); }
  .side nav .navgroup { position: relative; flex-direction: row; }
  .side nav .navgroup[open] { padding-bottom: 0; }
  .side nav .navgroup > summary::after { margin-left: 8px; width: 6px; height: 6px; margin-top: -3px; transform: rotate(45deg); }
  .side nav .navgroup[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
  .side nav .navgroup[data-current] > summary { color: #fff; box-shadow: inset 0 -3px 0 var(--side-mark); }
  .side nav .navgroup[open] > summary { background: var(--side-active); color: #fff; }
  .side nav .navpanel { position: absolute; top: calc(100% + 9px); left: 0; z-index: 50; width: max-content; min-width: 280px;
                        max-width: min(640px, 90vw); max-height: calc(100vh - var(--bar) - 24px); overflow-y: auto;
                        background: var(--card); border: 1px solid var(--line); border-radius: 12px;
                        box-shadow: 0 14px 36px rgba(0, 0, 0, .2); padding: 8px; display: grid; gap: 2px; }
  .side nav .navpanel.two { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .side nav .navgroup.end > .navpanel { left: auto; right: 0; }
  .side nav .navpanel a { height: auto; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 10px;
                          border-radius: 8px; color: var(--ink); font-size: 14px; font-weight: 600; white-space: normal; }
  .side nav .navpanel a small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.3; }
  .side nav .navpanel a:hover { background: var(--gray-bg); color: var(--ink); }
  .side nav .navpanel a.active { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 3px 0 0 var(--accent); }
  .side .navsearch { grid-column: 3; grid-row: 1; width: 190px; }
  .side .navhits { position: absolute; top: calc(100% + 15px); right: 0; z-index: 60; width: 400px; max-width: 92vw; margin: 0; padding: 8px;
                   max-height: calc(100vh - var(--bar) - 28px); overflow-y: auto;
                   background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px rgba(0, 0, 0, .2); }
  .side .navhits a { color: var(--ink); }
  .side .navhits a small, .side .navhits .hits-head, .side .navhits .hits-tip { color: var(--muted); }
  .side .navhits a.on, .side .navhits a:hover { background: var(--accent-soft); color: var(--accent-ink); }
  .side > .btn.primary { grid-column: 4; grid-row: 1; white-space: nowrap; min-height: 36px; }
  .side .user { grid-column: 5; grid-row: 1; border-top: 0; padding: 0; column-gap: 10px; max-width: 320px; line-height: 1.25; }
  .side .user > span.small { display: none; }      /* wiersz licencji; przycisk „Wyloguj” (btn small) zostaje */
  /* to, co przykleja się do góry okna, zostaje pod paskiem menu */
  .sticky-head.fits table.data thead th { top: var(--bar); }
  .board-card .board-head { top: var(--bar); }
  .now-line::before { top: calc(36px + var(--bar)); }
  #szczegoly { top: calc(16px + var(--bar)); max-height: calc(100vh - 32px - var(--bar)); }
  .help-toc { top: calc(16px + var(--bar)); }
}
/* laptop (1280–1639 px): wariant zwarty — samo logo, lupa zamiast pola szukania, przy użytkowniku tylko imię i nazwisko */
@media (min-width: 1280px) and (max-width: 1639px) {
  .side { gap: 8px; padding: 0 14px; }
  .side .brand b { display: none; }
  .side nav a.navtop, .side nav .navgroup > summary { padding: 0 8px; font-size: 13.5px; }
  .side nav .navgroup > summary::after { margin-left: 6px; }
  .side .navsearch { width: 38px; height: 36px; }
  .side .navsearch::before { content: ""; position: absolute; left: 11px; top: 9px; width: 11px; height: 11px; border-radius: 50%;
                             border: 2px solid var(--side-ink); pointer-events: none; z-index: 61; }
  .side .navsearch::after { content: ""; position: absolute; left: 22px; top: 21px; width: 7px; height: 2px; border-radius: 2px;
                            background: var(--side-ink); transform: rotate(45deg); pointer-events: none; z-index: 61; }
  .side .navfind { position: absolute; right: 0; top: 0; width: 38px; padding: 0; color: transparent; cursor: pointer;
                   transition: width .12s ease; }
  .side .navfind::placeholder { color: transparent; }
  .side .navfind:focus { width: 300px; padding: 0 10px 0 34px; color: #fff; cursor: text; background: var(--side); z-index: 60; }
  .side .navfind:focus::placeholder { color: var(--side-muted); }
  .side .navsearch:focus-within::before, .side .navsearch:focus-within::after { z-index: 62; transform: translateX(-262px); }
  .side .navsearch:focus-within::after { transform: translateX(-262px) rotate(45deg); }
  .side > .btn.primary { padding: 0 12px; }
  .side .user { max-width: 230px; }
  .side .user > b { max-width: 120px; }
  .side .user > span { display: none; }
  .side .user .btn { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) { .side .navfind { transition: none; } }
@media print { .side { display: none !important; } }

/* ================================================================================================================
   0.23.1: panel „Okres i filtry” nad dużymi listami (templates/common/_panel.html) i szybkie szukanie na małych
   ================================================================================================================ */
.fpanel { display: grid; gap: 10px; padding: 12px 16px; }
.fpanel-form { display: grid; gap: 10px; }
.fpanel-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; }
.fpanel-row + .fpanel-row, .fpanel-form > .fpanel-row:first-of-type { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.fpanel-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.fpanel .toolbar.filters { gap: 10px 12px; }
.fpanel .toolbar .filter.grow { flex: 1 1 220px; max-width: 360px; }
.fpanel .toolbar .filter.grow input { width: 100%; }
.fpanel-now { align-self: center; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchips a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 500;
  color: var(--ink); background: var(--card); text-decoration: none; white-space: nowrap; }
.pchips a:hover { border-color: var(--field-hover); background: var(--row-hover); }
.pchips a.on { background: var(--tab-on); border-color: var(--tab-on); color: var(--tab-on-ink); font-weight: 600; }
.pchips a:focus-visible { outline: 2px solid var(--side-mark); outline-offset: 2px; }
/* 0.24: te same przyciski okresu w raportach (tam są przyciskami formularza, nie odnośnikami) */
.pchips button { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 13px; font-weight: 500;
  color: var(--ink); background: var(--card); cursor: pointer; white-space: nowrap; }
.pchips button:hover { border-color: var(--field-hover); background: var(--row-hover); }
.pchips button.on { background: var(--tab-on); border-color: var(--tab-on); color: var(--tab-on-ink); font-weight: 600; }
.pchips button:focus-visible { outline: 2px solid var(--side-mark); outline-offset: 2px; }
.rperiod { flex: 1 1 100%; display: grid; gap: 10px; min-width: 0; }
.rperiod .filters { align-items: flex-end; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; }
/* 0.26: plan dnia — kierowca nie potwierdził zmiany zlecenia w ustawionym czasie */
.job.noconfirm, .job-bar.noconfirm { border-color: var(--bad) !important; box-shadow: 0 0 0 2px var(--bad); }
.job-bar.noconfirm span { color: var(--bad); font-weight: 700; }
.noconfirm-text { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; }
/* 0.25: pulpit według roli — wiersz skrótów pod kafelkami i wiersze list w kartach */
.shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.shortcuts .grow { flex: 1 1 0; }
a.prow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 6px; margin: 0 -6px; border-radius: 8px;
  border-bottom: 1px solid var(--line-soft); color: inherit; text-decoration: none; }
a.prow:last-of-type { border-bottom: 0; }
a.prow:hover { background: var(--row-hover); }
a.prow .grow { flex: 1 1 180px; min-width: 0; }
.nowrap { white-space: nowrap; }
.plabel { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 2px; }
@media (max-width: 820px) { .shortcuts { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .shortcuts > * { flex: 0 0 auto; } .shortcuts .grow { display: none; } }
/* kafelek z liczbą, który jest skrótem do szczegółów */
a.card.kpi { text-decoration: none; color: inherit; transition: border-color .12s ease, box-shadow .12s ease; }
a.card.kpi:hover { border-color: var(--accent-border); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
a.card.kpi .label::after { content: " →"; color: var(--accent-ink); opacity: 0; transition: opacity .12s ease; }
a.card.kpi:hover .label::after, a.card.kpi:focus-visible .label::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { a.card.kpi, a.card.kpi .label::after { transition: none; } }
@media (max-width: 820px) {
  .fpanel-row { grid-template-columns: 1fr; gap: 4px; }
  .pchips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .fpanel-now { flex-basis: 100%; }
  .fpanel .toolbar .filter { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .fpanel .toolbar .filter select, .fpanel .toolbar .filter input { min-width: 0; width: 100% !important; }
  .fpanel .toolbar .filter.grow { flex-basis: 100%; max-width: none; }
}
/* szybkie szukanie nad małą listą: pole, licznik „12 z 40”, a w tabeli sortowanie kliknięciem w nagłówek */
.quick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quick input[type=search] { width: 280px; max-width: 100%; }
.quick .count { font-size: 13px; color: var(--muted); }
@media print { .fpanel, .quick { display: none !important; } }
