* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: system-ui, sans-serif;
    background: #f4f4f5;
    color: #18181b;
    padding: 2rem;
}

h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: .5rem;
}

.query-box {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: .75rem 1rem;
    border-radius: 8px;
    font-family: monospace;
    font-size: .875rem;
    margin-bottom: 1.5rem;
}

.info {
    font-size: .875rem;
    color: #71717a;
    margin-bottom: 1rem;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: .75rem 1rem;
    border-radius: 8px;
    font-size: .875rem;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e4e4e7;
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

thead th {
    background: #f9f9fb;
    padding: .625rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #52525b;
    border-bottom: 1px solid #e4e4e7;
    white-space: nowrap;
}

tbody td {
    padding: .625rem 1rem;
    border-bottom: 1px solid #f4f4f5;
    color: #3f3f46;
    white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: #fafafa; }

.null { color: #a1a1aa; font-style: italic; }

.empty {
    text-align: center;
    padding: 2rem;
    color: #a1a1aa;
}

/* --- Menu --- */
.menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #18181b;
    padding: .75rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.menu-brand {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    text-decoration: none;
    margin-right: .5rem;
}

.menu-links {
    display: flex;
    gap: .25rem;
    flex-wrap: wrap;
}

.menu-links a {
    color: #a1a1aa;
    text-decoration: none;
    font-size: .875rem;
    padding: .4rem .85rem;
    border-radius: 6px;
    transition: background .15s, color .15s;
}

.menu-links a:hover,
.menu-links a.active {
    background: #3f3f46;
    color: #fff;
}

/* --- Formularze --- */
.form-card {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    padding: 1.5rem;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.form-row label {
    font-size: .8rem;
    font-weight: 600;
    color: #52525b;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.form-row input,
.form-row select,
.form-row textarea {
    padding: .5rem .75rem;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    font-size: .9rem;
    font-family: inherit;
    color: #18181b;
    background: #fafafa;
    transition: border-color .15s;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #71717a;
    background: #fff;
}

.form-row textarea { resize: vertical; }

.btn {
    align-self: flex-start;
    padding: .55rem 1.25rem;
    background: #18181b;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}

.btn:hover { background: #3f3f46; }

/* --- Alerty --- */
.alert {
    padding: .75rem 1rem;
    border-radius: 8px;
    font-size: .875rem;
    margin-bottom: 1rem;
}

.alert-ok {
    background: #dcfce7;
    color: #166534;
}

/* --- Wyszukiwarka --- */
.search-wrap {
    position: relative;
    max-width: 520px;
    margin-bottom: 1.5rem;
}

.search-wrap input {
    width: 100%;
    padding: .6rem 1rem;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    font-size: .95rem;
    font-family: inherit;
    color: #18181b;
    background: #fff;
    transition: border-color .15s;
}

.search-wrap input:focus {
    outline: none;
    border-color: #71717a;
}

#szukaj-lista {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    list-style: none;
    margin: 0;
    padding: .25rem 0;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    z-index: 100;
    max-height: 320px;
    overflow-y: auto;
}

#szukaj-lista li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 1rem;
    cursor: pointer;
    gap: 1rem;
}

#szukaj-lista li:hover {
    background: #f4f4f5;
}

#szukaj-lista li.brak {
    color: #a1a1aa;
    font-size: .875rem;
    cursor: default;
    justify-content: center;
}

.s-klient {
    font-weight: 500;
    font-size: .9rem;
    color: #18181b;
    white-space: nowrap;
}

.s-pojazd {
    font-size: .8rem;
    color: #71717a;
    white-space: nowrap;
}

/* --- Karta klienta --- */
.karta {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.karta-naglowek {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}

.karta-naglowek h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: .35rem;
}

.karta-meta {
    font-size: .875rem;
    color: #52525b;
}

.karta-id {
    font-size: .8rem;
    color: #a1a1aa;
    white-space: nowrap;
}

/* --- Blok pojazdu --- */
.pojazd-blok {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 640px) {
    .pojazd-blok { grid-template-columns: 1fr; }
}

.pojazd-info,
.pojazd-zlecenia {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}

.pojazd-info h3,
.pojazd-zlecenia h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .75rem;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.info-table td {
    padding: .3rem 0;
    vertical-align: top;
}

.info-table td:first-child {
    color: #71717a;
    width: 40%;
    padding-right: .75rem;
}

/* --- Zlecenie w karcie --- */
.zlecenie-karta {
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
}

.zlecenie-karta:last-child { margin-bottom: 0; }

.zlecenie-naglowek {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .4rem;
}

.zlecenie-nr {
    font-weight: 600;
    font-size: .875rem;
    color: #18181b;
}

.zlecenie-data {
    font-size: .8rem;
    color: #a1a1aa;
    margin-left: auto;
}

.zlecenie-opis {
    font-size: .875rem;
    color: #3f3f46;
    margin-bottom: .4rem;
}

.zlecenie-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: .8rem;
    color: #71717a;
}

/* --- Badges --- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: .75rem; font-weight: 500; }
.b-nowe    { background: #E6F1FB; color: #0C447C; }
.b-w_toku  { background: #FAEEDA; color: #633806; }
.b-gotowe  { background: #EAF3DE; color: #27500A; }
.b-wydane  { background: #F1EFE8; color: #444441; }

/* --- Lista pojazdów w karcie --- */
.pojazd-pozycja {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .6rem .75rem;
    border-radius: 8px;
    border: 1px solid #e4e4e7;
    margin-bottom: .5rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    font-size: .875rem;
}

.pojazd-pozycja:last-child { margin-bottom: 0; }

.pojazd-pozycja:hover {
    background: #f4f4f5;
    border-color: #d4d4d8;
}

.pojazd-pozycja.aktywny {
    background: #18181b;
    border-color: #18181b;
    color: #fff;
}

.pojazd-pozycja.aktywny span {
    color: #a1a1aa;
}

.pojazd-rok {
    font-size: .8rem;
    color: #a1a1aa;
}

/* --- Nagłówek kolumny z przyciskiem --- */
.kolumna-naglowek {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.kolumna-naglowek h3 {
    margin-bottom: 0;
}

.btn-sm {
    padding: .3rem .75rem;
    background: #18181b;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}

.btn-sm:hover { background: #3f3f46; }

/* --- Tabele z sortowaniem --- */
.tabela-naglowek {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tabela-naglowek h1 { font-size: 1.25rem; }

thead th[data-col]:hover { background: #f0f0f1; }

.tbl .klikalny { cursor: pointer; }
.tbl .klikalny:hover td { background: #f4f4f5; }

.tbl .row-wydane td { color: #a1a1aa; }

.center { text-align: center; }
.right  { text-align: right; }

.opis-skrot {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Akcje przy pojeździe --- */
.pojazd-akcje {
    display: flex;
    gap: .5rem;
    margin-top: .35rem;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    font-size: .8rem;
    cursor: pointer;
    color: #a1a1aa;
}

.btn-link:hover       { color: #fff; }
.btn-danger:hover     { color: #fca5a5; }

/* --- Zlecenie klikalne --- */
.zlecenie-karta.klikalny { cursor: pointer; transition: background .15s; }
.zlecenie-karta.klikalny:hover { background: #f9f9fb; }

/* --- VIN z kopiowaniem --- */
.pojazd-vin {
    font-size: .78rem;
    color: #a1a1aa;
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-top: .1rem;
}

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .85rem;
    padding: 0;
    line-height: 1;
    opacity: .6;
    transition: opacity .15s;
}

.btn-copy:hover { opacity: 1; }

/* --- Nowy układ pojazdu na karcie --- */
.pv-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .3rem;
    font-size: .875rem;
}

.pv-row--between {
    justify-content: space-between;
}

.pv-vin {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: .75rem;
    color: #a1a1aa;
    font-family: monospace;
}

.pojazd-pozycja.aktywny .pv-vin { color: #71717a; }

.pv-silnik  { color: inherit; font-size: .85rem; }
.pv-rocznik { color: inherit; font-size: .85rem; }

.pv-tablica-row {
    margin-top: .5rem;
}

/* Tablica rejestracyjna */
.tablica-rej {
    display: inline-flex;
    align-items: stretch;
    border: 2px solid #18181b;
    border-radius: 4px;
    overflow: hidden;
    font-weight: 700;
    font-size: .85rem;
    height: 28px;
}

.pojazd-pozycja.aktywny .tablica-rej {
    border-color: #fff;
}

.tablica-pl {
    background: #003DA5;
    color: #fff;
    padding: 0 5px;
    display: flex;
    align-items: center;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.tablica-nr {
    background: #fff;
    color: #18181b;
    padding: 0 10px;
    display: flex;
    align-items: center;
    letter-spacing: .1em;
    min-width: 80px;
    justify-content: center;
}

.pv-uwagi {
    margin-top: .4rem;
    font-size: .82rem;
    color: inherit;
    opacity: .85;
    white-space: pre-line;
}

.pojazd-pozycja .pojazd-akcje {
    margin-top: 0;
}
/* --- Przypisz do klienta (zlecenia_pojazdu) --- */
.przypisz-blok {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    max-width: 520px;
}

.przypisz-blok h3 {
    font-size: 1rem;
    font-weight: 600;
}

.przypisz-search-wrap {
    position: relative;
    margin-bottom: .75rem;
}

.przypisz-search-wrap input {
    width: 100%;
    padding: .6rem 1rem;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    font-size: .95rem;
    font-family: inherit;
    color: #18181b;
    background: #fff;
    transition: border-color .15s;
}

.przypisz-search-wrap input:focus {
    outline: none;
    border-color: #71717a;
}

.przypisz-search-wrap ul {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    list-style: none;
    margin: 0;
    padding: .25rem 0;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
}

.przypisz-search-wrap ul li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 1rem;
    cursor: pointer;
    gap: 1rem;
}

.przypisz-search-wrap ul li:hover { background: #f4f4f5; }

.przypisz-search-wrap ul li.brak {
    color: #a1a1aa;
    font-size: .875rem;
    cursor: default;
    justify-content: center;
}

.przypisz-form {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.przypisz-wybrany {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    padding: .4rem .85rem;
    font-size: .875rem;
    font-weight: 500;
    color: #18181b;
}

.przypisz-wybrany .btn-link {
    color: #a1a1aa;
    font-size: .8rem;
}

.przypisz-wybrany .btn-link:hover { color: #18181b; }

/* --- Edycja zlecenia — nagłówek strony --- */
.zlecenie-naglowek-strony {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.zlecenie-naglowek-strony h1 {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
}

.inline-form { display: inline; }

.btn-wydaj {
    background: #166534;
    white-space: nowrap;
}
.btn-wydaj:hover { background: #14532d; }

/* --- Układ dwukolumnowy zlecenia --- */
.zlecenie-kolumny {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 700px) {
    .zlecenie-kolumny { grid-template-columns: 1fr; }
}

.zlecenie-lewa  { display: flex; flex-direction: column; }
.zlecenie-prawa { display: flex; flex-direction: column; }

.zlecenie-lewa .form-card { max-width: none; }

/* --- Blok czynności --- */
.czynnosci-blok {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.czynnosci-blok h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.czynnosci-lista {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.czynnosc-pozycja {
    background: #f9f9fb;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: .6rem .9rem;
}

.czynnosc-nazwa {
    font-weight: 600;
    font-size: .875rem;
    color: #18181b;
}

.czynnosc-opis {
    font-size: .82rem;
    color: #71717a;
    margin-top: .2rem;
    white-space: pre-line;
}

.czynnosc-form {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    border-top: 1px solid #f0f0f0;
    padding-top: 1rem;
}

/* --- Widok tylko do odczytu --- */
.form-value {
    padding: .5rem .75rem;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    font-size: .9rem;
    color: #3f3f46;
    min-height: 2.25rem;
}

/* --- Czynności w karcie zlecenia --- */
.zlecenie-czynnosci {
    margin-top: .5rem;
    padding-top: .5rem;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.zlecenie-czynnosc {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.zlecenie-czynnosc-nazwa {
    font-size: .8rem;
    font-weight: 500;
    color: #3f3f46;
}

.zlecenie-czynnosc-opis {
    font-size: .82rem;
    color: #71717a;
    padding-left: 1.25rem;
    white-space: pre-line;
}

/* --- Wszystkie zlecenia — kolumna czynności --- */
.czynnosci-kolumna {
    white-space: normal;
    min-width: 180px;
}

.czynnosc-wiersz {
    font-size: .8rem;
    color: #3f3f46;
    padding: .1rem 0;
}

/* --- tabela-naglowek z przyciskiem --- */
.tabela-naglowek .btn-sm { margin-left: auto; }

/* --- Przycisk Gotowe --- */
.btn-gotowe {
    background: #1d4ed8;
    white-space: nowrap;
}
.btn-gotowe:hover { background: #1e40af; }

/* --- Archiwalne w wyszukiwarce --- */
.s-archiwalny {
    color: #71717a;
    font-style: italic;
}

/* --- Nagłówek czynności z przyciskiem usuń --- */
.czynnosc-pozycja-naglowek {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.czynnosc-pozycja-naglowek .btn-danger { color: #fca5a5; font-size: .85rem; }
.czynnosc-pozycja-naglowek .btn-danger:hover { color: #ef4444; }

/* --- Przycisk Nie gotowe --- */
.btn-nie-gotowe {
    background: #71717a;
    white-space: nowrap;
}
.btn-nie-gotowe:hover { background: #52525b; }

/* --- Przycisk outline (np. Drukuj w karcie) --- */
.btn-sm-outline {
    background: #fff;
    color: #18181b;
    border: 1px solid #e4e4e7;
}
.btn-sm-outline:hover { background: #f4f4f5; }

/* --- Edycja czynności inline --- */
.czynnosc-edycja-form {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.czynnosc-edycja-input {
    padding: .4rem .6rem;
    border: 1px solid #71717a;
    border-radius: 6px;
    font-size: .875rem;
    font-family: inherit;
    background: #fff;
    width: 100%;
}
.czynnosc-edycja-textarea {
    padding: .4rem .6rem;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    font-size: .82rem;
    font-family: inherit;
    background: #fafafa;
    width: 100%;
    resize: vertical;
}
.czynnosc-edycja-input:focus,
.czynnosc-edycja-textarea:focus { outline: none; border-color: #71717a; background: #fff; }
.czynnosc-edycja-przyciski {
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* --- Przycisk Drukuj zlecenie --- */
.btn-druk-zlecenie {
    background: #f4f4f5;
    color: #18181b;
    border: 1px solid #e4e4e7;
    white-space: nowrap;
}
.btn-druk-zlecenie:hover { background: #e4e4e7; }

/* ============================================
   Podgląd zlecenia po utworzeniu
   ============================================ */
.podglad-zlecenia { display: flex; flex-direction: column; gap: 1.25rem; }

.podglad-naglowek {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

.podglad-siatka {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.podglad-karta {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.podglad-karta-tytul {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #71717a;
    margin-bottom: .15rem;
}

.podglad-pole { font-size: .875rem; color: #3f3f46; }

/* Sekcja podpisu */
.podglad-podpis-sekcja {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    max-width: 480px;
}

.btn-podpis {
    background: #1d4ed8;
    color: #fff;
    align-self: flex-start;
}
.btn-podpis:hover { background: #1e40af; }

.podpis-img {
    max-width: 100%;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    background: #fff;
}

/* ============================================
   Modal podpisu
   ============================================ */
.modal-podpis {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.modal-podpis[hidden] { display: none !important; }

.modal-podpis-box {
    /* pełna szerokość, pojawia się na górze ekranu */
    width: 100%;
    margin-top: 10vh;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: .875rem 1.25rem 1rem;
    box-shadow: 0 4px 32px rgba(0,0,0,.3);
}

.modal-podpis-naglowek {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: .95rem;
    color: #18181b;
}

.modal-podpis-info {
    font-size: .82rem;
    color: #71717a;
    margin-top: -.25rem;
}

.canvas-podpis {
    /* pełna szerokość modalu, wysokość = połowa szerokości viewport */
    width: 100%;
    height: 50vw;
    max-height: 380px;
    border: 1.5px solid #d4d4d8;
    border-radius: 8px;
    cursor: crosshair;
    touch-action: none;
    background: #fff;
    display: block;
}

.modal-podpis-przyciski {
    display: flex;
    gap: .75rem;
    align-items: center;
}

.btn-podpis-zapisz {
    background: #166534;
    margin-left: auto;
}
.btn-podpis-zapisz:hover { background: #14532d; }

#podpis-status { font-size: .85rem; }

/* --- Modal root — kontener poza #content --- */
#modal-root {
    position: relative;
    z-index: 99999;
}

/* --- Zdjęcia zlecenia --- */
.zdjecia-blok {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.zdjecia-siatka {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: .5rem;
}

.zdj-miniatura {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    transition: opacity .15s;
}

.zdj-miniatura:hover { opacity: .85; }

.zdj-miniatura img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.btn-dodaj-zdj {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .9rem;
    background: #18181b;
    color: #fff;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    align-self: flex-start;
    transition: background .15s;
}
.btn-dodaj-zdj:hover { background: #3f3f46; }
