/* Mobilny asystent wyjazdów – style */

:root {
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-color: #333;
    --text-muted: #555;          /* 2026-10-10: wyższy kontrast w słońcu */
    --input-bg: rgba(0, 0, 0, 0.05);
    --tile-press: #e9f2ff;
    --row-hover: #f1f3f5;
    --menu-bg: #f1f3f5; --menu-fg: #212529; --menu-border: #dee2e6;
}

[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
    --card-bg: rgba(50, 50, 50, 0.9);
    --text-color: #eee;
    --text-muted: #bbb;
    --input-bg: rgba(255, 255, 255, 0.1);
    --tile-press: #2b3a55;
    --row-hover: #3a3a3a;
    --menu-bg: #3a3a3a; --menu-fg: #eee; --menu-border: #555;
}

/* 2026-10-11: gradient na <html> rozciągnięty na cały dokument (min-height 100%, no-repeat) – jeden przebieg zamiast
   powtarzania co ekran; bez background-attachment: fixed (Android przerysowywał tło przy scrollu) */
html { min-height: 100%; background: var(--bg-gradient) no-repeat; background-color: #c3cfe2; }
body {
    margin: 0;
    font-family: sans-serif;
    background: transparent;
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-bottom: 80px; 
    padding-top: var(--pasek-gora, 0px);   /* 2026-11-12: paski u góry (zasięg, kolejka) przesuwają ekran w dół, nie zasłaniają go */
}

.container { padding: 15px; }

.tile {
    width: 100%;
    margin-bottom: 15px;
    padding: 20px;
    border-radius: 15px;
    background: var(--card-bg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    box-sizing: border-box;
    position: relative;
}

.hidden { display: none !important; }

nav { 
    padding: 10px 15px; 
    background: rgba(0,0,0,0.1); 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

button {
    padding: 8px 12px;
    min-height: 44px;                    /* 2026-10-10: cel dotyku ≥ 44 px (rękawiczki, w ruchu) */
    border: none;
    border-radius: 5px;
    background-color: #007BFF;
    color: white;
    cursor: pointer;
    font-size: 14px;
}
@media (hover: hover) { button:hover { background-color: #0056b3; } }   /* na dotyku „wciśnięty” kolor nie zostaje po tapnięciu */

.btn-group { display: flex; gap: 10px; margin-top: 10px; }
.btn-action { background-color: #6c757d; font-size: 14px; padding: 10px 15px; flex: 1; text-align: center; }

.history-wrapper { max-height: 250px; overflow-y: auto; margin-bottom: 15px; }
.history-tile { background: var(--input-bg); border-left: 4px solid #007BFF; padding: 8px 10px; border-radius: 4px; margin-bottom: 8px; font-size: 13px; }
.history-header { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 12px; font-weight: bold; opacity: 0.7; }

.sticky-search {
    position: sticky;
    top: var(--pasek-gora, 0px);           /* 2026-11-12: pod paskiem zasięgu / kolejki, nie pod nim */
    background: var(--bg-gradient);
    padding: 10px 15px;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 10px;
}
.search-input {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 16px;
    background: var(--card-bg);
    color: var(--text-color);
}

.product-tile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
}
.product-info { flex: 1; padding-right: 10px; }
.product-nazwa { font-weight: bold; margin-bottom: 5px; font-size: 15px; }
.product-symbol { font-size: 12px; color: var(--text-muted); }
        
/* Zaktualizowany Stepper (Wybierak ilości) z przyciskami +/- 10 */
.stepper {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    overflow: hidden; /* żeby przyciski nie wychodziły za zaokrąglone rogi */
}
.stepper button {
    background: transparent;
    color: var(--text-color);
    font-size: 20px;
    width: 42px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: none;
    cursor: pointer;
}
.stepper button.btn-ten {
    font-size: 14px; /* mniejsza czcionka dla wartości "10" */
    font-weight: bold;
    width: 40px;
    background: rgba(0,0,0,0.03); /* lekkie odcięcie kolorem */
}
[data-theme="dark"] .stepper button.btn-ten {
    background: rgba(255,255,255,0.05);
}
.stepper input {
    width: 52px;                         /* ilości ≥ 1000 */
    text-align: center;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-color);
    font-weight: bold;
}

.bottom-cart-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--card-bg);
    padding: 15px;
    box-shadow: 0 -2px 15px rgba(0,0,0,0.2);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-save-cart {
    background-color: #28a745;
    font-size: 16px;
    font-weight: bold;
    padding: 12px 20px;
    width: 100%;
}

.form-control {
    width: 100%;
    height: 120px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: var(--card-bg); color: var(--text-color);   /* tryb ciemny */
    box-sizing: border-box;
    font-family: inherit;
    font-size: 15px;
    margin-bottom: 15px;
    resize: vertical;
}

.radio-group { margin-bottom: 20px; }
.radio-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
    cursor: pointer;
}
.radio-group input[type="radio"] {
    transform: scale(1.3);
    margin-right: 10px;
}

.btn-save { background-color: #28a745; }
.btn-save:hover { background-color: #218838; }
.btn-cancel { background-color: #dc3545; }
.btn-cancel:hover { background-color: #c82333; }
/* Szczegóły klienta – kompaktowe tabele */
.point-tile { position: relative; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.point-tile.wcisniety { background: var(--tile-press); }
.punkt-dodawanie { border: 2px dashed #adb5bd; background: var(--card-bg); opacity: .7; cursor: default; }
.ki-sekcja { margin-top: 14px; }
/* symbol faktury w prawym górnym rogu kafelka (2026-10-10, wcześniej pod „Popraw”): czerwony = niezatwierdzone,
   żółty = zamówienie zatwierdzone, zielony = FV wystawiona */
/* 2026-10-11: symbol faktury i paczka w jednym wierszu (prawy górny róg kafelka) */
.znaki { position: absolute; top: 10px; right: 10px; z-index: 2; display: flex; gap: 6px; align-items: center; }
.znaki:empty { display: none; }
.fv-znak { width: 34px; height: 30px; line-height: 30px; text-align: center;
           font-size: 18px; border-radius: 8px; border: 2px solid; }
.fv-znak.fv-zatw { background: #fff3cd; border-color: #e0a800; }
.fv-znak.fv-fv { background: #d4edda; border-color: #28a745; }
.fv-znak.fv-niezatw { background: #f8d7da; border-color: #dc3545; }
.btn-paczka { width: 34px; height: 30px; min-height: 30px; padding: 0; font-size: 18px; line-height: 30px;
              border-radius: 8px; border: 2px solid #fd7e14; background: #fff3e0; cursor: pointer; animation: paczkaPuls 1.6s ease-in-out infinite; }
/* okna dolne (menu punktu, dodaj punkt, notatka, NIP) */
.arkusz { position: fixed; inset: 0; z-index: 520; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.arkusz > div { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--card-bg); color: var(--text-color);
                border-radius: 18px 18px 0 0; padding: 16px 16px 22px; box-shadow: 0 -6px 30px rgba(0,0,0,.3); }
.arkusz .naglowek { display: flex; align-items: center; margin-bottom: 12px; gap: 10px; }
.arkusz .naglowek strong { font-size: 17px; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.arkusz .naglowek button { background: #6c757d; color: #fff; padding: 6px 14px; min-width: 44px; margin-left: auto; width: auto; flex: 0 0 auto; margin-bottom: 0; text-align: center; }
.arkusz input[type=text], .arkusz textarea { width: 100%; box-sizing: border-box; padding: 12px; border-radius: 8px; border: 1px solid #ccc; font-size: 16px;
                background: var(--card-bg); color: var(--text-color); }
.menu-punkt > button { width: 100%; padding: 14px; font-size: 16px; text-align: left; margin-bottom: 8px; background: var(--menu-bg); color: var(--menu-fg); border: 1px solid var(--menu-border); }
@media (hover: hover) { .menu-punkt > button:hover { background: var(--row-hover); } }
.firma-wynik { padding: 10px 12px; min-height: 44px; border: 1px solid var(--menu-border); border-radius: 8px; margin-top: 8px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
@media (hover: hover) { .firma-wynik:hover { background: var(--row-hover); } }
.btn-tel { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 10px; border-radius: 18px; background: #28a745; color: #fff; text-decoration: none; font-size: 13px; white-space: nowrap; }
.firma-wynik .km { margin-left: auto; white-space: nowrap; font-weight: bold; color: #0d6efd; }
.firma-wynik.na-trasie { opacity: .55; cursor: default; }
@keyframes paczkaPuls { 0%,100% { box-shadow: 0 0 0 0 rgba(253,126,20,.55); } 50% { box-shadow: 0 0 0 6px rgba(253,126,20,0); } }
.ki-sekcja > summary { cursor: pointer; font-weight: bold; font-size: 15px; padding: 6px 0; }
.mini-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 4px; }
.mini-tab th { text-align: left; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid rgba(128,128,128,.35); padding: 4px 3px; }
.mini-tab td { border-bottom: 1px solid rgba(128,128,128,.15); padding: 5px 3px; vertical-align: top; }
.mini-tab .r { text-align: right; white-space: nowrap; }
.ki-alert { padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-top: 10px; }
.ki-alert.ok   { background: #d1e7dd; color: #0f5132; }
.ki-alert.wn   { background: #fff3cd; color: #664d03; }
.ki-alert.err  { background: #f8d7da; color: #842029; }
.dim { opacity: .75; }
.stan-tab { font-size: 12px; background: var(--card-bg); border-radius: 8px; }
.stan-tab td, .stan-tab th { padding: 3px 4px; line-height: 1.25; }
.stan-tab td:first-child { max-width: 0; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* cena po podwyżce – pierwsze zamówienie od ostatniego zakupu */
input.cena-podwyzka { color: #d32f2f !important; font-weight: 800 !important; border: 2px solid #d32f2f !important; }
/* 2026-11-17 (p479): rabat 0% bez historii zakupów – czerwone pole w podsumowaniu zamówienia i ostrzeżenie przed zapisem */
input.rabat-brak { background: #dc2626 !important; color: #fff !important; font-weight: 800 !important; border: 2px solid #991b1b !important; }
.rabat-brak-info { margin: -2px 0 8px; padding: 5px 8px; border-radius: 6px; background: #fee2e2; color: #991b1b; font-size: 12px; font-weight: 700; }
[data-theme="dark"] .rabat-brak-info { background: #5c1515; color: #fecaca; }
.rabat-alarm { position: fixed; inset: 0; z-index: 10000; background: rgba(127, 29, 29, .82); display: flex; align-items: center; justify-content: center; padding: 16px; }
.rabat-alarm .ra-okno { width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; background: var(--card-bg, #fff); color: var(--text-color, #222); border-radius: 16px; border: 4px solid #dc2626;
                        box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: raPuls .9s ease-in-out 3; }
@keyframes raPuls { 50% { box-shadow: 0 0 0 12px rgba(220, 38, 38, .55), 0 20px 60px rgba(0,0,0,.5); } }
.rabat-alarm .ra-gl { background: #dc2626; color: #fff; font-size: 24px; font-weight: 800; text-align: center; padding: 14px; border-radius: 11px 11px 0 0; }
.rabat-alarm .ra-tr { padding: 14px 16px 6px; font-size: 15px; line-height: 1.4; }
.rabat-alarm .ra-tr ul { margin: 8px 0; padding-left: 22px; font-weight: 700; }
.rabat-alarm button { display: block; width: calc(100% - 32px); margin: 10px 16px; min-height: 54px; font-size: 16px; font-weight: 800; border-radius: 10px; }
.rabat-alarm .ra-wroc { background: #0d6efd; }
.rabat-alarm .ra-zapisz { background: #dc2626; margin-bottom: 16px; }
.cena-podwyzka-info { color: #d32f2f; font-weight: 700; }
/* tytuł ekranu (np. Reklamacje) – nad wyszukiwarką, żeby było widać, gdzie jesteśmy */
/* 2026-11-12: min-width 0 – bez tego długa nazwa firmy rozpychała tytuł (flex) i ekran przesuwał się w bok zamiast obciąć nazwę „…” */
.tytul-widoku { flex-basis: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; white-space: nowrap; display: flex; align-items: baseline; gap: 4px; font-weight: 800; font-size: 17px;
                padding: 8px 12px; border-radius: 8px; color: #fff; background: #0d6efd; }
.tytul-widoku.tytul-rekl { background: #dc3545; }
.tytul-firma { flex: 1 1 auto; font-weight: 400; font-size: 14px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* następny punkt do odwiedzenia na liście punktów trasy */
.punkt-nastepny { border: 3px solid #0d6efd; box-shadow: 0 0 0 4px rgba(13,110,253,.18); }
.punkt-nastepny-etykieta { display: inline-block; background: #0d6efd; color: #fff; font-size: 12px; font-weight: 700;
                           padding: 3px 9px; border-radius: 12px; margin-bottom: 6px; }

/* 2026-11-16 (p474): droga od poprzedniego punktu (tylko na następnym punkcie) i sztuczny kafelek „Impet” na końcu listy punktów */
.punkt-droga { display: block; margin: 0 0 6px 2px; font-size: 13px; font-weight: 700; color: #b91c1c; white-space: nowrap; }
.punkt-droga small { font-weight: 400; color: var(--text-muted); }
[data-theme="dark"] .punkt-droga { color: #ff9c9c; }
.punkt-impet { border-left: 6px solid #2b2382; cursor: default; }
.impet-sym { width: 30px; height: 30px; flex-shrink: 0; }
/* 2026-11-16 (p474): kafelek trasy – data startu jak w programie, zrobione / wszystkie punkty, pasek postępu, droga do następnego punktu */
.trasa-kaf { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; }
.tk-dz { width: 60px; flex-shrink: 0; text-align: center; border-radius: 10px; background: var(--input-bg); border: 1px solid rgba(148,163,184,.45); padding: 6px 0 5px; line-height: 1.1; }
.tk-dz .d { font-size: 27px; font-weight: 800; }
.tk-dz .m { font-size: 12px; font-weight: 700; color: #2563eb; text-transform: uppercase; }
.tk-dz .t { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
[data-theme="dark"] .tk-dz .m { color: #7fb0ff; }
.tk-srod { flex: 1; min-width: 0; }
.tk-srod h3 { margin: 0 0 6px; font-size: 17px; overflow-wrap: anywhere; }
.tk-licz { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.tk-licz b { font-size: 15px; color: var(--text-color); }
.tk-post { height: 8px; border-radius: 4px; background: rgba(148,163,184,.35); overflow: hidden; }
.tk-post i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #4ade80, #16a34a); }
.tk-nast { margin-top: 6px; font-size: 13px; overflow-wrap: anywhere; }
.tk-nast b { white-space: nowrap; }

/* Telefony (2026-10-11): wybór numeru po „Zadzwoń” i lista w szczegółach klienta */
.tel-wybor { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; min-height: 44px; margin-bottom: 8px; border-radius: 10px;
             background: var(--input-bg); color: var(--text-color); text-decoration: none; border-left: 4px solid #28a745; }
.tel-numer { font-size: 17px; font-weight: bold; }
.tel-podst { font-size: 11px; font-weight: normal; color: #28a745; margin-left: 6px; }
.tel-opis { font-size: 13px; color: var(--text-muted); }
.btn-zamknij { width: 44px; height: 44px; min-height: 44px; padding: 0; flex: 0 0 44px; border-radius: 50%; font-size: 18px; }
/* Tekst sformatowany z Accessa (richHtml) – akapity <div>/<p> bez dużych marginesów */
.rich p, .rich div { margin: 0; }
.rich ul, .rich ol { margin: 4px 0; padding-left: 22px; }

/* 2026-11-11 e: dokumenty WZ / PW na ekranie Stan auta (js/autoTel.js) */
.auto-dok { border: 1px solid rgba(128,128,128,.3); border-radius: 8px; padding: 7px 9px; margin: 6px 0; font-size: 13px; background: rgba(128,128,128,.06); }
.auto-dok.zast { opacity: .45; text-decoration: line-through; }
.auto-gora { margin-bottom: 3px; }
.auto-typ { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; color: #fff; margin-right: 3px; }
.auto-typ.wz { background: #dc3545; } .auto-typ.pw { background: #198754; }
.auto-zn { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 10px; }
.auto-zn.ok { background: rgba(25,135,84,.18); } .auto-zn.wysl { background: rgba(13,110,253,.18); }
.auto-zn.czeka { background: #fff3cd; color: #664d03; } .auto-zn.blad { background: #f8d7da; color: #842029; }
