*, *::before, *::after {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 16px;
    color: #fff;
    background: #061311;
}

a {
    color: #83d9bc;
}

h1:focus,
h2:focus,
h3:focus,
h4:focus,
h5:focus,
h6:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* ---------- zmienne ---------- */
:root {
    --sop-sidebar-szer: 264px;
    --sop-sidebar-szer-zwinieta: 76px;
    --sop-akcent: #6ce2b5;
    --sop-eyebrow: #83d9bc;
    --sop-tekst: #e8f4ef;
    --sop-tekst-wyciszony: #9ab6a8;
    --sop-ramka: rgba(143, 220, 193, .16);
    --sop-ramka-slaba: rgba(143, 220, 193, .10);
    --sop-promien: 16px;
    --sop-wys-przycisku: 42px;   /* przyciski w modułach (logowanie ma własne, wyższe) */
    --sop-odstep: 15px;          /* odstęp między panelami w modułach */
}

/* ---------- układ po zalogowaniu: zawsze 100% wysokości ekranu, bez przewijania ---------- */
.sop-app {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    color: var(--sop-tekst);
    background: linear-gradient(160deg, rgba(3, 22, 19, .90), rgba(1, 10, 9, .95)), url('/images/sop_background.jpg') center / cover no-repeat;
}

.sop-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 0 20px 15px;
    overflow: hidden;
}

/* ---------- nagłówek strony ---------- */
.sop-page-header {
    flex: 0 0 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--sop-ramka-slaba);
}

    .sop-page-header .sop-eyebrow {
        justify-content: flex-start;
    }

    .sop-page-header h1 {
        margin: .3rem 0 0;
        color: #eff8f3;
        font-size: 1.6rem;
        font-weight: 550;
        letter-spacing: .015em;
    }

.sop-page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

    /* osobne grupy w nagłówku — zakładki strony (np. Pojedynczo / Zespołowo) odsunięte od wyboru zestawu i przycisków */
    .sop-page-header-actions > * + .sop-wybor-zestawu,
    .sop-page-header-actions > .sop-przelacznik + * {
        margin-left: 30px;
    }

/* ---------- panel (szkło jak karta logowania) ---------- */
.sop-panel {
    padding: 24px;
    border: 1px solid var(--sop-ramka);
    border-radius: var(--sop-promien);
    background: linear-gradient(145deg, rgba(12, 42, 36, .82), rgba(5, 25, 23, .82));
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.sop-panel-form {
    width: min(100%, 520px);
}

.sop-password {
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(2, 17, 15, .6);
    color: #f2fff8;
    font-family: Consolas, monospace;
    font-size: 1rem;
    letter-spacing: .06em;
}

/* ---------- menu boczne ---------- */
.sop-sidebar {
    flex: 0 0 var(--sop-sidebar-szer);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 17px 16px 15px;
    overflow: hidden;
    border-right: 1px solid var(--sop-ramka-slaba);
    background: linear-gradient(180deg, rgba(5, 30, 26, .94), rgba(2, 16, 14, .97));
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

    .sop-sidebar svg {
        width: 20px;
        height: 20px;
        flex: 0 0 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.6px;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.sop-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 0 8px 22px;
    border-bottom: 1px solid var(--sop-ramka-slaba);
    color: inherit;
    text-decoration: none;
}

.sop-sidebar-emblem {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(107, 225, 186, .32);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 151, 117, .16), rgba(4, 25, 21, .1) 68%);
    color: #79e8c0;
    box-shadow: 0 0 22px rgba(35, 207, 155, .08);
}

    .sop-sidebar-emblem svg {
        width: 22px;
        height: 22px;
        flex-basis: 22px;
    }

.sop-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    white-space: nowrap;
}

    /* nazwa i podtytuł z ustawień — za długie kończą się wielokropkiem */
    .sop-sidebar-brand-text :is(strong, small) {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sop-sidebar-brand-text strong {
        font-size: 1.25rem;
        font-weight: 600;
        letter-spacing: .22em;
    }

    .sop-sidebar-brand-text small {
        color: var(--sop-eyebrow);
        font-size: .6rem;
        font-weight: 600;
        letter-spacing: .16em;
    }

.sop-sidebar-group {
    padding: 8px 14px 2px;
    color: rgba(131, 217, 188, .6);
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sop-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    color: #a9c9c1;
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

    .sop-sidebar-link:hover {
        background: rgba(108, 226, 181, .06);
        color: var(--sop-tekst);
    }

    .sop-sidebar-link.active {
        background: rgba(108, 226, 181, .12);
        color: #f2fff8;
        box-shadow: inset 0 0 0 1px rgba(108, 226, 181, .3);
    }

/* licznik niepotwierdzonych alarmów przy „Alarmy” */
.sop-sidebar-licznik {
    min-width: 22px;
    height: 22px;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 11px;
    background: #ff5d6c;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    animation: sop-puls-alarmu 1.6s ease-in-out infinite;
}

@keyframes sop-puls-alarmu {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 93, 108, .55); }
    50% { box-shadow: 0 0 0 6px rgba(255, 93, 108, 0); }
}

.sop-sidebar-spacer {
    flex: 1;
}

.sop-sidebar-user {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--sop-ramka);
    border-radius: 12px;
    background: rgba(108, 226, 181, .04);
}

.sop-sidebar-user-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* awatar z inicjałami — menu, lista użytkowników */
.sop-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(108, 226, 181, .14);
    color: var(--sop-akcent);
    font-size: .85rem;
    font-weight: 700;
}

.sop-sidebar-user-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .sop-sidebar-user-text strong {
        overflow: hidden;
        font-size: .85rem;
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sop-sidebar-user-text small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--sop-eyebrow);
        font-size: .58rem;
        font-weight: 600;
        letter-spacing: .14em;
        text-transform: uppercase;
    }

.sop-sidebar-user-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

    .sop-sidebar-user-actions form {
        margin: 0;
        display: flex;
    }

.sop-sidebar-action {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid rgba(143, 220, 193, .2);
    border-radius: 10px;
    background: transparent;
    color: #a9c9c1;
    font: inherit;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, color .2s ease;
}

    .sop-sidebar-action:hover {
        border-color: rgba(108, 226, 181, .5);
        background: rgba(108, 226, 181, .08);
        color: var(--sop-tekst);
    }

    .sop-sidebar-action svg {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }

.sop-sidebar-link:focus-visible,
.sop-sidebar-action:focus-visible {
    outline: 2px solid #8af0c5;
    outline-offset: 2px;
}

/* ---------- menu zwinięte (tablet i węższe ekrany) ---------- */
@media (max-width: 1400px) {
    .sop-sidebar {
        flex-basis: var(--sop-sidebar-szer-zwinieta);
        padding-inline: 12px;
    }

    .sop-sidebar-brand-text,
    .sop-sidebar-label,
    .sop-sidebar-user-text,
    .sop-sidebar-action-label {
        display: none;
    }

    .sop-sidebar-brand {
        justify-content: center;
        padding-inline: 0;
    }

    .sop-sidebar-group {
        height: 1px;
        margin: 10px 6px;
        padding: 0;
        overflow: hidden;
        background: var(--sop-ramka-slaba);
        font-size: 0;
    }

    .sop-sidebar-link {
        position: relative;
        justify-content: center;
        padding: 0;
    }

    .sop-sidebar-licznik {
        position: absolute;
        top: 3px;
        right: 3px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        font-size: .62rem;
        line-height: 18px;
    }

    .sop-sidebar-user {
        padding: 0;
        border: 0;
        background: none;
    }

    .sop-sidebar-user-head {
        justify-content: center;
    }

    .sop-sidebar-user-actions {
        grid-template-columns: 1fr;
    }
}

/* ---------- logowanie SOP ---------- */

.sop-login-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1.5rem;
    background-color: #04110f;
}

    /* Tło graficzne z delikatnym rozmyciem i przyciemnieniem */
    .sop-login-page::before {
        content: "";
        position: absolute;
        inset: -8px;
        z-index: 0;
        pointer-events: none;
        background: linear-gradient( 135deg, rgba(1, 12, 11, .25), rgba(1, 17, 15, .20) ), radial-gradient( ellipse at 50% 48%, transparent 0%, rgba(0, 8, 7, .12) 48%, rgba(0, 7, 6, .42) 100% ), url('/images/sop_background.jpg') center / cover no-repeat;
        filter: blur(1px);
        transform: scale(1.01);
    }

    /* Zawartość strony zawsze nad tłem */
    .sop-login-page > * {
        position: relative;
        z-index: 1;
    }

.sop-login-shell {
    position: relative;
    z-index: 1;
    width: min(100%, 460px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- ekran SYSTEM GOTOWY ---------- */

.sop-ready {
    position: relative;
    transform: translateY(-45px);
    width: 100%;
    min-height: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 2rem 2rem;
    text-align: center;
    animation: sop-fade-in .8s ease both;
}

.sop-ready-emblem,
.sop-auth-emblem {
    position: relative;
    display: grid;
    place-items: center;
    color: #79e8c0;
}

.sop-ready-emblem {
    width: 104px;
    height: 104px;
    margin-bottom: 2rem;
    border: 1px solid rgba(107, 225, 186, .32);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 151, 117, .16), rgba(4, 25, 21, .1) 68%);
    box-shadow: 0 0 35px rgba(35, 207, 155, .09), inset 0 0 24px rgba(35, 207, 155, .06);
}

    .sop-ready-emblem svg {
        width: 43px;
        height: 43px;
        stroke: currentColor;
        stroke-width: 1.5px;
        stroke-linecap: round;
        stroke-linejoin: round;
        filter: drop-shadow(0 0 8px rgba(87, 235, 183, .35));
    }

.sop-ready-orbit {
    position: absolute;
    top: 3.5rem;
    left: 50%;
    width: 142px;
    height: 142px;
    border: 1px solid rgba(91, 215, 177, .12);
    border-radius: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.sop-ready-orbit-one {
    animation: sop-orbit 24s linear infinite;
}

.sop-ready-orbit-two {
    width: 174px;
    height: 174px;
    border-color: rgba(91, 215, 177, .07);
    animation: sop-orbit 34s linear infinite reverse;
}

.sop-ready-copy {
    margin-bottom: 2rem;
}

    .sop-ready-copy h1:focus {
        outline: none;
    }

.sop-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    color: #83d9bc;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.sop-ready-copy h1 {
    margin: .8rem 0 .55rem;
    color: #e5f4ee;
    font-size: clamp(1.1rem, 3.2vw, 1.55rem);
    font-weight: 500;
    letter-spacing: .20em;
    white-space: nowrap;
}

.sop-ready-copy p {
    margin: 15px 0 0;
    color: rgba(205, 228, 218, .64);
    font-size: .85rem;
    letter-spacing: .025em;
}

.sop-status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #64d9a8;
    box-shadow: 0 0 9px rgba(100, 217, 168, .65);
}

.sop-secure-button {
    min-width: 148px;
    min-height: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    border: 1px solid rgba(106, 226, 184, .56);
    border-radius: 15px;
    background: rgba(28, 113, 88, .32);
    color: #a4f1d1;
    font: inherit;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .2em;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 22px rgba(60, 211, 158, .08);
    transition: background .25s ease, border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

    .sop-secure-button:hover {
        transform: translateY(-2px);
        border-color: rgba(132, 245, 204, .9);
        background: rgba(38, 143, 108, .42);
        box-shadow: 0 0 28px rgba(60, 211, 158, .17), inset 0 1px 0 rgba(255, 255, 255, .1);
    }

    .sop-secure-button:active {
        transform: translateY(0);
    }

    .sop-secure-button:focus-visible,
    .sop-button:focus-visible {
        outline: 2px solid #8af0c5;
        outline-offset: 4px;
    }

.sop-secure-icon {
    display: grid;
    place-items: center;
}

    .sop-secure-icon svg {
        width: 25px;
        height: 25px;
        stroke: currentColor;
        stroke-width: 1.5px;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.sop-ready-footer {
    position: absolute;
    right: 1.5rem;
    bottom: .5rem;
    left: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    color: rgba(174, 208, 194, .54);
    font-size: .62rem;
    letter-spacing: .13em;
}

    .sop-ready-footer > span:first-child {
        display: inline-flex;
        align-items: center;
        gap: .45rem;
    }

    .sop-ready-footer .sop-status-dot {
        width: 6px;
        height: 6px;
        flex-basis: 6px;
    }

.sop-footer-divider {
    width: 1px;
    height: 12px;
    background: rgba(153, 208, 185, .25);
}

/* ---------- szklany panel logowania ---------- */

.sop-login-card {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 2.25rem 2.25rem 1.5rem;
    border: 1px solid rgba(143, 220, 193, .25);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(12, 42, 36, .88), rgba(5, 25, 23, .88));
    color: #e8f4ef;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 45px rgba(27, 171, 125, .08);
    -webkit-backdrop-filter: blur(22px) saturate(125%);
    backdrop-filter: blur(22px) saturate(125%);
    animation: sop-card-in .45s cubic-bezier(.2, .75, .25, 1) both;
}

.sop-card-topline {
    position: absolute;
    top: 0;
    left: 2rem;
    width: 82px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #6ce2b5, transparent);
    box-shadow: 0 0 14px rgba(108, 226, 181, .5);
}

.sop-login-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.sop-login-mark {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(111, 222, 183, .27);
    border-radius: 13px;
    background: rgba(44, 148, 111, .14);
    color: #8ce7c1;
}

    .sop-login-mark svg {
        width: 25px;
        height: 25px;
        stroke: currentColor;
        stroke-width: 1.5px;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.sop-login-heading .sop-eyebrow {
    justify-content: flex-start;
    margin-bottom: .35rem;
    font-size: .6rem;
    letter-spacing: .19em;
}

.sop-login-heading h1 {
    margin: 0;
    color: #eff8f3;
    font-size: 1.45rem;
    font-weight: 550;
    letter-spacing: .015em;
}

.sop-login-heading p {
    margin: .3rem 0 0;
    color: rgba(198, 222, 211, .62);
    font-size: .82rem;
}

.sop-field {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1.2rem;
    color: #cce4d9;
}

    .sop-field label,
    .sop-field-label {
        color: rgba(190, 222, 207, .78);
        font-size: .67rem;
        font-weight: 650;
        letter-spacing: .13em;
    }

    .sop-field input,
    .sop-field select,
    .sop-field textarea {
        width: 100%;
        min-height: 48px;
        padding: .75rem .9rem;
        border: 1px solid rgba(138, 190, 168, .25);
        border-radius: 9px;
        outline: none;
        background: rgba(2, 17, 15, .52);
        color: #e8f5ee;
        font: inherit;
        font-size: .95rem;
        transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    }

        .sop-field input::placeholder,
        .sop-field textarea::placeholder {
            color: rgba(176, 204, 190, .36);
        }

        .sop-field input:focus,
        .sop-field select:focus,
        .sop-field textarea:focus {
            border-color: rgba(108, 226, 181, .72);
            background: rgba(2, 20, 16, .72);
            box-shadow: 0 0 0 3px rgba(66, 190, 143, .11), 0 0 18px rgba(66, 190, 143, .06);
        }

.sop-button {
    width: 100%;
    min-height: 49px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-top: .35rem;
    padding: .8rem 1rem;
    border: 1px solid rgba(145, 245, 202, .5);
    border-radius: 9px;
    background: linear-gradient(105deg, #0A4A36, #116E4C);
    color: #f2fff8;
    font: inherit;
    font-size: .88rem;
    font-weight: 650;
    letter-spacing: .025em;
    cursor: pointer;
    box-shadow: 0 7px 22px rgba(18, 119, 83, .2), inset 0 1px 0 rgba(255, 255, 255, .12);
    transition: filter .2s ease, transform .2s ease, box-shadow .2s ease;
}

    .sop-button:hover {
        filter: brightness(1.12);
        box-shadow: 0 8px 27px rgba(18, 150, 100, .28), inset 0 1px 0 rgba(255, 255, 255, .15);
    }

    .sop-button:active {
        transform: translateY(1px);
    }

    .sop-button svg {
        width: 17px;
        height: 17px;
        stroke: currentColor;
        stroke-width: 1.8px;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

a.sop-button {
    text-decoration: none;
}

/* przycisk drugorzędny (np. Wyloguj pod przyciskiem głównym) */
.sop-button-outline {
    margin-top: .75rem;
    border-color: rgba(143, 220, 193, .3);
    background: transparent;
    color: #cce4d9;
    box-shadow: none;
}

    .sop-button-outline:hover {
        background: rgba(108, 226, 181, .08);
        box-shadow: none;
    }

.sop-login-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: 1.45rem;
    color: rgba(166, 204, 187, .48);
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: .15em;
}

    .sop-login-bottom .sop-status-dot {
        width: 5px;
        height: 5px;
        flex-basis: 5px;
    }

/* ---------- komunikaty ---------- */

.sop-alert {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin: 0 0 1.2rem;
    padding: .8rem .9rem;
    border: 1px solid rgba(239, 130, 130, .28);
    border-radius: 9px;
    background: rgba(105, 30, 35, .2);
    color: #ffc1bd;
    font-size: .82rem;
    line-height: 1.45;
}

.sop-alert-indicator {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    margin-top: .35rem;
    border-radius: 50%;
    background: #ef8580;
    box-shadow: 0 0 9px rgba(239, 133, 128, .4);
}

.sop-validation,
.validation-message {
    color: #ffaaa4;
    font-size: .76rem;
}

.sop-muted {
    color: #9ab6a8;
    font-size: .85rem;
}

.sop-alert-ok {
    border-color: rgba(100, 217, 168, .28);
    background: rgba(30, 105, 75, .2);
    color: #a8ebc9;
}

/* =====================================================================
   WSPÓLNE ELEMENTY MODUŁÓW
   ===================================================================== */

.sop-tabular {
    font-variant-numeric: tabular-nums;
}

.sop-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sop-spacer {
    flex: 1;
}

.sop-panel-tytul {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

    .sop-panel-tytul .sop-eyebrow {
        justify-content: flex-start;
    }

/* ---------- tablica rejestracyjna (komponent Tablica) ---------- */
.sop-plate {
    display: inline-flex;
    align-items: stretch;
    flex-shrink: 0;
    height: 24px;
    overflow: hidden;
    border: 1px solid #0b0b0b;
    border-radius: 4px;
    background: #eef2f0;
    vertical-align: middle;
}

    .sop-plate i {
        display: flex;
        align-items: flex-end;
        justify-content: center;
        min-width: 14px;
        padding: 0 2px 2px;
        background: #1d4fd1;
        color: #fff;
        font-size: .5rem;
        font-style: normal;
        font-weight: 700;
    }

    .sop-plate span {
        display: flex;
        align-items: center;
        padding: 0 7px;
        color: #0d0d0d;
        font-size: .88rem;
        font-weight: 700;
        letter-spacing: .06em;
        white-space: nowrap;
    }

/* bez paska kraju: numer wyśrodkowany w całej szerokości ramki */
.sop-plate-bez-kraju span {
    flex: 1;
    justify-content: center;
}

.sop-plate-lg {
    height: 46px;
    border-width: 2px;
    border-radius: 6px;
}

    .sop-plate-lg i {
        min-width: 24px;
        padding-bottom: 5px;
        font-size: .7rem;
    }

    .sop-plate-lg span {
        padding: 0 16px;
        font-size: 1.7rem;
    }

/* ---------- formularz kompaktowy (filtry) ---------- */
.sop-form-kompakt .sop-field {
    gap: .4rem;
    margin-bottom: .8rem;
}

    .sop-form-kompakt .sop-field input,
    .sop-form-kompakt .sop-field select,
    .sop-form-kompakt .sop-field textarea {
        min-height: 40px;
        padding: .45rem .75rem;
        font-size: .88rem;
    }

.sop-field select option {
    background: #04110f;
    color: #e8f5ee;
}

.sop-field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

/* ---------- przełączniki (chipy) ---------- */
.sop-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sop-chip {
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(143, 220, 193, .22);
    border-radius: 999px;
    background: rgba(108, 226, 181, .04);
    color: #bfe0d7;
    font: inherit;
    font-size: .78rem;
    letter-spacing: 0;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, color .2s ease;
}

    .sop-chip:hover {
        border-color: rgba(108, 226, 181, .45);
    }

    .sop-chip.on {
        border-color: rgba(108, 226, 181, .6);
        background: rgba(108, 226, 181, .16);
        color: #f2fff8;
    }

/* ---------- przyciski w modułach: jedna wysokość (--sop-wys-przycisku) ---------- */
.sop-button-kompakt {
    min-height: var(--sop-wys-przycisku);
    margin-top: 0;
    padding-block: 0;
    font-size: .82rem;
}

/* wąski przycisk (strzałki stronicowania) */
.sop-button-sm {
    width: auto;
    padding-inline: 14px;
}

/* prawa strona paska tabeli: opis + przycisk (np. eksport) */
.sop-tabela-pasek-akcje {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sop-button:disabled {
    opacity: .4;
    cursor: default;
    filter: none;
    transform: none;
}

/* ---------- etykiety list ---------- */
.sop-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .1em;
}

.sop-pill-czarna {
    background: rgba(255, 93, 108, .16);
    color: #ff9aa4;
}

.sop-pill-biala {
    background: rgba(108, 226, 181, .14);
    color: #7ff0c9;
}

/* ---------- próbka koloru ---------- */
.sop-kolor {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

    .sop-kolor i {
        width: 12px;
        height: 12px;
        flex: 0 0 12px;
        border: 1px solid rgba(255, 255, 255, .25);
        border-radius: 3px;
    }

/* ---------- tabela (lista wierszy-przycisków o stałej wysokości) ---------- */
.sop-tabela {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.sop-tabela-pasek {
    flex: 0 0 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--sop-ramka-slaba);
}

    .sop-tabela-pasek strong {
        margin-right: 6px;
        font-size: 1.1rem;
    }

/* kolumny tabeli ustawia zmienna --kolumny na konkretnej tabeli */
.sop-tabela-naglowek,
.sop-tabela-wiersz {
    display: grid;
    grid-template-columns: var(--kolumny);
    align-items: center;
    gap: 10px;
    padding: 0 20px;
}

    .sop-tabela-naglowek > span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* tablice w tabeli i na liście aut grupy: równa szerokość = szerokość kolumny */
:is(.sop-tabela-wiersz, .sop-zespol-auto) .sop-plate {
    width: 100%;
}

    :is(.sop-tabela-wiersz, .sop-zespol-auto) .sop-plate span {
        flex: 1;
        justify-content: center;
    }

.sop-tabela-naglowek {
    flex: 0 0 42px;
    color: var(--sop-eyebrow);
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.sop-tabela-wiersze {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity .2s ease;
}

.sop-tabela.ladowanie .sop-tabela-wiersze {
    opacity: .5;
}

.sop-tabela-wiersz {
    flex: 0 0 44px;
    width: 100%;
    border: 0;
    border-top: 1px solid rgba(143, 220, 193, .06);
    background: transparent;
    color: var(--sop-tekst);
    font: inherit;
    font-size: .85rem;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease;
}

    .sop-tabela-wiersz > span {
        min-width: 0;
    }

    .sop-tabela-wiersz:hover {
        background: rgba(108, 226, 181, .05);
    }

    .sop-tabela-wiersz.zaznaczony {
        background: rgba(108, 226, 181, .12);
        box-shadow: inset 0 0 0 1px rgba(108, 226, 181, .28);
    }

    .sop-tabela-wiersz:focus-visible {
        outline: 2px solid #8af0c5;
        outline-offset: -2px;
    }

.sop-tabela-pusto {
    padding: 48px 20px;
    text-align: center;
}

.sop-tabela-komunikat {
    margin: 16px 20px;
}

.sop-tabela-stopka {
    flex: 0 0 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-top: 1px solid var(--sop-ramka-slaba);
}

.sop-stronicowanie {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---------- karta odczytu (komponent KartaOdczytu) ---------- */
.sop-karta-odczytu {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    padding: 18px;
    overflow: hidden;
}

.sop-karta-pusto {
    flex: 1;
    display: grid;
    place-items: center;
    text-align: center;
}

.sop-foto {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--sop-ramka);
    border-radius: 12px;
    background: linear-gradient(170deg, #1c3a35, #081614);
}

.sop-foto-glowne {
    position: absolute;
    inset: 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

    .sop-foto-glowne img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.sop-foto-etykieta {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(3, 22, 19, .85);
    color: var(--sop-eyebrow);
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: .16em;
    pointer-events: none;
}

.sop-foto-wycinek {
    position: absolute;
    right: 10px;
    bottom: 10px;
    height: 44px;
    max-width: 45%;
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--sop-akcent);
    border-radius: 6px;
    background: #000;
    cursor: zoom-in;
}

    .sop-foto-wycinek img {
        display: block;
        width: auto;
        height: 100%;
    }

.sop-foto-glowne:focus-visible,
.sop-foto-wycinek:focus-visible {
    outline: 2px solid #8af0c5;
    outline-offset: -2px;
}

.sop-karta-tablica {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--sop-ramka-slaba);
    border-radius: 12px;
    background: rgba(2, 17, 15, .45);
}

.sop-karta-pewnosc {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

    .sop-karta-pewnosc strong {
        color: var(--sop-akcent);
        font-size: 1.35rem;
        font-weight: 600;
    }

.sop-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    margin: 0;
}

    .sop-meta div {
        min-width: 0;
    }

    .sop-meta dt {
        color: #6fb9a4;
        font-size: .6rem;
        font-weight: 600;
        letter-spacing: .16em;
        text-transform: uppercase;
    }

    .sop-meta dd {
        margin: 3px 0 0;
        overflow: hidden;
        font-size: .88rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.sop-karta-lista {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: .82rem;
}

    .sop-karta-lista.czarna {
        border: 1px solid rgba(255, 93, 108, .4);
        background: rgba(255, 93, 108, .08);
        color: #ffc1bd;
    }

    .sop-karta-lista.biala {
        border: 1px solid rgba(108, 226, 181, .35);
        background: rgba(108, 226, 181, .06);
        color: #a8ebc9;
    }

/* ---------- podgląd zdjęcia na pełnym ekranie ---------- */
.sop-podglad {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    border: 0;
    background: rgba(0, 6, 5, .9);
    cursor: zoom-out;
}

.sop-podglad-glowne {
    min-height: 0;
    max-width: 100%;
    max-height: calc(100% - 156px);
    border-radius: 8px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, .6);
}

.sop-podglad-wycinek {
    height: 120px;
    border: 2px solid var(--sop-akcent);
    border-radius: 8px;
    background: #000;
}

/* ---------- wybór zestawu w nagłówku (komponent WyborZestawu) ---------- */
.sop-wybor-zestawu {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .sop-wybor-zestawu select {
        min-width: 220px;
        min-height: var(--sop-wys-przycisku);
        padding: 0 .75rem;
        border: 1px solid rgba(138, 190, 168, .3);
        border-radius: 9px;
        outline: none;
        background: rgba(2, 17, 15, .6);
        color: #e8f5ee;
        font: inherit;
        font-size: .88rem;
        cursor: pointer;
    }

        .sop-wybor-zestawu select:focus {
            border-color: rgba(108, 226, 181, .72);
            box-shadow: 0 0 0 3px rgba(66, 190, 143, .11);
        }

        .sop-wybor-zestawu select option {
            background: #04110f;
            color: #e8f5ee;
        }

/* =====================================================================
   MODUŁ: ODCZYTY
   ===================================================================== */

.sop-odczyty {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 400px;
    gap: var(--sop-odstep);
}

.sop-filtry {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
    padding: 18px;
    overflow: hidden;
}

    .sop-filtry .sop-panel-tytul {
        margin-bottom: 14px;
    }

.sop-filtry-przyciski {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

/* Czas | Numer | Pojazd | Kolor | Klasa | Kierunek | Jednostka | Lista
   stałe: czas, tablica, lista; reszta dzieli wolne miejsce proporcjonalnie */
.sop-tabela-odczyty {
    --kolumny: 104px 124px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) 44px;
}

/* ---------- komunikaty: warianty ---------- */
.sop-alert-ok .sop-alert-indicator {
    background: #64d9a8;
    box-shadow: 0 0 9px rgba(100, 217, 168, .5);
}

.sop-alert-ostrzezenie {
    border-color: rgba(246, 181, 74, .35);
    background: rgba(120, 80, 20, .18);
    color: #f3dcb0;
}

    .sop-alert-ostrzezenie .sop-alert-indicator {
        background: #f6b54a;
        box-shadow: 0 0 9px rgba(246, 181, 74, .45);
    }

.sop-alert-tresc {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sop-haslo-tymczasowe {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------- przyciski: dopasowany do treści, niebezpieczny ---------- */
.sop-button-auto {
    width: auto;
    padding-inline: 18px;
}

.sop-button-niebezpieczny {
    border-color: rgba(255, 93, 108, .45);
    background: rgba(255, 93, 108, .10);
    color: #ffd5d9;
    box-shadow: none;
}

    .sop-button-niebezpieczny:hover {
        background: rgba(255, 93, 108, .18);
        box-shadow: none;
    }

.sop-akcje-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.sop-akcje-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.sop-field select:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ---------- statusy ---------- */
/* tryb zespołowy: 4 suwaki w dwóch kolumnach */
.sop-kontr-suwaki.sop-kontr-suwaki-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
}

/* # | Auta | Aut | Pokrycie | Czas | Ocena */
.sop-tabela-zespol {
    --kolumny: 36px minmax(0, 1fr) 44px 80px 96px 120px;
}

    .sop-tabela-zespol :is(.sop-tabela-naglowek, .sop-tabela-wiersz) > :nth-child(3) {
        text-align: center;
    }

/* auta grupy na karcie: kolor odcinka | tablica | godzina, dystans, inne trasy */
.sop-zespol-auta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* kolor | tablica | godzina, dystans, inne trasy (tablica węższa niż w tabelach — karta ma 320 px) */
.sop-zespol-auto {
    display: grid;
    grid-template-columns: 10px 104px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    margin: 0 -8px;
    border-radius: 8px;
    color: var(--sop-tekst);
    font-size: .8rem;
    text-decoration: none;
}

    .sop-zespol-auto:hover {
        background: rgba(108, 226, 181, .08);
    }

    /* tylko kropka koloru — nie pasek kraju w tablicy (też <i>) */
    .sop-zespol-auto > i {
        width: 10px;
        height: 10px;
        border-radius: 50%;
    }

.sop-zespol-opis {
    min-width: 0;
}

/* „też w trasie …” — zawsze jedna linia; całość w podpowiedzi, gdy się nie mieści */
.sop-zespol-inne {
    display: block;
    overflow: hidden;
    color: #f6cd84;
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sop-pill-ostrzezenie {
    background: rgba(246, 181, 74, .14);
    color: #f6c46a;
}

.sop-statusy {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 6px;
}

/* ---------- tabela z przewijaniem wierszy (krótkie listy, np. użytkownicy) ---------- */
.sop-tabela-przewijana .sop-tabela-wiersze {
    overflow-y: auto;
}

/* =====================================================================
   MODUŁ: ADMINISTRACJA → UŻYTKOWNICY
   ===================================================================== */

.sop-admin {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 460px;
    gap: var(--sop-odstep);
}

/* Użytkownik | E-mail | Rola | Status | Ostatnie logowanie */
.sop-tabela-uzytkownicy {
    --kolumny: minmax(0, 1.3fr) minmax(0, 1.5fr) minmax(0, 1fr) 220px 150px;
}

.sop-osoba {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

    .sop-osoba .sop-avatar {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
        border-radius: 8px;
        font-size: .72rem;
    }

.sop-avatar-lg {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 12px;
    font-size: 1rem;
}

.sop-admin-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
}

.sop-osoba-naglowek {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--sop-ramka-slaba);
}

.sop-osoba-dane {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .sop-osoba-dane strong {
        font-size: 1.05rem;
        font-weight: 600;
    }

    .sop-osoba-dane .sop-muted {
        font-size: .82rem;
    }

.sop-admin-sekcja {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--sop-ramka-slaba);
}

.sop-potwierdzenie {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(246, 181, 74, .35);
    border-radius: 10px;
    background: rgba(246, 181, 74, .06);
    color: #f3dcb0;
    font-size: .85rem;
    line-height: 1.45;
}

.sop-uwaga {
    margin: 0;
    font-size: .82rem;
    line-height: 1.45;
}

/* ---------- link / przycisk-link (akcja drugorzędna w tekście) ---------- */
.sop-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--sop-eyebrow);
    font: inherit;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

    .sop-link:hover {
        color: #a6f0d6;
        text-decoration: underline;
    }

/* ---------- przełącznik segmentowy (np. Czarna / Biała) ---------- */
.sop-przelacznik {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--sop-ramka);
    border-radius: 12px;
    background: rgba(2, 17, 15, .45);
}

    .sop-przelacznik button {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 34px;
        padding: 0 14px;
        border: 0;
        border-radius: 9px;
        background: transparent;
        color: #a9c9c1;
        font: inherit;
        font-size: .82rem;
        font-weight: 600;
        cursor: pointer;
        transition: background .2s ease, color .2s ease;
    }

        .sop-przelacznik button:hover {
            color: var(--sop-tekst);
        }

        .sop-przelacznik button.on {
            background: rgba(108, 226, 181, .14);
            color: #f2fff8;
            box-shadow: inset 0 0 0 1px rgba(108, 226, 181, .3);
        }

        .sop-przelacznik button strong {
            margin: 0;
            font-size: .82rem;
            color: var(--sop-tekst-wyciszony);
        }

    /* ikona w zakładce: biała, niezależna od nazwy listy (wykrzyknik / ptaszek) */
    .sop-przelacznik svg {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
        fill: none;
        stroke: #f2fff8;
        stroke-width: 1.8px;
        stroke-linecap: round;
        stroke-linejoin: round;
        opacity: .75;
    }

    .sop-przelacznik button.on svg {
        opacity: 1;
    }

/* ---------- nagłówek kolumny z sortowaniem (komponent NaglowekSortowania) ---------- */
.sop-sortuj {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

    .sop-sortuj span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sop-sortuj:hover,
    .sop-sortuj.aktywna {
        color: #f2fff8;
    }

    .sop-sortuj svg {
        width: 14px;
        height: 14px;
        flex: 0 0 14px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2px;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .sop-sortuj:focus-visible {
        outline: 2px solid #8af0c5;
        outline-offset: 2px;
    }

/* ---------- pole wyszukiwania w pasku tabeli ---------- */
.sop-szukaj {
    position: relative;
    width: min(100%, 320px);
}

    .sop-szukaj svg {
        position: absolute;
        top: 50%;
        left: 12px;
        width: 16px;
        height: 16px;
        transform: translateY(-50%);
        fill: none;
        stroke: var(--sop-tekst-wyciszony);
        stroke-width: 1.7px;
        stroke-linecap: round;
        pointer-events: none;
    }

    .sop-szukaj input {
        width: 100%;
        min-height: 38px;
        padding: 0 12px 0 36px;
        border: 1px solid rgba(138, 190, 168, .25);
        border-radius: 9px;
        outline: none;
        background: rgba(2, 17, 15, .52);
        color: #e8f5ee;
        font: inherit;
        font-size: .85rem;
    }

        .sop-szukaj input:focus {
            border-color: rgba(108, 226, 181, .72);
            box-shadow: 0 0 0 3px rgba(66, 190, 143, .11);
        }

/* ---------- wybór pliku (InputFile ukryty w przycisku) ---------- */
.sop-plik {
    position: relative;
    cursor: pointer;
}

    .sop-plik:focus-within {
        outline: 2px solid #8af0c5;
        outline-offset: 2px;
    }

.sop-plik-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

/* =====================================================================
   MODUŁ: LISTY
   ===================================================================== */

.sop-listy {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: var(--sop-odstep);
}

/* Numer | Opis | Dodał | Data dodania */
.sop-tabela-listy {
    --kolumny: 124px minmax(0, 2.5fr) minmax(0, 1fr) 136px;
}

.sop-tabela-listy .sop-tabela-pasek {
    gap: 16px;
}

.sop-field textarea {
    min-height: 0;
    resize: none;
    line-height: 1.4;
}

.sop-import {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--sop-ramka);
    border-radius: 10px;
    background: rgba(2, 17, 15, .45);
    font-size: .85rem;
}

    .sop-import ul {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .sop-import .blad {
        color: #ffaaa4;
    }

.sop-import-bledy {
    max-height: 110px;
    overflow-y: auto;
    font-size: .78rem;
}

    .sop-import-bledy summary {
        color: #ffaaa4;
        cursor: pointer;
    }

.sop-import-pytanie {
    color: var(--sop-tekst);
    font-weight: 600;
}

/* =====================================================================
   MODUŁ: JEDNOSTKI
   ===================================================================== */

.sop-jednostki {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: var(--sop-odstep);
}

/* Jednostka | Numer seryjny | Status | Ostatni kontakt | Ostatni odczyt | Odczyty dziś | Adres IP */
.sop-tabela-jednostki {
    --kolumny: minmax(0, 1.4fr) minmax(0, 1fr) 130px minmax(0, 1fr) minmax(0, 1fr) 100px minmax(0, 1fr);
}

    .sop-tabela-jednostki strong {
        font-weight: 600;
    }

.sop-pill-neutralny {
    background: rgba(143, 178, 170, .12);
    color: #bcd2cc;
}

.sop-ikona-jednostki svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sop-jednostka-odczyty {
    gap: 8px;
}

.sop-mini-odczyt {
    display: grid;
    grid-template-columns: 112px 124px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 34px;
    font-size: .82rem;
}

    .sop-mini-odczyt .sop-plate {
        width: 100%;
    }

        .sop-mini-odczyt .sop-plate span {
            flex: 1;
            justify-content: center;
        }

/* ---------- animacja oczekiwania na wynik logowania ---------- */

.sop-auth-progress {
    min-height: 310px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: sop-fade-in .35s ease both;
}

.sop-auth-emblem {
    width: 100px;
    height: 100px;
    margin-bottom: 2rem;
    border: 1px solid rgba(108, 226, 181, .24);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(38, 143, 108, .16), transparent 70%);
}

    .sop-auth-emblem svg {
        position: relative;
        z-index: 1;
        width: 42px;
        height: 42px;
        stroke: #8ce7c1;
        stroke-width: 1.5px;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.sop-auth-ring {
    position: absolute;
    inset: -9px;
    border: 1px solid transparent;
    border-top-color: rgba(116, 238, 190, .85);
    border-right-color: rgba(116, 238, 190, .25);
    border-radius: 50%;
    animation: sop-spin 2.4s linear infinite;
}

.sop-auth-ring-delayed {
    inset: -17px;
    border-top-color: rgba(116, 238, 190, .25);
    border-right-color: transparent;
    animation-duration: 4s;
    animation-direction: reverse;
}

.sop-auth-progress .sop-eyebrow {
    margin-bottom: .7rem;
}

.sop-auth-progress h1 {
    margin: 0;
    color: #edf8f2;
    font-size: 1.3rem;
    font-weight: 500;
}

.sop-auth-message {
    margin: .6rem 0 1.5rem;
    color: rgba(198, 222, 211, .65);
    font-size: .84rem;
}

.sop-progress-track {
    width: min(100%, 230px);
    height: 2px;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(134, 192, 165, .16);
}

    .sop-progress-track span {
        display: block;
        width: 38%;
        height: 100%;
        border-radius: inherit;
        background: #71dfb3;
        box-shadow: 0 0 12px rgba(113, 223, 179, .7);
        animation: sop-progress-sweep 1.8s ease-in-out infinite;
    }

.sop-auth-footnote {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1.4rem;
    color: rgba(166, 204, 187, .48);
    font-size: .59rem;
    font-weight: 600;
    letter-spacing: .15em;
}

    .sop-auth-footnote .sop-status-dot {
        width: 5px;
        height: 5px;
        flex-basis: 5px;
        animation: sop-status-pulse 1.5s ease-in-out infinite;
    }

/* ---------- animacje i dostępność ---------- */

@keyframes sop-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes sop-card-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes sop-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes sop-orbit {
    to {
        transform: translateX(-50%) rotate(360deg);
    }
}

@keyframes sop-progress-sweep {
    0% {
        transform: translateX(-110%);
    }

    50% {
        transform: translateX(110%);
    }

    100% {
        transform: translateX(270%);
    }
}

@keyframes sop-status-pulse {
    0%, 100% {
        opacity: .45;
    }

    50% {
        opacity: 1;
    }
}

@media (max-width: 520px) {
    .sop-login-page {
        padding: 1rem;
        background-attachment: scroll;
    }

    .sop-login-card {
        padding: 1.75rem 1.35rem 1.25rem;
        border-radius: 16px;
    }

    .sop-ready {
        min-height: 390px;
        padding-inline: 1rem;
    }

    .sop-ready-orbit {
        top: 2.5rem;
    }

    .sop-login-heading {
        gap: .8rem;
    }

        .sop-login-heading h1 {
            font-size: 1.25rem;
        }
}

@media (max-height: 620px) {
    .sop-login-page {
        align-items: flex-start;
        overflow-y: auto;
    }

    .sop-ready {
        min-height: 360px;
        padding-top: 2rem;
    }

    .sop-ready-emblem {
        width: 78px;
        height: 78px;
        margin-bottom: 1.3rem;
    }

    .sop-ready-orbit {
        top: 1.4rem;
        width: 112px;
        height: 112px;
    }

    .sop-ready-orbit-two {
        width: 138px;
        height: 138px;
    }

    .sop-auth-progress {
        min-height: 260px;
    }

    .sop-auth-emblem {
        width: 78px;
        height: 78px;
        margin-bottom: 1.4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/* Wyłączenie żółtego tła w Firefox, Chrome, Edge i Safari - dodac na kocu glownego CSS*/
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    /* Używa płynnego przejścia (animacji), aby utrzymać białe (lub dowolne inne) tło */
    -webkit-box-shadow: 0 0 0 30px rgb(4, 24, 22) inset !important;
    /* Zmienia kolor tekstu na taki jaki chcesz (np. czarny) */
    -webkit-text-fill-color: #e8f5ee !important;
}
/* =====================================================================
   SMART PANEL (strona główna): wskaźniki, mapa, kolumna zdarzeń
   ===================================================================== */
.sop-smart {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sop-odstep);
}

/* tyle równych kolumn, ile kafelków w Home.razor — dodanie kafelka nie wymaga zmian tutaj */
.sop-kpi-rzad {
    flex: 0 0 auto;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: var(--sop-odstep);
}

.sop-kpi {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 20px;
}

    /* przy sześciu kafelkach etykieta w jednej linii, za długa — wielokropek */
    .sop-kpi .sop-field-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sop-kpi strong {
        font-size: 1.9rem;
        line-height: 1.1;
        font-weight: 700;
        color: var(--sop-tekst);
    }

.sop-kpi-alarm {
    border-color: rgba(255, 93, 108, .45);
    background: linear-gradient(145deg, rgba(70, 18, 26, .82), rgba(30, 10, 14, .82));
}

    .sop-kpi-alarm strong {
        color: #ff9aa4;
    }

/* podejrzenia kontrobserwacji — pomarańczowy jak na mapie (KoloryMapy.Powtarzajacy) */
.sop-kpi-ostrzezenie {
    border-color: rgba(246, 181, 74, .45);
    background: linear-gradient(145deg, rgba(66, 46, 14, .82), rgba(28, 20, 8, .82));
}

    .sop-kpi-ostrzezenie strong {
        color: #f6cd84;
    }

/* podejrzenia sztafety — fioletowy jak kontrobserwacja zespołowa (KoloryMapy.Towarzysz) */
.sop-kpi-zespol {
    border-color: rgba(195, 140, 255, .45);
    background: linear-gradient(145deg, rgba(50, 30, 72, .82), rgba(22, 14, 32, .82));
}

    .sop-kpi-zespol strong {
        color: #d9bcff;
    }

.sop-smart-uklad {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: var(--sop-odstep);
}

/* panel z mapą (Smart Panel, Trasy) */
.sop-mapa-panel {
    position: relative;
    padding: 0;
    overflow: hidden;
    min-height: 0;
}

.sop-mapa {
    position: absolute;
    inset: 0;
}

    /* mapa, w którą się klika (np. dodawanie miejsc we Współwystępowaniu) */
    .sop-mapa.sop-mapa-klikalna,
    .sop-mapa.sop-mapa-klikalna .leaflet-interactive {
        cursor: crosshair;
    }

.sop-mapa-legenda {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 500;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    max-width: calc(100% - 90px);
    padding: 8px 14px;
    border: 1px solid var(--sop-ramka);
    border-radius: 12px;
    background: rgba(3, 20, 18, .86);
    font-size: .8rem;
    pointer-events: none;
}

    .sop-mapa-legenda span {
        display: inline-flex;
        align-items: center;
        gap: 7px;
    }

    .sop-mapa-legenda i,
    .sop-smart-jednostka i {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        flex-shrink: 0;
    }

/* obwódka znacznika w legendzie (czarna lista, powtarzający się); kolor z KoloryMapy przez style="color" */
i.sop-mapa-legenda-obwodka {
    background: currentColor;
    box-shadow: 0 0 0 2px #031a17, 0 0 0 3px currentColor;
}

.sop-mapa-blad {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 600;
}

.sop-smart-boczny {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
    overflow: hidden;
    padding: 20px;
}

.sop-smart-sekcja {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
}

.sop-smart-sekcja-rosnie {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

/* trzecia kolumna mini-odczytu z dopiskiem (np. liczba wykryć) */
.sop-mini-odczyt-opis {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sop-mini-odczyt-alarm {
    margin: 0 -8px;
    padding: 0 8px;
    border-radius: 8px;
    background: rgba(255, 93, 108, .10);
}

.sop-smart-jednostka {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    font-size: .85rem;
}

@media (max-width: 1400px) {
    .sop-smart-uklad {
        grid-template-columns: minmax(0, 1fr) 380px;
    }

    .sop-kpi strong {
        font-size: 1.5rem;
    }
}

/* ---------- Leaflet: dopasowanie do motywu SOP ---------- */
/* =====================================================================
   TRASY: lista tras zestawów + mapa z kartą szczegółów
   ===================================================================== */
.sop-trasy {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 640px minmax(0, 1fr);
    gap: var(--sop-odstep);
}

/* Zestaw | Start | Czas | Dystans | Odczyty | Czarna */
.sop-tabela-trasy {
    --kolumny: minmax(0, 1fr) 96px 100px 80px 70px 60px;
}

.sop-trasa-zestaw {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

    .sop-trasa-zestaw i {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        flex-shrink: 0;
    }

/* karta leżąca na mapie (Trasy, Kontrobserwacja, Analizy) */
.sop-mapa-karta {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 320px;
    padding: 16px;
    border: 1px solid var(--sop-ramka);
    border-radius: 12px;
    background: rgba(3, 20, 18, .9);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
    font-size: .82rem;
}

    /* karta na mapie ma 320 px — mniejsze wartości i przyciski, żeby nic się nie zawijało */
    .sop-mapa-karta .sop-meta dd {
        font-size: .8rem;
    }

    .sop-mapa-karta .sop-button-kompakt {
        padding-inline: .5rem;
        font-size: .72rem;
        letter-spacing: .01em;
        white-space: nowrap;
    }

@media (max-width: 1400px) {
    .sop-trasy {
        grid-template-columns: 560px minmax(0, 1fr);
    }
}

/* =====================================================================
   KONTROBSERWACJA: suwaki progów, lista pojazdów, mapa z przebiegiem wykryć
   ===================================================================== */
.sop-kontr {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 640px minmax(0, 1fr);
    gap: var(--sop-odstep);
}

/* Numer | Wykrycia | Trasy | Czas | Dystans | Ocena */
.sop-tabela-kontr {
    --kolumny: 124px 66px 50px 86px 76px minmax(0, 1fr);
}

/* Wykrycia i Trasy wyśrodkowane — odsunięte od tablicy, łatwiej je wychwycić */
.sop-tabela-kontr :is(.sop-tabela-naglowek, .sop-tabela-wiersz) > :is(:nth-child(2), :nth-child(3)) {
    text-align: center;
}

.sop-kontr-parametry {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--sop-ramka-slaba);
}

.sop-kontr-okres {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sop-kontr-suwaki {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.sop-kontr-pominiete {
    font-size: .78rem;
}

.sop-suwak {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* opis suwaka zawsze w jednej linii: etykieta (skracana „…”, gdy brak miejsca) | wartość */
.sop-suwak-opis {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    white-space: nowrap;
}

    .sop-suwak-opis .sop-field-label {
        min-width: 0;
        overflow: hidden;
        font-size: .6rem;
        letter-spacing: .1em;
        text-overflow: ellipsis;
    }

    .sop-suwak-opis strong {
        flex-shrink: 0;
        font-size: .85rem;
        color: var(--sop-tekst);
    }

/* suwak w kolumnie (Kontrobserwacja) i w wierszu (Współwystępowanie) — ten sam wygląd */
:is(.sop-suwak, .sop-suwak-wiersz) input[type="range"] {
    width: 100%;
    height: 18px;
    margin: 0;
    background: transparent;
    accent-color: var(--sop-akcent);
    cursor: pointer;
}

.sop-pill-ostrzezenie {
    background: rgba(246, 181, 74, .16);
    color: #f6cd84;
}

.sop-mapa-karta-foto {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--sop-ramka);
}

/* numer wykrycia na mapie (rozmiar tylko tutaj; Leaflet dostaje iconSize: null; kolor z KoloryMapy) */
.sop-mapa-numer span {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid #031a17;
    border-radius: 50%;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
}

@media (max-width: 1400px) {
    .sop-kontr {
        grid-template-columns: 560px minmax(0, 1fr);
    }
}

/* =====================================================================
   ANALIZY — HISTORIA POJAZDU: podsumowanie, kierunek, godziny, miejsca, wykrycia
   ===================================================================== */
.sop-historia {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 640px minmax(0, 1fr);
    gap: var(--sop-odstep);
}

/* # | Czas | Kierunek | Zestaw | Miejsce */
.sop-tabela-historia {
    --kolumny: 36px 160px 96px minmax(0, 1fr) 70px;
}

    .sop-tabela-historia .sop-tabela-pasek {
        gap: 16px;
    }

.sop-historia-sekcja {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--sop-ramka-slaba);
}

/* pojazd (tablica, opis, powrót do listy) | Wykrycia | Dni | Trasy | Zestawy */
.sop-historia-podsumowanie {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr));
    align-items: start;
}

/* numer zwykłym tekstem, w tym samym stylu co liczby obok (POJAZD / WYKRYCIA / …) */
.sop-historia-pojazd {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    font-size: .82rem;
}

    .sop-historia-akcje {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 14px;
    }

    .sop-historia-numer-wiersz {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .sop-historia-pojazd .sop-ellipsis {
        max-width: 100%;
    }

/* dodanie do listy z opisem (komponent DodajDoListy) — wspólne dla Historii i karty Kontrobserwacji */
.sop-dodaj-do-listy .sop-field {
    gap: .35rem;
    margin-bottom: 0;
}

    /* pole tej samej wysokości co przyciski */
    .sop-dodaj-do-listy .sop-field input {
        min-height: var(--sop-wys-przycisku);
    }

/* układ w Historii pojazdu (w miejscu kierunku i godzin):
   pytanie
   opis (pole z etykietą) | ANULUJ DODAJ */
.sop-historia-dodaj {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    align-items: end;
    gap: 10px 14px;
    font-size: .88rem;
}

    .sop-historia-dodaj > span:first-child {
        grid-column: 1 / -1;
    }



    .sop-historia-dodaj > :last-child:not(.sop-akcje-2) {
        grid-column: 1 / -1;
    }

/* kierunek | godziny — dwie kolumny w jednej sekcji */
.sop-historia-dwie {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.sop-historia-blok {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

    .sop-historia-podsumowanie > div {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .sop-historia-podsumowanie strong {
        font-size: 1.35rem;
        line-height: 1.1;
        color: var(--sop-tekst);
    }

/* pasek proporcji kierunków; kolory tylko tutaj (pasek i kropki opisu) */
.sop-historia-kierunek {
    display: flex;
    gap: 2px;
    height: 10px;
    overflow: hidden;
    border-radius: 5px;
}

    .sop-historia-kierunek span {
        flex-basis: 0;
    }

.sop-historia-kierunek-opis {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    font-size: .8rem;
}

    .sop-historia-kierunek-opis span {
        display: inline-flex;
        align-items: center;
        gap: 7px;
    }

    .sop-historia-kierunek-opis i {
        width: 10px;
        height: 10px;
        border-radius: 50%;
    }

.kierunek-tensam {
    background: var(--sop-akcent);
}

.kierunek-naprzeciw {
    background: #8fb2aa;
}

.kierunek-nieznany {
    background: rgba(143, 178, 170, .25);
}

.sop-historia-godziny {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 34px;
}

    .sop-historia-godziny span {
        flex: 1;
        border-radius: 2px 2px 0 0;
        background: rgba(143, 220, 193, .12);
    }

        .sop-historia-godziny span.jest {
            background: var(--sop-akcent);
        }

.sop-historia-godziny-os {
    display: flex;
    justify-content: space-between;
    font-size: .7rem;
}

.sop-historia-miejsce {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 110px 44px;
    align-items: center;
    gap: 10px;
    min-height: 30px;
    padding: 0 8px;
    margin: 0 -8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sop-tekst);
    font: inherit;
    font-size: .82rem;
    text-align: left;
    cursor: pointer;
}

    .sop-historia-miejsce:hover {
        background: rgba(108, 226, 181, .08);
    }

    .sop-historia-miejsce strong {
        text-align: right;
    }

/* numery do wyboru: 3 równe kolumny — każda tablica tej samej szerokości, liczba wykryć wyrównana do prawej */
.sop-historia-wybor {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.sop-historia-numer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--sop-ramka);
    border-radius: 10px;
    background: rgba(2, 17, 15, .45);
    color: var(--sop-tekst);
    font: inherit;
    cursor: pointer;
}

    .sop-historia-numer:hover {
        border-color: rgba(108, 226, 181, .4);
    }

    .sop-historia-numer .sop-plate {
        flex: 1;
    }

        .sop-historia-numer .sop-plate span {
            flex: 1;
            justify-content: center;
        }

    .sop-historia-numer > .sop-tabular {
        min-width: 3ch;
        text-align: right;
    }

@media (max-width: 1400px) {
    .sop-historia {
        grid-template-columns: 560px minmax(0, 1fr);
    }
}

/* =====================================================================
   ANALIZY — POWIĄZANIA: pojazdy pojawiające się razem ze sprawdzanym
   ===================================================================== */
/* Numer | Razem | Trasy | Dni | Ostatnio (+ znacznik listy) */
.sop-tabela-powiazania {
    --kolumny: 124px 76px 56px 50px minmax(0, 1fr);
}

    .sop-tabela-powiazania :is(.sop-tabela-naglowek, .sop-tabela-wiersz) > :is(:nth-child(2), :nth-child(3), :nth-child(4)) {
        text-align: center;
    }

.sop-powiazania-ostatnio {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sop-powiazania-godziny {
    font-size: .78rem;
    line-height: 1.5;
}

.sop-powiazania-akcje {
    justify-content: center;
}

/* link pod przyciskami karty na mapie */
.sop-karta-link {
    align-self: center;
}

/* =====================================================================
   ANALIZY — WSPÓŁWYSTĘPOWANIE: miejsca (promień, czas), próg, wyniki
   ===================================================================== */
.sop-wspol {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 640px minmax(0, 1fr);
    gap: var(--sop-odstep);
}

/* Numer | Miejsca | Wykrycia | Ostatnie */
.sop-tabela-wspol {
    --kolumny: 124px minmax(0, 1fr) 80px 110px;
}

    .sop-tabela-wspol :is(.sop-tabela-naglowek, .sop-tabela-wiersz) > :nth-child(3) {
        text-align: center;
    }

/* litera | współrzędne | promień | usuń
   od – do (cały wiersz) */
.sop-wspol-miejsce {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 230px 28px;
    align-items: center;
    gap: 8px 12px;
    padding: 6px 0;
    font-size: .85rem;
}

    .sop-wspol-miejsce + .sop-wspol-miejsce {
        border-top: 1px dashed var(--sop-ramka-slaba);
    }

.sop-suwak-wiersz {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .sop-suwak-wiersz strong {
        min-width: 62px;
        text-align: right;
        color: var(--sop-tekst);
    }

.sop-wspol-usun {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--sop-ramka);
    border-radius: 8px;
    background: transparent;
    color: var(--sop-tekst-wyciszony);
    cursor: pointer;
}

    .sop-wspol-usun:hover {
        border-color: rgba(255, 93, 108, .5);
        color: #ff9aa4;
    }

    .sop-wspol-usun svg {
        width: 14px;
        height: 14px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2px;
        stroke-linecap: round;
    }

.sop-wspol-czas {
    grid-column: 2 / -1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

    .sop-wspol-czas input {
        flex: 1;
    }

/* pola formularza w wersji zwartej (np. czas miejsca) */
.sop-field.sop-field-kompakt input {
    min-height: 36px;
    padding: .35rem .6rem;
    font-size: .85rem;
}

.sop-wspol-prog {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    font-size: .88rem;
}

    .sop-wspol-prog .sop-wspol-szukaj {
        margin-left: auto;
    }

.sop-wspol-litery {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

@media (max-width: 1400px) {
    .sop-wspol {
        grid-template-columns: 560px minmax(0, 1fr);
    }
}

.leaflet-container {
    background: #0b1a18;
    font-family: inherit;
}

/* jasne kafelki (np. OpenStreetMap) zamienione na ciemne, w tonacji SOP */
.sop-kafelki-przyciemnione {
    filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.85) saturate(.35) sepia(.15) hue-rotate(110deg);
}

.leaflet-control-zoom a {
    background: rgba(3, 20, 18, .9) !important;
    color: var(--sop-tekst) !important;
    border-color: var(--sop-ramka) !important;
}

    .leaflet-control-zoom a:hover {
        background: rgba(20, 60, 52, .95) !important;
    }

.leaflet-control-attribution {
    background: rgba(3, 20, 18, .7) !important;
    color: var(--sop-tekst-wyciszony) !important;
    font-size: 10px;
}

    .leaflet-control-attribution a {
        color: var(--sop-eyebrow) !important;
    }

.leaflet-tooltip.sop-mapa-etykieta,
.leaflet-tooltip.sop-mapa-dymek {
    background: rgba(3, 20, 18, .92);
    color: var(--sop-tekst);
    border: 1px solid var(--sop-ramka);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
    font-size: .78rem;
}

.leaflet-tooltip.sop-mapa-etykieta {
    font-weight: 600;
    padding: 3px 8px;
}

    .leaflet-tooltip.sop-mapa-etykieta::before,
    .leaflet-tooltip.sop-mapa-dymek::before {
        display: none;
    }

/* =====================================================================
   MODUŁ: ADMINISTRACJA → USTAWIENIA
   ===================================================================== */

.sop-ustawienia {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: var(--sop-odstep);
}

/* ---------- lista sekcji ---------- */
.sop-ustawienia-sekcje {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
}

    .sop-ustawienia-sekcje .sop-uwaga {
        padding: 12px 10px 4px;
        font-size: .76rem;
    }

.sop-ustawienia-sekcja {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #a9c9c1;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

    .sop-ustawienia-sekcja:hover {
        background: rgba(108, 226, 181, .05);
        color: var(--sop-tekst);
    }

    .sop-ustawienia-sekcja.on {
        border-color: rgba(108, 226, 181, .3);
        background: rgba(108, 226, 181, .12);
        color: #f2fff8;
    }

.sop-ustawienia-sekcja-tekst {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .sop-ustawienia-sekcja-tekst strong {
        font-size: .9rem;
        font-weight: 600;
    }

    .sop-ustawienia-sekcja-tekst small {
        overflow: hidden;
        color: var(--sop-tekst-wyciszony);
        font-size: .72rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.sop-ustawienia-wlasne {
    flex-shrink: 0;
    color: var(--sop-eyebrow);
    font-size: .7rem;
    white-space: nowrap;
}

/* ---------- formularz sekcji ---------- */
.sop-ustawienia-formularz {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
}

.sop-ustawienia-naglowek {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--sop-ramka-slaba);
}

    .sop-ustawienia-naglowek > div {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .sop-ustawienia-naglowek .sop-eyebrow {
        justify-content: flex-start;
    }

.sop-ustawienia-lista {
    flex: 1;
    min-height: 0;
    padding: 6px 24px;
    overflow-y: auto;
}

    .sop-ustawienia-lista > .sop-alert {
        margin: 12px 0 6px;
    }

/* jedno ustawienie: opis | pole */
.sop-ustawienie {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: center;
    gap: 24px;
    padding: 13px 0;
    border-bottom: 1px solid var(--sop-ramka-slaba);
}

    .sop-ustawienie:last-child {
        border-bottom: 0;
    }

    /* długie pola (adres kafelków, atrybucja) — pole pod opisem */
    .sop-ustawienie.szerokie {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

.sop-ustawienie-opis {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sop-ustawienie-nazwa {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    font-weight: 550;
}

    /* zmiana do zapisania — ta sama kropka co pill w liście sekcji */
    .sop-ustawienie.zmienione .sop-ustawienie-nazwa::after {
        content: "";
        width: 7px;
        height: 7px;
        flex: 0 0 7px;
        border-radius: 50%;
        background: #f6b54a;
        box-shadow: 0 0 9px rgba(246, 181, 74, .45);
    }

.sop-ustawienie-pomoc {
    color: var(--sop-tekst-wyciszony);
    font-size: .76rem;
    line-height: 1.4;
}

.sop-field.sop-ustawienie-pole {
    gap: 6px;
    min-width: 0;
    margin: 0;
}

    .sop-field.sop-ustawienie-pole input {
        min-height: var(--sop-wys-przycisku);
        padding: .4rem .75rem;
        font-size: .9rem;
    }

    .sop-ustawienie-pole .sop-przelacznik {
        align-self: flex-start;
    }

.sop-ustawienie-liczba {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .sop-field .sop-ustawienie-liczba input {
        width: 130px;
        font-variant-numeric: tabular-nums;
    }

    .sop-ustawienie-liczba span {
        color: var(--sop-tekst-wyciszony);
        font-size: .82rem;
        white-space: nowrap;
    }

.sop-ustawienie-domyslna {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--sop-tekst-wyciszony);
    font-size: .72rem;
}

    .sop-ustawienie-domyslna .sop-link {
        flex-shrink: 0;
        font-size: .72rem;
    }

.sop-link:disabled,
.sop-link:disabled:hover {
    color: var(--sop-eyebrow);
    opacity: .4;
    cursor: default;
    text-decoration: none;
}

/* ---------- stopka: ostatnia zmiana | komunikat | przyciski ---------- */
.sop-ustawienia-stopka {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--sop-ramka-slaba);
}

    .sop-ustawienia-stopka > .sop-muted {
        flex: 1;
        min-width: 0;
        font-size: .78rem;
    }

    .sop-ustawienia-stopka .sop-alert {
        margin: 0;
        padding: .5rem .8rem;
        white-space: nowrap;
    }

    .sop-ustawienia-stopka .sop-button-outline {
        margin-top: 0;
    }

/* =====================================================================
   MODUŁ: ALARMY (lista, karta, pasek na Smart Panelu)
   ===================================================================== */

/* etykiety rodzaju — kolory jak na mapie (KoloryMapy) */
.sop-pill-kontrobserwacja {
    background: rgba(246, 181, 74, .16);
    color: #f6cd84;
}

.sop-pill-zespol {
    background: rgba(195, 140, 255, .16);
    color: #d9bcff;
}

.sop-alarmy {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: var(--sop-odstep);
}

/* kropka | Czas | Rodzaj | Numer | Zestaw | Załoga | Centrala */
.sop-tabela-alarmy {
    --kolumny: 14px 124px 110px 120px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr);
}

.sop-alarm-kropka {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.sop-alarm-numer {
    font-weight: 600;
    letter-spacing: .05em;
    white-space: nowrap;
}

.sop-alarm-nowy {
    color: #ff8a95;
    font-weight: 600;
}

.sop-alarm-potwierdzony {
    color: #a8ebc9;
}

/* potwierdzony przez centralę lub zamknięty — wiersz przygaszony */
.sop-tabela-wiersz.sop-alarm-zamkniety > span {
    opacity: .55;
}

.sop-tabela-wiersz.sop-alarm-zamkniety.zaznaczony > span {
    opacity: .8;
}

/* zakres dat w pasku tabeli */
.sop-alarmy-daty {
    gap: 8px;
}

    .sop-alarmy-daty .sop-field {
        margin: 0;
    }

/* ---------- karta alarmu ---------- */
.sop-karta-alarmu .sop-panel-tytul {
    min-height: 24px;
}

.sop-alarm-stan {
    color: var(--sop-tekst-wyciszony);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    white-space: nowrap;
}

    .sop-alarm-stan.nowy {
        color: #ff8a95;
    }

.sop-alarm-potwierdzenia {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--sop-ramka-slaba);
    border-radius: 10px;
    background: rgba(2, 17, 15, .45);
    font-size: .82rem;
}

    .sop-alarm-potwierdzenia > div {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr);
        align-items: baseline;
        column-gap: 10px;
    }

        .sop-alarm-potwierdzenia > div > .sop-muted {
            grid-column: 2;
            font-size: .78rem;
        }

.sop-karta-alarmu .sop-field {
    margin: 0;
}

.sop-karta-alarmu-przyciski {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 10px;
}

/* ---------- pasek alarmu (Smart Panel) ---------- */
.sop-pasek-alarmu {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 8px 10px 8px 14px;
    border: 1px solid color-mix(in srgb, var(--kolor-alarmu) 55%, transparent);
    border-radius: var(--sop-promien);
    background: color-mix(in srgb, var(--kolor-alarmu) 14%, #071a17);
    font-size: .85rem;
}

    .sop-pasek-alarmu > svg {
        width: 20px;
        height: 20px;
        flex: 0 0 20px;
        fill: none;
        stroke: var(--kolor-alarmu);
        stroke-width: 1.8px;
        stroke-linecap: round;
        stroke-linejoin: round;
        animation: sop-dzwonek 1.2s ease-in-out infinite;
    }

    .sop-pasek-alarmu .sop-muted {
        min-width: 0;
        font-size: .82rem;
    }

    .sop-pasek-alarmu .sop-button {
        flex-shrink: 0;
    }

.sop-pasek-alarmu-numer {
    font-size: .95rem;
    letter-spacing: .05em;
    white-space: nowrap;
}

.sop-pasek-alarmu-zestaw {
    color: var(--sop-tekst);
}

.sop-pasek-alarmu-ukryj {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sop-tekst-wyciszony);
    cursor: pointer;
}

    .sop-pasek-alarmu-ukryj:hover {
        background: rgba(255, 255, 255, .06);
        color: var(--sop-tekst);
    }

    .sop-pasek-alarmu-ukryj svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2px;
        stroke-linecap: round;
    }

@keyframes sop-dzwonek {
    0%, 60%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(-12deg); }
    20%, 40% { transform: rotate(12deg); }
}

.sop-karta-alarmu > .sop-plate {
    align-self: flex-start;
}

/* ---------- karta alarmu kontrobserwacji ---------- */
.sop-alarm-kpi {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

    .sop-alarm-kpi > div {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
        padding: 8px 10px;
        border: 1px solid var(--sop-ramka-slaba);
        border-radius: 10px;
        background: rgba(2, 17, 15, .45);
    }

    .sop-alarm-kpi strong {
        font-size: 1.05rem;
        white-space: nowrap;
    }

    .sop-alarm-kpi span {
        overflow: hidden;
        color: var(--sop-tekst-wyciszony);
        font-size: .72rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* auta grupy zespołowej: kropka w kolorze z mapy | numer | od–do | wykrycia */
.sop-alarm-auta {
    display: flex;
    flex-direction: column;
    padding: 4px 12px;
    border: 1px solid var(--sop-ramka-slaba);
    border-radius: 10px;
    background: rgba(2, 17, 15, .45);
    font-size: .82rem;
}

    .sop-alarm-auta > div {
        display: grid;
        grid-template-columns: 9px minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 10px;
        padding: 5px 0;
    }

    .sop-alarm-auta i {
        width: 9px;
        height: 9px;
        border-radius: 50%;
    }

    .sop-alarm-auta strong {
        letter-spacing: .05em;
        white-space: nowrap;
    }

/* miniatury zdjęć z wykryć (klik — powiększenie) */
.sop-alarm-miniatury {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

    .sop-alarm-miniatury button {
        position: relative;
        aspect-ratio: 16 / 9;
        overflow: hidden;
        padding: 0;
        border: 1px solid var(--sop-ramka-slaba);
        border-radius: 8px;
        background: #0b1a18;
        cursor: zoom-in;
    }

    .sop-alarm-miniatury img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .sop-alarm-miniatury span {
        position: absolute;
        right: 4px;
        bottom: 4px;
        padding: 1px 5px;
        border-radius: 4px;
        background: rgba(2, 17, 15, .8);
        color: var(--sop-tekst);
        font-size: .66rem;
        white-space: nowrap;
    }
