:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e3e6eb;
  --border-strong: #cdd2da;
  --text: #1b2230;
  --text-2: #5b6474;
  --text-3: #8a93a3;
  --primary: #2f5bea;
  --primary-hover: #2449c7;
  --primary-soft: #edf1fe;
  --on-primary: #ffffff;
  --red: #c4320a;
  --red-bg: #fdecea;
  --orange: #b54708;
  --orange-bg: #fef0e1;
  --yellow: #8a6100;
  --yellow-bg: #fdf6d8;
  --green: #067647;
  --green-bg: #e5f6ec;
  --gray: #5b6474;
  --gray-bg: #eef0f3;
  --blue: #2449c7;
  --blue-bg: #edf1fe;
  --sidebar: #151a26;
  --sidebar-text: #a9b1c1;
  --sidebar-hover: #1f2635;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131a;
    --surface: #171c25;
    --surface-2: #1c222d;
    --border: #272e3b;
    --border-strong: #3a4353;
    --text: #e6e9ef;
    --text-2: #a3abba;
    --text-3: #7a8394;
    --primary: #5b7ff5;
    --primary-hover: #7390f7;
    --primary-soft: #1f2a47;
    --red: #f97066;
    --red-bg: #3a1d1b;
    --orange: #fdb022;
    --orange-bg: #3a2a12;
    --yellow: #eac54f;
    --yellow-bg: #2f2a14;
    --green: #47cd89;
    --green-bg: #133024;
    --gray: #a3abba;
    --gray-bg: #252b36;
    --blue: #8aa4fa;
    --blue-bg: #1f2a47;
    --sidebar: #0b0e14;
    --sidebar-hover: #171c25;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0 0 .75em; }
p:last-child { margin-bottom: 0; }

.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.link { font-weight: 500; }
.link-quiet { color: inherit; }

/* ---------- Układ ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  color: var(--sidebar-text);
  padding: 18px 12px;
  overflow-y: auto;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 22px;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none !important;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
}

.brand-logo { width: 30px; height: 30px; flex: none; object-fit: contain; }
.brand-auth .brand-logo { width: 40px; height: 40px; }
.brand-auth { font-size: 18px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
/* Narzędzia i administracja: dolna część paska, nad kontem użytkownika. */
.nav-admin { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.nav-admin + .nav-foot { margin-top: 12px; }
.nav form { margin: 0; }

.nav a, .nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.nav a span, .nav button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a:hover, .nav button:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active { background: var(--sidebar-hover); color: #fff; box-shadow: inset 3px 0 var(--primary); }

.main { flex: 1; min-width: 0; margin-left: 232px; }

.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 22px 32px 6px;
}
.page-title { flex: 1; min-width: 0; }
.page-title h1 { font-size: 22px; font-weight: 650; overflow-wrap: anywhere; }
.page-title p { margin: 2px 0 0; color: var(--text-2); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.nav-toggle { display: none; }
.backdrop { display: none; }
.bottom-nav { display: none; }

/* Listy i pulpit na całą szerokość; strony formularzy i szczegółów do 1500 px (rdzeń: .core-content-narrow, layout.narrow_pages). */
.content { padding: 16px 32px 48px; }

/* Nagłówek strony (tytuł, akcje, pomiar czasu) przyklejony u góry przy przewijaniu długich list. */
@media (min-width: 901px) {
  .topbar { position: sticky; top: 0; z-index: 15; background: var(--bg); padding-bottom: 12px; }
  body.is-scrolled .topbar { box-shadow: 0 1px 0 var(--border), 0 6px 16px -10px rgba(16, 24, 40, .18); }
  .content { padding-top: 8px; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 20; }
  .main { margin-left: 0; }
  .nav-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
  }
  .topbar { padding: 14px 16px 4px; }
  .page-actions { width: 100%; }
  .content { padding: 12px 16px 40px; }
  /* Menu otwiera przycisk „Menu” w dolnym pasku. */
  .topbar .nav-toggle { display: none; }
  .main { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    gap: 2px;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(16, 24, 40, .06);
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px 4px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text-2);
    font: inherit;
    font-size: 11px;
    font-weight: 550;
    text-decoration: none;
    cursor: pointer;
  }
  .bottom-nav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav .icon { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--primary); background: var(--primary-soft); }
  /* Pola formularzy 16 px — iOS nie powiększa wtedy strony przy wpisywaniu. */
  input, select, textarea { font-size: 16px; }
  .app-footer { padding-bottom: 12px; }
}

/* Ekrany dotykowe: większe przyciski. */
@media (pointer: coarse) {
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }
  .btn-icon { min-width: 36px; }
}

@media (max-width: 560px) {
  .page-title h1 { font-size: 19px; }
  .page-actions .btn { flex: 1 1 auto; }
  .form-actions .btn { flex: 1 1 auto; }
  .timer-pill-client { display: none; }
  .card { padding: 16px; }
}

/* ---------- Karty i sekcje ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }

.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h2 { font-size: 16px; font-weight: 600; }
.section-head h2 .muted { font-weight: 400; font-size: 14px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.empty { text-align: center; padding: 32px 20px; color: var(--text-2); }
.empty h2 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.empty .btn, .empty .button-row { margin-top: 12px; }

.button-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: inherit; }
.empty .button-row { justify-content: center; }

.list { padding: 4px 0; }
.list-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }

.details { margin: 0; display: grid; gap: 10px; }
.details > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.details dt { color: var(--text-2); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details .badge { margin: 0 4px 4px 0; }
@media (max-width: 520px) { .details > div { grid-template-columns: 1fr; gap: 0; } }

.steps { margin: 0 0 12px; padding-left: 20px; }
.steps li { margin-bottom: 4px; }
.steps .icon { width: 15px; height: 15px; vertical-align: -2px; }

/* ---------- Historia zmian ---------- */
/* scroll-margin — pod przyklejonym paskiem tytułu strony (kotwica #v<wersja> z linku w stopce). */
.changelog .changelog-version { scroll-margin-top: 110px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.changelog .changelog-version.is-current { margin-left: -12px; padding: 10px 12px; border: 1px solid var(--green); border-radius: var(--radius-sm); background: var(--green-bg); }
.changelog h3 { color: var(--text-2); }

/* ---------- Pulpit: szybkie akcje ---------- */
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
@media (max-width: 700px) {
  /* Na wąskim ekranie — siatka dwóch kolumn, przyciski na pełną szerokość komórki. */
  .quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-actions .btn { justify-content: center; white-space: normal; text-align: center; }
}

/* ---------- Kafelki ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }

.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none !important;
  border-top: 3px solid var(--tile-accent, var(--border-strong));
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16, 24, 40, .08); }
.tile-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tile-accent, var(--text)); }
.tile-label { color: var(--text-2); }
.tile-expired { --tile-accent: var(--red); }
.tile-warn { --tile-accent: var(--orange); }
.tile-notice { --tile-accent: var(--yellow); }
.tile-ok { --tile-accent: var(--green); }
.tile.is-zero .tile-value { color: var(--text-3); }
@media (max-width: 520px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px 14px; }
  .tile-value { font-size: 24px; }
  .tile-label { font-size: 13px; line-height: 1.3; }
}

/* ---------- Tabele ---------- */

.table-wrap {
  position: relative;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 10px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table th {
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}
.table th a { color: inherit; }
.table th a.is-sorted { color: var(--text); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; }
.table .actions { text-align: right; width: 1%; white-space: nowrap; }
.table .notes { color: var(--text-2); max-width: 260px; }
.table .cell-main { font-weight: 550; min-width: 180px; }
.table .cell-main a { color: var(--text); }
.table .cell-main a:hover { color: var(--primary); }
.table .cell-sub { display: block; color: var(--text-3); font-size: 12.5px; font-weight: 400; }
.time-table .cell-main { min-width: 120px; }

.table tr.state-expired td:first-child { box-shadow: inset 3px 0 var(--red); }
.table tr.state-warn td:first-child { box-shadow: inset 3px 0 var(--orange); }
.table tr.state-notice td:first-child { box-shadow: inset 3px 0 var(--yellow); }
.table tr.state-inactive td { color: var(--text-3); }
.table tr.state-inactive .cell-main a { color: var(--text-3); }

/* Listy na wspólnych stylach rdzenia (assets/core/core.css + core-table.js, od 3.1.0): linie między wierszami
   i kolumnami, naprzemienne tło, jedna linia z wielokropkiem i pełną treścią w podpowiedzi, zmiana szerokości kolumn
   zapamiętana w przeglądarce (data-table-id). Kolory rdzenia z tokenów CRM — działa też w trybie ciemnym. */
:root {
  --core-border: var(--border);
  --core-border-strong: var(--border-strong);
  --core-head-bg: var(--surface-2);
  --core-head-ink: var(--text-2);
  --core-stripe: color-mix(in srgb, var(--surface-2) 75%, var(--surface));
  --core-hover: var(--primary-soft);
  --core-accent: var(--primary);
  --core-danger: var(--red);
  --core-cell-pad-y: 9px;
  --core-cell-pad-x: 10px;
  --core-button-bg: var(--surface);
  --core-button-ink: var(--text);
}
.table-wrap.core-table-wrap { border-radius: var(--radius); }
.table.core-table { border-collapse: separate; border-spacing: 0; }
.table.core-table th, .table.core-table td { vertical-align: middle; }
.table.core-table thead th { border-bottom-width: 1px; }
.table.core-table tbody tr:hover td { background: var(--core-hover); }
.table.core-table tbody tr.is-current td { background: var(--primary-soft); }
.table.core-table.attendance-edit tbody tr.is-weekend td { background: var(--surface-2); }
.core-table .badge { vertical-align: middle; }
/* Komórki z polami formularza i kilkoma liniami (listy problemów) — bez ucinania. */
.table.core-table td.check, .table.core-table td.actions, .table.core-table td:has(input:not([type=checkbox]), select) { overflow: visible; }
.core-table-tools .core-table-reset { color: var(--text-2); }

.days {
  display: inline-block;
  min-width: 3em;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.days-expired { background: var(--red-bg); color: var(--red); }
.days-warn { background: var(--orange-bg); color: var(--orange); }
.days-notice { background: var(--yellow-bg); color: var(--yellow); }
.days-ok { background: var(--green-bg); color: var(--green); }
.days-inactive, .days-none { background: var(--gray-bg); color: var(--gray); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.badge-ok { background: var(--green-bg); color: var(--green); }
.badge-info { background: var(--blue-bg); color: var(--blue); }
.badge-muted { background: var(--gray-bg); color: var(--gray); }

/* Kolory pozycji słowników (np. usług licencji) — paleta DICTIONARY_COLORS w app/dictionaries.php. */
.badge-c-blue { --c: #175cd3; --c-bg: #e8f1fd; }
.badge-c-indigo { --c: #3538cd; --c-bg: #eef0fe; }
.badge-c-purple { --c: #6941c6; --c-bg: #f3eefd; }
.badge-c-pink { --c: #c11574; --c-bg: #fdeef6; }
.badge-c-red { --c: #c4320a; --c-bg: #fdecea; }
.badge-c-orange { --c: #b54708; --c-bg: #fef0e1; }
.badge-c-yellow { --c: #8a6100; --c-bg: #fdf6d8; }
.badge-c-green { --c: #067647; --c-bg: #e5f6ec; }
.badge-c-teal { --c: #107569; --c-bg: #e3f6f3; }
.badge-c-gray { --c: #5b6474; --c-bg: #eef0f3; }
@media (prefers-color-scheme: dark) {
  .badge-c-blue { --c: #84adff; --c-bg: #182a4a; }
  .badge-c-indigo { --c: #a4bcfd; --c-bg: #212449; }
  .badge-c-purple { --c: #c3a6fb; --c-bg: #2c2147; }
  .badge-c-pink { --c: #f69ac9; --c-bg: #3f1a2e; }
  .badge-c-red { --c: #f97066; --c-bg: #3a1d1b; }
  .badge-c-orange { --c: #fdb022; --c-bg: #3a2a12; }
  .badge-c-yellow { --c: #eac54f; --c-bg: #2f2a14; }
  .badge-c-green { --c: #47cd89; --c-bg: #133024; }
  .badge-c-teal { --c: #5fd4c3; --c-bg: #11302d; }
  .badge-c-gray { --c: #a3abba; --c-bg: #252b36; }
}
.badge[class*="badge-c-"] { background: var(--c-bg); color: var(--c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); }
.color-pick { display: inline-flex; align-items: center; gap: 6px; }
.color-pick select { width: auto; min-width: 0; }
.color-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--c-bg, var(--surface)); box-shadow: inset 0 0 0 2px var(--c, var(--border-strong)); }

.result-count { color: var(--text-2); margin: 14px 2px 8px; }

/* Cały wiersz tabeli prowadzi do rekordu (app.js). */
.table tbody tr.is-link { cursor: pointer; }

/* Telefon: wiersze tabel jako karty — etykieta kolumny po lewej, wartość po prawej (etykiety dodaje app.js). */
@media (max-width: 700px) {
  .table.is-stackable, .table.is-stackable tbody, .table.is-stackable tfoot, .table.is-stackable tr { display: block; width: 100%; }
  .table.is-stackable thead { display: none; }
  .table.is-stackable tr { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table.is-stackable tbody tr:last-child { border-bottom: 0; }
  .table.is-stackable td {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 2px 6px;
    min-width: 0;
    max-width: none;
    padding: 3px 0;
    border: 0;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .table.is-stackable td::before {
    content: attr(data-label);
    flex: none;
    max-width: 45%;
    margin-right: auto;
    padding-right: 12px;
    color: var(--text-3);
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
  }
  .table.is-stackable td[data-label=""]::before, .table.is-stackable td.cell-main::before,
  .table.is-stackable td.actions::before, .table.is-stackable td.check::before { content: none; }
  .table.is-stackable td.is-blank { display: none; }
  .table.is-stackable td.cell-main { display: block; min-width: 0; padding: 0 44px 6px 0; font-size: 15px; text-align: left; }
  .table.is-stackable td.notes { flex-direction: column; align-items: flex-start; gap: 0; text-align: left; }
  .table.is-stackable td.actions { justify-content: flex-end; flex-wrap: wrap; width: auto; padding-top: 8px; }
  /* Przycisk akcji w prawym górnym rogu karty (gdy nie zajmuje go pole wyboru). */
  .table.is-stackable tr:not(:has(td.check)) td.actions:not(.is-blank) { position: absolute; top: 8px; right: 10px; padding: 0; }
  .table.is-stackable td.check { position: absolute; top: 12px; right: 14px; width: auto; padding: 0; }
  .table.is-stackable td.check input { width: 22px; height: 22px; }
  .table.is-stackable tbody tr:hover td { background: transparent; }
  .table.is-stackable tr td:first-child { box-shadow: none; }
  .table.is-stackable tr.state-expired { box-shadow: inset 3px 0 var(--red); }
  .table.is-stackable tr.state-warn { box-shadow: inset 3px 0 var(--orange); }
  .table.is-stackable tr.state-notice { box-shadow: inset 3px 0 var(--yellow); }
  .table.is-stackable tr.is-running { box-shadow: inset 3px 0 var(--green); }
  .table.is-stackable tfoot tr { background: var(--surface-2); border-top: 2px solid var(--border); }
  .table.is-stackable tfoot td { border-top: 0; }
  .table.is-stackable .days { min-width: 0; }
  /* Karty zamiast wierszy: bez zapamiętanych szerokości kolumn, wielokropka i linii kolumn rdzenia. */
  .table.core-table.is-stackable { width: 100% !important; table-layout: auto; }
  .table.core-table.is-stackable td { overflow: visible; text-overflow: clip; max-width: none; border-right: 0; }
  .table.core-table.is-stackable tbody tr:nth-child(even) td, .table.core-table.is-stackable tbody tr:hover td { background: transparent; }
  .core-table-tools { display: none; }
}

/* ---------- Przyciski ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--gray-bg); }
.btn-danger { color: var(--red); border-color: var(--red); background: transparent; }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-icon { padding: 5px 7px; }
.btn-block { width: 100%; }

.danger-zone { padding-top: 20px; border-top: 1px dashed var(--border-strong); }

/* ---------- Formularze ---------- */

input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel],
input[type=date], input[type=time], input[type=datetime-local], input[type=file], input[type=number], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
textarea { resize: vertical; }

/* Data i godzina w osobnych polach (np. początek i koniec wpisu czasu pracy). */
.datetime-field > legend, fieldset.field > legend { padding: 0; margin-bottom: 5px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 6px 0; }
.datetime-inputs { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.datetime-inputs input { min-height: 40px; }

/* Lista wyboru z wyszukiwarką (data-combobox w app.js). */
.combobox { position: relative; min-width: 0; }
.combobox input.combobox-input {
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.combobox-list {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0;
  min-width: 220px; max-height: 280px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .14);
}
.combobox-list li { padding: 7px 10px; border-radius: 5px; cursor: pointer; overflow-wrap: anywhere; }
.combobox-list li.is-active { background: var(--primary-soft); color: var(--primary); }
.combobox-list li.is-empty { color: var(--text-2); font-style: italic; }
.combobox-list li.combobox-none { color: var(--text-3); cursor: default; }
.filters .combobox { flex: 0 1 220px; }
.filters .combobox-input { width: 100%; }
@media (max-width: 700px) {
  .filters .combobox { flex: 1 1 calc(50% - 4px); }
}
input:focus, select:focus, textarea:focus, .btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.span-2 { grid-column: span 2; }
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}

.form .field + .field { margin-top: 14px; }
.form-grid .field + .field { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.label { font-weight: 550; }
.label em { color: var(--red); font-style: normal; }
.hint { display: block; color: var(--text-3); font-size: 13px; }
.field-error { color: var(--red); font-size: 13px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.filters select, .filters input { width: auto; }
.filters .filter-search { flex: 1 1 240px; }
.filters select { flex: 0 1 200px; min-width: 0; }
@media (max-width: 700px) {
  .filters .filter-search { flex: 1 1 100%; order: -1; }
  .filters select { flex: 1 1 calc(50% - 4px); }
  .filters .btn { flex: 1 1 auto; }
  .filters .filter-dates { flex: 1 1 100%; }
  .filters .filter-dates input { flex: 1 1 0; min-width: 0; }
}

/* Chipy (szybki wybór wartości) i nawigacja po sekcjach strony. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.anchor-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.anchor-nav a { padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 550; font-size: 13px; }
.anchor-nav a:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
[id] { scroll-margin-top: 110px; }

/* Pasek akcji zbiorczych pod listą — przyklejony u dołu ekranu, gdy lista jest długa. */
.bulk-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 -4px 16px rgba(16, 24, 40, .06);
}
.bulk-bar [data-selected-count] { margin-right: auto; }
.bulk-bar .btn:disabled { opacity: .45; cursor: default; }
/* Telefon: pasek przykleja się dopiero po zaznaczeniu wpisów (nie zasłania listy). */
@media (max-width: 900px) {
  .bulk-bar { position: static; }
  .bulk-bar.has-selection { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); }
  .bulk-bar [data-selected-count] { flex-basis: 100%; }
}
.table-note { margin-top: 8px; }

/* ---------- Komunikaty ---------- */

.alert {
  padding: 12px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-success { background: var(--green-bg); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.alert-error { background: var(--red-bg); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alert-info { background: var(--blue-bg); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.text-danger { color: var(--red); font-weight: 600; }

/* Stopka: wersja aplikacji i autor. */
.app-footer { padding: 0 32px 24px; font-size: 12.5px; color: var(--text-3); }
.app-footer a { color: inherit; text-decoration: underline; }
.auth .app-footer, .legal .app-footer { padding: 16px 0 0; text-align: center; }
@media (max-width: 900px) { .app-footer { padding: 0 16px 20px; } }
.card .alert { margin: 16px 0; }

/* ---------- Ustawienia i elementy formularzy ---------- */

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { background: var(--surface-2); color: var(--text); opacity: 1; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.tabs a {
  padding: 8px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-weight: 550;
  text-decoration: none;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
/* Telefon: zakładki w jednym przewijanym wierszu zamiast kilku linii. */
@media (max-width: 700px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; white-space: nowrap; }
}

.checkbox { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.filters .checkbox { align-items: center; padding: 0 4px; color: var(--text-2); }
.filters .checkbox input { margin: 0; }
.form .checkbox + .field { margin-top: 10px; }
.form-section { margin-top: 24px; }
.form-stack { display: grid; gap: 14px; }

.permission-grid { display: grid; gap: 10px; margin-top: 14px; padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.permission-grid[hidden] { display: none; }
.permission-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }

.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 6px 14px; color: var(--text-2); border-left: 1px solid var(--border); white-space: nowrap; }
.segmented label:first-child span { border-left: 0; }
.segmented input:checked + span { background: var(--primary); color: var(--on-primary); }
.segmented input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -2px; }

.input-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix input { max-width: 120px; }
.input-suffix span { color: var(--text-2); }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 16px; color: var(--text-2); font-size: 13px; }

.code {
  margin: 6px 0 14px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.table tr.is-current td { background: var(--primary-soft); }

/* ---------- Pulpit: swobodna siatka rdzenia (assets/core/core-dashboard.js, od 3.1.0) ---------- */

/* Kafelek: nagłówek i treść przewijana w obrębie wysokości z siatki (wiersze po 80 px). */
.core-dashboard { margin-top: 8px; --core-dashboard-gap: 16px; }
.core-tile.widget { display: flex; flex-direction: column; overflow: hidden; }
.core-tile .widget-head { flex: none; align-items: center; margin-bottom: 8px; padding-right: 4px; }
.core-tile .widget-head h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.core-tile .widget-body { flex: 1; min-height: 0; overflow: auto; padding: 2px; }
.core-tile .tile-value small { font-size: 15px; font-weight: 600; color: var(--text-2); }
/* Liczniki w kafelku: węższe minimum — trzy obok siebie już w kafelku na pół szerokości pulpitu. */
.core-tile .tiles { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
/* Pasek „Dostosuj pulpit / Gotowe / Przywróć układ domyślny” — przyciski ze stylów rdzenia (kolory: --core-button-*). */
.core-dashboard-toolbar { justify-content: flex-end; margin-bottom: 8px; }
.core-dashboard-grid.is-editing { background: repeating-linear-gradient(90deg, var(--primary-soft) 0 calc((100% - 11 * 16px) / 12), transparent 0 calc((100% - 11 * 16px) / 12 + 16px)); border-radius: var(--radius); }
.core-dashboard-grid.is-editing .core-tile { background: var(--surface-2); border-radius: var(--radius); }
/* Wąski ekran (rdzeń: < 768 px) — kafelki jeden pod drugim, wysokość według treści. */
@media (max-width: 767px) {
  .core-tile.widget { overflow: visible; }
  .core-tile .widget-body { overflow: visible; }
}
.btn.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.badge-warn { background: var(--orange-bg); color: var(--orange); }
.badge-danger { background: var(--red-bg); color: var(--red); }

/* ---------- Kalendarz ---------- */

.calendar-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 12px 16px; margin-bottom: 12px; }
.calendar-bar .button-row { align-items: center; }
.calendar-title { font-size: 16px; margin-left: 6px; }
.calendar-filter { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cal-dot.cal-license, .cal-event.cal-license { --cal-color: var(--primary); }
.cal-dot.cal-time, .cal-event.cal-time { --cal-color: #0d9488; }
.cal-event.cal-time { border-left-color: var(--cal-color); }
.cal-event.state-billed { opacity: .55; }
.cal-event.state-running { border-left-color: var(--green); }
.cal-dot { background: var(--cal-color); }

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--border);
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.cal-head { background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; text-transform: uppercase; padding: 8px; text-align: center; }
.cal-day { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.is-weekend { background: var(--surface-2); }
.cal-day.is-other { background: var(--bg); }
.cal-day.is-other .cal-date { color: var(--text-3); }
.cal-date { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.cal-weekday { display: none; }
.cal-day.is-today .cal-date { color: var(--primary); }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-event {
  display: block;
  padding: 3px 6px 3px 8px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--cal-color) 10%, var(--surface));
  border-left: 3px solid var(--cal-color);
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  text-decoration: none !important;
  overflow: hidden;
}
.cal-event:hover { background: color-mix(in srgb, var(--cal-color) 18%, var(--surface)); }
.cal-event.state-expired { border-left-color: var(--red); }
.cal-event.state-warn { border-left-color: var(--orange); }
.cal-event.state-notice { border-left-color: var(--yellow); }
.cal-client, .cal-label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-client { font-weight: 600; }
.cal-label { color: var(--text-2); }

/* Na telefonie: lista dni z terminami zamiast siatki. */
@media (max-width: 760px) {
  .calendar { grid-template-columns: 1fr; }
  .cal-head, .cal-day.is-empty, .cal-day.is-other.is-empty { display: none; }
  .cal-day { min-height: 0; padding: 10px 12px; }
  .cal-weekday { display: inline; text-transform: capitalize; }
}

/* ---------- Słowniki ---------- */

.dictionary .hint { margin-bottom: 12px; }
.dict-list { display: grid; gap: 6px; }
.dict-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; }
.dict-row .dict-name { flex: 1 1 160px; width: auto; }
.dict-row .dict-months { width: 84px; flex: none; }
.dict-row .dict-amount { flex: none; }
.dict-row .dict-amount input { width: 100px; }
.dict-usage { font-size: 12px; min-width: 64px; }
.dict-actions { display: inline-flex; gap: 4px; margin-left: auto; }
.dict-actions .btn:disabled { opacity: .35; cursor: default; }
.dict-add { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }

/* ---------- Pliki ---------- */

.attachments { padding: 8px 20px 16px; }
.file-list { list-style: none; margin: 0 0 8px; padding: 0; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
/* ---------- Czas pracy ---------- */
.timer-panel { display: grid; grid-template-columns: auto 1fr auto; gap: 12px 20px; align-items: end; }
.timer-panel.is-running { border-color: color-mix(in srgb, var(--green) 45%, var(--border)); box-shadow: inset 4px 0 var(--green); }
.timer-clock { display: flex; flex-direction: column; min-width: 130px; }
.timer-label { font-size: 12.5px; color: var(--text-2); }
.timer-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.timer-value.is-idle { color: var(--text-3); }
.timer-panel.is-running .timer-value { color: var(--green); }
.timer-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; }
.timer-fields .field { margin: 0; }
.timer-actions { flex-wrap: nowrap; }
.timer-panel.is-compact { grid-template-columns: 1fr; }
.timer-panel.is-compact .timer-fields { grid-template-columns: 1fr 1fr; }
.timer-panel.is-compact .timer-description { grid-column: span 2; }
.timer-panel.is-compact .timer-start { grid-column: span 2; }
@media (max-width: 1100px) {
  .timer-panel { grid-template-columns: 1fr; }
  .timer-fields { grid-template-columns: 1fr 1fr; }
  .timer-description { grid-column: span 2; }
}
@media (max-width: 560px) {
  .timer-fields, .timer-panel.is-compact .timer-fields { grid-template-columns: 1fr; }
  .timer-description, .timer-panel.is-compact .timer-description, .timer-panel.is-compact .timer-start { grid-column: auto; }
}
.timer-pill { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 4px 4px 10px; border: 1px solid color-mix(in srgb, var(--green) 45%, var(--border));
  border-radius: 999px; background: var(--green-bg); }
.timer-pill a { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: none; }
.timer-pill-client { font-weight: 500; color: var(--text-2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time-table tr.is-running td:first-child { box-shadow: inset 3px 0 var(--green); }
.table td.check, .table th.check { width: 32px; }
.table tfoot td { border-top: 2px solid var(--border); }
.filter-dates { display: inline-flex; gap: 8px; }
.filter-dates[hidden] { display: none; }
.billing-details summary { cursor: pointer; }
.billing-details .table-wrap { margin-top: 12px; }

.device-list { list-style: none; margin: 0 0 8px; padding: 0; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.device-row form { margin: 0; flex: none; }
.file-ext {
  flex: none;
  width: 44px;
  padding: 4px 0;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
}
.file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-main a { font-weight: 550; overflow-wrap: anywhere; }
.file-main .muted { font-size: 12.5px; }
.file-source { font-size: 13px; overflow-wrap: anywhere; }
.file-source a { font-weight: 400; }
.file-actions { display: inline-flex; gap: 4px; flex: none; }
.file-actions form { margin: 0; }
.attachments > .muted { margin: 12px 0; }
.file-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 12px; }
.file-upload input[type=file] { flex: 1 1 260px; width: auto; }
.file-upload .hint { flex-basis: 100%; }

/* ---------- 2FA ---------- */

.qr { display: flex; justify-content: center; margin: 12px 0; }
.qr svg { width: 220px; height: 220px; max-width: 100%; border-radius: 8px; }
.secret-key code, .recovery-codes code {
  font: 600 15px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .04em;
}
.secret-key { text-align: center; padding: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.code-input { font: 600 20px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .15em; text-align: center; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin: 16px 0; padding-left: 24px; }
.inline-form { max-width: 480px; }
.section-first { margin-top: 8px; }

/* ---------- Logowanie ---------- */

body.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.auth-box { width: 100%; max-width: 400px; }
.brand-auth { color: var(--text); justify-content: center; padding-bottom: 18px; }
.auth-card h1 { font-size: 20px; margin-bottom: 16px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn { margin-top: 6px; }

/* ---------- Dokumenty prawne (strony publiczne) ---------- */
.legal-page { background: var(--bg); }
.legal { max-width: 900px; margin: 0 auto; padding: 24px 16px 48px; }
.legal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
.legal-head .brand { color: var(--text); }
.legal-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.legal-nav a[aria-current] { font-weight: 600; text-decoration: underline; }
/* Nagłówek grupy (CRM / HRM / wspólne) — zaczyna nowy wiersz nawigacji. */
.legal-nav-group { flex-basis: 100%; margin-top: 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.legal-body { padding: 24px 28px; line-height: 1.6; }
.legal-body h1 { font-size: 24px; margin: 0 0 12px; }
.legal-body h2 { font-size: 18px; margin: 28px 0 8px; }
.legal-body h3 { font-size: 16px; margin: 20px 0 6px; }
.legal-body ol, .legal-body ul { padding-left: 24px; }
.legal-body li { margin-bottom: 4px; }
.legal-body blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.legal-body .table-wrap { margin: 12px 0; }
.legal-meta { margin-top: 32px; font-size: 13px; }
@media (max-width: 520px) { .legal-body { padding: 16px; } }

/* ---------- Lista obecności ---------- */
.attendance-edit .attendance-input { width: 96px; text-align: right; }
.attendance-edit .attendance-input.is-invalid, .attendance-edit .has-error .attendance-input { border-color: var(--red); }
.attendance-edit tr.is-weekend td { background: var(--surface-2); }
.attendance-edit tr.is-weekend td:nth-child(2) { color: var(--text-3); }

/* Ostateczna lista do druku / PDF: kartka A4, zawsze czarno na białym (niezależnie od motywu). */
.print-page { background: var(--bg); padding: 16px; }
.print-toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 auto 16px; max-width: 210mm; }
.print-toolbar .inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.attendance-sheet {
  max-width: 210mm; margin: 0 auto; padding: 18mm 16mm; background: #fff; color: #111;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .15); font-size: 13px; line-height: 1.4;
}
.attendance-sheet h1 { margin: 0; font-size: 22px; text-align: center; letter-spacing: .02em; }
.attendance-month { margin: 4px 0 18px; text-align: center; font-size: 15px; text-transform: capitalize; }
.attendance-parties { display: grid; gap: 6px; margin: 0 0 16px; }
.attendance-parties div { display: grid; grid-template-columns: 130px 1fr; gap: 8px; }
.attendance-parties dt { color: #555; }
.attendance-parties dd { margin: 0; font-weight: 600; border-bottom: 1px dotted #999; }
.attendance-table { width: 100%; border-collapse: collapse; }
.attendance-table th, .attendance-table td { border: 1px solid #444; padding: 3px 8px; text-align: left; }
.attendance-table th { background: #eee; font-weight: 600; }
.attendance-table .num { text-align: right; }
.attendance-table tr.is-weekend td { background: #f3f3f3; color: #555; }
.attendance-table tfoot td { font-weight: 700; background: #eee; }
.attendance-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; }
.attendance-signatures div { border-top: 1px dotted #444; padding-top: 4px; text-align: center; font-size: 11px; color: #555; }
@media (max-width: 700px) { .attendance-sheet { padding: 16px; } .attendance-parties div { grid-template-columns: 1fr; gap: 0; } }
@media print {
  @page { size: A4; margin: 12mm; }
  .print-page { background: #fff; padding: 0; }
  .print-toolbar { display: none; }
  .attendance-sheet { max-width: none; padding: 0; box-shadow: none; }
  .attendance-table th, .attendance-table tfoot td, .attendance-table tr.is-weekend td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* Wybór systemu przy dodawaniu instalacji (HRM, Globmetal…). */
/* Kafelki w jednym rzędzie mają równą wysokość (siatka rozciąga je do najwyższego), przycisk zawsze na dole. Długie nazwy
   systemów (np. „Wycieczki - wycieczkazprzewodnikiem.pl”) zawijają się w obrysie kafelka — także w przycisku. */
.product-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; align-items: stretch; }
.product-option { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.product-option:hover { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.product-option .card-title, .product-option p { white-space: normal; overflow-wrap: anywhere; }
.product-option p { margin: 0; }
.product-option .btn { width: 100%; margin-top: auto; white-space: normal; overflow-wrap: anywhere; text-align: center; }
.product-option .btn .icon { flex: none; }
