/* ============================================================
   PEP Web — elementy specyficzne (na tokenach WycenaWeb)
   ============================================================ */

/* ---------- Pasek: znak marki bez logotypu klienta ---------- */
.brand__mark .icon { color: #fff; }
.brand__sub { font-size: var(--fs-11); color: var(--c-text-muted); font-weight: var(--fw-medium);
  letter-spacing: .04em; text-transform: uppercase; margin-left: var(--s-1); }
.toolbar__user { font-size: var(--fs-12); color: var(--c-text-muted); white-space: nowrap; }
.toolbar__mode { font-family: var(--font-mono); font-size: 11px; }

/* ---------- Nagłówek projektu + zakładki ---------- */
.project-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4);
  flex-wrap: wrap; margin-bottom: var(--s-4); }
.project-head__crumbs { font-size: var(--fs-12); color: var(--c-text-muted); margin-bottom: var(--s-1); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--c-surface-3); margin-bottom: var(--s-5);
  overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--c-text-muted);
  font-weight: var(--fw-medium); font-size: var(--fs-13); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--c-text); }
.tabs a.is-active { color: var(--c-text); border-bottom-color: var(--c-text-link); }
.tabs .pill { padding: 0 7px; font-size: 11px; }

/* ---------- Statusy ---------- */
.pep { font-weight: var(--fw-semibold); }
.pep--TAK { color: var(--c-red-500); }
.pep--NIEPEWNE { color: var(--c-amber-500); }
.pep--NIE { color: var(--c-emerald-500); }
.pill--muted { color: var(--c-text-muted); }
.pill--tier-T1 { background: var(--c-tint-emerald); border-color: rgba(87,171,90,.35); color: var(--c-emerald-500); }
.pill--tier-T2 { background: var(--c-tint-blue); border-color: rgba(83,155,245,.35); color: var(--c-text-link-2); }
.pill--tier-T3 { background: var(--c-tint-purple); border-color: rgba(152,110,226,.35); color: var(--c-purple-500); }
.pill--tier-T4 { color: var(--c-text-muted); }
.attr--MATCH { color: var(--c-emerald-500); font-weight: var(--fw-semibold); }
.attr--MISMATCH { color: var(--c-red-500); font-weight: var(--fw-semibold); }
.attr--UNKNOWN { color: var(--c-text-subtle); }

/* ---------- Karty statystyk ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-3); }
.stat { background: var(--c-surface-1); border: 1px solid var(--c-surface-3); border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4); }
.stat__label { font-size: var(--fs-11); color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .05em;
  font-weight: var(--fw-semibold); }
.stat__value { font-size: var(--fs-24); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.stat--warn .stat__value { color: var(--c-amber-500); }
.stat--danger .stat__value { color: var(--c-red-500); }
.stat--ok .stat__value { color: var(--c-emerald-500); }
.progress { height: 8px; background: var(--c-surface-3); border-radius: 4px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad-primary); border-radius: 4px;
  transition: width var(--dur-base) var(--ease-out); }
.progress > span.is-indet { width: 30% !important; animation: pepindet 1.2s ease-in-out infinite; }
@keyframes pepindet { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }

/* ---------- Kroki projektu ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.steps li { display: grid; grid-template-columns: 28px 1fr auto; gap: var(--s-3); align-items: center;
  padding: var(--s-3); border: 1px solid var(--c-surface-3); border-radius: var(--r-md); background: var(--c-surface-1); }
.steps__n { width: 28px; height: 28px; border-radius: 14px; display: inline-flex; align-items: center;
  justify-content: center; font-family: var(--font-mono); font-size: 12px; background: var(--c-surface-2);
  color: var(--c-text-muted); font-weight: var(--fw-semibold); }
.steps li.is-done .steps__n { background: var(--c-tint-emerald); color: var(--c-emerald-500); }
.steps li.is-todo .steps__n { background: var(--c-tint-amber); color: var(--c-amber-500); }
.steps__title { font-weight: var(--fw-semibold); }
.steps__desc { font-size: var(--fs-12); color: var(--c-text-muted); }

/* ---------- Rekord: sekcje, dowody ---------- */
.rec-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--s-4); }
@media (max-width: 1023px) { .rec-grid { grid-template-columns: minmax(0, 1fr); } }
.item { border: 1px solid var(--c-surface-3); border-radius: var(--r-lg); background: var(--c-surface-1);
  padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); }
.item + .item { margin-top: var(--s-3); }
.item__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.item__title { font-weight: var(--fw-semibold); font-size: var(--fs-14); }
.item__meta { font-size: var(--fs-12); color: var(--c-text-muted); }
.item--main { border-color: var(--c-blue-500); box-shadow: inset 3px 0 0 var(--c-blue-500); }
.evidence { border-left: 3px solid var(--c-surface-3); padding: var(--s-2) var(--s-3); background: var(--c-surface-0);
  border-radius: 0 var(--r-md) var(--r-md) 0; display: flex; flex-direction: column; gap: var(--s-1); }
.evidence--ok { border-left-color: var(--c-emerald-500); }
.evidence--bad { border-left-color: var(--c-red-500); }
.evidence__quote { font-style: italic; }
.evidence__meta { font-size: var(--fs-11); color: var(--c-text-muted); word-break: break-all; }
.snippet { font-size: var(--fs-12); line-height: 1.6; white-space: pre-wrap; background: var(--c-surface-1);
  border: 1px solid var(--c-surface-3); border-radius: var(--r-md); padding: var(--s-3); max-height: 320px; overflow: auto; }
.snippet mark { background: rgba(198,144,38,.35); color: inherit; padding: 0 2px; border-radius: 2px; }
details.more > summary { cursor: pointer; color: var(--c-text-link); font-size: var(--fs-12); }
.form-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; }
.form-row > .field { flex: 1 1 160px; min-width: 120px; }
.form-row > .field--wide { flex: 3 1 280px; }
.form-row > .field--narrow { flex: 0 1 110px; }
select.input { appearance: auto; }
textarea.input { height: auto; min-height: 90px; padding: var(--s-2) var(--s-3); font-family: var(--font-mono);
  font-size: var(--fs-12); line-height: 1.5; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-1); }
.checklist li { display: flex; gap: var(--s-2); align-items: baseline; }
.ck--ok { color: var(--c-emerald-500); } .ck--bad { color: var(--c-red-500); } .ck--unk { color: var(--c-amber-500); }
.history { font-size: var(--fs-12); color: var(--c-text-muted); margin: 0; padding-left: var(--s-4); }

/* ---------- Kolejka ---------- */
.filters { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; margin-bottom: var(--s-4); }
.filters .field { min-width: 150px; }
.table td.wrap { white-space: normal; max-width: 360px; }
.table tr.row-link:hover td { background: var(--c-surface-2); cursor: pointer; }
.table td .pill { white-space: nowrap; }
.pager { display: flex; gap: var(--s-2); align-items: center; margin-top: var(--s-3); }

/* ---------- Panel zadania ---------- */
.job { border: 1px solid var(--c-blue-500); background: var(--c-panel-accent); border-radius: var(--r-lg);
  padding: var(--s-4); display: grid; gap: var(--s-2); margin-bottom: var(--s-5); }
.job__row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.job pre { margin: 0; max-height: 180px; overflow: auto; font-size: var(--fs-11); white-space: pre-wrap;
  color: var(--c-text-muted); }

/* ---------- Kody zapasowe / QR ---------- */
.qr { background: #fff; border-radius: var(--r-md); padding: var(--s-2); display: block; width: max-content; margin: 0 auto; }
.qr svg { display: block; width: 200px; height: 200px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2); list-style: none; padding: 0; margin: 0;
  font-family: var(--font-mono); }
.codes li { background: var(--c-surface-0); border: 1px solid var(--c-surface-3); border-radius: var(--r-sm);
  padding: var(--s-2); text-align: center; }

/* ---------- Ostrzeżenie o danych fikcyjnych / trybie ---------- */
.banner { padding: 6px var(--s-4); font-size: var(--fs-12); text-align: center; background: var(--c-tint-amber);
  color: var(--c-amber-500); border-bottom: 1px solid var(--c-surface-3); }

/* ---------- Odstęp sekcji pod siatką rekordu ---------- */
/* .section:first-of-type (components.css) gubi odstęp, gdy sekcję poprzedza siatka, formularz albo karta */
.rec-grid + .section, form + .section, .card + .section, .stat-grid + .section {
  margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--c-surface-2); }

/* ---------- Telefon: pasek zawija się, bez szerokości ponad ekran ---------- */
@media (max-width: 767px) {
  .toolbar { height: auto; min-height: var(--layout-toolbar-h); flex-wrap: wrap; row-gap: var(--s-2);
    padding-top: var(--s-2); padding-bottom: var(--s-2); }
  .toolbar .spacer { display: none; }
  .toolbar__user, .font-controls { display: none; }
  .brand__name { font-size: var(--fs-14); }
  .toolbar__nav { order: 10; flex-basis: 100%; margin-left: 0; }
  .kv { grid-template-columns: 1fr; gap: 2px var(--s-3); }
  .kv dd { margin-bottom: var(--s-2); }
  .project-head { align-items: flex-start; }
}

/* długie ścieżki i identyfikatory w listach klucz–wartość nie rozpychają kart na telefonie */
.kv dd { overflow-wrap: anywhere; min-width: 0; }
