/* Labrix24 — motyw: bordo #A30026, tlo laboratoryjne (tlo.png) */
:root {
  --acc: #A30026;
  --acc-d: #7d001d;
  --acc-l: #faeef1;
  --ink: #222;
  --line: #e8e2e4;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, Arial, sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  /* wzor laboratoryjny lekko przeswituje pod biala mgielka */
  background:
    linear-gradient(rgba(255,255,255,.62), rgba(255,255,255,.62)),
    url('tlo.webp') repeat;
  background-size: auto, 1024px 1024px;
  min-height: 100vh;
}

/* ---------- gorny pasek ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, var(--acc), var(--acc-d));
  color: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 18px; min-height: 52px;
}
.brand {
  color: #fff; text-decoration: none; font-weight: 700; font-size: 19px;
  letter-spacing: .5px;
}
.mainnav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.mainnav a {
  color: #fff; text-decoration: none; padding: 14px 14px;
  opacity: .85; border-bottom: 3px solid transparent; white-space: nowrap;
}
.mainnav a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.mainnav a.active { opacity: 1; border-bottom-color: #fff; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.sync-badge {
  font-size: 12px; background: rgba(255,255,255,.15);
  padding: 4px 10px; border-radius: 20px; white-space: nowrap;
}
.sync-badge.on { background: #1f7a54; cursor: pointer; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; color: var(--acc-d); font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.logout { color: #fff; opacity: .8; font-size: 13px; }

/* ---------- uklad ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
.foot { text-align: center; color: #999; font-size: 12px; padding: 20px; }
h1 { font-size: 24px; margin: 8px 0 16px; color: var(--acc-d); }
h2 { font-size: 16px; margin: 0 0 12px; color: var(--acc-d); }
.muted { color: #888; font-weight: 400; font-size: .9em; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }

.card {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin: 0 0 16px;
  box-shadow: 0 3px 12px rgba(30,40,45,.06);
}

.page-head { display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- kafelki pulpitu ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-bottom: 18px; }
@media (max-width: 700px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile {
  background: rgba(255,255,255,.92); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; text-align: center;
  box-shadow: 0 3px 12px rgba(30,40,45,.06);
}
.tile-num { font-size: 28px; font-weight: 700; color: var(--acc); }
.tile-label { color: #777; font-size: 13px; }

/* ---------- tabele ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  background: var(--acc); color: #fff; text-align: left;
  padding: 8px 10px; font-weight: 600; position: sticky; top: 52px;
}
.tbl td { padding: 8px 10px; border-bottom: 1px solid #f0eaec; vertical-align: top; }
.tbl tr:hover td { background: var(--acc-l); }
.tbl .r, .r { text-align: right; white-space: nowrap; }
.tbl a { color: var(--acc-d); font-weight: 600; text-decoration: none; }
.tbl a:hover { text-decoration: underline; }
.tbl-scroll { overflow-x: auto; }
/* w przewijanym kontenerze sticky-naglowek nachodzi na wiersze — wylaczamy */
.tbl-scroll .tbl th { position: static; }
tr.inactive td { opacity: .45; text-decoration: line-through; }

.pill {
  display: inline-block; color: #fff; border-radius: 20px;
  padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* ---------- przyciski i formularze ---------- */
.btn {
  background: var(--acc); color: #fff; border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 14px; cursor: pointer; text-decoration: none;
  display: inline-block;
}
.btn:hover { background: var(--acc-d); }
.btn.ghost { background: #fff; color: var(--acc-d); border: 1px solid var(--acc); }
.btn.ghost:hover { background: var(--acc-l); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.danger { background: #b3261e; }

.searchbar { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.searchbar input {
  flex: 1; min-width: 200px; padding: 10px 12px; font-size: 15px;
  border: 1px solid #ccc; border-radius: 8px; background: rgba(255,255,255,.95);
}
.searchbar input.short { flex: 0 0 110px; min-width: 110px; }
.searchbar .chk { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.searchbar .chk input { width: 18px; height: 18px; accent-color: var(--acc); }

.grid-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-top: 10px; }
@media (max-width: 700px) { .grid-form { grid-template-columns: 1fr; } }
.grid-form input, .grid-form select {
  padding: 9px 11px; border: 1px solid #ccc; border-radius: 8px; font-size: 14px;
}

.alert {
  background: #fff2f3; border-left: 4px solid var(--acc);
  border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px;
}
.alert.ok { background: #eef8f1; border-left-color: #1f7a54; }

.pager { display: flex; gap: 6px; padding: 12px 0 2px; align-items: center;
  flex-wrap: wrap; }
.pager a {
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 6px;
  text-decoration: none; color: var(--acc-d); background: #fff;
}
.pager a.cur { background: var(--acc); color: #fff; border-color: var(--acc); }
.pager a.dis { color: #bbb; pointer-events: none; }

/* ---------- pasek etapow deala ---------- */
.stagebar { display: flex; gap: 3px; margin: 0 0 16px; flex-wrap: wrap; }
.stage {
  border: none; cursor: pointer; font-size: 12.5px; padding: 8px 12px 8px 18px;
  background: #eee; color: #666; position: relative;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
}
.stage:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); padding-left: 12px; }
.stage.done { background: var(--acc-l); color: var(--acc-d); }
.stage.cur { background: var(--acc); color: #fff; font-weight: 700; }
.stage:hover { background: var(--acc-d); color: #fff; }

/* ---------- lista towarow (mobile-first karty) ---------- */
.prod-list { display: grid; gap: 10px; }
.prod {
  background: rgba(255,255,255,.94); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(30,40,45,.05);
}
.prod-name { font-weight: 600; margin-bottom: 4px; }
.prod-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px;
  color: #666; margin-bottom: 6px; }
.prod-kod { font-family: Consolas, monospace; color: var(--acc-d); }
.prod-nums { display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; }
.stan { font-size: 13px; padding: 3px 10px; border-radius: 14px; }
.stan.ok { background: #eef8f1; color: #1f7a54; font-weight: 600; }
.stan.zero { background: #f4f4f4; color: #999; }
.cena { font-weight: 700; color: var(--acc-d); }

/* ---------- logowanie (obraz bannera losowany w login.php) ---------- */
.login-body {
  display: flex; align-items: center; justify-content: flex-start;
  min-height: 100vh; margin: 0; padding-left: 8vw;
  background-color: #fdf7f8;
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  font-family: 'Segoe UI', system-ui, Arial, sans-serif;
}
@media (max-width: 900px) {
  .login-body { justify-content: center; padding-left: 0;
    background-position: center; }
}

/* ---------- pasek z banerem (pulpit) ---------- */
.banner-strip {
  border-radius: 12px; margin: 0 0 18px; min-height: 130px;
  background-size: cover; background-position: right center;
  border: 1px solid var(--line);
  display: flex; align-items: center; padding: 18px 24px;
  box-shadow: 0 3px 12px rgba(30,40,45,.06);
}
.banner-strip h1 { margin: 0; text-shadow: 0 1px 0 #fff; }
.login-card {
  background: #fff; border-radius: 14px; padding: 34px 38px; width: 360px;
  box-shadow: 0 10px 40px rgba(0,0,0,.16);
}
.login-card h1 { color: var(--acc); font-size: 24px; margin: 0 0 14px; }
.login-card label { font-size: 12px; color: #555; display: block; margin-top: 12px; }
.login-card input {
  width: 100%; padding: 11px 12px; margin-top: 4px;
  border: 1px solid #bbb; border-radius: 8px; font-size: 15px;
}
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 42px; }
.pwd-wrap .eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  margin-top: 2px; width: 32px; height: 32px; padding: 0;
  background: none; border: none; cursor: pointer; font-size: 17px;
  line-height: 1; opacity: .55;
}
.pwd-wrap .eye:hover { opacity: 1; }

.login-card button {
  width: 100%; margin-top: 20px; padding: 12px; background: var(--acc);
  color: #fff; border: none; border-radius: 8px; font-size: 15px;
  font-weight: 600; cursor: pointer;
}
.login-card button:hover { background: var(--acc-d); }

/* ---------- zakladki lejkow (CRM) ---------- */
.lejki { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.lejek {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 22px; text-decoration: none;
  background: rgba(255,255,255,.92); color: var(--ink);
  border: 1px solid var(--line); font-size: 14px;
}
.lejek:hover { border-color: var(--acc); }
.lejek.cur { background: var(--acc); color: #fff; border-color: var(--acc);
  font-weight: 600; }
.lejek .ldot { width: 10px; height: 10px; border-radius: 50%;
  background: var(--lc, #999); }
.lejek.cur .ldot { outline: 2px solid rgba(255,255,255,.6); }
.lejek .lcnt {
  background: rgba(0,0,0,.08); border-radius: 12px; padding: 1px 8px;
  font-size: 12px;
}
.lejek.cur .lcnt { background: rgba(255,255,255,.25); }
a.plain { color: var(--ink); text-decoration: none; }
a.plain:hover { color: var(--acc-d); }

/* ---------- panel wysuwany (drawer, ~40% ekranu) ---------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 90;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 95;
  width: 40%; min-width: 340px; max-width: 560px;
  background: #fff; box-shadow: -8px 0 30px rgba(0,0,0,.2);
  transform: translateX(105%); transition: transform .25s ease;
  overflow-y: auto; padding: 18px 22px;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center;
  border-bottom: 2px solid var(--acc-l); padding-bottom: 8px; margin-bottom: 8px; }
.drawer-close {
  background: none; border: none; font-size: 26px; cursor: pointer;
  color: #999; line-height: 1; padding: 4px 8px;
}
.drawer-close:hover { color: var(--acc); }
.drawer-form label { display: block; font-size: 12px; color: #555; margin-top: 10px; }
.drawer-form input, .drawer-form select {
  width: 100%; padding: 9px 11px; border: 1px solid #ccc; border-radius: 8px;
  font-size: 14px; margin-top: 3px;
}
.drawer-form .chk { display: flex; align-items: center; gap: 8px; font-size: 14px;
  color: var(--ink); }
.drawer-form .chk input { width: 18px; height: 18px; accent-color: var(--acc); }
@media (max-width: 700px) { .drawer { width: 100%; max-width: none; min-width: 0; } }

/* ---------- widoki CRM: przelacznik, kanban, kalendarz ---------- */
.widoki { display: inline-flex; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; background: #fff; }
.widoki a { padding: 8px 13px; text-decoration: none; color: var(--ink);
  font-size: 13px; border-right: 1px solid var(--line); }
.widoki a:last-child { border-right: none; }
.widoki a.cur { background: var(--acc); color: #fff; font-weight: 600; }

.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px;
  align-items: flex-start; }
.kan-col { flex: 0 0 240px; background: rgba(246,242,243,.9);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-height: 120px; }
.kan-col.today { outline: 2px solid var(--acc); }
.kan-col.late-col { background: #fdf0f1; }
.kan-head { font-weight: 600; font-size: 13px; color: var(--acc-d);
  padding: 4px 6px 8px; display: flex; justify-content: space-between;
  align-items: center; gap: 6px; }
.kan-card { display: block; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; text-decoration: none;
  color: var(--ink); font-size: 13px; box-shadow: 0 1px 4px rgba(30,40,45,.06); }
.kan-card:hover { border-color: var(--acc); }
.kan-card.late { border-left: 3px solid var(--acc); }
.kan-nazwa { margin: 4px 0 2px; font-weight: 600; }
.kan-data { font-size: 12px; color: #a06; }

.kal-wrap { position: relative; }
.kal-strzalka {
  position: absolute; top: 0; bottom: 14px; right: -6px; width: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; text-decoration: none; color: var(--acc-d);
  background: linear-gradient(270deg, rgba(255,255,255,.9), rgba(255,255,255,0));
  opacity: .35; transition: opacity .2s; border-radius: 8px;
}
.kal-strzalka.left { right: auto; left: -6px;
  background: linear-gradient(90deg, rgba(255,255,255,.9), rgba(255,255,255,0)); }
.kal-strzalka:hover { opacity: 1; }

.avatar.small { width: 26px; height: 26px; font-size: 11px;
  background: var(--acc-l); color: var(--acc-d); }

/* ---------- nowy deal: podpowiedzi, wybor ---------- */
.suggest { border-radius: 8px; margin-top: 4px; }
.suggest-item { padding: 9px 12px; border: 1px solid var(--line);
  border-top: none; cursor: pointer; background: #fff; }
.suggest-item:first-child { border-top: 1px solid var(--line);
  border-radius: 8px 8px 0 0; }
.suggest-item:last-child { border-radius: 0 0 8px 8px; }
.suggest-item:hover { background: var(--acc-l); }
.picked { background: #eef8f1; border: 1px solid #bfe3cd; border-radius: 8px;
  padding: 10px 14px; display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; }
.osoba-radio { display: block; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; margin: 6px 0; cursor: pointer; background: #fff; }
.osoba-radio:hover { border-color: var(--acc); }
.osoba-radio input { accent-color: var(--acc); margin-right: 6px; }
.lejek.radio { cursor: pointer; }
.lejek.radio input { display: none; }
.lejek.radio:has(input:checked) { background: var(--acc); color: #fff;
  border-color: var(--acc); font-weight: 600; }

/* ---------- karta deala: kontenery, dzialania, wpisy ---------- */
.kont-lista { display: flex; gap: 8px; flex-wrap: wrap; }
.kont-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 8px 12px; cursor: pointer; font-size: 13px; display: inline-flex;
  align-items: center; gap: 7px; }
.kont-btn:hover { border-color: var(--acc); }
.kont-btn.cur { border-color: var(--acc); background: var(--acc-l);
  font-weight: 600; }
.dzialanie { display: flex; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  margin-bottom: 8px; background: #fff; flex-wrap: wrap; }
.dzialanie.late { border-left: 4px solid var(--acc); background: #fdf4f5; }
.dzialanie.done { opacity: .55; }
.dz-termin { color: #a06; font-size: 13px; margin-left: 8px; }
.dz-akcje { display: flex; gap: 8px; align-items: center; }
.dz-akcje select { padding: 6px 8px; border: 1px solid #ccc; border-radius: 7px;
  font-size: 13px; }
.wpis { border-bottom: 1px solid #f0eaec; padding: 8px 0; font-size: 14px; }
.wpis-tresc { white-space: pre-wrap; max-height: 340px; overflow-y: auto;
  background: #fafafa; border-radius: 6px; padding: 6px 8px; }

/* ---------- konfiguracja: sekcje zwijane + auto-zapis ---------- */
.konf-sec { background: rgba(255,255,255,.92); border: 1px solid var(--line);
  border-radius: 12px; margin: 0 0 12px; box-shadow: 0 3px 12px rgba(30,40,45,.06); }
.konf-sec summary { cursor: pointer; padding: 14px 18px; font-weight: 600;
  color: var(--acc-d); font-size: 16px; list-style: none; position: relative; }
.konf-sec summary::before { content: '▸'; margin-right: 10px;
  display: inline-block; transition: transform .15s; }
.konf-sec[open] summary::before { transform: rotate(90deg); }
.konf-sec summary::-webkit-details-marker { display: none; }
.konf-body { padding: 0 18px 16px; }
.savedot { display: inline-block; min-width: 20px; text-align: center;
  font-size: 14px; color: #1f7a54; }
.savedot.saving { color: #d99a00; animation: pulsuj 1s infinite; }
.savedot.saved { color: #1f7a54; }
.savedot.error { color: #b3261e; }
@keyframes pulsuj { 50% { opacity: .3; } }

/* ---------- poczta ---------- */
.mail-tresc { background: #fafafa; border: 1px solid #eee; border-radius: 8px;
  padding: 12px 14px; margin-top: 10px; font-size: 14px; max-height: 480px;
  overflow-y: auto; white-space: pre-wrap; }
.mail-frame { width: 100%; height: 55vh; border: 1px solid #eee;
  border-radius: 8px; background: #fff; margin-top: 10px; }
tr.mail-nowy td { font-weight: 700; }
.wpis-temat { color: var(--acc-d); }
.wpis-meta { font-size: 12px; }
.wpis .btn { margin-top: 6px; }

/* ---------- karta deala: kontenery z lista, braki, pasek daty ---------- */
/* szerokie kontenery — jak kafelek Kontrahenta (2 kolumny, na mobile 1) */
.kont-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 800px) { .kont-grid { grid-template-columns: 1fr; } }
.tnr { display: inline-block; background: var(--acc); color: #fff;
  border-radius: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 6px;
  margin-right: 5px; }
.wpis-grupa-nr { font-weight: 700; color: var(--acc-d); font-size: 13px;
  padding: 2px 0 4px; border-bottom: 1px solid var(--acc-l); }
/* temat w szufladzie kontenera: przeniesienie do innego kontenera / usuniecie */
.temat-narz { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0 2px; }
.temat-narz .btn.small { padding: 3px 9px; font-size: 12px; }
.temat-narz .temat-usun { color: #b3261e; border-color: #e6c3c0; }
.temat-narz .temat-usun:hover { background: #fbeceb; }
.temat-cel { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; width: 100%; }
.temat-cel[hidden] { display: none; }
.temat-cel select { flex: 1; min-width: 180px; padding: 5px 8px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 13px; background: #fff; }
.dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }
/* lista deali: dymek +3/+7/+14/+30 dni po najechaniu na date */
.data-hover { position: relative; display: inline-block; cursor: pointer;
  padding: 2px 4px; border-radius: 6px; }
.data-hover:hover { background: var(--acc-l); }
.data-plus { display: none; position: absolute; left: 0; top: 100%; z-index: 20;
  background: #fff; border: 1px solid var(--acc); border-radius: 8px;
  padding: 6px 8px; box-shadow: 0 6px 18px rgba(0,0,0,.14); white-space: nowrap;
  align-items: center; gap: 4px; margin-top: 2px; }
.data-hover:hover .data-plus, .data-hover.open .data-plus { display: inline-flex; }
.data-plus button { border: 1px solid var(--acc); background: #fff; color: var(--acc-d);
  border-radius: 6px; padding: 4px 9px; font-size: 13px; font-weight: 700;
  cursor: pointer; }
.data-plus button:hover { background: var(--acc); color: #fff; }
.data-po { color: #b3261e; font-weight: 700; }
.data-dzis { color: #b58900; font-weight: 700; }
.data-po .dot, .data-dzis .dot { width: 10px; height: 10px; vertical-align: middle; }
.dot.czerwona { background: #d21f1f; animation: pulsuj .9s infinite; }
.dot.zolta { background: #e5b400; animation: pulsuj 1.2s infinite; }
.kont-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: #fff; }
.kont-card.cur { border-color: var(--acc); background: var(--acc-l); }
.kont-head-row { display: flex; align-items: center; gap: 8px;
  justify-content: space-between; }
.kont-tytul { background: none; border: none; cursor: pointer; font-weight: 700;
  color: var(--acc-d); font-size: 14px; padding: 0; display: inline-flex; gap: 8px;
  align-items: center; }
/* naglowek kontenera = chevron etapu (jak pasek etapow u gory, kolor 60%) */
.kont-head-row.kont-etap {
  margin: -10px -12px 0; padding: 8px 22px;
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%,
    0 100%, 11px 50%);
}
.kont-head-row.kont-etap .kont-tytul { color: #1a1a1a; }
.kont-head-row.kont-etap .lcnt { background: rgba(0,0,0,.16); color: #1a1a1a; }
.kont-head-row.kont-etap .btn.ghost { border-color: rgba(0,0,0,.25);
  color: #1a1a1a; background: rgba(255,255,255,.4); }
.kont-btn.kont-etap {
  border: none; color: #1a1a1a; font-weight: 700; padding: 8px 20px;
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%,
    0 100%, 10px 50%);
}
.kont-btn.kont-etap:hover { filter: brightness(.94); }
.kont-btn.kont-etap.cur { background: var(--acc) !important; color: #fff; }
.kont-btn.kont-etap .lcnt { background: rgba(0,0,0,.16); color: #1a1a1a; }
.kont-items { list-style: none; margin: 8px 0 0; padding: 0; }
.kont-items li { margin: 3px 0; }
.kont-item { background: none; border: none; cursor: pointer; text-align: left;
  font-size: 13px; color: var(--ink); padding: 3px 4px; border-radius: 6px;
  width: 100%; }
.kont-item:hover { background: rgba(163,0,38,.07); }
.pill.brak { background: #b3261e; border: none; cursor: pointer;
  animation: pulsuj 1.2s infinite; }
.databar { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.databar.brak-danych { border-left: 4px solid #b3261e; background: #fdf0f1; }
/* stopka karty deala: prowadzacy (lewo) + utworzono/przez (prawo) */
.deal-stopka { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; font-size: 14px; }
.deal-stopka-l { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.deal-stopka-l select { padding: 7px 9px; border: 1px solid #ccc; border-radius: 7px; }
.deal-stopka-r { text-align: right; margin-left: auto; }
@media (max-width: 640px) { .deal-stopka-r { margin-left: 0; text-align: left; } }
.wpis.wybrany { background: var(--acc-l); border-radius: 8px;
  padding: 8px 10px; border: 1px solid var(--acc); }

/* ---------- edytor stopki ---------- */
.rt-toolbar { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.rt-toolbar button { border: 1px solid var(--line); background: #fff;
  border-radius: 6px; padding: 5px 10px; cursor: pointer; font-size: 13px; }
.rt-toolbar button:hover { border-color: var(--acc); }
.rt-editor { border: 1px solid #ccc; border-radius: 8px; min-height: 110px;
  padding: 10px 12px; background: #fff; font-size: 14px; }
.rt-editor:focus { outline: 2px solid var(--acc-l); }
/* stopka w tresci maila: widoczna ramka tylko w edytorze Labrixa (u odbiorcy zwykly tekst) */
.rt-editor .lx-stopka { position: relative; margin-top: 4px; padding-top: 10px; border-top: 1px dashed #c4c4c4; }
.rt-editor .lx-stopka::before { content: "stopka"; position: absolute; top: -8px; left: 0; padding-right: 6px;
  background: #fff; color: #999; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  line-height: 14px; pointer-events: none; }
/* edytor maila z dlugim cytatem: przewijanie w polu zamiast bardzo dlugiego okna */
.rt-mail, #m-tresc-rt { max-height: 60vh; overflow-y: auto; }
.p2-stopka-brak { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding: 8px 10px;
  border: 1px dashed #d9b3bd; border-radius: 8px; background: #fbf4f6; font-size: 12.5px; color: #6b3442; }
.p2-stopka-brak[hidden] { display: none; }
.p2-stopka-brak a { color: inherit; }

/* ---------- poczta: wiersze, zalaczniki ---------- */
.mail-wiersz { cursor: pointer; }
/* poczta: zaznaczanie checkboxami + pasek operacji masowych */
.mas-td { width: 28px; text-align: center; }
.mas-chk, #mas-all { width: 17px; height: 17px; accent-color: var(--acc); cursor: pointer; }
tr.mas-zaznaczony td { background: var(--acc-l); }
.mas-pasek { display: none; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; margin: 0 0 16px; background: var(--acc-l);
  border: 1px solid var(--acc); border-radius: 8px; font-size: 14px; }
.mas-pasek.widoczny { display: flex; }
tr.mail-otwarty td { background: var(--acc-l); }
.zal-lista { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.zal { display: inline-flex; gap: 5px; align-items: center;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  text-decoration: none; color: var(--acc-d); font-size: 13px; background: #fff; }
.zal:hover { border-color: var(--acc); background: var(--acc-l); }

/* ---------- kontener: grupy tematow, miniaturki ---------- */
.wpis-grupa { padding: 8px 6px; margin-bottom: 4px; border-radius: 8px; }
.wpis-grupa .wpis { border-bottom: 1px solid #e3dcdf; }
.wpis-sep { border: 0; border-top: 3px solid var(--acc); margin: 12px 0; opacity: .85; }
.kont-dodaj { background: #faf7f8; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; }
.wpis-grupa .wpis:last-child { border-bottom: none; }
.wpis-grupa.wybrany { background: var(--acc-l); border: 1px solid var(--acc);
  border-bottom-width: 3px; }
.wpis-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px;
  vertical-align: middle; margin-right: 6px; border: 1px solid var(--line); }

/* ---------- pulpit: zalegle ---------- */
.zalegle-alert { font-size: 16px; border-left-width: 6px;
  animation: pulsuj 1.6s infinite; }
.pill.brak-static { background: #b3261e; }

.przelicz { font-size: 13px; color: #555; }
.przelicz u { text-decoration-color: var(--acc); text-underline-offset: 2px;
  cursor: help; font-weight: 600; }

/* ---------- kursy walut ---------- */
.kursy-box { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.kurs-kafel { display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 20px;
  background: #fff; box-shadow: 0 2px 8px rgba(30,40,45,.05); }
.kurs-flaga { font-size: 30px; }
.kurs-wal { font-size: 13px; color: #888; font-weight: 600; }
.kurs-wart { font-size: 24px; font-weight: 700; color: var(--acc-d); }

/* ---------- narzedzia: menu paskow ---------- */
.narz-menu { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.narz-pasek { display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  text-decoration: none; color: var(--ink); box-shadow: 0 2px 8px rgba(30,40,45,.05);
  transition: border-color .15s, transform .1s; }
.narz-pasek:hover { border-color: var(--acc); transform: translateX(3px); }
.narz-ikona { font-size: 30px; flex: 0 0 auto; }
.narz-tekst { flex: 1; min-width: 0; }
.narz-nazwa { display: block; font-size: 17px; font-weight: 700; color: var(--acc-d); }
.narz-opis { display: block; font-size: 13px; color: #666; margin-top: 3px; }
.narz-strzalka { font-size: 26px; color: var(--acc); flex: 0 0 auto; }

/* ---------- narzedzia: pasek filtrow ---------- */
.narz-filtry { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  margin: 0 0 16px; }
.okres-guziki { display: inline-flex; gap: 6px; }
.okres-guzik { display: inline-flex; flex-direction: column; align-items: center;
  justify-content: center; width: 62px; height: 48px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--acc-d);
  text-decoration: none; font-size: 19px; font-weight: 700; line-height: 1; }
.okres-guzik small { font-size: 10px; font-weight: 500; color: #999;
  margin-top: 2px; }
.okres-guzik:hover { border-color: var(--acc); }
.okres-guzik.cur { background: var(--acc); color: #fff; border-color: var(--acc); }
.okres-guzik.cur small { color: rgba(255,255,255,.8); }
.narz-pole { display: flex; flex-direction: column; font-size: 12px;
  color: #555; gap: 3px; }
.narz-pole input { padding: 11px 12px; border: 1px solid #ccc; border-radius: 9px;
  font-size: 14px; min-width: 160px; }
.narz-filtry select {
  padding: 11px 34px 11px 12px; border: 1px solid #ccc; border-radius: 9px;
  font-size: 14px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23A30026' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
  -webkit-appearance: none; appearance: none; max-width: 320px; height: 44px; }
.narz-filtry input[type=text], .narz-filtry input:not([type]) {
  padding: 11px 12px; border: 1px solid #ccc; border-radius: 9px; font-size: 14px;
  min-width: 220px; flex: 1 1 220px; }
.narz-filtry .btn { height: 44px; }

/* ---------- podsumowanie dnia ---------- */
.pods h1 { color: var(--acc-d); }
.pods-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 9px; margin: 6px 0;
  text-decoration: none; color: var(--ink); background: #fff; }
.pods-row:hover { border-color: var(--acc); background: var(--acc-l); }
.pods-row.late { border-left: 4px solid #b3261e; background: #fdf4f5; }
/* przelacznik suwak (czerwony=off / zielony=on) */
.przel { position: relative; display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 13px; user-select: none; }
.przel input { position: absolute; opacity: 0; width: 0; height: 0; }
.przel .tor { width: 42px; height: 22px; border-radius: 22px; background: #d33;
  transition: background .15s; flex: 0 0 auto; position: relative; }
.przel .tor::after { content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.35); transition: transform .15s; }
.przel input:checked + .tor { background: #1f9d55; }
.przel input:checked + .tor::after { transform: translateX(20px); }

/* plakietka etapu = chevron etapu (jak pasek etapow na projekcie) */
.pods-etap { flex: 0 0 auto; width: 210px; text-align: center; color: #fff;
  font-size: 12px; font-weight: 700; padding: 6px 20px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%,
    0 100%, 10px 50%); }
.pods-kiedy { flex: 0 0 120px; font-size: 13px; color: #a06; white-space: nowrap; }
.pods-tytul { flex: 1 1 28%; font-weight: 600; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pods-klient { flex: 1 1 26%; min-width: 0; font-size: 13px; color: var(--acc-d);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pods-deal { flex: 1 1 24%; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .pods-row { flex-wrap: wrap; gap: 6px; }
  .pods-etap { width: 100%; }
  .pods-kiedy { flex: 0 0 auto; }
  .pods-tytul, .pods-klient, .pods-deal { flex: 1 1 100%; white-space: normal; }
}
.pods-ciekawostka { background: var(--acc-l); border-radius: 10px;
  padding: 12px 16px; font-size: 15px; }
.pods-h { margin-top: 20px; }
.pods-h.late { color: #b3261e; }
.pods-motto { font-size: 16px; font-weight: 600; color: var(--acc-d);
  margin-top: 22px; }

/* ---------- kalendarz: siatka dzien/tydzien/miesiac ---------- */
.kal-nav { display: flex; gap: 12px; align-items: center; margin: 0 0 14px;
  font-size: 17px; }
.kal-grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px; }
.kal-cell { background: rgba(246,242,243,.9); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; min-height: 110px; min-width: 0; }
.kal-cell.today { outline: 2px solid var(--acc); }
.kal-cell.obcy { opacity: .45; }
.kal-cell-head { font-weight: 600; font-size: 12.5px; color: var(--acc-d);
  display: flex; justify-content: space-between; align-items: center;
  padding: 2px 4px 6px; }
.kal-cell-head a { color: var(--acc-d); text-decoration: none; }
.kal-cell .kan-card { padding: 6px 8px; font-size: 12px; margin-bottom: 6px; }
.kal-cell .kan-card .pill { font-size: 10.5px; padding: 1px 7px; }
.kal-dow { text-align: center; font-weight: 700; font-size: 12px;
  color: var(--acc-d); padding: 2px 0; }
.kal-cell.mies { min-height: 84px; }
.kal-mini { display: block; font-size: 11px; border-left: 3px solid var(--acc);
  background: #fff; border-radius: 4px; padding: 2px 5px; margin: 2px 0;
  text-decoration: none; color: var(--ink); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.kal-mini:hover { background: var(--acc-l); }
.kal-mini.late { background: #fdf0f1; color: #b3261e; font-weight: 600; }
.kal-wiecej { font-size: 11px; color: var(--acc-d); }
.kal-late-grid { display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
@media (max-width: 860px) {
  .kal-grid7:not(.kal-mies) { grid-template-columns: repeat(2, 1fr); }
  .kal-mies { font-size: 11px; }
}

.wiersz-link { cursor: pointer; }

/* ---------- towary na komorce: mniej kolumn, wieksze wiersze ---------- */
@media (max-width: 640px) {
  .tbl-towary th:nth-child(3), .tbl-towary td:nth-child(3),
  .tbl-towary th:nth-child(6), .tbl-towary td:nth-child(6),
  .tbl-towary th:nth-child(7), .tbl-towary td:nth-child(7),
  .tbl-towary th:nth-child(8), .tbl-towary td:nth-child(8) { display: none; }
  .tbl-towary td { padding: 12px 8px; font-size: 14px; }
}

/* ---------- pulpit: przerwa miedzy zaleglymi a nadchodzacymi ---------- */
.przerwa-terminy { text-align: center; color: #999; font-size: 12px;
  margin: 14px 0 10px; display: flex; align-items: center; gap: 10px; }
.przerwa-terminy::before, .przerwa-terminy::after { content: '';
  flex: 1; border-top: 2px dashed #ddd; }

/* ---------- przypisz mail: chipy adresow ---------- */
.imp-foldery { display: flex; gap: 10px; align-items: center; margin: 4px 0 10px; }
.imp-chipy { display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  margin: 0 0 10px; }
.imp-chip { display: inline-flex; gap: 6px; align-items: center;
  background: var(--acc-l); border: 1px solid var(--acc); color: var(--acc-d);
  border-radius: 16px; padding: 3px 10px; font-size: 12.5px;
  text-decoration: none; }
.imp-chip a { color: #b3261e; font-weight: 700; text-decoration: none;
  font-size: 15px; line-height: 1; }
.imp-chip.wyl { background: #f1f1f1; border-color: #ccc; color: #999; }

/* ---------- toast (potwierdzenie zapisu) ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1f7a54; color: #fff; padding: 12px 22px; border-radius: 10px;
  font-size: 15px; z-index: 200; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.err { background: #b3261e; }
.konf-sec summary .btn { margin-left: 12px; }

/* ---------- przewodnik (pomoc) ---------- */
.prz-toc { columns: 2; margin-top: 8px; }
.prz-toc a { display: block; padding: 3px 0; color: var(--acc-d);
  text-decoration: none; }
.prz-toc a:hover { text-decoration: underline; }
@media (max-width: 640px) { .prz-toc { columns: 1; } }
.prz-schemat { display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin: 12px 0; }
.prz-box { border: 2px solid var(--line); border-radius: 12px; padding: 12px 18px;
  background: #fff; text-align: center; }
.prz-box.acc { border-color: var(--acc); background: var(--acc-l); }
.prz-strzalka { text-align: center; font-size: 22px; color: var(--acc-d); }
.prz-mock { border: 1px dashed #cbb; border-radius: 10px; padding: 12px;
  margin: 10px 0; background: rgba(255,255,255,.6); overflow-x: auto; }
.prz-mock .mainnav a, .prz-mock .lejek, .prz-mock .stage { cursor: default; }
.prz-callouts { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px;
  font-size: 13px; }
.prz-callouts b { display: inline-flex; width: 20px; height: 20px;
  border-radius: 50%; background: var(--acc); color: #fff; align-items: center;
  justify-content: center; margin-right: 5px; font-size: 12px; }
.prz-kroki { padding-left: 20px; }
.prz-kroki li { margin: 8px 0; }
.card h3 { color: var(--acc-d); margin: 18px 0 6px; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .topbar-inner { padding: 0 8px; gap: 8px; }
  .brand { font-size: 16px; }
  .mainnav a { padding: 14px 9px; font-size: 13px; }
  .sync-badge { display: none; }
  .wrap { padding: 14px 10px 50px; }
  .tbl th { top: 0; }
}

/* ---------- Poczta: trzy kolumny (skrzynki i foldery | lista | podglad) ----------
   Uklad wzorowany na Poczcie P2 z ERP KrakPrint, w kolorach Labrix24. */
.wrap:has(.p2) { max-width: 1680px; padding-bottom: 12px; }
.wrap:has(.p2) ~ .foot { display: none; }          /* Poczta zajmuje cale okno - bez stopki strony */
.p2 {
  --p2-acc: var(--acc); --p2-acc-dark: var(--acc-d); --p2-active: var(--acc-l);
  --p2-bg: #fff; --p2-side: #fbf7f8; --p2-open: #f7f2f3; --p2-hover: #f8f0f2;
  --p2-border: #ece3e5; --p2-text: #22191b; --p2-muted: #7b6f72; --p2-card: #fff; --p2-chip: #f2ecee;
  --p2-shadow: 0 1px 2px rgba(40, 10, 18, .07);
  display: grid; grid-template-columns: 252px minmax(360px, 470px) 1fr;
  height: calc(100vh - 88px); min-height: 560px;
  border: 1px solid var(--p2-border); border-radius: 12px; overflow: hidden;
  background: var(--p2-bg); color: var(--p2-text); font-size: 13.5px; line-height: 1.4;
  box-shadow: 0 4px 18px rgba(60, 10, 25, .06);
}
.p2 * { box-sizing: border-box; }
.p2 button { font: inherit; color: inherit; }
.p2 .ik { flex: none; }
.p2 a { color: inherit; }

/* lewa kolumna */
.p2-side { background: var(--p2-side); border-right: 1px solid var(--p2-border); display: flex; flex-direction: column; min-height: 0; }
.p2-side-top { padding: 14px 12px 8px; }
.p2-new {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--p2-acc); color: #fff !important; border: 0; border-radius: 9px; padding: 10px;
  font-weight: 600; cursor: pointer;
}
.p2-new:hover { filter: brightness(1.08); }
.p2-side-scroll { flex: 1; overflow-y: auto; padding: 0 8px 10px; }
.p2-sec {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--p2-muted); text-transform: uppercase;
  margin: 14px 8px 6px; display: flex; justify-content: space-between; align-items: center;
}
.p2-sec a { color: var(--p2-muted); display: flex; }
.p2-sec a:hover { color: var(--p2-acc); }
.p2-nav {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; cursor: pointer;
  color: var(--p2-text); text-decoration: none; user-select: none;
}
.p2-nav:hover { background: var(--p2-hover); }
.p2-nav.on { background: var(--p2-active); color: var(--p2-acc-dark); font-weight: 600; }
.p2-nav .lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.p2-nav .n { margin-left: auto; font-size: 11.5px; color: var(--p2-muted); font-weight: 600; }
/* lata pod otwartym folderem: filtr roku */
.p2-lata { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 6px 6px 34px; }
.p2-lata:empty { display: none; }
.p2-rok { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  color: var(--p2-acc-dark); background: #f6eef1; text-decoration: none; border: 1px solid transparent; }
.p2-rok span { font-size: 10.5px; color: var(--p2-muted); font-weight: 600; }
.p2-rok:hover { border-color: var(--p2-acc-dark); }
.p2-rok.on { background: var(--p2-acc-dark); color: #fff; }
.p2-rok.on span { color: rgba(255,255,255,.8); }
.p2-rok.wsz { background: transparent; color: var(--p2-muted); text-decoration: underline; }
.p2-nav.on .n { color: var(--p2-acc-dark); }
.p2-nav-info { color: var(--p2-muted); cursor: default; white-space: normal; font-size: 12.5px; }
.p2-nav-info:hover { background: none; }
.p2-acc { display: flex; align-items: center; gap: 4px; border-radius: 8px; margin-bottom: 1px; }
.p2-acc > a { display: flex; align-items: center; gap: 9px; padding: 7px 9px; flex: 1; min-width: 0; text-decoration: none; color: var(--p2-text); border-radius: 8px; }
.p2-acc:hover { background: var(--p2-hover); }
.p2-acc.on { background: var(--p2-card); box-shadow: var(--p2-shadow); outline: 1px solid var(--p2-border); }
.p2-acc .t { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.p2-acc .e { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p2-acc .d { font-size: 11px; color: var(--p2-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p2-acc .ub { font-size: 11px; font-weight: 700; background: var(--p2-acc); color: #fff; border-radius: 10px; padding: 1px 7px; }
.p2-acc .sh { background: none; border: 0; cursor: pointer; color: var(--p2-muted); padding: 6px; display: flex; border-radius: 6px; }
.p2-acc .sh:hover { color: var(--p2-acc); background: var(--p2-active); }
.p2-acc.razem .rz {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--p2-acc); color: #fff; flex: 0 0 30px;
}
.p2-av-wrap { position: relative; display: inline-flex; flex: none; }
.p2-stan { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #c9c3c5; border: 2px solid var(--p2-side); }
.p2-stan.czeka { animation: skrz-puls 1s ease-in-out infinite; }
.p2-stan.dobra { background: #1f7a54; }
.p2-stan.zla { background: #b3261e; }
@keyframes skrz-puls { 50% { opacity: .35; } }
.p2-side-bot { border-top: 1px solid var(--p2-border); padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.p2-me { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.p2-me .nm { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p2-ib {
  background: var(--p2-card); border: 1px solid var(--p2-border); border-radius: 8px; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--p2-text);
  text-decoration: none; padding: 0; flex: none;
}
.p2-ib:hover { background: var(--p2-hover); color: var(--p2-acc-dark); }
.p2-ib.off { opacity: .35; cursor: default; }
.p2-ib.off:hover { background: var(--p2-card); color: var(--p2-text); }
.p2-ib-usun:hover { color: #b91c1c; border-color: #f1b8b8; }
.p2-av {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; color: #fff; letter-spacing: .02em;
}
.p2-av.sm { width: 22px; height: 22px; font-size: 9.5px; }

/* lista */
.p2-list { border-right: 1px solid var(--p2-border); display: flex; flex-direction: column; min-height: 0; background: var(--p2-bg); min-width: 0; }
.p2-lh { padding: 14px 14px 8px; }
.p2-lh h2 { margin: 0; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--p2-text); }
.p2-lh .sub { color: var(--p2-muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p2-search { display: flex; gap: 6px; margin-top: 10px; }
.p2-search input { flex: 1; min-width: 0; border: 1px solid var(--p2-border); background: var(--p2-card); color: var(--p2-text); border-radius: 8px; padding: 7px 10px; font: inherit; }
.p2-search input:focus { outline: 2px solid var(--p2-active); border-color: var(--p2-acc); }
.p2-opcje { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.p2-filtr { display: inline-flex; border: 1px solid var(--p2-border); border-radius: 8px; overflow: hidden; }
.p2-filtr a { padding: 4px 10px; font-size: 12px; text-decoration: none; color: var(--p2-muted); }
.p2-filtr a + a { border-left: 1px solid var(--p2-border); }
.p2-filtr a.on { background: var(--p2-active); color: var(--p2-acc-dark); font-weight: 600; }
.p2-ustaw-listy { display: flex; gap: 6px; margin: 0; }
.p2-ustaw-listy select, .p2-bulk select {
  border: 1px solid var(--p2-border); background: var(--p2-card); color: var(--p2-text); border-radius: 7px;
  padding: 3px 6px; font-size: 12px; cursor: pointer;
}
.p2-masform { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; }
.p2-bulk {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px 8px; font-size: 12px; color: var(--p2-muted);
  border-bottom: 1px solid var(--p2-border); flex-wrap: wrap; min-height: 42px;
}
.p2-bulk input[type=checkbox], .p2-it input[type=checkbox], .p2-urow input[type=checkbox] { accent-color: var(--p2-acc); width: 15px; height: 15px; }
.p2-chk-all { display: flex; align-items: center; cursor: pointer; }
.p2-zazn button { background: none; border: 0; padding: 2px 3px; color: var(--p2-acc-dark); cursor: pointer; font-size: 12px; }
.p2-zazn button:hover { text-decoration: underline; }
.p2-bulk-akcje { display: none; align-items: center; gap: 5px; flex-wrap: wrap; width: 100%; }
.p2-bulk-akcje.widoczny { display: flex; }
.p2-bulk-akcje b { color: var(--p2-text); }
.p2-ile { background: var(--p2-acc); color: #fff !important; border-radius: 10px; padding: 1px 7px; font-size: 11px; }
.p2-btn-m { padding: 3px 7px; font-size: 11.5px; gap: 4px; }
.p2-items { flex: 1; overflow-y: auto; }
.p2-day {
  position: sticky; top: 0; z-index: 1; background: var(--p2-bg); font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; color: var(--p2-muted); padding: 10px 14px 4px; text-transform: uppercase;
}
.p2-it {
  display: grid; grid-template-columns: 18px 30px 1fr; gap: 9px; padding: 10px 14px;
  border-bottom: 1px solid var(--p2-border); cursor: pointer; position: relative;
}
.p2-it:hover { background: var(--p2-hover); }
.p2-it.on { background: var(--p2-open); }
.p2-it.sel { background: var(--p2-active); }
.p2-it.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--p2-acc); }
.p2-chk { display: flex; align-items: flex-start; padding-top: 7px; cursor: pointer; }
.p2-it-t { min-width: 0; }
.p2-it .r1 { display: flex; gap: 6px; align-items: baseline; }
.p2-it .fr { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.p2-it.nowa .fr, .p2-it.nowa .sj { font-weight: 700; }
.p2-it .tm { font-size: 11px; color: var(--p2-muted); white-space: nowrap; }
.p2-it .sj { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; text-decoration: none; color: var(--p2-text); }
.p2-it .ch { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; align-items: center; }
.p2-it .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--p2-acc); display: inline-block; flex: none; align-self: center; }
.p2-it .acc { font-size: 10.5px; color: var(--p2-muted); }
.p2-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; border-radius: 5px; padding: 1px 6px;
  background: var(--p2-chip); color: var(--p2-muted); white-space: nowrap;
}
.p2-rozm.mocny { background: var(--p2-active); color: var(--p2-acc-dark); }
.p2-empty { padding: 40px 20px; text-align: center; color: var(--p2-muted); }
.p2-info { padding: 8px 14px 0; }
.p2-info .alert { margin: 0; font-size: 12px; padding: 7px 10px; line-height: 1.35; }
.p2-pager {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px;
  border-top: 1px solid var(--p2-border); background: var(--p2-side);
}
.p2-pager-t { font-size: 12px; padding: 0 6px; white-space: nowrap; }

/* podglad */
.p2-view { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--p2-bg); overflow: hidden; }
.p2-tb { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--p2-border); flex-wrap: wrap; }
.p2-tb form { margin: 0; display: flex; }
.p2-tb .sp { flex: 1; }
.p2-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--p2-border); background: var(--p2-card);
  color: var(--p2-text); border-radius: 8px; padding: 6px 11px; cursor: pointer; font-size: 12.5px; font-weight: 500; text-decoration: none;
}
.p2-btn:hover { background: var(--p2-hover); }
.p2-btn.pri { background: var(--p2-acc); border-color: var(--p2-acc); color: #fff; }
.p2-btn.pri:hover { filter: brightness(1.08); background: var(--p2-acc); }
.p2-wstecz { display: none; }
.p2-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.p2-subj { font-size: 19px; font-weight: 700; margin: 0 0 8px; line-height: 1.3; color: var(--p2-text); }
.p2-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.p2-from { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.p2-from .w { flex: 1; min-width: 0; }
.p2-from .nm { font-weight: 700; }
.p2-from .em, .p2-from .to, .p2-from .dt { color: var(--p2-muted); font-size: 12px; }
.p2-from .to { margin-top: 2px; word-break: break-word; }
.p2-from .dt { white-space: nowrap; }
.p2-atts { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.p2-att {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--p2-border); border-radius: 8px; padding: 5px 9px;
  font-size: 12px; color: var(--p2-text) !important; background: var(--p2-card); text-decoration: none;
}
.p2-att:hover { background: var(--p2-hover); }
.p2-frame { width: 100%; height: 62vh; min-height: 320px; border: 1px solid var(--p2-border); border-radius: 10px; background: #fff; }
.p2-tekst { white-space: normal; line-height: 1.6; font-size: 14px; word-break: break-word; border: 1px solid var(--p2-border); border-radius: 10px; padding: 14px 16px; }
.p2-forma { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--p2-border); }
.p2-forma h3 { margin: 0 0 8px; font-size: 15px; }
.p2-forma input[name=do], .p2-forma input[name=dw], .p2-forma .deal-filtr {
  width: 100%; padding: 8px 10px; border: 1px solid var(--p2-border); border-radius: 8px; font: inherit; margin: 2px 0 8px;
}
.p2-forma .deal-lista { max-height: 200px; overflow: auto; }
.p2-pliki { border: 1px dashed #cdbfc3; border-radius: 8px; padding: 9px; width: 100%; margin-top: 8px; font-size: 12px; }
.p2-ph { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--p2-muted); gap: 10px; padding: 20px; text-align: center; }
.p2-ph .ik { opacity: .5; }

/* okna */
.p2-modal { position: fixed; inset: 0; background: rgba(25, 10, 15, .45); z-index: 1500; display: none; align-items: center; justify-content: center; padding: 20px; }
.p2-modal.show { display: flex; }
.p2-dlg {
  --p2-border: #ece3e5; --p2-muted: #7b6f72; --p2-acc: var(--acc); --p2-card: #fff; --p2-hover: #f8f0f2;
  background: #fff; color: #22191b; border: 1px solid var(--p2-border); border-radius: 14px; width: min(820px, 100%); max-height: 92vh;
  display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); margin: 0; font-size: 13.5px;
}
.p2-dlg.sm { width: min(480px, 100%); }
.p2-dh { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--p2-border); font-weight: 700; font-size: 15px; }
.p2-db { padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.p2-df { padding: 12px 16px; border-top: 1px solid var(--p2-border); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.p2-row { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: center; }
.p2-row label { font-size: 12px; color: var(--p2-muted); font-weight: 600; }
.p2-row input, .p2-row select { border: 1px solid var(--p2-border); background: #fff; border-radius: 8px; padding: 7px 10px; font: inherit; width: 100%; }
.p2-urow { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--p2-border); cursor: pointer; }
.p2-dlg .p2-ib { width: 30px; height: 30px; }

/* telefon i waskie okna: jedna kolumna; otwarta wiadomosc zaslania liste */
@media (max-width: 1200px) { .p2 { grid-template-columns: 220px minmax(300px, 360px) 1fr; } }
@media (max-width: 900px) {
  .p2 { display: flex; flex-direction: column; height: auto; min-height: 0; overflow: visible; }
  .p2-side { border-right: 0; border-bottom: 1px solid var(--p2-border); }
  .p2-side-scroll { max-height: 260px; }
  .p2-list { border-right: 0; }
  .p2-items { overflow: visible; }
  .p2-view { display: none; }
  .p2.p2-otwarta .p2-side, .p2.p2-otwarta .p2-list { display: none; }
  .p2.p2-otwarta .p2-view { display: flex; overflow: visible; }
  .p2-wstecz { display: inline-flex; }
  .p2-frame { height: 70vh; }
}
@media (prefers-reduced-motion: reduce) { .p2-stan.czeka { animation: none; } }

/* ---------- Cenniki ---------- */
.cen-forma label { display: block; font-size: 13px; color: #555; margin: 10px 0 0; }
.cen-forma input[name=nazwa], .cen-forma input[type=file] {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid #ccc; border-radius: 8px; font: inherit;
}
.cen-forma input[type=file] { border-style: dashed; }
.cen-typy { display: flex; gap: 10px; flex-wrap: wrap; }
.cen-forma label.cen-typ {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--ink); background: #fff;
}
.cen-forma label.cen-typ:has(input:checked) { border-color: var(--acc); background: var(--acc-l); font-weight: 600; }
.cen-typ input { accent-color: var(--acc); width: 16px; height: 16px; }
.cen-tbl th a.cen-sort { color: #fff; font-weight: 600; }
.cen-tbl th a.cen-sort.on { text-decoration: underline; }
.cen-chip { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.cen-chip.cen-dostawca { background: #e0ecff; color: #1d4ed8; }
.cen-chip.cen-klient { background: #dcf5e6; color: #15803d; }
.cen-ext {
  display: inline-block; min-width: 38px; text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
  border-radius: 5px; padding: 1px 5px; margin-right: 4px; background: #f2ecee; color: var(--acc-d);
}
.cen-plik { color: #555; font-size: 13px; }
.cen-akcje { white-space: nowrap; text-align: right; }
.cen-akcje form { display: inline; margin: 0; }
.cen-akcje .btn.small { padding: 3px 8px; }
.cen-usun:hover { border-color: #b3261e; color: #b3261e; }
/* Cenniki: drzewa folderow, okruszki, import grupowy, przeciaganie mysza */
.cen-uklad { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.cen-drzewa { padding: 12px 10px; position: sticky; top: 12px; }
.cen-drzewo + .cen-drzewo { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cen-drzewo ul { list-style: none; margin: 2px 0 0 14px; padding: 0 0 0 8px; border-left: 1px dashed #e2d6da; }
.cen-wezel { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 7px; color: #333;
  text-decoration: none; font-size: 13.5px; border: 1px solid transparent; }
.cen-wezel:hover { background: #f7f1f3; }
.cen-wezel.cur { background: var(--acc-l); color: var(--acc-d); font-weight: 600; }
.cen-korzen { font-weight: 700; font-size: 14px; }
.cen-wezel .cen-wn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cen-wezel .lcnt { margin-left: auto; background: #efe6e9; color: #6b3442; border-radius: 10px; font-size: 11px;
  font-weight: 600; padding: 1px 7px; }
.cen-wezel.cur .lcnt { background: #fff; }
.cen-ik { width: 18px; text-align: center; flex-shrink: 0; }
/* olowek przy folderze w drzewie: widoczny po najechaniu na folder (na ekranach dotykowych zawsze) */
.cen-drzewo li { position: relative; }
.cen-wezel-zmien { position: absolute; top: 3px; right: 34px; width: 24px; height: 22px; padding: 0; border: 1px solid #e2d6da;
  border-radius: 6px; background: #fff; color: var(--acc-d); font-size: 12px; line-height: 20px; cursor: pointer; opacity: 0; }
.cen-wezel:hover + .cen-wezel-zmien, .cen-wezel-zmien:hover, .cen-wezel-zmien:focus-visible { opacity: 1; }
.cen-wezel-zmien:hover { border-color: var(--acc-d); }
@media (hover: none) { .cen-wezel-zmien { opacity: .75; } }
.cen-okr-akcje { display: inline-flex; gap: 6px; margin-left: 8px; }
.cen-okr-akcje .btn.small { padding: 3px 9px; font-size: 12.5px; }
.cen-podp { font-size: 12px; margin: 10px 4px 0; }
.card > .cen-podp:first-child { margin: 0 0 8px; }
.cen-glowna { min-width: 0; }
.cen-szukaj { margin-top: 0; }
.cen-okruszki { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0 12px; font-size: 15px; }
.cen-okruszki a { padding: 3px 8px; border-radius: 7px; border: 1px solid transparent; color: var(--acc-d); text-decoration: none; }
.cen-okruszki a:hover { background: #f7f1f3; }
.cen-okruszki a.cur { font-weight: 700; color: #222; }
.cen-sep { color: #aaa; }
.cen-panel h2 { margin-top: 0; font-size: 16px; }
.cen-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.cen-inline label { flex: 1; min-width: 240px; font-size: 13px; color: #555; }
.cen-inline input[name=nazwa] { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid #ccc; border-radius: 8px; }
.cen-lista-nazw { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cen-ln-glowka, .cen-ln-wiersz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 34px; gap: 10px; align-items: center; padding: 6px 10px; }
.cen-ln-glowka { background: #f7f1f3; font-size: 12px; font-weight: 600; color: #6b3442; }
.cen-ln-wiersz + .cen-ln-wiersz { border-top: 1px solid #f0e8eb; }
.cen-ln-plik { font-size: 13px; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cen-ln-wiersz input { width: 100%; padding: 6px 9px; border: 1px solid #ccc; border-radius: 7px; font-size: 13.5px; }
.cen-uchwyt-kol { width: 22px; }
.cen-uchwyt { width: 22px; color: #b9aab0; cursor: grab; text-align: center; user-select: none; font-size: 15px; }
tr[data-rodzaj] { cursor: grab; }
tr[data-rodzaj] a, tr[data-rodzaj] button { cursor: pointer; }
.cen-folder-wiersz td { background: #fbf7f8; }
.cen-folder-link { font-weight: 600; color: #3a2a30; }
.cen-ciagniety { opacity: .4; }
tr.cen-nad td { background: var(--acc-l) !important; box-shadow: inset 0 1px 0 var(--acc), inset 0 -1px 0 var(--acc); }
tr.cen-przed td { box-shadow: inset 0 3px 0 var(--acc); }
tr.cen-po td { box-shadow: inset 0 -3px 0 var(--acc); }
a.cen-nad { background: var(--acc-l) !important; border-color: var(--acc) !important; }
.cen-miejsca { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 14px; }
body.cen-zapis, body.cen-zapis * { cursor: progress !important; }
a.cen-chip { text-decoration: none; white-space: normal; }
@media (max-width: 900px) {
  .cen-uklad { grid-template-columns: 1fr; }
  .cen-drzewa { position: static; }
}
