* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    color: #222;
}


/* =========================================================
   MAPA
========================================================= */

#map {
    position: fixed;

    top: 0;
    right: 0;
    bottom: 0;
    left: 360px;

    z-index: 1;

    background: #e5e5e5;
}


/* =========================================================
   LEWY PANEL
========================================================= */

#panel {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: 360px;
    height: 100vh;

    box-sizing: border-box;

    padding: 20px;

    background: #ffffff;

    z-index: 1000;

    overflow-y: auto;

    box-shadow:
        2px 0 8px rgba(0, 0, 0, 0.15);
}


/* =========================================================
   TYTUŁ APLIKACJI
========================================================= */

.app-title {
    margin-bottom: 24px;
}

.app-title h1 {
    margin: 0 0 8px 0;

    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
}

.app-title p {
    margin: 0;

    font-size: 13px;
    line-height: 1.5;

    color: #666;
}


/* =========================================================
   SEKCJE
========================================================= */

.section {
    margin-bottom: 22px;
}

.section h3 {
    margin: 0 0 9px 0;

    font-size: 14px;
    font-weight: 700;

    color: #333;
}


/* =========================================================
   SELECT
========================================================= */

select {
    width: 100%;

    min-height: 38px;

    padding: 8px 10px;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    background: #ffffff;

    color: #222;

    font-family: inherit;
    font-size: 13px;

    cursor: pointer;
}

select:focus {
    outline: none;

    border-color: #2563eb;

    box-shadow:
        0 0 0 2px rgba(37, 99, 235, 0.12);
}


/* =========================================================
   PRZYCISKI GEOMETRII
========================================================= */

#geometrie {
    display: flex;

    gap: 7px;

    width: 100%;
}

.btn-tool {
    flex: 1;

    min-height: 38px;

    padding: 8px 10px;

    border: 1px solid #2563eb;
    border-radius: 6px;

    background: #ffffff;

    color: #2563eb;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        opacity 0.15s ease;
}

.btn-tool:hover:not(:disabled) {
    background: #eff6ff;
}

.btn-tool.active {
    background: #2563eb;

    color: #ffffff;

    border-color: #2563eb;
}

.btn-tool:disabled {
    background: #eeeeee;

    border-color: #e5e7eb;

    color: #a3a3a3;

    opacity: 0.55;

    cursor: not-allowed;
}


/* =========================================================
   PRZYCISKI GPS
========================================================= */

.btn-primary,
.btn-secondary {
    width: 100%;

    min-height: 38px;

    margin-bottom: 7px;

    padding: 8px 12px;

    border-radius: 6px;

    font-family: inherit;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.btn-primary {
    border: 1px solid #2563eb;

    background: #2563eb;

    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;

    border-color: #1d4ed8;
}

.btn-secondary {
    border: 1px solid #d1d5db;

    background: #ffffff;

    color: #333;
}

.btn-secondary:hover {
    background: #f5f5f5;
}


/* =========================================================
   STATUS GPS
========================================================= */

#gpsStatus {
    margin-top: 5px;

    padding: 7px 9px;

    border-radius: 5px;

    background: #f5f5f5;

    color: #666;

    font-size: 12px;
}


/* =========================================================
   FORMULARZ OBIEKTU
========================================================= */

#formularzKategorii {
    width: 100%;
}

.placeholderForm {
    padding: 12px;

    border: 1px dashed #d1d5db;
    border-radius: 6px;

    background: #fafafa;

    color: #777;

    font-size: 12px;
    line-height: 1.5;
}


/* =========================================================
   FORMULARZ — POLA
========================================================= */

.formularz-obiektu {
    display: flex;

    flex-direction: column;

    gap: 12px;

    width: 100%;
}

.pole-formularza {
    display: flex;

    flex-direction: column;

    gap: 5px;

    width: 100%;
}

.pole-formularza label {
    font-size: 12px;

    font-weight: 600;

    line-height: 1.35;

    color: #333;
}

.pole-formularza input[type="text"],
.pole-formularza textarea {
    width: 100%;

    padding: 8px 9px;

    border: 1px solid #d1d5db;
    border-radius: 5px;

    background: #ffffff;

    color: #222;

    font-family: inherit;

    font-size: 13px;
}

.pole-formularza input[type="text"] {
    min-height: 36px;
}

.pole-formularza textarea {
    min-height: 75px;

    resize: vertical;
}

.pole-formularza input[type="text"]:focus,
.pole-formularza textarea:focus {
    outline: none;

    border-color: #2563eb;

    box-shadow:
        0 0 0 2px rgba(37, 99, 235, 0.10);
}


/* =========================================================
   ZDJĘCIA
========================================================= */

.pole-formularza input[type="file"] {
    width: 100%;

    padding: 6px;

    border: 1px solid #d1d5db;
    border-radius: 5px;

    background: #ffffff;

    font-family: inherit;

    font-size: 12px;
}

.pole-formularza small {
    font-size: 11px;

    color: #777;
}


/* =========================================================
   PANEL WARSTW
========================================================= */

#panelWarstw {
    position: fixed;

    top: 16px;
    right: 16px;

    width: 330px;

    max-height: calc(100vh - 32px);

    display: flex;

    flex-direction: column;

    z-index: 1100;

    background: #ffffff;

    border-radius: 8px;

    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.18);

    overflow: hidden;
}


/* =========================================================
   PRZYCISK PANELU WARSTW
========================================================= */

#toggleWarstw {
    flex-shrink: 0;

    width: 100%;

    min-height: 42px;

    padding: 10px 14px;

    border: 0;

    background: #ffffff;

    color: #222;

    font-family: inherit;

    font-size: 14px;
    font-weight: 700;

    text-align: left;

    cursor: pointer;
}

#toggleWarstw:hover {
    background: #f5f5f5;
}


/* =========================================================
   ZAWARTOŚĆ PANELU WARSTW
========================================================= */

#zawartoscWarstw {
    min-height: 0;

    flex: 1;

    overflow-y: auto;

    padding: 0 14px 14px 14px;
}

#zawartoscWarstw h3 {
    margin: 5px 0 14px 0;

    font-size: 15px;
}

#zawartoscWarstw h4 {
    margin: 0 0 10px 0;

    font-size: 12px;

    color: #555;

    text-transform: uppercase;

    letter-spacing: 0.03em;
}


/* =========================================================
   GRUPY WARSTW
========================================================= */

.warstwa-grupa {
    margin-bottom: 20px;

    padding-bottom: 12px;

    border-bottom: 1px solid #e5e7eb;
}

.warstwa-grupa:last-child {
    border-bottom: 0;
}


/* =========================================================
   WARSTWA — NAZWA + CHECKBOX
========================================================= */

.warstwa {
    display: block;

    width: 100%;

    margin-bottom: 14px;
}

.warstwa > label {
    display: flex;

    width: 100%;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    box-sizing: border-box;

    font-size: 12px;

    line-height: 1.35;

    cursor: pointer;
}

.warstwa > label span {
    flex: 1;

    min-width: 0;
}

.warstwa > label input[type="checkbox"],
.warstwa > label input[type="radio"] {
    flex-shrink: 0;

    margin: 0;

    cursor: pointer;
}


/* =========================================================
   SUWAK PRZEŹROCZYSTOŚCI
========================================================= */

.warstwa > input[type="range"] {
    display: block;

    width: 100%;

    height: 4px;

    margin: 7px 0 0 0;

    padding: 0;

    box-sizing: border-box;

    cursor: pointer;
}


/* =========================================================
   SCROLL PANELU WARSTW
========================================================= */

#zawartoscWarstw::-webkit-scrollbar {
    width: 7px;
}

#zawartoscWarstw::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#zawartoscWarstw::-webkit-scrollbar-thumb {
    background: #c7c7c7;

    border-radius: 5px;
}

#zawartoscWarstw::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}


/* =========================================================
   LEAFLET
========================================================= */

.leaflet-control-zoom {
    margin-left: 10px !important;

    margin-top: 10px !important;
}


/* =========================================================
   EKRANY WĄSKIE
========================================================= */

@media (max-width: 900px) {

    #panel {
        width: 320px;
    }

    #map {
        left: 320px;
    }

    #panelWarstw {
        width: 290px;
    }

}


@media (max-width: 700px) {

    #panel {
        width: 300px;
    }

    #map {
        left: 300px;
    }

    #panelWarstw {
        right: 8px;

        top: 8px;

        width: 270px;

        max-height: calc(100vh - 16px);
    }

}


@media (max-width: 600px) {

    #panel {
        width: 280px;
    }

    #map {
        left: 280px;
    }

    #panelWarstw {
        width: 250px;
    }

}