/* =====================================================================
   Panel warsztatu – dodatki do /app/style.css.
   Telefon: górny pasek + dolne menu (jak aplikacja klienta).
   Komputer/tablet (od 960 px): czarne menu boczne i szersza treść.
   ===================================================================== */

html, body.panel { background: var(--tlo); }
.p-uklad { min-height: 100dvh; }
.p-boczne { display: none; }
.p-glowna { min-width: 0; padding-bottom: calc(var(--menu-wys) + var(--dol) + 24px); }

/* ---------- Nagłówek ---------- */
.p-naglowek {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  min-height: calc(60px + var(--gora));
  padding: var(--gora) 12px 0 16px;
  background: var(--czarny); color: #fff;
}
.p-naglowek-tytul { flex: 1; min-width: 0; }
.p-naglowek h1 { font-size: 18px; font-weight: 800; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-naglowek small { display: block; color: #a9a9b0; font-size: 12.5px; }
.p-naglowek-akcje { display: flex; gap: 8px; align-items: center; }
.p-naglowek .przycisk { min-height: 40px; padding: 0 14px; font-size: 13px; }

.p-tresc { display: flex; flex-direction: column; gap: 12px; padding: 16px; max-width: 1280px; }
.p-tresc:focus { outline: none; }

/* ---------- Menu boczne (komputer) ---------- */
.p-boczne .logo { font-size: 24px; padding: 0 12px; margin: 0; }
.p-boczne-pod { color: #8b8e94; font-size: 13px; padding: 2px 12px 22px; }
.p-menu { display: flex; flex-direction: column; gap: 2px; }
.p-menu a, .p-boczne-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 8px;
  color: #d6d6db; text-decoration: none; font-weight: 500; font-size: 15px;
}
.p-menu a:hover, .p-boczne-link:hover { background: rgba(255, 255, 255, .07); }
.p-menu a.aktywna { background: var(--czerwony); color: #fff; font-weight: 700; }
.p-boczne-link { margin-top: auto; color: #a9a9b0; font-size: 14px; }

.p-licznik {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--czerwony); color: #fff; font-size: 12px; font-weight: 800; font-style: normal;
}
.p-menu a.aktywna .p-licznik { background: #fff; color: var(--czerwony); }
.p-dolne a { position: relative; }
.p-dolne .p-licznik { position: absolute; top: 6px; left: calc(50% + 4px); margin: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; }

@media (min-width: 960px) {
  .p-uklad { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
  .p-boczne {
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: 24px 14px 18px; background: var(--czarny); color: #fff;
  }
  .p-dolne { display: none !important; }
  .p-glowna { padding-bottom: 40px; }
  .p-naglowek {
    position: static; min-height: 0; padding: 26px 32px 4px;
    background: none; color: var(--tekst);
  }
  .p-naglowek h1 { font-size: 26px; white-space: normal; }
  .p-naglowek small { color: var(--tekst-3); font-size: 14px; margin-top: 2px; }
  .p-naglowek .naglowek-przycisk { color: var(--tekst); }
  .p-naglowek .naglowek-przycisk:active { background: var(--szary-jasny); }
  .p-naglowek .przycisk { min-height: 44px; padding: 0 18px; font-size: 14px; }
  .p-tresc { padding: 16px 32px 32px; gap: 16px; }
  .komunikat { bottom: 24px; }
  .arkusz { border-radius: 18px; bottom: 50%; transform: translate(-50%, 50%); animation: none; }
}

/* ---------- Liczniki na górze ---------- */
.p-statystyki { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .p-statystyki { grid-template-columns: repeat(4, 1fr); } }
.p-stat {
  display: block; padding: 14px 16px; border-radius: var(--promien);
  background: var(--karta); box-shadow: var(--cien); color: inherit; text-decoration: none;
}
.p-stat small { display: block; color: var(--tekst-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.p-stat strong { display: block; font-size: 30px; font-weight: 900; line-height: 1.1; margin-top: 4px; }
.p-stat--alarm strong { color: var(--czerwony); }
.p-stat--zielony strong { color: var(--zielony-ciemny); }

/* ---------- Tablica zleceń (3 kolumny statusów) ---------- */
.p-kolumny { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .p-kolumny { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.p-kolumna { display: flex; flex-direction: column; gap: 10px; }
.p-kolumna-gora { display: flex; align-items: center; justify-content: space-between; padding: 0 2px; }
.p-kolumna-gora b { color: var(--tekst-3); font-size: 14px; }
.p-pusta-kolumna {
  border: 1.5px dashed #d0d1d6; border-radius: var(--promien);
  padding: 18px; text-align: center; color: var(--tekst-3); font-size: 14px;
}

.karta.p-zlecenie { padding: 0; overflow: hidden; }
.karta.p-zlecenie > * + * { margin-top: 0; }
.p-zlecenie-link { display: block; padding: 14px 14px 12px; color: inherit; text-decoration: none; }
.p-zlecenie-link:hover strong { text-decoration: underline; }
.p-zlecenie-gora { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.p-zlecenie-gora strong { font-size: 16px; font-weight: 800; line-height: 1.25; }
.p-zlecenie p { font-size: 14px; color: var(--tekst-2); margin-top: 4px; }
.p-zlecenie small { display: block; color: var(--tekst-3); font-size: 13px; margin-top: 2px; }
.p-flagi { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.p-flagi .znaczek { white-space: normal; }
.p-zlecenie-dol {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--linia); background: #fafafb;
  font-size: 13px; color: var(--tekst-2);
}
.p-spoznione { color: var(--czerwony-ciemny); font-weight: 700; }

/* ---------- Szczegóły zlecenia ---------- */
.p-dwie { display: grid; gap: 12px; align-items: start; }
@media (min-width: 1100px) { .p-dwie { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; } }
.p-dwie > div { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.p-segmenty { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 10px; background: var(--tlo); }
.p-segmenty button {
  min-height: 46px; padding: 0 6px; border: 0; border-radius: 8px; background: none;
  font-weight: 700; font-size: 14px; color: var(--tekst-3); cursor: pointer;
}
.p-segmenty button[aria-pressed="true"] { background: #fff; color: var(--tekst); box-shadow: var(--cien); }
.p-segmenty button[data-status="w_trakcie"][aria-pressed="true"] { color: var(--pomaranczowy-ciemny); }
.p-segmenty button[data-status="do_odbioru"][aria-pressed="true"] { color: var(--zielony-ciemny); }

.p-czasy { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--tekst-2); }
.p-czasy b { color: var(--tekst); font-weight: 600; }

.p-praca { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--linia); }
.p-praca:first-of-type { padding-top: 0; }
.p-praca:last-of-type { border-bottom: 0; }
.p-praca strong { font-weight: 700; }
.p-praca p { color: var(--tekst-2); font-size: 14px; }
.p-praca-koszt { font-weight: 900; font-size: 17px; white-space: nowrap; text-align: right; }
.p-praca img { width: 100%; max-width: 220px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; margin-top: 6px; }
.p-praca-akcje { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

.p-zdjecie-pole {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  border: 1.5px dashed var(--linia); border-radius: 8px; cursor: pointer; color: var(--tekst-2);
}
.p-zdjecie-pole input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.p-zdjecie-pole img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }

/* ---------- Rachunek przy wydaniu ---------- */
.p-pozycja {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid var(--linia);
}
.p-pozycja .p-nazwa { grid-column: 1 / -1; order: -1; }
@media (min-width: 720px) {
  .p-pozycja { grid-template-columns: 130px minmax(0, 1fr) 100px 120px auto; }
  .p-pozycja .p-nazwa { grid-column: auto; order: 0; }
}
.p-pozycja input, .p-pozycja select {
  width: 100%; min-height: 44px; padding: 8px 10px;
  border: 1.5px solid var(--linia); border-radius: 8px; background: #fff;
  font: inherit; font-size: 15px; color: var(--tekst);
}
.p-pozycja input:focus, .p-pozycja select:focus { outline: none; border-color: var(--czerwony); box-shadow: 0 0 0 3px var(--czerwony-jasny); }
.p-pozycje-naglowek { display: none; }
@media (min-width: 720px) {
  .p-pozycje-naglowek {
    display: grid; grid-template-columns: 130px minmax(0, 1fr) 100px 120px 44px; gap: 8px;
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tekst-3);
  }
}
.p-usun {
  width: 44px; height: 44px; border: 0; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center; background: var(--tlo); color: var(--tekst-2);
}
.p-usun:hover { color: var(--czerwony); }
.p-suma { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.p-suma strong { font-size: 28px; font-weight: 900; }

/* ---------- Listy klientów, rezerwacji, nagród ---------- */
.awatar--maly { width: 42px; height: 42px; font-size: 18px; flex-shrink: 0; }
.p-szukaj { position: relative; }
.p-szukaj .ik { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--tekst-3); pointer-events: none; }
.p-szukaj input {
  width: 100%; min-height: 50px; padding: 12px 14px 12px 44px;
  border: 1.5px solid var(--linia); border-radius: 10px; background: #fff; font: inherit; font-size: 16px;
}
.p-szukaj input:focus { outline: none; border-color: var(--czerwony); box-shadow: 0 0 0 3px var(--czerwony-jasny); }

.p-siatka-kart { display: grid; gap: 12px; }
@media (min-width: 900px) { .p-siatka-kart { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.p-rez-gora { display: flex; align-items: flex-start; gap: 12px; }
.p-rez-gora strong { display: block; font-size: 16px; font-weight: 800; }
.p-rez-gora small { display: block; color: var(--tekst-3); font-size: 13px; }
.p-rez-gora > div { flex: 1; min-width: 0; }
.p-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.p-info dt { color: var(--tekst-3); }
.p-info dd { font-weight: 600; min-width: 0; }

.p-kod { font-size: 22px; font-weight: 900; letter-spacing: .08em; }

.p-nagroda-wiersz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 110px 44px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--linia); }
@media (max-width: 719px) {
  .p-nagroda-wiersz { grid-template-columns: 1fr 110px 44px; }
  .p-nagroda-wiersz input[name="nazwa"] { grid-column: 1 / -1; }
}
.p-nagroda-wiersz input { width: 100%; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--linia); border-radius: 8px; font: inherit; font-size: 15px; }

.karta h2 { font-size: 17px; font-weight: 800; }

/* szybkie podpowiedzi (tytuł naprawy, typowe punkty) */
.chip-szybki {
  padding: 7px 12px; border: 1.5px solid var(--linia); border-radius: 999px;
  background: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip-szybki:hover { border-color: var(--czerwony); color: var(--czerwony); }
.p-zlecenie-gora strong { min-width: 0; }
.p-zlecenie-gora .tablica { flex-shrink: 0; }

/* kod QR do aplikacji */
.p-qr { width: min(260px, 70vw); margin: 0 auto; padding: 8px; background: #fff; border: 1.5px solid var(--linia); border-radius: 12px; }
.p-qr svg { display: block; width: 100%; height: auto; }

/* statystyki */
.chip-szybki.aktywny { background: var(--czarny); border-color: var(--czarny); color: #fff; }
a.chip-szybki { text-decoration: none; color: inherit; }
.p-stat-pod { display: block; color: var(--tekst-3); font-size: 13px; margin-top: 4px; }
.p-stat strong small { font-weight: 700; }
.p-wykres { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; min-height: 220px; }
.p-slupek { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; text-align: center; }
.p-slupek small { font-size: 11.5px; color: var(--tekst-3); }
.p-slupek b { font-size: 13px; text-transform: capitalize; }
.p-slupek-b { display: block; width: 100%; max-width: 56px; border-radius: 6px 6px 0 0; background: var(--czerwony); }

/* czat w panelu: na komputerze pole pisania przy dolnej krawędzi */
@media (min-width: 960px) { .panel .czat-pisz { bottom: 0; margin: 0; padding: 10px 0; } }
.wiersz-prawo .p-licznik { display: inline-grid; margin: 0 0 4px; }
