    :root {
        --bg-color: #f4f7f6;
        --card-bg: #ffffff;
        --text-main: #1a1d20;
        --text-muted: #6c757d;
        --border-color: #dee2e6;
        --input-focus: #0d6efd;
        --brand-green-dark: #0b3f2d;
        --brand-green: #00693b;
        --brand-green-soft: #2e7b55;
        --brand-bridge: #6e6250;
        --brand-red-soft: #8f4a45;
        --brand-red: #a91e34;
    }

    html {
        min-height: 100%;
        background-color: #1a1d20;
    }

    body {
        margin: 0;
        padding: 0;
        font-family: 'Inter', -apple-system, sans-serif;
        min-height: 100vh;
        min-height: 100svh;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow-x: hidden;
        isolation: isolate;
        background: transparent;
    }

    body::before {
        content: '';
        position: fixed;
        inset: -20vmax;
        background:
            radial-gradient(circle at 18% 18%, rgba(0, 105, 59, 0.42) 0%, rgba(0, 105, 59, 0.18) 26%, rgba(0, 105, 59, 0) 56%),
            radial-gradient(circle at 82% 76%, rgba(169, 30, 52, 0.34) 0%, rgba(169, 30, 52, 0.16) 24%, rgba(169, 30, 52, 0) 56%),
            radial-gradient(circle at 52% 26%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 18%, rgba(255, 255, 255, 0) 42%),
            linear-gradient(135deg,
                var(--brand-green-dark) 0%,
                var(--brand-green) 24%,
                var(--brand-green-soft) 43%,
                var(--brand-bridge) 64%,
                var(--brand-red-soft) 82%,
                var(--brand-red) 100%);
        transform: translateZ(0);
        filter: saturate(1.02) blur(18px);
        z-index: -1;
        pointer-events: none;
    }

    .login-container {
        background: var(--card-bg);
        width: 100%;
        max-width: 420px;
        padding: 2.5rem;
        border-radius: 24px;
        border: none;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
        box-sizing: border-box;
        margin: 20px;
    }

    .logo-section {
        text-align: center;
        margin-bottom: 2rem;
    }

    .logo-section h1 {
        margin: 0;
        font-size: 32px;
        font-weight: 700;
        color: #1e1e1e;
        letter-spacing: -0.5px;
    }

    /* Kolory marki WikiAPiR */
    .logo-section h1 span.green {
        color: #00693b;
    }

    .logo-section h1 span.red {
        color: #a91e34;
    }

    .logo-section p {
        margin: 8px 0 0;
        font-size: 14px;
        color: var(--text-muted);
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        font-size: 14px;
        color: var(--text-main);
    }

    .form-control {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 15px;
        font-family: inherit;
        color: var(--text-main);
        background-color: #f8f9fa;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        transition: all 0.2s ease-in-out;
        box-sizing: border-box;
    }

    .form-control:focus {
        outline: 0;
        background-color: #ffffff;
        border-color: var(--input-focus);
        box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
    }

    .btn-submit {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        padding: 0.85rem 1rem;
        font-size: 16px;
        font-weight: 600;
        color: #fff;
        background-color: #1a1d20;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: background-color 0.2s, transform 0.1s;
        margin-top: 1rem;
    }

    .btn-submit:hover:not(:disabled) {
        background-color: #343a40;
    }

    .btn-submit:active:not(:disabled) {
        transform: scale(0.98);
    }

    .btn-submit:disabled {
        background-color: var(--text-muted);
        cursor: not-allowed;
        opacity: 0.8;
    }

    #error-msg {
        display: none;
        background-color: #fef2f2;
        color: #991b1b;
        padding: 0.75rem;
        margin-bottom: 1.5rem;
        border-radius: 8px;
        font-size: 14px;
        text-align: center;
        border: 1px solid #fecaca;
        animation: fadeIn 0.3s ease-in-out;
    }

    .status-box {
        display: none;
        padding: 0.75rem;
        margin-bottom: 1.5rem;
        border-radius: 8px;
        font-size: 14px;
        text-align: center;
        animation: fadeIn 0.3s ease-in-out;
    }

    .status-success {
        background-color: #ecfdf3;
        color: #166534;
        border: 1px solid #bbf7d0;
    }

    .info-box {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        margin-bottom: 1.5rem;
        padding: 0.9rem 1rem;
        border-radius: 12px;
        background: rgba(13, 110, 253, 0.08);
        border: 1px solid rgba(13, 110, 253, 0.16);
        color: #12345b;
        font-size: 14px;
        line-height: 1.5;
    }

    .text-link {
        font-size: 14px;
        color: #20c997;
        text-decoration: none;
    }

    .footer-text {
        text-align: center;
        margin-top: 2rem;
        font-size: 12px;
        color: var(--text-muted);
    }

    .spinner {
        display: none;
        width: 1.2rem;
        height: 1.2rem;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-top-color: #fff;
        border-radius: 50%;
        animation: rotation 0.8s linear infinite;
        margin-right: 8px;
    }

    .panel-shell {
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 24px 16px;
        box-sizing: border-box;
    }

    .devices-container {
        max-width: 760px;
    }

    .devices-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 1.5rem;
    }

    .devices-logo {
        margin-bottom: 0;
        text-align: left;
    }

    .devices-home-link {
        white-space: nowrap;
        margin-top: 0.4rem;
    }

    .devices-toolbar {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 1rem;
    }

    .btn-secondary,
    .btn-danger-outline {
        border: 1px solid rgba(26, 29, 32, 0.14);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.76);
        color: var(--text-main);
        font: inherit;
        font-weight: 600;
        padding: 0.7rem 1rem;
        cursor: pointer;
        transition: transform 0.1s ease, background-color 0.2s ease, border-color 0.2s ease;
    }

    .btn-secondary:hover:not(:disabled),
    .btn-danger-outline:hover:not(:disabled) {
        transform: translateY(-1px);
    }

    .btn-secondary:disabled,
    .btn-danger-outline:disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }

    .btn-danger-outline {
        border-color: rgba(185, 28, 28, 0.18);
        color: #991b1b;
        background: rgba(254, 242, 242, 0.88);
    }

    .devices-list {
        display: grid;
        gap: 1rem;
    }

    .device-card {
        padding: 1.1rem 1.15rem;
        border-radius: 18px;
        border: 1px solid rgba(26, 29, 32, 0.08);
        background: rgba(255, 255, 255, 0.74);
        box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
    }

    .device-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 0.9rem;
    }

    .device-title {
        margin: 0 0 0.45rem;
        font-size: 18px;
        line-height: 1.3;
        color: var(--text-main);
    }

    .device-badge {
        display: inline-flex;
        align-items: center;
        border-radius: 999px;
        padding: 0.3rem 0.65rem;
        font-size: 12px;
        font-weight: 700;
        background: rgba(13, 110, 253, 0.08);
        color: #12406a;
        border: 1px solid rgba(13, 110, 253, 0.12);
    }

    .device-badge-current {
        background: rgba(22, 163, 74, 0.1);
        color: #166534;
        border-color: rgba(22, 163, 74, 0.16);
    }

    .device-meta {
        display: grid;
        gap: 0.65rem;
    }

    .device-meta-row {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        font-size: 14px;
    }

    .device-meta-label {
        color: var(--text-muted);
    }

    .device-meta-value {
        color: var(--text-main);
        text-align: right;
        font-weight: 500;
    }

    .empty-state {
        padding: 1.4rem 1rem;
        text-align: center;
        border-radius: 16px;
        border: 1px dashed rgba(26, 29, 32, 0.14);
        color: var(--text-muted);
        background: rgba(255, 255, 255, 0.52);
    }

    @keyframes rotation {
        0% {
            transform: rotate(0deg);
        }

        100% {
            transform: rotate(360deg);
        }
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-5px);
        }

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

    @media (max-width: 640px) {
        body {
            align-items: stretch;
            padding:
                calc(16px + env(safe-area-inset-top))
                calc(16px + env(safe-area-inset-right))
                calc(16px + env(safe-area-inset-bottom))
                calc(16px + env(safe-area-inset-left));
            box-sizing: border-box;
        }

        .login-container {
            margin: auto 0;
            padding: 2rem 1.25rem;
        }

        .devices-header,
        .device-card-header,
        .device-meta-row {
            flex-direction: column;
        }

        .devices-toolbar {
            justify-content: stretch;
        }

        .btn-secondary,
        .btn-danger-outline {
            width: 100%;
        }

        .device-meta-value {
            text-align: left;
        }
    }
