/* Magazyn Awenor – kolory z logo: granat #10295A, turkus #0E8C96 */
:root {
  --granat: #10295A; --granat-2: #1B3A73; --turkus: #0E8C96; --turkus-2: #0B737B; --turkus-jasny: #E3F4F5;
  --tlo: #F3F6FA; --karta: #FFFFFF; --tekst: #0F172A; --szary: #64748B; --linia: #E2E8F0; --linia-2: #CBD5E1;
  --zielony: #059669; --zielony-jasny: #DCFCE7; --czerwony: #DC2626; --czerwony-jasny: #FEE2E2;
  --zolty: #D97706; --zolty-jasny: #FEF3C7; --pasek-wiersza: #F8FAFC;
  --cien: 0 1px 2px rgba(16, 41, 90, .06), 0 4px 16px rgba(16, 41, 90, .06);
  --promien: 12px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--tlo); color: var(--tekst); font-size: 14.5px; line-height: 1.45; }
a { color: var(--turkus-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0 0 2px; color: var(--granat); letter-spacing: -.3px; }
h2 { font-size: 17px; margin: 0 0 14px; color: var(--granat); }
code { background: var(--tlo); padding: 1px 5px; border-radius: 4px; }
.szary { color: var(--szary); } .zielony { color: var(--zielony); } .czerwony { color: var(--czerwony); }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13.5px; }
.p { text-align: right; white-space: nowrap; }

/* ── pasek górny ─────────────────────────────────────────── */
.pasek { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px;
  height: 64px; padding: 0 24px; background: var(--karta); border-bottom: 1px solid var(--linia);
  box-shadow: 0 1px 0 rgba(16,41,90,.03); }
.logo img { height: 34px; display: block; }
.pasek-nazwa { font-weight: 700; color: var(--turkus); border-left: 2px solid var(--linia); padding-left: 16px;
  font-size: 15px; letter-spacing: .5px; text-transform: uppercase; }
.menu { display: flex; gap: 4px; flex: 1; }
.menu a { padding: 8px 14px; border-radius: 8px; color: var(--granat); font-weight: 600; }
.menu a:hover { background: var(--tlo); text-decoration: none; }
.menu a.aktywna { background: var(--turkus-jasny); color: var(--turkus-2); }
.konto { display: flex; align-items: center; gap: 10px; }
.kto { display: flex; align-items: center; gap: 8px; color: var(--tekst); }
.awatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(135deg, var(--granat), var(--turkus)); color: #fff; }
.konto form { margin: 0; }

.tresc { max-width: 1400px; margin: 0 auto; padding: 26px 24px 40px; }
.stopka { text-align: center; color: var(--szary); font-size: 12px; padding: 10px 0 24px; }

/* ── przyciski ───────────────────────────────────────────── */
.przycisk { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--linia-2);
  background: #fff; color: var(--granat); font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 9px;
  cursor: pointer; text-decoration: none; transition: background .15s, box-shadow .15s; white-space: nowrap; }
.przycisk:hover { background: var(--tlo); text-decoration: none; }
.przycisk.glowny { background: linear-gradient(135deg, var(--turkus), var(--turkus-2)); border-color: var(--turkus-2); color: #fff;
  box-shadow: 0 2px 6px rgba(14, 140, 150, .3); }
.przycisk.glowny:hover { filter: brightness(1.06); }
.przycisk.duzy { padding: 12px 22px; font-size: 15.5px; }
.przycisk.maly { padding: 5px 10px; font-size: 13px; }
.przycisk.cichy { border-color: transparent; background: transparent; color: var(--szary); }
.przycisk.cichy:hover { background: var(--tlo); color: var(--granat); }
.przycisk.szeroki { width: 100%; }
.przycisk[disabled] { opacity: .55; cursor: wait; }
.ikona-przycisk { border: 0; background: none; cursor: pointer; color: var(--szary); font-size: 18px; padding: 4px 8px; border-radius: 6px; }
.ikona-przycisk:hover { background: var(--czerwony-jasny); color: var(--czerwony); }

/* ── karty i układ ───────────────────────────────────────── */
.naglowek { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.naglowek p { margin: 4px 0 0; }
.okruszki { margin: 0 0 4px !important; font-size: 13px; }
.karta { background: var(--karta); border-radius: var(--promien); box-shadow: var(--cien); padding: 22px 24px; margin-bottom: 20px;
  border: 1px solid rgba(226, 232, 240, .7); }
.karta.bez-wypelnienia { padding: 0; overflow: hidden; }
.karta.waska { max-width: 640px; }
.w-karcie { padding: 18px 22px 0; }
.siatka-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.siatka-2.szeroka-lewa { grid-template-columns: 2fr 1fr; }
.siatka-2 > .karta { margin-bottom: 0; }
.siatka-2 + .karta, .siatka-2 + section { margin-top: 20px; }

.kafle { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kafel { background: var(--karta); border-radius: var(--promien); box-shadow: var(--cien); padding: 14px 18px;
  border: 1px solid rgba(226, 232, 240, .7); }
.kafel span { display: block; color: var(--szary); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
.kafel b { font-size: 22px; color: var(--granat); }
.kafel.duzy b { font-size: 28px; }
.kafel b.zielony { color: var(--zielony); } .kafel b.czerwony { color: var(--czerwony); } .kafel b.szary { color: var(--szary); }

/* ── komunikaty ──────────────────────────────────────────── */
.komunikat { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.komunikat.ok { background: var(--zielony-jasny); border-color: #86EFAC; color: #065F46; }
.komunikat.blad { background: var(--czerwony-jasny); border-color: #FCA5A5; color: #991B1B; }
.komunikat.uwaga { background: var(--zolty-jasny); border-color: #FCD34D; color: #92400E; }
.haslo-tymczasowe { display: inline-block; font-family: Consolas, monospace; font-size: 18px; font-weight: 700;
  background: #fff; border: 1px dashed var(--turkus); padding: 6px 12px; border-radius: 8px; color: var(--granat); }
.pusto { color: var(--szary); text-align: center; padding: 26px 10px !important; }

/* ── formularze ──────────────────────────────────────────── */
.formularz { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--granat); }
input, select, textarea { font: inherit; font-weight: 400; color: var(--tekst); padding: 10px 12px; border: 1px solid var(--linia-2);
  border-radius: 9px; background: #fff; transition: border-color .15s, box-shadow .15s; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--turkus); box-shadow: 0 0 0 3px rgba(14, 140, 150, .16); }
label.zaznacz { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--tekst); margin: 10px 0; }
.pola-w-rzedzie { display: flex; gap: 16px; flex-wrap: wrap; }
.pola-w-rzedzie > label { flex: 1 1 200px; }
.pola-w-rzedzie > label.rozciagnij { flex: 3 1 300px; }
.przyciski-koniec { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.szukaj { min-width: 280px; flex: 1; padding-left: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748B' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; }

.filtry { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.zakladki { display: flex; gap: 4px; background: #E8EDF4; padding: 4px; border-radius: 10px; flex-wrap: wrap; }
.zakladka { border: 0; background: transparent; font: inherit; font-weight: 600; padding: 7px 14px; border-radius: 7px;
  cursor: pointer; color: var(--szary); }
.zakladka:hover { color: var(--granat); }
.zakladka.aktywna { background: #fff; color: var(--granat); box-shadow: 0 1px 3px rgba(16,41,90,.12); }

/* ── tabele ──────────────────────────────────────────────── */
.tabela { width: 100%; border-collapse: collapse; }
.tabela th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--szary);
  font-weight: 700; padding: 11px 14px; background: #F8FAFC; border-bottom: 1px solid var(--linia); white-space: nowrap; }
.tabela td { padding: 11px 14px; border-bottom: 1px solid var(--linia); vertical-align: middle; }
.tabela tbody tr:nth-child(even) td { background: var(--pasek-wiersza); }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela.klikalna tbody tr[data-href] { cursor: pointer; }
.tabela.klikalna tbody tr[data-href]:hover td { background: var(--turkus-jasny); }
.tabela tr.pusty td { color: #94A3B8; }
.tabela tr.ostrzezenie td { background: #FFF7ED; }
.tabela td.nazwa { font-weight: 600; }
.tabela tfoot td { font-weight: 600; border-bottom: 0; }
.tabela tfoot tr.razem td { font-size: 16px; color: var(--granat); border-top: 2px solid var(--granat); }
.akcje form { display: flex; gap: 4px; justify-content: flex-end; margin: 0; }

.stan { display: inline-block; min-width: 46px; text-align: center; padding: 3px 10px; border-radius: 20px; font-weight: 700; }
.stan.jest { background: var(--zielony-jasny); color: #047857; }
.stan.brak { background: #F1F5F9; color: #94A3B8; }
.stan.niski { background: var(--zolty-jasny); color: #B45309; }
.znaczek { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  background: var(--turkus-jasny); color: var(--turkus-2); }
.znaczek.zolty { background: var(--zolty-jasny); color: #B45309; }
.znaczek.szary { background: #F1F5F9; color: var(--szary); }
.znaczek.typ-pz { background: var(--zielony-jasny); color: #047857; }
.znaczek.typ-rw { background: #DBEAFE; color: #1D4ED8; }
.znaczek.typ-us, .znaczek.typ-kor { background: var(--czerwony-jasny); color: #B91C1C; }

/* ── logowanie ───────────────────────────────────────────── */
body.bez-menu { background: radial-gradient(1200px 600px at 10% -10%, #D7EEF0 0%, transparent 60%),
  radial-gradient(900px 500px at 110% 110%, #D9E1F2 0%, transparent 55%), var(--tlo); }
.logowanie { min-height: 90vh; display: grid; place-items: center; }
.logowanie-karta { width: min(420px, 100%); background: #fff; border-radius: 18px; padding: 36px 34px;
  box-shadow: 0 10px 40px rgba(16, 41, 90, .14); text-align: center; }
.logowanie-karta .formularz { text-align: left; margin-top: 18px; }
.logowanie-logo { width: 230px; max-width: 80%; margin-bottom: 10px; }
.logowanie-karta h1 { font-size: 22px; }

/* ── przyjęcie ───────────────────────────────────────────── */
.krok h2 { display: flex; align-items: center; gap: 10px; }
.krok .nr { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--granat), var(--turkus)); }
.wiersz-akcji { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.lista-dostawcow { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.dostawca-kafel { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--linia);
  border-radius: 10px; color: var(--tekst); transition: border-color .15s, box-shadow .15s, transform .1s; }
.dostawca-kafel:hover { border-color: var(--turkus); box-shadow: 0 3px 12px rgba(14,140,150,.16); text-decoration: none; transform: translateY(-1px); }
.dostawca-kafel b { color: var(--granat); }
.dostawca-kafel span { font-size: 12.5px; }
.dostawca-wybrany { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--turkus-jasny); border-radius: 10px; margin-bottom: 16px; }
.dostawca-wybrany b { display: block; color: var(--granat); font-size: 16px; }
.dodawanie { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.podpowiedzi-pole { position: relative; flex: 1; min-width: 280px; display: flex; }
.podpowiedzi { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; background: #fff;
  border: 1px solid var(--linia-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(16,41,90,.15); max-height: 330px; overflow: auto; }
.podpowiedz { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--linia); }
.podpowiedz:last-child { border-bottom: 0; }
.podpowiedz:hover, .podpowiedz.wybrana { background: var(--turkus-jasny); }
.podpowiedz small { color: var(--szary); }
.pozycje input { padding: 7px 9px; width: 100%; }
.pozycje .w-ilosc { width: 100px; } .pozycje .w-jm { width: 90px; } .pozycje .w-cena { width: 130px; }
.pozycje input.liczba { text-align: right; }
.pozycje tr.nowa td { background: #FFFBEB !important; }
.pozycje .nowa-pola { display: flex; gap: 6px; }
.pozycje .nowa-pola input:first-child { flex: 2; }
.pozycje .nowa-pola input:last-child { flex: 1; }
.pozycje .opis-czesci b { display: block; }
.pozycje .opis-czesci small { color: var(--szary); }
.podsumowanie { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin: 16px 0 6px; flex-wrap: wrap; }
.podsumowanie div span { display: block; font-size: 12px; color: var(--szary); text-transform: uppercase; }
.podsumowanie b { font-size: 18px; color: var(--granat); }
.podsumowanie .razem b { font-size: 24px; color: var(--turkus-2); }
.podsumowanie .plus { color: var(--szary); font-size: 20px; }
input.blad { border-color: var(--czerwony); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }

/* ── dokument (ekran i druk) ─────────────────────────────── */
.dokument { background: #fff; max-width: 1000px; margin: 0 auto; padding: 40px 46px; border-radius: var(--promien); box-shadow: var(--cien); }
.dok-naglowek { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--granat);
  padding-bottom: 18px; margin-bottom: 22px; }
.dok-logo { height: 58px; }
.dok-tytul { text-align: right; }
.dok-tytul h1 { font-size: 22px; }
.dok-nr { font-size: 18px; font-weight: 700; color: var(--turkus-2); margin: 2px 0; }
.dok-strony { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.dok-strony > div { background: #F8FAFC; border: 1px solid var(--linia); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.etyk { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--szary); font-weight: 700; margin-bottom: 4px; }
.dok-tabela th { background: var(--granat); color: #fff; }
.dok-podpisy { display: flex; justify-content: space-between; gap: 40px; margin-top: 70px; }
.dok-podpisy div { flex: 1; text-align: center; color: var(--szary); font-size: 12px; border-top: 1px dotted #94A3B8; padding-top: 6px; }
.dok-podpisy span { display: block; color: var(--tekst); font-size: 13px; margin-top: -28px; margin-bottom: 14px; }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 11.5px; }
  .pasek, .stopka, .nie-drukuj, .komunikat { display: none !important; }
  .tresc { padding: 0; max-width: none; }
  .dokument { box-shadow: none; padding: 0; max-width: none; }
  .tabela td, .tabela th { padding: 6px 8px; }
  .dok-tabela th { background: var(--granat) !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── telefon / tablet ────────────────────────────────────── */
@media (max-width: 900px) {
  .pasek { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .pasek-nazwa, .kto-nazwa { display: none; }
  .menu { order: 3; flex-basis: 100%; overflow-x: auto; }
  .tresc { padding: 18px 12px 30px; }
  .siatka-2, .siatka-2.szeroka-lewa { grid-template-columns: 1fr; }
  .karta.bez-wypelnienia, .karta:has(> .tabela) { overflow-x: auto; }
  .tabela { min-width: 720px; }
  .dokument { padding: 18px; }
  h1 { font-size: 22px; }
}

/* dokument – zwarte kolumny liczbowe, numer części w jednej linii */
.dokument { max-width: 1100px; }
.dok-tabela td.mono { white-space: nowrap; }
.dok-tabela th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.dok-tabela td { padding: 9px 10px; }
.dok-tabela th:nth-child(3), .dok-tabela td:nth-child(3) { width: 34%; }

/* ── administracja: zakładki, role i uprawnienia ─────────── */
.maly-tekst { font-size: 12.5px; }
.admin-zakladki { display: inline-flex; margin-bottom: 20px; }
.admin-zakladki a.zakladka { text-decoration: none; }
.siatka-role { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.siatka-role > .karta { margin-bottom: 0; }
.lista-rol { display: flex; flex-direction: column; gap: 6px; }
.lista-rol .rola { display: flex; flex-direction: column; gap: 1px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--linia); color: var(--tekst); transition: border-color .15s, background .15s; }
.lista-rol .rola:hover { border-color: var(--turkus); text-decoration: none; }
.lista-rol .rola.aktywna { background: var(--turkus-jasny); border-color: var(--turkus); }
.lista-rol .rola b { color: var(--granat); }
.lista-rol .rola span { font-size: 12.5px; }
.lista-rol .nowa-rola { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--linia); gap: 10px; }
.tabela .c { text-align: center; width: 80px; }
.tabela.uprawnienia input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--turkus); cursor: pointer; }
.tabela.uprawnienia input[type=checkbox]:disabled { cursor: default; }

/* ── baza części ─────────────────────────────────────────── */
.miniatura-kol { width: 56px; padding-right: 0 !important; }
.miniatura { display: block; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: #F1F5F9; border: 1px solid var(--linia); }
.zdjecie-czesci { display: grid; place-items: center; min-height: 180px; background: #F8FAFC; border: 1px dashed var(--linia-2);
  border-radius: 10px; margin-bottom: 16px; overflow: hidden; }
.zdjecie-czesci img { display: block; max-width: 100%; max-height: 340px; object-fit: contain; }
.dodaj-dostawce { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--linia); }
.dodaj-dostawce > label { flex: 1 1 140px; }
.dodaj-dostawce > label.rozciagnij { flex: 3 1 260px; }
.dodaj-dostawce > label.zaznacz { flex: 0 0 auto; margin: 0 0 10px; }
.naglowek .wiersz-akcji { margin-bottom: 0; }

@media (max-width: 900px) {
  .siatka-role { grid-template-columns: 1fr; }
}

/* stan: (wydane do urządzeń) magazyn / zamówione */
.stan { white-space: nowrap; }
.stan .stan-wydane { color: #1D4ED8; font-weight: 600; margin-right: 2px; }
.stan .stan-zam { color: var(--szary); font-weight: 600; }
.stan-legenda { display: block; font-size: 10.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: #94A3B8; }

/* ── zamówienia ──────────────────────────────────────────── */
.znaczek.duzy-znaczek { font-size: 13px; padding: 3px 10px; vertical-align: middle; margin-left: 6px; }
progress.postep { width: 70px; height: 8px; vertical-align: middle; border: 0; border-radius: 6px; background: #E2E8F0; overflow: hidden; }
progress.postep::-webkit-progress-bar { background: #E2E8F0; border-radius: 6px; }
progress.postep::-webkit-progress-value { background: var(--zielony); border-radius: 6px; }
progress.postep::-moz-progress-bar { background: var(--zielony); border-radius: 6px; }
.dodaj-pozycje { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 16px 22px 20px; border-top: 1px solid var(--linia);
  background: #FBFCFE; }
.dodaj-pozycje .podpowiedzi-pole { flex: 1 1 320px; }
.dodaj-pozycje .podpowiedzi-pole input { width: 100%; }
.dodaj-pozycje label { flex: 0 0 auto; }
.przyciski-koniec.wewnatrz { padding: 0 22px 16px; }
.przyciski-statusu { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.dodaj-dostawce.bez-kreski { border-top: 0; margin-top: 0; padding-top: 0; }
p.w-karcie { padding-top: 4px; margin: 0 0 8px; }
.siatka-2 > div > .karta:last-child { margin-bottom: 0; }
.przyciski-koniec > .maly-tekst { align-self: center; margin-right: auto; }
