:root {
    --ui-radius: 10px;
    --ui-radius-sm: 8px;
    --ui-gap: 1rem;
    --ui-shadow: var(--app-card-shadow);
    --app-ink: #0b1736;
    --app-muted: #42557e;
    --app-line: #e3eaf6;
    --app-bg: #edf3fc;
    --app-accent: #0f5cff;
    --app-accent-dark: #0847d8;
    --app-soft-blue: #eef5ff;
    --app-sidebar: #ffffff;
    --app-card-shadow: 0 18px 45px rgba(31, 56, 102, 0.08);
}

/* Wspólna walidacja formularzy dla jasnego i ciemnego motywu. */
.form-control.is-invalid,
.form-select.is-invalid,
.form-check-input.is-invalid,
.was-validated .form-control:invalid,
.was-validated .form-select:invalid,
.was-validated .form-check-input:invalid {
    border-color: var(--app-danger) !important;
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--app-danger) 22%, transparent) !important;
}

.form-check-input.is-invalid + .form-check-label,
.was-validated .form-check-input:invalid + .form-check-label {
    color: var(--app-danger);
}

.qr-print-body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--app-surface);
}

.qr-print-image {
    display: block;
    width: 180mm;
    height: 180mm;
    max-width: 92vw;
    max-height: 92vh;
    image-rendering: pixelated;
}

.app-invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    color: var(--app-danger);
    font-size: 0.82rem;
    font-weight: 600;
}

.app-notification-button {
    position: relative;
    text-decoration: none;
    border: none;
    background: none;
}

.app-notification-button.dropdown-toggle::after {
    display: none;
}

.app-notification-menu {
    width: 320px;
    max-width: calc(100vw - 2rem);
    padding: 0.45rem;
    border: 1px solid var(--app-line);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.app-notification-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 0.7rem;
    border-radius: 9px;
    color: var(--app-ink);
    white-space: normal;
}

.app-notification-item:hover,
.app-notification-item:focus {
    background: var(--app-soft-blue);
    color: var(--app-ink);
}

.app-notification-item-title {
    font-weight: 700;
}

.app-notification-item-message {
    color: var(--app-muted);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.app-notification-item-time {
    color: var(--app-muted);
    font-size: 0.76rem;
}

.app-notification-empty {
    padding: 1rem 0.7rem;
    color: var(--app-muted);
    text-align: center;
    font-size: 0.9rem;
}

.app-notification-see-all {
    text-align: center;
    font-weight: 700;
    color: var(--app-accent);
}

.app-notification-count {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--app-surface);
    border-radius: 999px;
    background: var(--app-danger);
    color: var(--app-surface);
    font-size: 0.67rem;
    font-weight: 800;
}

.app-surface-accent {
    background: var(--app-soft-blue);
    border-color: color-mix(in srgb, var(--app-accent) 35%, var(--app-line)) !important;
}

@media print {
    .qr-print-body {
        page: attendance-qr;
    }

    @page attendance-qr {
        size: auto;
        margin: 0;
    }

    .app-sidebar,
    .app-topbar,
    .app-mobile-section-menu,
    .app-footer,
    .event-details-tabs > .nav,
    .event-operation-action {
        display: none !important;
    }

    .app-shell,
    .app-workspace,
    .app-main,
    .event-operation-report {
        display: block !important;
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: var(--app-surface) !important;
        color: var(--app-ink) !important;
    }

    .event-operation-report .panel-block {
        break-inside: avoid;
        box-shadow: none;
    }

    .payroll-report {
        max-width: none !important;
        page: payroll;
    }

    @page payroll {
        size: A4 landscape;
        margin: 10mm;
    }

    .payroll-report .table-responsive {
        overflow: visible !important;
    }

    .payroll-report .payroll-table {
        font-size: 8.5pt;
    }

    .payroll-report .payroll-table th,
    .payroll-report .payroll-table td {
        padding: 5px !important;
        color: var(--app-ink) !important;
    }

    .payroll-report .payroll-signature-column {
        min-width: 110px;
    }

    .payroll-report .payroll-table-panel {
        break-inside: auto;
    }
}

.payroll-report {
    max-width: 1680px;
}

.payroll-report-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.payroll-report-meta {
    display: grid;
    gap: 0.25rem;
    color: var(--app-muted);
    font-size: 0.88rem;
    text-align: right;
}

.payroll-cash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.payroll-cash-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.3rem 0.65rem;
    padding: 0.8rem;
    border: 1px solid var(--app-line);
    border-radius: 0.75rem;
    background: var(--app-surface-muted);
}

.payroll-cash-item strong {
    font-size: 1.05rem;
}

.payroll-cash-item small {
    grid-column: 1 / -1;
}

.payroll-person-cash {
    max-width: 240px;
    margin-top: 0.2rem;
    line-height: 1.25;
}

.payroll-table {
    min-width: 1320px;
}

.payroll-table tfoot th {
    border-top: 2px solid var(--app-line);
}

.payroll-signature-column {
    min-width: 140px;
}

/* Profile workspace */
.profile-page {
    max-width: 1460px;
}

.profile-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 2rem;
    color: var(--app-muted);
    font-size: 0.9rem;
}

.profile-breadcrumb a {
    color: var(--app-accent);
    font-weight: 700;
    text-decoration: none;
}

.profile-breadcrumb i {
    font-size: 0.72rem;
}

.profile-legacy-heading,
.profile-edit-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--app-line);
    border-radius: 14px;
    background: var(--app-surface);
}

.profile-workspace {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.profile-section-nav {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 0.35rem;
    padding: 0.65rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface);
}

.profile-section-nav a {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--app-ink);
    font-weight: 800;
    text-decoration: none;
}

.profile-section-nav a i {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: var(--app-surface-muted);
    color: var(--app-accent);
}

.profile-section-nav a:hover,
.profile-section-nav a.active {
    border-color: color-mix(in srgb, var(--app-accent) 22%, var(--app-line));
    background: var(--app-soft-blue);
    color: var(--app-accent);
}

.profile-section-content {
    min-width: 0;
}

.profile-card {
    min-height: 430px;
    padding: 1.6rem;
}

.profile-card .profile-summary {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 2rem;
}

.profile-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--app-line);
}

.profile-rank-card {
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    border: 1px solid color-mix(in srgb, var(--app-accent) 24%, var(--app-line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--app-accent) 10%, var(--app-surface));
}

.profile-rank-card-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--app-soft-blue);
    color: var(--app-accent);
    font-size: 1.25rem;
}

.profile-rank-card small,
.profile-rank-card em {
    display: block;
    color: var(--app-muted);
    font-style: normal;
}

.profile-rank-card strong {
    display: block;
    font-size: 1rem;
}

.profile-card .profile-photo-lg,
.profile-card .profile-photo-button-lg {
    width: 160px;
    height: 180px;
    flex-basis: 160px;
}

.profile-card .profile-photo-lg {
    object-position: center top;
}

.profile-detail-list {
    display: grid;
    grid-template-columns: minmax(185px, 250px) minmax(0, 1fr);
    gap: 0;
}

.profile-detail-list dt,
.profile-detail-list dd {
    min-height: 52px;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--app-line);
}

.profile-detail-list dt {
    gap: 0.75rem;
    color: var(--app-ink);
}

.profile-detail-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: var(--app-soft-blue);
    color: var(--app-accent);
}

.profile-documents-list {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--app-line);
}

.profile-documents-list article {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--app-line);
}

.profile-card fieldset {
    padding: 1rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface-muted);
}

/* MFA (#77): metoda z poziomem bezpieczeństwa, kody zapasowe. */
.mfa-level-badge {
    font-weight: 600;
    vertical-align: middle;
}

.mfa-method-summary,
.mfa-recovery-panel {
    background: var(--app-surface);
}

.mfa-recovery-code-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: .25rem 1.5rem;
    padding-left: 1.5rem;
}

.mfa-recovery-code-list code {
    font-size: 1rem;
    letter-spacing: .05em;
}

.mfa-method-legend dt {
    margin-top: .5rem;
    color: var(--app-ink);
    font-weight: 600;
}

.mfa-method-legend dd {
    margin-bottom: 0;
}

/* Wspólny podgląd plików (#71): obraz w całości (contain), PDF w iframe, tło zgodne z motywem. */
.file-preview-modal .modal-content {
    background: var(--app-surface);
}

.file-preview-counter {
    color: var(--app-muted);
    font-size: .88rem;
    white-space: nowrap;
}

.file-preview-body {
    position: relative;
    background: var(--app-surface-muted);
}

.file-preview-stage {
    display: grid;
    place-items: center;
    height: min(78vh, 900px);
    overflow: hidden;
}

.file-preview-image {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
}

.file-preview-stage.is-zoomed {
    place-items: start;
    overflow: auto;
}

.file-preview-stage.is-zoomed .file-preview-image {
    width: auto;
    height: auto;
    max-width: none;
    cursor: zoom-out;
}

.file-preview-stage:not(.is-zoomed) .file-preview-image {
    cursor: zoom-in;
}

.file-preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--app-surface);
}

.file-preview-status {
    display: grid;
    justify-items: center;
    gap: .75rem;
    padding: 2rem;
    color: var(--app-muted);
    text-align: center;
}

.file-preview-status .bi {
    font-size: 2.5rem;
}

.file-preview-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    transform: translateY(-50%);
    border: 1px solid var(--app-line);
    border-radius: 50%;
    background: var(--app-surface);
    color: var(--app-ink);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.file-preview-nav.is-prev {
    left: .75rem;
}

.file-preview-nav.is-next {
    right: .75rem;
}

.file-preview-nav:hover,
.file-preview-nav:focus-visible {
    border-color: var(--app-accent);
    color: var(--app-accent);
}

@media (max-width: 575.98px) {
    .file-preview-stage {
        height: calc(100vh - 8.5rem);
    }
}

@media (max-width: 991.98px) {
    .profile-workspace {
        grid-template-columns: 1fr;
    }

    .profile-section-nav {
        position: static;
        display: flex;
        overflow-x: auto;
        padding: 0.45rem;
        scrollbar-width: thin;
    }

    .profile-section-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .profile-summary-head {
        flex-direction: column;
    }

    .profile-rank-card {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    .profile-breadcrumb {
        margin-bottom: 1.25rem;
    }

    .profile-legacy-heading,
    .profile-edit-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-card {
        min-height: 0;
        padding: 1rem;
    }

    .profile-card .profile-summary {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .profile-card .profile-photo-lg,
    .profile-card .profile-photo-button-lg {
        width: 112px;
        height: 126px;
        flex-basis: 112px;
    }

    .profile-detail-list {
        grid-template-columns: 1fr;
    }

    .profile-detail-list dt {
        min-height: 42px;
        padding-bottom: 0.25rem;
        border-bottom: 0;
    }

    .profile-detail-list dd {
        min-height: 38px;
        padding-top: 0;
    }

    .profile-documents-list article {
        flex-wrap: wrap;
    }
}

body {
    min-height: 100vh;
    background: var(--app-bg);
    color: var(--app-ink);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-navbar {
    background: var(--app-ink);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    background:
        radial-gradient(circle at 82% 0%, rgba(15, 92, 255, 0.12), transparent 34rem),
        linear-gradient(180deg, #f8fbff 0%, #edf3fc 100%);
}

.app-shell-no-sidebar {
    grid-template-columns: minmax(0, 1fr);
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1.7rem 1rem 1.25rem;
    background: var(--app-surface);
    border-right: 1px solid var(--app-line);
    box-shadow: 14px 0 34px rgba(31, 56, 102, 0.04);
    z-index: 20;
}

.app-brand,
.app-mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--app-ink);
    font-size: 1.08rem;
    font-weight: 900;
    text-decoration: none;
    line-height: 1.25;
}

.app-brand-mark {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    flex: 0 0 48px;
    overflow: hidden;
}

.app-brand-mark img,
.app-brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
}

html[data-app-theme="light"] .app-brand-logo-dark,
.app-brand-logo-dark {
    display: none;
}

html[data-app-theme="dark"] .app-brand-logo-light {
    display: none;
}

html[data-app-theme="dark"] .app-brand-logo-dark {
    display: block;
}

.app-sidebar-section {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
}

.app-sidebar-section > span {
    display: block;
    margin: 0 0.8rem 0.65rem;
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.app-side-menu {
    display: grid;
    gap: 0.35rem;
    min-height: 0;
    padding-right: 0.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--app-muted) 45%, transparent) transparent;
}

.app-side-menu a,
.app-side-group-label,
.app-context-link {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.82rem;
    color: var(--app-ink);
    font-weight: 800;
    text-decoration: none;
}

.app-side-menu a {
    min-height: 49px;
    padding: 0.68rem 0.78rem;
    border-radius: 8px;
    border: 1px solid transparent;
}

.app-side-group {
    display: grid;
    gap: 0.3rem;
}

.app-side-group-label {
    width: 100%;
    min-height: 49px;
    padding: 0.68rem 0.78rem;
    border-radius: 8px;
    color: var(--app-ink);
    background: var(--app-soft-blue);
    border: 1px solid color-mix(in srgb, var(--app-accent) 22%, var(--app-line));
    text-align: left;
}

.app-side-group.active .app-side-group-label {
    color: var(--app-accent);
    background: var(--app-soft-blue);
}

.app-side-group-chevron {
    margin-left: auto;
    color: var(--app-muted);
    font-size: 0.8rem;
    transition: transform 0.15s ease;
}

.app-side-group.is-open .app-side-group-chevron {
    transform: rotate(180deg);
}

.app-side-submenu {
    display: grid;
    gap: 0.25rem;
    margin: 0.1rem 0 0.15rem 1.2rem;
    padding-left: 0.85rem;
    border-left: 1px solid var(--app-line);
}

.app-side-submenu[hidden] {
    display: none;
}

.app-side-submenu a {
    min-height: 42px;
    padding: 0.55rem 0.7rem;
    font-size: 0.94rem;
}

.app-side-submenu .app-menu-icon {
    width: 24px;
    height: 24px;
    font-size: 1.05rem;
}

.app-side-menu a:hover,
.app-side-menu a.active {
    background: var(--app-soft-blue);
    color: var(--app-accent);
    border-color: color-mix(in srgb, var(--app-accent) 24%, var(--app-line));
    box-shadow: none;
}

.app-side-menu a.disabled,
.app-context-link.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.app-menu-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.14rem;
    line-height: 1;
    color: currentColor;
    opacity: 1;
    flex: 0 0 24px;
}

.app-side-menu .app-menu-icon {
    border-radius: 8px;
    background: var(--app-soft-blue);
    color: var(--app-accent);
    font-size: 0.92rem;
}

.app-side-menu a.active .app-menu-icon,
.app-side-menu a:hover .app-menu-icon {
    color: var(--app-accent);
    background: var(--app-soft-blue);
}

.app-help-card {
    display: none;
}

.app-help-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    border-radius: 10px;
    background: var(--app-soft-blue);
    color: var(--app-accent);
    font-size: 1.35rem;
    font-weight: 900;
}

.app-help-card strong {
    display: block;
    margin-bottom: 0.35rem;
}

.app-help-card p {
    color: var(--app-muted);
    font-size: 0.92rem;
}

.app-workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topbar {
    min-height: 88px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.85rem;
    background: color-mix(in srgb, var(--app-surface) 94%, transparent);
    border-bottom: 1px solid var(--app-line);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 15;
}

.app-mobile-brand {
    display: none;
}

.app-shell-no-sidebar .app-mobile-brand {
    display: inline-flex;
    flex: 0 0 auto;
}

.app-top-menu {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow-x: auto;
    scrollbar-width: thin;
}

.app-top-menu.empty::before {
    content: "";
}

.app-context-link {
    min-height: 38px;
    padding: 0.45rem 0.72rem;
    border: 1px solid transparent;
    border-radius: 8px;
    white-space: nowrap;
    color: var(--app-muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.app-context-link:hover,
.app-context-link.active {
    color: var(--app-accent);
    border-color: color-mix(in srgb, var(--app-accent) 24%, var(--app-line));
    background: var(--app-soft-blue);
}

.app-context-link i {
    width: 18px;
    text-align: center;
    font-size: 0.92rem;
}


.app-user-box {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 0 0 auto;
    position: relative;
}

.app-user-box::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    width: max(100%, 220px);
    height: 0.65rem;
    pointer-events: none;
}

@media (min-width: 992px) {
    .app-user-box:hover::after,
    .app-user-box:focus-within::after {
        pointer-events: auto;
    }
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
    margin-left: auto;
}

.app-user-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--app-ink);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.app-user-link.dropdown-toggle::after {
    color: var(--app-muted);
    margin-left: 0.1rem;
}

.app-user-menu {
    position: absolute !important;
    inset: calc(100% + 0.65rem) 0 auto auto !important;
    margin: 0 !important;
    transform: none !important;
    min-width: 220px;
    padding: 0.45rem;
    border: 1px solid var(--app-line);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.app-user-mobile-icon {
    display: none;
}

@media (min-width: 992px) {
    .app-user-box:hover > .app-user-menu,
    .app-user-box:focus-within > .app-user-menu {
        display: block;
    }
}

.app-user-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 40px;
    border-radius: 9px;
    color: var(--app-ink);
    font-weight: 700;
}

.app-user-menu .dropdown-item i {
    width: 22px;
    text-align: center;
    color: var(--app-muted);
}

.app-user-menu .dropdown-item:hover,
.app-user-menu .dropdown-item.active {
    background: var(--app-soft-blue);
    color: var(--app-accent);
}

.app-main {
    /* Odstęp treści — menu ustawień (#137) zjada go, żeby przylegać do belki i lewej krawędzi. */
    --app-main-pad: clamp(1.4rem, 3vw, 2.35rem);
    flex: 1 0 auto;
    padding: var(--app-main-pad);
}

.app-has-sidebar .settings-shell {
    grid-template-columns: minmax(0, 1fr);
}

.app-has-sidebar .settings-sidebar {
    display: none;
}

.app-main > .container {
    max-width: 1480px;
}

.app-footer {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 2rem;
    color: var(--app-muted);
    font-size: 0.88rem;
    border-top: 1px solid var(--app-line);
    background: color-mix(in srgb, var(--app-surface) 70%, transparent);
}

/* Zainstalowana wersja w stopce (#94). */
.app-footer-version {
    color: var(--app-muted);
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    white-space: nowrap;
}

a.app-footer-version:hover,
a.app-footer-version:focus-visible {
    color: var(--app-accent);
    text-decoration: underline;
}

.app-navbar .navbar-brand {
    margin-left: 0;
}

.app-navbar .dropdown-menu .dropend {
    position: relative;
}

.app-navbar .dropdown-menu .dropend > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-left: 0.1rem;
}

.app-navbar .dropdown-menu .dropend:hover > .dropdown-menu,
.app-navbar .dropdown-menu .dropend:focus-within > .dropdown-menu {
    display: block;
}

.btn-primary {
    --bs-btn-bg: var(--app-accent);
    --bs-btn-border-color: var(--app-accent);
    --bs-btn-hover-bg: var(--app-accent-dark);
    --bs-btn-hover-border-color: var(--app-accent-dark);
}

.install-shell,
.auth-card,
.panel-block {
    background: var(--app-surface);
    border: 1px solid var(--app-line);
    border-radius: var(--ui-radius);
    box-shadow: var(--app-card-shadow);
}

.install-shell {
    max-width: 820px;
    padding: clamp(1.25rem, 4vw, 2rem);
}

.auth-card {
    max-width: 440px;
    padding: clamp(1.25rem, 4vw, 2rem);
}

.panel-block {
    padding: 1.35rem;
}

.stat-label {
    color: var(--app-muted);
}

.stat-label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.table {
    --bs-table-color: var(--app-ink);
    --bs-table-border-color: var(--app-line);
}

.table thead th {
    color: var(--app-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.btn {
    border-radius: 7px;
    font-weight: 700;
}

.btn-outline-secondary {
    --bs-btn-color: #425578;
    --bs-btn-border-color: #cfd9e8;
    --bs-btn-hover-bg: #eef5ff;
    --bs-btn-hover-border-color: #b8cae3;
    --bs-btn-hover-color: #0b1736;
}

.empty-state {
    border: 1px dashed var(--app-line);
    border-radius: var(--ui-radius);
    padding: 1.5rem 1.25rem;
    color: var(--app-muted);
    text-align: center;
}

/* Wspólne komponenty (#66): kafelek statystyki, nagłówek karty, pusty stan. */
.ui-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: var(--ui-gap);
}

.ui-stat {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    min-width: 0;
    padding: 1rem 1.1rem;
    border: 1px solid var(--app-line);
    border-radius: var(--ui-radius);
    background: var(--app-surface);
    color: var(--app-ink);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

a.ui-stat:hover,
a.ui-stat:focus-visible {
    border-color: var(--app-accent);
    box-shadow: var(--ui-shadow);
    color: var(--app-ink);
}

.ui-stat.is-active {
    border-color: var(--app-accent);
    box-shadow: 0 0 0 1px var(--app-accent);
}

.ui-stat-icon {
    display: inline-flex;
    flex: 0 0 2.25rem;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--ui-radius-sm);
    background: var(--app-soft-blue);
    color: var(--app-accent-dark);
    font-size: 1.05rem;
}

.ui-stat-body {
    min-width: 0;
}

.ui-stat-label {
    display: block;
    color: var(--app-muted);
    font-size: .86rem;
}

.ui-stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.ui-stat-context {
    display: block;
    color: var(--app-muted);
    font-size: .8rem;
}

.ui-stat.is-danger {
    border-color: color-mix(in srgb, var(--app-danger) 40%, var(--app-line));
}

.ui-stat.is-danger .ui-stat-value {
    color: var(--app-danger);
}

.ui-stat.is-danger .ui-stat-icon {
    background: var(--app-danger-soft);
    color: var(--app-danger);
}

.ui-stat.is-warning {
    border-color: color-mix(in srgb, var(--app-warning) 40%, var(--app-line));
}

.ui-stat.is-warning .ui-stat-value {
    color: var(--app-warning);
}

.ui-stat.is-warning .ui-stat-icon {
    background: color-mix(in srgb, var(--app-warning) 14%, var(--app-surface));
    color: var(--app-warning);
}

.ui-stat.is-success .ui-stat-icon {
    background: var(--app-success-soft);
    color: var(--app-success);
}

.ui-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem .75rem;
    margin-bottom: 1rem;
}

.ui-card-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.ui-card-title > i {
    color: var(--app-accent-dark);
}

.ui-card-count {
    padding: .05rem .5rem;
    border-radius: 999px;
    background: var(--app-surface-muted);
    color: var(--app-muted);
    font-size: .8rem;
    font-weight: 600;
}

.ui-card-more {
    font-size: .86rem;
    white-space: nowrap;
    text-decoration: none;
}

.ui-card-more:hover {
    text-decoration: underline;
}

.empty-state.ui-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    text-align: center;
    color: var(--app-muted);
}

.ui-empty-icon {
    font-size: 1.6rem;
    color: var(--app-muted);
}

@media (max-width: 575.98px) {
    .ui-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .6rem;
    }

    .ui-stat {
        flex-direction: column;
        gap: .5rem;
        padding: .8rem;
    }

    .ui-stat-value {
        font-size: 1.35rem;
    }
}

.invitation-secret {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.profile-photo {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    object-fit: cover;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface-muted);
}

.profile-photo-button {
    display: inline-block;
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
}

.profile-photo-button:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.35);
    outline-offset: 3px;
}

.profile-photo-lg,
.profile-photo-button-lg {
    width: 120px;
    height: 120px;
    flex-basis: 120px;
}

.profile-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-muted);
    font-weight: 700;
}

.profile-photo-large {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 8px;
}

.profile-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.profile-summary-main {
    min-width: 0;
}

.profile-details {
    display: grid;
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
    gap: 0.55rem 1rem;
    margin-bottom: 0;
}

.profile-details dt {
    color: var(--app-muted);
    font-weight: 700;
}

.profile-details dd {
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.employee-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 220px;
}

.employee-photo {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
}

.employees-table td {
    vertical-align: middle;
}

/* Lista pracowników (#48): spokojny wiersz, akcje w menu, karty na telefonie. */
.link-quiet {
    color: inherit;
    text-decoration: none;
}

.link-quiet:hover,
.link-quiet:focus-visible {
    color: var(--app-accent);
    text-decoration: underline;
}

.employees-table .employee-cell {
    min-width: 0;
}

.employees-table .employee-photo {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
}

.employee-initials {
    font-size: .95rem;
    font-weight: 700;
    color: var(--app-accent-dark);
    background: var(--app-soft-blue);
}

.employee-cell-text {
    min-width: 0;
}

.employee-cell-text a {
    display: block;
    color: var(--app-muted);
    overflow-wrap: anywhere;
}

.employee-badges {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: .3rem;
}

.employee-permission-badge,
.employee-rank-badge {
    display: inline-block;
    padding: .15rem .5rem;
    border: 1px solid var(--app-line);
    border-radius: 999px;
    background: var(--app-surface-muted);
    color: var(--app-ink);
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: default;
}

.employee-rank-badge {
    font-weight: 500;
}

.employee-status {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
    font-size: .9rem;
}

.employee-status::before {
    content: "";
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: var(--app-muted);
}

.employee-status.is-active::before {
    background: var(--app-success);
}

.employee-status.is-blocked {
    color: var(--app-danger);
}

.employee-status.is-blocked::before {
    background: var(--app-danger);
}

.employee-actions {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

.employee-menu-toggle {
    border: 1px solid var(--app-line);
    background: var(--app-surface);
    color: var(--app-ink);
}

.employees-table tr[data-details-target] {
    cursor: pointer;
}

.employees-table tbody tr[data-details-target]:hover > td {
    background: var(--app-surface-muted);
}

@media (max-width: 767.98px) {
    .employees-table thead {
        display: none;
    }

    .employees-table,
    .employees-table tbody,
    .employees-table tr,
    .employees-table td {
        display: block;
        width: 100%;
    }

    .employees-table tr[data-employee-row] {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: .35rem .75rem;
        padding: .85rem 0;
        border-bottom: 1px solid var(--app-line);
    }

    .employees-table tr[data-employee-row][hidden] {
        display: none;
    }

    .employees-table td {
        padding: 0;
        border: 0;
    }

    .employees-table td[data-label="Pracownik"] {
        grid-column: 1;
    }

    .employees-table td.employee-actions-cell {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
    }

    .employees-table td[data-label="Kontakt"],
    .employees-table td[data-label="Uprawnienia"],
    .employees-table td[data-label="Ranga"],
    .employees-table td[data-label="Status"] {
        grid-column: 1 / -1;
        padding-left: calc(44px + .85rem);
    }

}

.employee-details-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.employee-details-list {
    max-width: 720px;
}

/* Okno „Dane pracownika” (#50). */
.employee-details-heading {
    min-width: 0;
}

.employee-details-meta,
.employee-details-quick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.employee-details-section {
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface);
}

.employee-details-section h4 {
    margin-bottom: .75rem;
    color: var(--app-muted);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.employee-details-section dl {
    margin: 0;
}

.employee-details-row {
    display: grid;
    grid-template-columns: minmax(8.5rem, max-content) minmax(0, 1fr);
    gap: .75rem;
    padding: .35rem 0;
}

.employee-details-row + .employee-details-row {
    border-top: 1px solid var(--app-line);
}

.employee-details-row dt {
    color: var(--app-muted);
    font-weight: 500;
    min-width: 0;
    overflow-wrap: anywhere;
}

.employee-details-row dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.employee-rank-progress {
    height: .4rem;
    max-width: 14rem;
}

.employee-document {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem 0;
}

.employee-document + .employee-document {
    border-top: 1px solid var(--app-line);
}

.employee-document-state {
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}

.employee-document-state.is-ok {
    color: var(--app-success);
}

.employee-document-state.is-warning {
    color: var(--app-warning);
}

.employee-document-state.is-danger {
    color: var(--app-danger);
}

.employee-document-state.is-muted {
    color: var(--app-muted);
}

/* Profil pracownika (/pracownicy/{id}) i szybki podgląd w oknie. */
.employee-link {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted color-mix(in srgb, currentColor 45%, transparent);
}

.employee-link:hover,
.employee-link:focus-visible {
    color: var(--app-accent);
    border-bottom-color: var(--app-accent);
}

.employee-profile-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
}

@media (max-width: 575.98px) {
    .employee-profile-back {
        width: 100%;
    }
}

.employee-profile-breadcrumb a {
    color: var(--app-muted);
    text-decoration: none;
}

.employee-profile-breadcrumb a:hover {
    color: var(--app-accent);
}

.employee-profile-header,
.employee-preview-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.employee-profile-heading {
    min-width: 0;
}

.employee-preview {
    display: grid;
    gap: 1rem;
}

.employee-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.employee-preview-actions .btn {
    max-width: 100%;
}

.employee-preview-context {
    margin-top: .5rem;
    padding: .65rem .75rem;
    border: 1px solid var(--app-line);
    border-left: 4px solid var(--app-accent);
    border-radius: 8px;
    background: var(--app-surface-muted);
}

.employee-preview-context-title {
    display: block;
    margin-bottom: .25rem;
    font-weight: 600;
}

.employee-history-table td {
    vertical-align: top;
}

@media (max-width: 575.98px) {
    .employee-details-header,
    .employee-profile-header {
        align-items: flex-start;
    }

    .employee-details-row {
        grid-template-columns: 1fr;
        gap: .1rem;
    }
}

.status-badge {
    background: var(--app-success-soft);
    color: var(--app-success);
    border: 1px solid color-mix(in srgb, var(--app-success) 40%, var(--app-line));
}

.settings-shell {
    display: block;
    margin: 0;
    min-height: 0;
}

.settings-sidebar {
    align-self: stretch;
    background: var(--app-surface);
    border-right: 1px solid var(--app-line);
    padding: 1.7rem 1rem 1.25rem;
    position: sticky;
    top: 0;
    height: calc(100vh - 76px);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--app-muted) 45%, transparent) transparent;
}

.settings-sidebar-title {
    padding: 0 0.65rem 0.45rem;
    margin-bottom: 0.25rem;
}

.settings-sidebar-title span {
    display: block;
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.settings-sidebar-title strong {
    display: none;
}

.settings-menu {
    display: grid;
    gap: 0.35rem;
}

.settings-menu-empty {
    color: var(--app-muted);
    font-size: 0.9rem;
    padding: 0.65rem 0.8rem;
}

.settings-menu a {
    display: flex;
    align-items: center;
    gap: 0.82rem;
    min-height: 49px;
    padding: 0.68rem 0.78rem;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--app-ink);
    font-weight: 800;
    text-decoration: none;
}

.settings-menu-group {
    border-radius: 8px;
}

.settings-menu-group summary {
    display: flex;
    align-items: center;
    gap: 0.82rem;
    min-height: 49px;
    padding: 0.68rem 0.78rem;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--app-ink);
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.settings-menu-group summary::-webkit-details-marker {
    display: none;
}

.settings-menu-group summary::after {
    content: "▾";
    margin-left: auto;
    color: var(--app-muted);
    font-size: 0.8rem;
    transition: transform 0.15s ease;
}

.settings-menu-group[open] summary::after {
    transform: rotate(180deg);
}

.settings-menu-group summary:hover,
.settings-menu-group[open] summary {
    background: var(--app-soft-blue);
    border-color: color-mix(in srgb, var(--app-accent) 24%, var(--app-line));
    color: var(--app-accent);
}

.settings-submenu {
    display: grid;
    gap: 0.25rem;
    margin: 0.1rem 0 0.15rem 1.2rem;
    padding-left: 0.85rem;
    border-left: 1px solid var(--app-line);
}

.settings-submenu a {
    min-height: 42px;
    padding: 0.55rem 0.7rem;
    font-size: 0.94rem;
}

.settings-menu a:hover,
.settings-menu a.active {
    background: var(--app-soft-blue);
    border-color: color-mix(in srgb, var(--app-accent) 24%, var(--app-line));
    color: var(--app-accent);
}

.settings-menu .app-menu-icon,
.settings-menu-group summary .app-menu-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
    border-radius: 8px;
    background: var(--app-soft-blue);
    color: var(--app-accent);
    font-size: 0.92rem;
    line-height: 1;
}

.settings-menu a:hover .app-menu-icon,
.settings-menu a.active .app-menu-icon,
.settings-menu-group summary:hover .app-menu-icon,
.settings-menu-group[open] summary .app-menu-icon {
    color: var(--app-accent);
    background: var(--app-soft-blue);
}

.settings-main {
    min-width: 0;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0;
}

/* Zakładki podstrony ustawień (#93): zwykłe linki ?tab=, na wąskim ekranie przewijane w poziomie. */
.settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
}

.settings-tabs .nav-link {
    white-space: nowrap;
}

/* Zwijana pomoc (#93): zwija się tylko objaśnienie, nigdy pola formularza. */
.settings-help > summary {
    cursor: pointer;
    color: var(--bs-secondary-color);
}

.settings-help[open] > summary {
    color: var(--bs-body-color);
}

/* Powiadomienia i szablony (#99): lista zdań, rozwijany edytor jednej wiadomości. */
.notification-group-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.notification-group-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-group-filter .form-select {
    width: auto;
    min-width: 12rem;
}

.notification-list {
    background: var(--bs-body-bg);
    border: 1px solid var(--app-line);
    border-radius: 1rem;
    overflow: hidden;
}

.notification-row + .notification-row {
    border-top: 1px solid var(--app-line);
}

.notification-row-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.85rem 1rem;
}

.notification-row-text {
    flex: 1 1 auto;
    min-width: 0;
}

.notification-row.is-disabled .notification-row-text,
.notification-row.is-disabled .notification-row-channels {
    opacity: 0.55;
}

.notification-row.is-open {
    background: color-mix(in srgb, var(--app-accent) 4%, var(--bs-body-bg));
}

.notification-row-channels {
    display: flex;
    gap: 0.4rem;
    color: var(--bs-secondary-color);
}

.notification-row-channels .is-unavailable {
    color: var(--bs-warning-text-emphasis);
}

.notification-row-lock {
    color: var(--bs-secondary-color);
    width: 2.5rem;
    text-align: center;
}

.notification-toggle-form .form-check-input {
    cursor: pointer;
}

.notification-editor {
    border-top: 1px dashed var(--app-line);
    padding: 1rem;
    container-type: inline-size;
}

/* Układ zależy od szerokości samego edytora (obok menu ustawień bywa wąski), nie okna. */
.notification-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

.notification-editor-content {
    container-type: inline-size;
    min-width: 0;
}

@container (min-width: 46rem) {
    .notification-editor-grid {
        grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
    }
}

.notification-channel-tabs {
    margin-bottom: 1rem;
}

.notification-channel-tabs .nav-link.is-off {
    opacity: 0.45;
}

.has-channel-tabs .notification-channel-pane-title {
    display: none;
}

.notification-channel-pane + .notification-channel-pane {
    margin-top: 1.5rem;
}

.has-channel-tabs .notification-channel-pane + .notification-channel-pane {
    margin-top: 0;
}

.notification-channel-pane {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem 1.25rem;
    align-items: start;
}

@container (min-width: 40rem) {
    .notification-channel-pane {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

.notification-channel-pane > :not(.notification-fields):not(.notification-preview) {
    grid-column: 1 / -1;
}

.notification-channel-pane > .notification-fields[hidden] + .notification-preview {
    grid-column: 1 / -1;
}

.template-editor {
    position: relative;
    background: var(--bs-body-bg);
    border-radius: var(--bs-border-radius);
    margin-bottom: 0.6rem;
}

.template-editor-backdrop,
.template-editor-input {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.375rem 0.75rem;
    border: var(--bs-border-width) solid transparent;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
    letter-spacing: normal;
    scrollbar-gutter: stable;
}

.template-editor-backdrop {
    position: absolute;
    inset: 0;
    overflow: hidden;
    color: transparent;
    pointer-events: none;
}

.template-editor-input {
    position: relative;
    z-index: 1;
    background: transparent !important;
    border-color: var(--bs-border-color);
}

.template-editor-input.font-monospace,
.template-editor:has(.font-monospace) .template-editor-backdrop {
    font-family: var(--bs-font-monospace);
    font-size: 0.85rem;
}

.template-editor.is-single-line .template-editor-input {
    resize: none;
    overflow: hidden;
}

.template-editor-backdrop mark {
    padding: 0;
    color: transparent;
    border-radius: 0.25rem;
}

.template-editor-backdrop mark.is-known {
    background: color-mix(in srgb, var(--app-accent) 22%, transparent);
}

.template-editor-backdrop mark.is-unknown {
    background: color-mix(in srgb, var(--bs-danger) 22%, transparent);
    text-decoration: underline wavy var(--bs-danger);
}

.template-variables {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.template-variable {
    background: color-mix(in srgb, var(--app-accent) 10%, transparent);
    color: var(--app-accent);
    border: 1px solid color-mix(in srgb, var(--app-accent) 30%, transparent);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
}

.template-variable:hover,
.template-variable:focus-visible {
    background: color-mix(in srgb, var(--app-accent) 20%, transparent);
    color: var(--app-accent);
}

.template-errors:not(:empty) {
    margin-top: 0.5rem;
}

.notification-preview {
    background: var(--bs-tertiary-bg);
    border-radius: 0.75rem;
    padding: 0.75rem;
}

.notification-preview-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--app-line);
    border-radius: 0.6rem;
    padding: 0.75rem;
}

.notification-preview-body {
    color: var(--bs-secondary-color);
    margin-top: 0.35rem;
    overflow-wrap: anywhere;
}

.notification-preview-frame {
    width: 100%;
    height: 26rem;
    border: 0;
    border-radius: 0.5rem;
    /* Podgląd e-maila: zawsze jasne tło jak w skrzynce pocztowej. */
    --notification-preview-paper: #fff;
    background: var(--notification-preview-paper);
}

.notification-preview-sms {
    background: var(--bs-body-bg);
    border: 1px solid var(--app-line);
    border-radius: 1rem 1rem 1rem 0.25rem;
    padding: 0.6rem 0.8rem;
    max-width: 22rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.notification-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--app-line);
}

@media (max-width: 575.98px) {
    .notification-row-summary {
        flex-wrap: wrap;
    }

    .notification-row-text {
        flex-basis: 100%;
    }

    .notification-row-edit {
        margin-left: auto;
    }
}

/* Wspólny szkielet podstron ustawień (#44): nawigacja boczna, okruszki, karty wierszy. */
/* Menu przyklejone do górnej belki i lewej krawędzi (#137, jak menu boczne aplikacji), treść obok z ograniczoną
   szerokością. Ujemny margines zjada odstęp .app-main; wysokość belki ustawia settings-layout.js (--app-topbar-height). */
.settings-shell:has(> .settings-nav) {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    margin: calc(-1 * var(--app-main-pad, 0px)) 0 0 calc(-1 * var(--app-main-pad, 0px));
    /* Wiersz okruszków tylko tak wysoki jak one — wysokie menu nie może spychać treści w dół. */
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "nav crumbs"
        "nav main";
    column-gap: var(--app-main-pad, 2rem);
    align-items: start;
}

.settings-shell:has(> .settings-nav) > .settings-breadcrumbs {
    padding-top: var(--app-main-pad, 0px);
}

.settings-shell:has(> .settings-nav) > .settings-main,
.settings-shell:has(> .settings-nav) > .settings-breadcrumbs {
    width: 100%;
    max-width: 1320px;
    margin: 0;
}

.settings-shell:has(> .settings-nav) > .settings-main {
    grid-area: main;
}

.settings-nav {
    grid-area: nav;
    position: sticky;
    top: var(--app-topbar-height, 76px);
    height: calc(100vh - var(--app-topbar-height, 76px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem .75rem 1.5rem;
    border-right: 1px solid var(--app-line);
    background: var(--app-surface);
}

/* Menu ustawień (#137): spokojne nagłówki grup, pozycje ~36 px, pasek akcentu przy aktywnej, link powrotu. */
.settings-nav-home,
.settings-nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 2.25rem;
    padding: .5rem .75rem;
    border-radius: 6px;
    color: var(--app-ink);
    font-size: .93rem;
    line-height: 1.3;
    text-decoration: none;
}

.settings-nav-home {
    margin-bottom: .6rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid var(--app-line);
    border-radius: 6px 6px 0 0;
    color: var(--app-muted);
    font-size: .88rem;
}

.settings-nav-home i,
.settings-nav-link i {
    width: 1.2rem;
    flex: 0 0 1.2rem;
    font-size: 1rem;
    color: var(--app-muted);
    text-align: center;
}

.settings-nav-link > span:first-of-type {
    flex: 1 1 auto;
    min-width: 0;
}

.settings-nav-home:hover,
.settings-nav-link:hover {
    background: var(--app-surface-muted);
    color: var(--app-ink);
}

.settings-nav-home:focus-visible,
.settings-nav-link:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: -2px;
    background: var(--app-surface-muted);
    color: var(--app-ink);
}

.settings-nav-home.active {
    color: var(--app-accent-dark);
    font-weight: 600;
}

.settings-nav-link.active {
    background: var(--app-soft-blue);
    box-shadow: inset 3px 0 0 var(--app-accent);
    color: var(--app-accent-dark);
    font-weight: 600;
}

.settings-nav-home.active i,
.settings-nav-link.active i {
    color: var(--app-accent);
}

.settings-nav-search {
    position: relative;
    margin-bottom: .25rem;
}

.settings-nav-search > i {
    position: absolute;
    top: 50%;
    left: .65rem;
    transform: translateY(-50%);
    color: var(--app-muted);
    font-size: .85rem;
    pointer-events: none;
}

.settings-nav-search .form-control {
    padding-left: 2rem;
    padding-right: 2rem;
}

.settings-nav-search-key {
    position: absolute;
    top: 50%;
    right: .5rem;
    transform: translateY(-50%);
    padding: 0 .35rem;
    border: 1px solid var(--app-line);
    border-radius: 4px;
    background: var(--app-surface-muted);
    color: var(--app-muted);
    font-size: .72rem;
    pointer-events: none;
}

.settings-nav-group {
    margin-top: 1rem;
}

.settings-nav-group[hidden] {
    display: none;
}

.settings-nav-heading {
    margin: 0 0 .25rem;
    padding: 0 .75rem;
    color: var(--app-muted);
    font-size: .8rem;
    font-weight: 500;
}

.settings-nav-empty {
    margin: 1rem .75rem 0;
}

/* Znaczniki stanu (te same sprawdzenia co alerty na panelu); tekst dla czytników w .visually-hidden. */
.settings-nav-badge {
    flex: 0 0 auto;
    padding: .05rem .4rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.4;
}

.settings-nav-badge-warning {
    border: 1px solid var(--app-warning);
    color: var(--app-warning);
}

.settings-nav-badge-danger {
    border: 1px solid var(--app-danger);
    color: var(--app-danger);
}

.settings-nav-badge-dot {
    width: .55rem;
    height: .55rem;
    padding: 0;
    border: 0;
    background: var(--app-danger);
}

.settings-nav-mobile {
    display: none;
}

.settings-breadcrumbs {
    grid-area: crumbs;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin-bottom: 1rem;
    font-size: .88rem;
}

.settings-breadcrumbs .breadcrumb a {
    color: var(--app-muted);
    text-decoration: none;
}

.settings-breadcrumbs .breadcrumb a:hover {
    color: var(--app-accent);
    text-decoration: underline;
}

.settings-last-change {
    color: var(--app-muted);
}

/* Karta tematyczna z wierszami: po lewej nazwa i opis, po prawej kontrolka. */
.panel-block.settings-card {
    padding: 0;
    overflow: hidden;
}

.settings-card + .settings-card {
    margin-top: 1rem;
}

.settings-card-header {
    padding: 1rem 1.35rem;
    border-bottom: 1px solid var(--app-line);
}

.settings-card-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.settings-card-header p {
    margin: .2rem 0 0;
    color: var(--app-muted);
    font-size: .88rem;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding: .9rem 1.35rem;
}

.settings-row-link {
    color: var(--app-ink);
    text-decoration: none;
}

.settings-row-link:hover,
.settings-row-link:focus-visible {
    background: var(--app-surface-muted);
    color: var(--app-ink);
}

.settings-row + .settings-row {
    border-top: 1px solid var(--app-line);
}

.settings-row-label {
    min-width: 0;
}

.settings-row-label label,
.settings-row-label strong {
    display: block;
    font-weight: 600;
}

.settings-row-label small {
    display: block;
    color: var(--app-muted);
}

.settings-row-control {
    flex: 0 0 auto;
}

.settings-row-control .form-switch {
    min-height: 0;
    margin: 0;
    padding-left: 0;
}

.settings-row-control .form-switch .form-check-input {
    width: 2.5rem;
    height: 1.35rem;
    margin: 0;
    cursor: pointer;
}

.settings-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
    margin-top: 1rem;
    padding: .85rem 0;
    background: linear-gradient(to top, var(--app-bg) 70%, transparent);
}

.settings-unsaved-bar {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    z-index: 1030;
    transform: translateX(-50%);
    padding: .5rem 1rem;
    border: 1px solid color-mix(in srgb, var(--app-warning) 45%, var(--app-line));
    border-radius: 999px;
    background: var(--app-surface);
    color: var(--app-warning);
    box-shadow: var(--app-card-shadow);
    font-size: .9rem;
    font-weight: 600;
}

.settings-unsaved-bar[hidden] {
    display: none;
}

.settings-toast-container {
    top: 88px;
}

.settings-toast {
    background: var(--app-surface);
    color: var(--app-ink);
    border: 1px solid color-mix(in srgb, var(--app-success) 40%, var(--app-line)) !important;
    box-shadow: var(--app-card-shadow);
}

.settings-toast .bi-check-circle-fill {
    color: var(--app-success);
}

@media (max-width: 991.98px) {
    .settings-shell:has(> .settings-nav) {
        margin: 0;
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "mobile"
            "crumbs"
            "main";
    }

    .settings-shell > .settings-nav {
        display: none;
    }

    .settings-shell:has(> .settings-nav) > .settings-breadcrumbs {
        padding-top: 0;
    }

    .settings-shell > .settings-nav-mobile {
        grid-area: mobile;
        display: block;
        margin-bottom: 1rem;
    }

    .settings-row {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-row-control {
        width: 100%;
    }

    .settings-row-control:has(.form-switch) {
        width: auto;
        align-self: flex-start;
    }
}

.settings-landing {
    max-width: 980px;
    margin-right: auto;
    margin-left: auto;
}

.settings-page-header {
    width: 100%;
    max-width: 980px;
    margin-right: auto;
    margin-left: auto;
}

.settings-landing-card {
    margin-bottom: 1rem;
}

.settings-landing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.settings-module-link {
    display: block;
    background: var(--app-surface);
    border: 1px solid var(--app-line);
    border-radius: 8px;
    padding: 1.1rem;
    color: var(--app-ink);
    text-decoration: none;
}

.settings-module-link:hover {
    border-color: color-mix(in srgb, var(--app-accent) 28%, var(--app-line));
    box-shadow: 0 8px 24px rgba(23, 32, 42, 0.06);
}

.settings-module-link span {
    display: block;
    color: var(--app-accent-dark);
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.settings-module-link strong {
    display: block;
    font-size: 1.05rem;
}

.settings-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 1.25rem;
    align-items: start;
}

.settings-list-panel,
.settings-form-panel {
    min-width: 0;
}

.settings-form-panel {
    position: sticky;
    top: 1rem;
}

.settings-table th {
    color: var(--app-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.settings-table td,
.settings-table th {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.settings-table code {
    color: var(--app-accent);
    white-space: nowrap;
}

/* Uprawnienia dodatkowe (#518): wpis wygasły zostaje na liście jako historia — szary. */
.permission-grant-expired td {
    color: var(--app-muted);
    opacity: 0.7;
}

.permission-grant-module {
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0.35rem 0;
}

.permission-grant-module summary {
    cursor: pointer;
    font-weight: 600;
}

.settings-tree-name {
    position: relative;
    padding-left: calc(var(--menu-depth, 0) * 1.35rem);
}

.settings-tree-name::before {
    content: "";
    display: none;
    position: absolute;
    left: calc((var(--menu-depth, 0) - 1) * 1.35rem);
    top: 0.45rem;
    width: 0.75rem;
    height: 0.7rem;
    border-left: 1px solid var(--app-line);
    border-bottom: 1px solid var(--app-line);
}

.settings-tree-depth-1::before,
.settings-tree-depth-2::before,
.settings-tree-depth-3::before,
.settings-tree-depth-4::before,
.settings-tree-depth-5::before {
    display: block;
}

.settings-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 0.4rem;
    white-space: nowrap;
}

.settings-actions form {
    margin: 0;
}

.settings-actions .form-control-sm {
    min-width: 180px;
}

.mass-events-register {
    overflow: hidden;
}

.mass-events-count {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--app-line);
    border-radius: 6px;
    background: var(--app-surface-muted);
    color: var(--app-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.mass-events-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.mass-events-calendar-weekday {
    padding: 0.35rem 0.25rem;
    text-align: center;
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.mass-events-calendar-day {
    min-height: 108px;
    padding: 0.4rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface);
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.mass-events-calendar-day.is-outside {
    background: var(--app-surface-muted);
    opacity: 0.6;
}

.mass-events-calendar-day.is-today {
    border-color: var(--app-accent);
    box-shadow: inset 0 0 0 1px var(--app-accent);
}

.mass-events-calendar-day-number {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--app-ink);
}

.mass-events-calendar-event {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    font-weight: 600;
}

.mass-events-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--app-line);
}

.mass-events-calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--app-muted);
}

.mass-events-calendar-legend-item .badge {
    width: 0.85rem;
    height: 0.85rem;
    padding: 0;
    border-radius: 50%;
}


/* Kolory wpisów i kropek legendy kalendarza (#399) — zmienne --app-cal-* w obu motywach */
.calendar-badge-planned {
    background-color: var(--app-cal-planned);
    color: var(--app-cal-planned-ink);
}

.calendar-badge-active {
    background-color: var(--app-cal-active);
    color: var(--app-cal-active-ink);
}

.calendar-badge-ended {
    background-color: var(--app-cal-ended);
    color: var(--app-cal-ended-ink);
}

.calendar-badge-cancelled {
    background-color: var(--app-cal-cancelled);
    color: var(--app-cal-cancelled-ink);
}

.calendar-badge-shift {
    background-color: var(--app-cal-shift);
    color: var(--app-cal-shift-ink);
}

.calendar-badge-request {
    background-color: var(--app-cal-request);
    color: var(--app-cal-request-ink);
}

.calendar-badge-leave {
    background-color: var(--app-cal-leave);
    color: var(--app-cal-leave-ink);
}

.calendar-badge-sick {
    background-color: var(--app-cal-sick);
    color: var(--app-cal-sick-ink);
}

.calendar-badge-swap {
    background-color: var(--app-cal-swap);
    color: var(--app-cal-swap-ink);
}

.calendar-badge-dayoff {
    background-color: var(--app-cal-dayoff);
    color: var(--app-cal-dayoff-ink);
}

.mass-events-calendar-legend-item .badge {
    border: 1px solid var(--app-line);
}

@media (max-width: 767.98px) {
    .mass-events-calendar-grid {
        grid-template-columns: repeat(7, minmax(40px, 1fr));
    }

    .mass-events-calendar-day {
        min-height: 72px;
        padding: 0.25rem;
    }

    .mass-events-calendar-event {
        font-size: 0.65rem;
    }
}

.mass-events-table {
    margin-bottom: 0;
}

.mass-events-table thead th {
    color: var(--app-muted);
    font-size: 0.78rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.mass-events-table th,
.mass-events-table td {
    padding: 1rem 0.75rem;
}

.mass-event-row + .mass-event-row td {
    border-top-color: var(--app-line);
}

.mass-event-title-cell {
    min-width: 260px;
}

.mass-event-title {
    display: block;
    font-size: 1.02rem;
    line-height: 1.25;
}

.mass-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.mass-event-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--app-line);
    border-radius: 6px;
    background: var(--app-surface-muted);
    color: var(--app-muted);
    font-size: 0.86rem;
}

.mass-event-note {
    margin-top: 0.55rem;
    color: var(--app-muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.mass-event-date-cell {
    min-width: 150px;
}

.mass-event-date {
    display: block;
    font-weight: 800;
}

.mass-event-staff-cell {
    min-width: 260px;
}

.mass-event-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(92px, 1fr));
    gap: 0.45rem;
}

.mass-event-metrics div {
    min-height: 56px;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--app-line);
    border-radius: 6px;
    background: var(--app-surface-muted);
}

.mass-event-metrics span {
    display: block;
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.mass-event-metrics strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 1.05rem;
}

.mass-event-status-cell {
    min-width: 150px;
}

.mass-event-status-box {
    display: grid;
    justify-items: start;
    gap: 0.35rem;
}

.mass-event-risk {
    color: var(--app-muted);
    font-size: 0.85rem;
}

.mass-event-transport-summary {
    margin-top: 0.35rem;
    color: var(--app-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.mass-event-action-cell {
    min-width: 360px;
}

.mass-event-actions {
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    max-width: none;
}

.employee-rate-box {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--app-accent) 28%, var(--app-line));
    border-radius: 6px;
    background: var(--app-soft-blue);
    color: var(--app-accent);
    font-size: 0.86rem;
    text-align: left;
    white-space: normal;
}

.employee-rate-box strong {
    display: block;
    margin-bottom: 0.15rem;
}

.event-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.event-details-grid > div {
    min-height: 76px;
    padding: 0.8rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface-muted);
}

.event-details-grid span {
    display: block;
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.event-details-grid strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.event-details-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--app-line);
}

.event-details-section h3 {
    margin-bottom: 0.65rem;
    font-size: 0.95rem;
    font-weight: 800;
}

.event-rate-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.event-rate-list span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.35rem 0.6rem;
    border: 1px solid color-mix(in srgb, var(--app-accent) 28%, var(--app-line));
    border-radius: 6px;
    background: var(--app-soft-blue);
    color: var(--app-accent);
    font-size: 0.88rem;
    font-weight: 700;
}

.event-group-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    max-height: 320px;
    overflow: auto;
    padding: 0.5rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface-muted);
}

.event-group-picker label {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    min-height: 54px;
    padding: 0.55rem;
    border: 1px solid var(--app-line);
    border-radius: 6px;
    background: var(--app-surface);
    cursor: pointer;
}

.event-group-picker span {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.event-group-picker small {
    color: var(--app-muted);
    overflow-wrap: anywhere;
}

.event-group-status-picker label.is-disabled {
    cursor: default;
    opacity: 0.72;
}

.event-group-status-picker small {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.45rem;
    align-items: center;
}

.event-group-list,
.event-group-submit-list {
    display: grid;
    gap: 0.75rem;
}

.event-group-list > div,
.event-group-submit-list > section {
    padding: 0.85rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface);
}

.event-group-list > div > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.event-group-list span {
    color: var(--app-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.event-group-list p {
    margin: 0.35rem 0 0.65rem;
    color: var(--app-muted);
}

.event-group-radio {
    margin-left: 0.5rem;
}

.transport-choice-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(160px, 220px));
    gap: 0.75rem;
    align-items: end;
}

.event-details-poster-thumb {
    width: 112px;
    height: 112px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--app-line);
    border-radius: 12px;
    background: var(--app-surface-muted);
    color: var(--app-muted);
    cursor: pointer;
}

.event-details-poster-thumb:hover,
a.mass-event-poster-thumb:hover {
    border-color: var(--app-accent);
}

.event-details-poster-thumb img,
.mass-event-poster-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-details-tabs .nav-link {
    font-weight: 700;
}

.mass-event-poster-cell {
    width: 84px;
}

.mass-event-poster-thumb {
    width: 56px !important;
    height: 56px !important;
    flex: 0 0 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--app-line);
    border-radius: 10px;
    background: var(--app-surface-muted);
    color: var(--app-muted);
    font-size: 0.75rem;
}

a.mass-event-poster-thumb {
    cursor: pointer;
}

.employee-photo-link {
    display: inline-flex;
    flex: 0 0 auto;
    border-radius: 50%;
}

.employee-photo-link:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.35);
    outline-offset: 2px;
}

.mass-event-poster-thumb img {
    display: block;
    min-width: 56px !important;
    max-width: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
}

.transport-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface-muted);
    color: var(--app-ink);
}

.transport-personal-panel {
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--app-accent) 32%, var(--app-line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--app-soft-blue) 42%, var(--app-surface));
}

.transport-section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.transport-section-number,
.transport-section-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--app-accent);
    color: #fff;
    font-weight: 900;
}

.transport-status-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--app-soft-blue);
    color: var(--app-accent);
}

.transport-coordinator-panel {
    padding: 16px;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface-muted);
    color: var(--app-ink);
}

.transport-coordinator-action,
.transport-coordinator-settings {
    padding: 14px;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface);
}

.transport-coordinator-settings summary {
    color: var(--app-ink);
    font-weight: 800;
    cursor: pointer;
}

.transport-coordinator-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.transport-coordinator-stats > div {
    min-height: 82px;
    padding: 12px;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface);
}

.transport-coordinator-stats span {
    display: block;
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.transport-coordinator-stats strong {
    display: block;
    margin-top: 6px;
    color: var(--app-ink);
    font-size: 1.4rem;
}

.transport-coordinator-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.transport-settings-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 10px;
}

.transport-mileage-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}

.deployment-map-editor {
    position: relative;
    width: 100%;
    overflow: visible;
    border: 1px solid var(--app-line);
    border-radius: 10px;
    background: var(--app-surface-muted);
    touch-action: none;
}

.deployment-map-editor > img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: inherit;
    opacity: 1 !important;
}

.deployment-section-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.deployment-section-icon {
    width: 44px;
    height: 44px;
    display: grid;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 12px;
    background: var(--app-soft-blue);
    color: var(--app-accent);
    font-size: 1.2rem;
}

.deployment-map-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
}

.deployment-map-upload-form .btn {
    min-width: 150px;
}

.deployment-map-marker {
    position: absolute;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    transform: translate(-50%, -50%);
    border: 3px solid var(--app-surface);
    border-radius: 50%;
    background: var(--app-accent);
    color: #fff;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--app-ink) 35%, transparent);
    font-weight: 900;
    cursor: grab;
    z-index: 2;
}

.deployment-map-marker:active {
    cursor: grabbing;
}

.deployment-map-marker.is-mine {
    width: 46px;
    height: 46px;
    background: var(--app-success);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--app-success) 25%, transparent);
    z-index: 3;
}

.deployment-map-marker-number {
    line-height: 1;
}

.deployment-map-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    width: max-content;
    min-width: 190px;
    max-width: 290px;
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    transform: translate(-50%, 6px);
    border: 1px solid var(--app-line);
    border-radius: 9px;
    background: var(--app-surface);
    color: var(--app-ink);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--app-ink) 22%, transparent);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 10;
}

.deployment-map-tooltip::after {
    position: absolute;
    left: 50%;
    top: 100%;
    width: 10px;
    height: 10px;
    content: "";
    transform: translate(-50%, -5px) rotate(45deg);
    border-right: 1px solid var(--app-line);
    border-bottom: 1px solid var(--app-line);
    background: var(--app-surface);
}

.deployment-map-tooltip strong,
.deployment-map-tooltip span,
.deployment-map-tooltip small {
    display: block;
}

.deployment-map-tooltip strong {
    color: var(--app-ink);
    font-size: 0.84rem;
}

.deployment-map-tooltip small {
    color: var(--app-muted);
}

.deployment-map-marker:hover .deployment-map-tooltip,
.deployment-map-marker:focus-visible .deployment-map-tooltip {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

.deployment-map-position-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Rozstawienie (#74): patrole z obszarem działania i punkty informacyjne. */
.deployment-map-viewport {
    overflow: auto;
    max-height: 80vh;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
}

.deployment-map-viewport > .deployment-map-editor {
    min-width: 100%;
}

.deployment-map-areas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.deployment-map-area {
    fill: color-mix(in srgb, #7c3aed 22%, transparent);
    stroke: #7c3aed;
    stroke-width: 2px;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

polyline.deployment-map-area {
    fill: none;
    stroke-dasharray: 4 3;
}

.deployment-map-area.is-mine {
    fill: color-mix(in srgb, var(--app-success) 28%, transparent);
    stroke: var(--app-success);
}

.deployment-map-area.is-selected {
    stroke-width: 3px;
}

.deployment-map-marker.is-patrol,
.deployment-map-vertex {
    --deployment-map-patrol: #7c3aed;
}

.deployment-map-marker.is-patrol {
    border-radius: 10px;
    background: var(--deployment-map-patrol);
}

.deployment-map-marker.is-patrol.is-mine {
    background: var(--app-success);
}

.deployment-map-marker.is-selected {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-accent) 45%, transparent);
}

.deployment-map-vertex {
    position: absolute;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--deployment-map-patrol);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    cursor: grab;
    touch-action: none;
    z-index: 4;
}

.deployment-map-point {
    --point-color: var(--app-muted);
    position: absolute;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    border-radius: 8px;
    background: var(--point-color);
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    z-index: 2;
    touch-action: none;
}

.deployment-map-point.is-police,
.deployment-map-legend-item.is-police,
.deployment-point-row.is-police,
.deployment-point-add.is-police {
    --point-color: #1d4ed8;
}

.deployment-map-point.is-ambulance,
.deployment-map-legend-item.is-ambulance,
.deployment-point-row.is-ambulance,
.deployment-point-add.is-ambulance {
    --point-color: #dc2626;
}

.deployment-map-point.is-security_assembly,
.deployment-map-legend-item.is-security_assembly,
.deployment-point-row.is-security_assembly,
.deployment-point-add.is-security_assembly {
    --point-color: #15803d;
}

.deployment-map-point.is-selected,
.deployment-map-point.is-highlighted {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--point-color) 40%, transparent), 0 3px 10px rgba(0, 0, 0, 0.35);
    z-index: 5;
}

.deployment-map-point.is-highlighted {
    animation: deployment-point-pulse 0.6s ease-in-out 3;
}

@keyframes deployment-point-pulse {
    50% {
        transform: translate(-50%, -50%) scale(1.3);
    }
}

.deployment-map-point:hover .deployment-map-tooltip,
.deployment-map-point:focus-visible .deployment-map-tooltip {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

.deployment-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.deployment-map-legend[hidden] {
    display: none;
}

.deployment-map-legend-item {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .15rem .45rem;
    padding: .35rem .65rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-ink);
    font-size: .88rem;
    text-align: left;
}

.deployment-map-legend-item i {
    color: var(--point-color);
}

.deployment-map-legend-item small {
    flex-basis: 100%;
    color: var(--app-muted);
    font-size: .78rem;
}

.deployment-map-toolbar {
    display: grid;
    gap: .75rem;
}

.deployment-map-point-tools,
.deployment-area-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.deployment-area-tools[hidden] {
    display: none;
}

.deployment-area-tools {
    padding: .5rem .75rem;
    border: 1px dashed #7c3aed;
    border-radius: 8px;
}

.deployment-point-add {
    border: 1px solid var(--point-color);
    color: var(--point-color);
    background: transparent;
}

.deployment-point-add:hover,
.deployment-point-add.active {
    background: var(--point-color);
    color: #fff;
}

.deployment-point-list {
    display: grid;
    gap: .5rem;
}

.deployment-point-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.5fr) auto;
    align-items: center;
    gap: .5rem;
    padding: .4rem .5rem;
    border: 1px solid var(--app-line);
    border-left: 4px solid var(--point-color);
    border-radius: 8px;
}

.deployment-point-row.is-selected {
    background: var(--app-surface-muted);
}

.deployment-point-icon {
    color: var(--point-color);
    font-size: 1.1rem;
}

.position-kind-badge {
    display: inline-flex;
    align-items: center;
    margin-left: .35rem;
    padding: .1rem .45rem;
    border: 1px solid var(--app-line);
    border-radius: 999px;
    color: var(--app-muted);
    font-size: .75rem;
    font-weight: 600;
    vertical-align: middle;
}

.position-kind-badge.is-patrol {
    border-color: #7c3aed;
    color: #7c3aed;
}

@media (max-width: 575.98px) {
    .deployment-point-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .deployment-point-row > input:nth-of-type(2) {
        grid-column: 2 / 4;
        grid-row: 2;
    }
}

.position-number-badge {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    min-height: 28px;
    padding: 2px 7px;
    border-radius: 7px;
    background: var(--app-soft-blue);
    color: var(--app-accent);
    font-size: 0.82rem;
}

.position-create-card {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--app-accent) 5%, transparent), transparent 45%),
        var(--app-surface);
}

.position-assignment-card {
    padding: 18px;
    border: 1px solid var(--app-line);
    border-radius: 12px;
    background: var(--app-surface);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--app-ink) 5%, transparent);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.position-assignment-card:hover {
    border-color: color-mix(in srgb, var(--app-accent) 35%, var(--app-line));
    box-shadow: 0 10px 24px color-mix(in srgb, var(--app-ink) 8%, transparent);
}

.position-catalog-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px auto;
    gap: 10px;
    align-items: end;
}

.position-catalog-list {
    display: grid;
    gap: 8px;
}

.position-catalog-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 110px auto auto;
    gap: 8px;
    align-items: center;
    padding: 9px;
    border: 1px solid var(--app-line);
    border-radius: 10px;
    background: var(--app-surface-muted);
}

.position-catalog-handle {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--app-soft-blue);
    color: var(--app-accent);
}

.position-catalog-order {
    text-align: center;
}

.staffing-shifts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--app-line);
    border-radius: 10px;
    background: var(--app-surface-muted);
}

.staffing-shifts-list {
    display: grid;
    gap: 10px;
}

.staffing-shift-row {
    display: grid;
    grid-template-columns: 82px minmax(190px, 1fr) minmax(190px, 1fr) 130px auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--app-line);
    border-radius: 10px;
    background: var(--app-surface);
}

.staffing-shift-label {
    align-self: center;
    color: var(--app-accent);
}

.test-data-addon {
    position: relative;
    overflow: hidden;
}

.test-data-addon.is-active {
    border-color: color-mix(in srgb, var(--app-success) 45%, var(--app-line));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--app-success) 7%, transparent), transparent 52%),
        var(--app-surface);
}

.test-data-credentials {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.test-data-credentials > div {
    min-width: 0;
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--app-line);
    border-radius: 9px;
    background: var(--app-surface-muted);
}

.test-data-credentials span {
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.test-data-credentials strong {
    overflow-wrap: anywhere;
}

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

.transport-mode-button {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-ink);
    font-weight: 700;
    text-align: left;
}

.transport-mode-button span,
.transport-mode-button strong,
.transport-mode-button small {
    display: block;
}

.transport-mode-button small {
    margin-top: 2px;
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 500;
}

.transport-mode-button:hover small,
.transport-mode-button.is-active small {
    color: inherit;
}

.transport-mode-button:hover,
.transport-mode-button.is-active {
    border-color: var(--app-accent);
    background: var(--app-soft-blue);
    color: var(--app-accent);
}

.transport-mode-panel,
.transport-edit-panel {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface-muted);
    color: var(--app-ink);
}

.transport-mode-panel[hidden],
.transport-edit-panel[hidden] {
    display: none !important;
}

.transport-driver-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.transport-admin-car-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 0.65rem;
}

.transport-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
    gap: 1rem;
}

.transport-layout h4 {
    margin-bottom: 0.6rem;
    font-size: 0.92rem;
    font-weight: 800;
}

.transport-car-list {
    display: grid;
    gap: 0.75rem;
}

.transport-car-list section,
.transport-unassigned-list {
    padding: 0.85rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface);
}

.transport-car-list > section {
    padding: 16px;
}

.transport-car-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.transport-car-header span {
    color: var(--app-muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.transport-vehicle-details,
.transport-vehicle-hint {
    margin-top: 0.55rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--app-accent) 28%, var(--app-line));
    border-radius: 6px;
    background: var(--app-soft-blue);
    color: var(--app-accent);
}

.transport-vehicle-details span {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.transport-vehicle-details strong {
    display: block;
    margin-top: 0.15rem;
}

.transport-vehicle-hint {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    align-items: center;
}

.transport-passenger-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.transport-unassigned-list {
    margin: 0;
    padding-left: 1.1rem;
}

.transport-passenger-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 9px 0;
    border-top: 1px solid var(--app-line);
}

.transport-car-meta {
    display: grid;
    gap: 5px;
    margin-top: 10px;
    color: var(--app-muted);
}

.transport-passenger-list form {
    margin: 0;
}

.transport-add-passenger-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

@media (max-width: 767.98px) {
    .transport-mode-buttons,
    .transport-driver-form,
    .transport-mileage-form,
    .transport-settings-form {
        grid-template-columns: 1fr;
    }

    .transport-status,
    .transport-car-header {
        align-items: flex-start;
    }

    .transport-car-header {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 991.98px) {
    .transport-coordinator-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.form-control:focus {
    border-color: var(--app-accent);
    box-shadow: 0 0 0 0.2rem rgba(15, 92, 255, 0.16);
}

@media (max-width: 575.98px) {
    .install-shell,
    .auth-card,
    .panel-block {
        box-shadow: none;
    }

    .profile-summary,
    .profile-details {
        grid-template-columns: 1fr;
    }

    .profile-details {
        gap: 0.2rem;
    }

    .settings-shell,
    .settings-landing-grid {
        grid-template-columns: 1fr;
    }

    .settings-sidebar,
    .settings-form-panel {
        position: static;
    }

    .settings-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--app-line);
        height: auto;
        overflow: visible;
    }

    .settings-content-grid {
        grid-template-columns: 1fr;
    }

    .profile-details dd {
        margin-bottom: 0.65rem;
    }

    .mass-events-table thead {
        display: none;
    }

    .mass-events-table,
    .mass-events-table tbody,
    .mass-events-table tr,
    .mass-events-table td {
        display: block;
        width: 100%;
    }

    .mass-event-row {
        border: 1px solid var(--app-line);
        border-radius: 8px;
        background: var(--app-surface);
    }

    .mass-event-row + .mass-event-row {
        margin-top: 0.9rem;
    }

    .mass-event-row td {
        border-top: 0;
        padding: 0.85rem;
    }

    .mass-event-action-cell {
        text-align: left !important;
    }

    .mass-event-actions {
        justify-content: flex-start;
        max-width: none;
    }

    .event-details-grid {
        grid-template-columns: 1fr;
    }

    .event-group-picker {
        grid-template-columns: 1fr;
    }

    .transport-choice-grid,
    .transport-admin-car-form,
    .transport-layout,
    .transport-add-passenger-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .deployment-map-upload-form,
    .position-catalog-add {
        grid-template-columns: 1fr;
    }

    .deployment-map-upload-form .btn {
        min-height: 44px;
    }

    .position-catalog-row {
        grid-template-columns: 34px minmax(0, 1fr) 82px;
    }

    .position-catalog-row .btn {
        grid-column: span 1;
    }

    .position-catalog-row .btn:first-of-type {
        grid-column: 2;
    }

    .deployment-map-tooltip {
        min-width: 170px;
        max-width: min(250px, 75vw);
    }

    .staffing-shifts-header {
        align-items: stretch;
        flex-direction: column;
    }

    .staffing-shift-row {
        grid-template-columns: 1fr;
    }

    .staffing-shift-row > .btn {
        min-height: 42px;
    }

    .test-data-credentials {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 992px) {
    .settings-shell {
        margin: 0;
    }
}

@media (max-width: 991.98px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: static;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }

    .app-brand,
    .app-sidebar-section > span,
    .app-help-card {
        display: none;
    }

    .app-side-menu {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.15rem;
    }

    .app-side-menu a {
        flex: 0 0 auto;
        min-height: 44px;
        white-space: nowrap;
    }

    .app-side-group {
        flex: 0 0 auto;
        min-width: 180px;
    }

    .app-side-group-label {
        min-height: 44px;
        padding: 0.55rem 0.7rem;
    }

    .app-side-submenu {
        margin-left: 0.75rem;
    }

    .app-topbar {
        position: static;
        min-height: auto;
        flex-wrap: wrap;
        padding: 0.9rem 1rem;
    }

    .app-mobile-brand {
        display: inline-flex;
    }

    .app-top-menu {
        order: 3;
        flex-basis: 100%;
    }

    .app-context-link {
        min-height: 44px;
        padding: 0.35rem 0.45rem;
    }

    .app-user-box {
        margin-left: 0;
    }

    .app-topbar-actions {
        display: flex !important;
        margin-left: auto;
        gap: 0.45rem;
        position: relative;
        z-index: 1040;
    }

    .app-theme-toggle,
    .app-user-box {
        flex: 0 0 auto;
    }

    .app-user-menu {
        max-width: calc(100vw - 1.5rem);
    }

    .app-main {
        padding: 1rem;
    }

    .settings-shell {
        margin: 0;
    }

    .app-footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }
}

/* Unified light and dark application shell */
:root,
html[data-app-theme="light"] {
    color-scheme: light;
    --app-ink: #172033;
    --app-muted: #667085;
    --app-line: #dce3ed;
    --app-bg: #f3f6fa;
    --app-surface: #ffffff;
    --app-surface-muted: #f7f9fc;
    --app-accent: #1463ff;
    --app-accent-dark: #0d4ed1;
    --app-soft-blue: #edf4ff;
    --app-success: #087f5b;
    --app-success-soft: #dcf8ea;
    --app-warning: #9c4a00;
    --app-danger: #b42318;
    --app-danger-soft: #fff1f0;
    --app-sidebar: #ffffff;
    --app-card-shadow: 0 12px 32px rgba(31, 42, 68, 0.07);
    --app-overlay: rgba(17, 24, 39, 0.42);
    --app-weekend-soft: #fff6d6;
    --app-weekend-ink: #7a5600;
    --app-holiday-soft: #ffe1de;
    --app-holiday-ink: #a01b10;
    --app-cal-planned: #0b6fa4;
    --app-cal-planned-ink: #ffffff;
    --app-cal-active: #087f5b;
    --app-cal-active-ink: #ffffff;
    --app-cal-ended: #5b6677;
    --app-cal-ended-ink: #ffffff;
    --app-cal-cancelled: #b42318;
    --app-cal-cancelled-ink: #ffffff;
    --app-cal-shift: #2b3a55;
    --app-cal-shift-ink: #ffffff;
    --app-cal-request: #9c4a00;
    --app-cal-request-ink: #ffffff;
    --app-cal-leave: #1463ff;
    --app-cal-leave-ink: #ffffff;
    --app-cal-sick: #7a2e9e;
    --app-cal-sick-ink: #ffffff;
    --app-cal-swap: #0e7c86;
    --app-cal-swap-ink: #ffffff;
    --app-cal-dayoff: #8591a6;
    --app-cal-dayoff-ink: #0b1220;
}

html[data-app-theme="dark"] {
    color-scheme: dark;
    --app-ink: #f1f4f8;
    --app-muted: #aab4c4;
    --app-line: #303744;
    --app-bg: #11141b;
    --app-surface: #191e27;
    --app-surface-muted: #202631;
    --app-accent: #6ea1ff;
    --app-accent-dark: #8db5ff;
    --app-soft-blue: #202d45;
    --app-success: #5dd6a7;
    --app-success-soft: #173b31;
    --app-warning: #ffb86b;
    --app-danger: #ff8a82;
    --app-danger-soft: #3a2427;
    --app-sidebar: #151922;
    --app-card-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
    --app-overlay: rgba(0, 0, 0, 0.68);
    --app-weekend-soft: #3a3218;
    --app-weekend-ink: #ffd978;
    --app-holiday-soft: #47231f;
    --app-holiday-ink: #ffaaa3;
    --app-cal-planned: #5bb8e8;
    --app-cal-planned-ink: #11141b;
    --app-cal-active: #5dd6a7;
    --app-cal-active-ink: #11141b;
    --app-cal-ended: #9aa5b8;
    --app-cal-ended-ink: #11141b;
    --app-cal-cancelled: #ff8a82;
    --app-cal-cancelled-ink: #11141b;
    --app-cal-shift: #a5b4fc;
    --app-cal-shift-ink: #11141b;
    --app-cal-request: #ffb86b;
    --app-cal-request-ink: #11141b;
    --app-cal-leave: #6ea1ff;
    --app-cal-leave-ink: #11141b;
    --app-cal-sick: #d79bff;
    --app-cal-sick-ink: #11141b;
    --app-cal-swap: #4fd1c5;
    --app-cal-swap-ink: #11141b;
    --app-cal-dayoff: #dfe5ee;
    --app-cal-dayoff-ink: #11141b;
    --bs-body-bg: var(--app-bg);
    --bs-body-color: var(--app-ink);
    --bs-secondary-color: var(--app-muted);
    --bs-border-color: var(--app-line);
    --bs-tertiary-bg: var(--app-surface-muted);
}

body,
.app-shell {
    background: var(--app-bg);
}

.app-sidebar,
.settings-sidebar,
.app-topbar,
.install-shell,
.auth-card,
.panel-block,
.settings-module-link,
.settings-form-panel,
.profile-photo,
.card,
.list-group-item,
.accordion-item,
.event-group-picker label,
.event-group-list > div,
.event-group-submit-list > section,
.transport-car-list section,
.transport-unassigned-list,
.modal-content,
.dropdown-menu,
.mass-event-row {
    background: var(--app-surface);
    color: var(--app-ink);
}

.app-sidebar {
    box-shadow: 10px 0 28px rgba(31, 42, 68, 0.04);
}

.app-topbar {
    min-height: 76px;
    background: color-mix(in srgb, var(--app-surface) 94%, transparent);
    backdrop-filter: blur(12px);
}

.app-footer {
    background: var(--app-surface);
}

.app-side-menu a,
.app-side-group-label,
.settings-menu a,
.settings-menu-group summary,
.app-context-link,
.app-user-link,
.app-user-menu .dropdown-item,
.app-brand,
.app-mobile-brand {
    color: var(--app-ink);
}

.settings-module-link:hover {
    color: var(--app-ink);
    border-color: color-mix(in srgb, var(--app-accent) 45%, var(--app-line));
    box-shadow: var(--app-card-shadow);
}

.app-side-group-label,
.app-side-menu .app-menu-icon,
.app-context-link:hover,
.app-context-link.active,
.app-side-menu a:hover,
.app-side-menu a.active,
.app-user-menu .dropdown-item:hover,
.app-user-menu .dropdown-item.active {
    background: var(--app-soft-blue);
}

.app-side-menu a:hover,
.app-side-menu a.active,
.app-context-link:hover,
.app-context-link.active,
.app-user-menu .dropdown-item:hover,
.app-user-menu .dropdown-item.active {
    color: var(--app-accent);
    border-color: color-mix(in srgb, var(--app-accent) 24%, var(--app-line));
}

.app-brand-mark {
    background: transparent;
    box-shadow: none;
}

.app-user-menu,
.dropdown-menu {
    border-color: var(--app-line);
    border-radius: 8px;
    box-shadow: var(--app-card-shadow);
}

.dropdown-item {
    color: var(--app-ink);
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--app-accent);
    background: var(--app-soft-blue);
}

.app-icon-button {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    padding: 0;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-ink);
    font-size: 1.08rem;
}

.app-icon-button:hover,
.app-icon-button:focus-visible {
    color: var(--app-accent);
    border-color: color-mix(in srgb, var(--app-accent) 45%, var(--app-line));
    background: var(--app-soft-blue);
}

.app-sidebar-toggle {
    display: none;
}

.theme-icon-light,
html[data-app-theme="dark"] .theme-icon-dark {
    display: none;
}

html[data-app-theme="dark"] .theme-icon-light {
    display: inline-block;
    color: #ffcc66;
}

.app-sidebar-backdrop {
    display: none;
}

.app-mobile-section-menu {
    display: none;
}

.app-auth-theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1040;
}

.form-control,
.form-select,
.form-check-input,
.input-group-text,
.invitation-secret,
.empty-state {
    color: var(--app-ink);
    background-color: var(--app-surface-muted);
    border-color: var(--app-line);
}

.mass-events-count,
.mass-event-meta span,
.mass-event-metrics div,
.event-details-grid > div,
.event-group-picker {
    color: var(--app-ink);
    background: var(--app-surface-muted);
    border-color: var(--app-line);
}

.employee-rate-box,
.event-rate-list span,
.transport-vehicle-details,
.transport-vehicle-hint {
    color: var(--app-accent);
    background: var(--app-soft-blue);
    border-color: color-mix(in srgb, var(--app-accent) 28%, var(--app-line));
}

.mass-event-note {
    color: var(--app-muted);
}

html[data-app-theme="dark"] .bg-light,
html[data-app-theme="dark"] .text-bg-light,
html[data-app-theme="dark"] .alert-light {
    color: var(--app-muted) !important;
    background-color: var(--app-surface-muted) !important;
    border-color: var(--app-line) !important;
}

.form-control:focus,
.form-select:focus {
    color: var(--app-ink);
    background-color: var(--app-surface);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--app-ink);
    --bs-table-border-color: var(--app-line);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    background-color: var(--bs-table-bg);
}

.text-secondary {
    color: var(--app-muted) !important;
}

.btn-outline-secondary {
    --bs-btn-color: var(--app-muted);
    --bs-btn-border-color: var(--app-line);
    --bs-btn-hover-color: var(--app-ink);
    --bs-btn-hover-bg: var(--app-surface-muted);
    --bs-btn-hover-border-color: var(--app-muted);
}

.nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.nav-tabs .nav-link {
    white-space: nowrap;
    color: var(--app-muted);
}

.nav-tabs .nav-link.active {
    color: var(--app-accent);
    background: var(--app-surface);
    border-color: var(--app-line) var(--app-line) var(--app-surface);
}

html[data-app-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
}

html[data-app-theme="dark"] img:not(.app-brand-mark img):not(.app-brand-logo):not(.profile-photo):not(.profile-photo-large):not(.event-poster-image):not(.file-preview-image) {
    opacity: 0.94;
}

/* Shared layout helpers. Feature templates should use these instead of inline styles. */
.app-honeypot {
    pointer-events: none;
}

.app-field-compact {
    width: 120px;
}

.app-field-narrow {
    max-width: 280px;
}

.app-search-field {
    max-width: 360px;
}

.app-surface-row {
    background: var(--app-surface);
    color: var(--app-ink);
}

.app-select-visibility {
    max-width: 180px;
}

.available-link-category {
    min-width: 180px;
    max-width: 240px;
}

.attendance-qr-container {
    max-width: 720px;
}

.table-selection-column {
    width: 42px;
}

.table-order-column {
    width: 110px;
}

.table-days-column {
    width: 180px;
}

.table-module-column {
    min-width: 190px;
}

.table-permission-column {
    min-width: 220px;
}

.settings-tree-depth-0 { --menu-depth: 0; }
.settings-tree-depth-1 { --menu-depth: 1; }
.settings-tree-depth-2 { --menu-depth: 2; }
.settings-tree-depth-3 { --menu-depth: 3; }
.settings-tree-depth-4 { --menu-depth: 4; }
.settings-tree-depth-5 { --menu-depth: 5; }

.branding-panel {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.branding-preview {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    padding: 24px;
    border: 1px solid var(--app-line);
    border-radius: 12px;
    background: var(--app-surface-muted);
}

.branding-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.error-page {
    min-height: min(680px, calc(100vh - 180px));
    display: grid;
    place-items: center;
    padding-block: 32px;
}

.error-card {
    position: relative;
    width: min(620px, 100%);
    padding: clamp(28px, 6vw, 56px);
    overflow: hidden;
    border: 1px solid var(--app-line);
    border-radius: 16px;
    background: var(--app-surface);
    box-shadow: var(--app-card-shadow);
    color: var(--app-ink);
    text-align: center;
}

.error-code {
    position: absolute;
    top: -34px;
    right: 12px;
    color: color-mix(in srgb, var(--app-accent) 9%, transparent);
    font-size: clamp(7rem, 22vw, 12rem);
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}

.error-icon {
    position: relative;
    width: 72px;
    height: 72px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 18px;
    background: var(--app-soft-blue);
    color: var(--app-accent);
    font-size: 2rem;
}

.error-countdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 16px;
    border: 1px solid var(--app-line);
    border-radius: 999px;
    background: var(--app-surface-muted);
    color: var(--app-muted);
}

.error-countdown strong {
    min-width: 1.4em;
    color: var(--app-accent);
    font-size: 1.15rem;
}

@media (max-width: 767.98px) {
    .branding-panel {
        grid-template-columns: 1fr;
    }

    .branding-preview {
        max-width: 240px;
    }
}

/* Standalone pages also consume the application theme tokens. */
.standalone-status-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 24px;
    background: var(--app-bg);
    color: var(--app-ink);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.standalone-status-card {
    width: min(560px, 100%);
    padding: 28px;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--app-card-shadow);
}

.standalone-status-card h1 {
    margin: 0 0 12px;
    font-size: 26px;
}

.standalone-status-card p {
    margin: 0 0 12px;
    color: var(--app-muted);
}

.standalone-status-card code {
    color: var(--app-ink);
}

.standalone-status-label {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--app-danger);
    font-weight: 700;
}

.api-docs-page {
    min-height: 100vh;
    margin: 0;
    background: var(--app-bg);
    color: var(--app-ink);
    font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.api-docs-page *,
.api-docs-page *::before,
.api-docs-page *::after {
    box-sizing: border-box;
}

.api-docs-header {
    border-bottom: 1px solid var(--app-line);
    background: var(--app-surface);
}

.api-docs-container {
    width: min(1040px, calc(100% - 32px));
    margin-inline: auto;
}

.api-docs-header .api-docs-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 0;
}

.api-docs-page h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.api-docs-page h2 {
    margin: 30px 0 12px;
    font-size: 20px;
}

.api-docs-page p,
.api-docs-summary {
    color: var(--app-muted);
}

.api-docs-page a {
    color: inherit;
}

.api-docs-button {
    display: inline-flex;
    padding: 9px 13px;
    border: 1px solid var(--app-line);
    border-radius: 7px;
    background: var(--app-surface);
    text-decoration: none;
}

.api-docs-notice,
.api-docs-endpoint,
.api-docs-page pre {
    border: 1px solid var(--app-line);
    background: var(--app-surface);
}

.api-docs-notice {
    margin-top: 24px;
    padding: 14px 16px;
    border-left: 4px solid var(--app-accent);
}

.api-docs-endpoint {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 14px;
    margin-bottom: 10px;
    padding: 16px;
}

.api-docs-method,
.api-docs-page code,
.api-docs-page pre {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.api-docs-method {
    font-weight: 750;
}

.api-docs-method-get { color: var(--app-success); }
.api-docs-method-post { color: var(--app-accent); }
.api-docs-method-patch { color: var(--app-warning); }

.api-docs-page pre {
    padding: 16px;
    overflow: auto;
    color: var(--app-ink);
    white-space: pre-wrap;
}

.api-docs-path {
    font-weight: 650;
}

.api-docs-summary {
    margin-top: 4px;
}

@media (max-width: 640px) {
    .api-docs-header .api-docs-container {
        display: block;
    }

    .api-docs-button {
        margin-top: 16px;
    }

    .api-docs-endpoint {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

@media (max-width: 991.98px) {
    body.app-sidebar-open {
        overflow: hidden;
    }

    .app-shell {
        display: block;
    }

    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 310px);
        height: 100dvh;
        display: flex;
        gap: 1.35rem;
        padding: 1.15rem;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform 180ms ease;
        z-index: 1055;
    }

    .app-sidebar .app-brand,
    .app-sidebar .app-sidebar-section > span {
        display: flex;
    }

    .app-sidebar .app-sidebar-section > span {
        display: block;
    }

    .app-side-menu {
        display: grid;
        overflow: visible;
        padding: 0;
    }

    .app-side-menu a,
    .app-side-group {
        width: 100%;
        min-width: 0;
    }

    .app-side-submenu {
        margin-left: 1rem;
    }

    .app-sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .app-sidebar-backdrop {
        position: fixed;
        inset: 0;
        border: 0;
        background: var(--app-overlay);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
        z-index: 1050;
    }

    .app-sidebar-open .app-sidebar-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .app-sidebar-toggle {
        display: none;
    }

    .app-topbar {
        position: sticky;
        min-height: 64px;
        padding: 0.65rem 0.85rem;
        flex-wrap: nowrap;
        /* backdrop-filter tworzy nowy containing block dla position:fixed potomków
           (tutaj .app-top-menu, przypięty do dołu ekranu jako pasek zakładek) —
           z blurem odziedziczonym z .app-topbar pasek renderował się przy górnej
           krawędzi nagłówka zamiast na dole ekranu. */
        backdrop-filter: none;
    }

    .app-mobile-brand,
    .app-shell-no-sidebar .app-mobile-brand {
        display: inline-flex;
        min-width: 0;
        font-size: 0.94rem;
    }

    .app-mobile-brand .app-brand-mark {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .app-mobile-brand .app-brand-mark img {
        width: 27px;
        height: 27px;
    }

    .app-top-menu {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        order: initial;
        min-height: 62px;
        display: flex;
        justify-content: flex-start;
        gap: 0.25rem;
        padding: 0.45rem max(0.55rem, env(safe-area-inset-right)) calc(0.45rem + env(safe-area-inset-bottom)) max(0.55rem, env(safe-area-inset-left));
        overflow-x: auto;
        background: var(--app-surface);
        border-top: 1px solid var(--app-line);
        box-shadow: 0 -8px 24px rgba(31, 42, 68, 0.08);
        z-index: 1030;
    }

    .app-context-link {
        min-width: 72px;
        min-height: 48px;
        flex-direction: column;
        justify-content: center;
        gap: 0.18rem;
        padding: 0.3rem 0.5rem;
        font-size: 0.68rem;
    }

    .app-context-link i {
        font-size: 1.08rem;
    }

    .app-user-link span {
        display: none;
    }

    .app-user-link {
        width: 40px;
        height: 40px;
        justify-content: center;
        border: 1px solid var(--app-line);
        border-radius: 8px;
    }

    .app-user-mobile-icon {
        display: inline-block;
        font-size: 1.08rem;
    }

    .app-user-link.dropdown-toggle::after {
        display: none;
    }

    .app-main {
        padding: 1rem 0.85rem calc(5rem + env(safe-area-inset-bottom));
    }

    .app-mobile-section-menu {
        position: sticky;
        top: 64px;
        display: block;
        padding: 0.65rem 0.85rem;
        background: var(--app-bg);
        border-bottom: 1px solid var(--app-line);
        z-index: 14;
    }

    .app-mobile-section-toggle {
        width: 100%;
        min-height: 46px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.6rem 0.75rem;
        border: 1px solid var(--app-line);
        border-radius: 8px;
        background: var(--app-surface);
        color: var(--app-ink);
        text-align: left;
    }

    .app-mobile-section-toggle-label {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        color: var(--app-muted);
        font-size: 0.76rem;
        font-weight: 800;
        text-transform: uppercase;
    }

    .app-mobile-section-toggle strong {
        min-width: 0;
        margin-left: auto;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-mobile-section-toggle::after {
        flex: 0 0 auto;
        margin-left: 0;
    }

    .app-mobile-section-dropdown {
        width: calc(100% - 1.7rem);
        max-height: min(60vh, 420px);
        margin: 0 0.85rem !important;
        padding: 0.45rem;
        overflow-y: auto;
    }

    .app-mobile-section-dropdown .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 0.65rem;
        border-radius: 7px;
        font-weight: 700;
    }

    .app-mobile-section-dropdown .dropend > .dropdown-menu {
        position: static !important;
        width: 100%;
        margin: 0.25rem 0 0.35rem !important;
        transform: none !important;
        box-shadow: none;
    }

    .app-footer {
        padding: 1rem 0.85rem calc(5rem + env(safe-area-inset-bottom));
    }

    .panel-block {
        padding: 1rem;
    }

    .table-responsive {
        margin-inline: -0.25rem;
        padding-inline: 0.25rem;
    }
}

@media (max-width: 575.98px) {
    .app-mobile-brand > span:last-child {
        display: none;
    }

    .app-topbar {
        gap: 0.5rem;
    }

    .app-theme-toggle,
    .app-sidebar-toggle,
    .app-user-link {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .app-user-box {
        margin-left: 0;
    }

    .app-top-menu {
        justify-content: flex-start;
    }

    .app-main h1,
    .app-main .h1 {
        font-size: 1.65rem;
    }

    .app-main h2,
    .app-main .h2 {
        font-size: 1.3rem;
    }

    .settings-actions,
    .mass-event-actions {
        width: 100%;
    }

    .settings-actions .btn,
    .mass-event-actions .btn {
        flex: 1 1 auto;
    }

    .modal-dialog {
        margin: 0.65rem;
    }
}
.notification-template-preview {
    white-space: pre-wrap;
}
.uniform-limit-input {
    max-width: 6.25rem;
}

.registration-final-actions,
.registration-reject-form,
.registration-document-actions,
.registration-document-reject {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .5rem;
}

.registration-reject-form .form-control,
.registration-document-reject .form-control {
    min-width: 14rem;
    flex: 1 1 14rem;
}

.registration-document-card {
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: var(--app-surface-muted);
}

.registration-document-missing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.registration-document-preview-modal {
    height: min(90vh, 64rem);
}


.event-signup-panel {
    overflow: hidden;
}

.event-signup-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 30rem);
    gap: 1.25rem;
    align-items: stretch;
}

.event-signup-status,
.event-signup-actions {
    border: 1px solid var(--app-line);
    border-radius: 1rem;
    background: var(--app-surface-muted);
    padding: 1rem;
}

.event-signup-status {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
}

.event-signup-icon {
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .9rem;
    background: rgba(var(--bs-primary-rgb), .14);
    color: var(--bs-primary);
    font-size: 1.25rem;
}

.event-signup-actions {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.event-signup-actions .event-rate-confirm-form,
.event-signup-actions .event-decline-form {
    margin: 0;
}

.event-signup-actions .employee-rate-box {
    display: block;
    padding: .85rem 1rem;
}

.event-signup-actions .employee-rate-box span {
    display: block;
    margin-bottom: .25rem;
    color: var(--app-muted);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.event-signup-actions .employee-rate-box strong {
    display: block;
    color: var(--app-ink);
    font-size: .95rem;
    line-height: 1.45;
}

@media (max-width: 991.98px) {
    .event-signup-card {
        grid-template-columns: 1fr;
    }
}


.audience-check-list {
    max-height: 13.5rem;
    overflow-y: auto;
    padding: .45rem;
    border: 1px solid var(--app-line);
    border-radius: .75rem;
    background: var(--app-surface-muted);
}

.audience-check-item {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .55rem .65rem;
    border-radius: .55rem;
    cursor: pointer;
    font-weight: 600;
}

.audience-check-item:hover {
    background: rgba(var(--bs-primary-rgb), .08);
}

.audience-check-item .form-check-input {
    margin-top: .15rem;
    flex: 0 0 auto;
}

html[data-app-theme="light"] .app-brand-logo-dark,
html[data-app-theme="dark"] .app-brand-logo-light {
    display: none !important;
}

html[data-app-theme="light"] .app-brand-logo-light,
html[data-app-theme="dark"] .app-brand-logo-dark {
    display: block !important;
}


/* Panel (#53, układ #82): alerty → powitanie → statystyki → dwie kolumny (działanie | informacje). */
.dashboard-greeting {
    margin-bottom: 1.25rem;
}

.dashboard-alerts {
    display: grid;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.dashboard-alert {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    border: 1px solid color-mix(in srgb, var(--app-warning) 45%, var(--app-line));
    border-left: 4px solid var(--app-warning);
    border-radius: var(--ui-radius-sm, 8px);
    background: color-mix(in srgb, var(--app-warning) 10%, var(--app-surface));
    color: var(--app-ink);
    font-size: .92rem;
}

.dashboard-alert-icon {
    flex: 0 0 auto;
    color: var(--app-warning);
    font-size: 1.1rem;
}

/* Brak danych firmy (#229) — mocniejszy od ostrzeżeń systemowych. */
.dashboard-alert.is-danger {
    border-color: color-mix(in srgb, var(--app-danger, #dc3545) 45%, var(--app-line));
    border-left-color: var(--app-danger, #dc3545);
    background: color-mix(in srgb, var(--app-danger, #dc3545) 10%, var(--app-surface));
}

.dashboard-alert.is-danger .dashboard-alert-icon {
    color: var(--app-danger, #dc3545);
}

.dashboard-alert-text {
    flex: 1 1 auto;
    min-width: 0;
}

.dashboard-alert-action {
    flex: 0 0 auto;
    white-space: nowrap;
}

.dashboard-alerts-more > summary {
    padding: .25rem .75rem;
    color: var(--app-muted);
    font-size: .88rem;
    cursor: pointer;
}

.dashboard-alerts-more > .dashboard-alert + .dashboard-alert,
.dashboard-alerts-more > summary + .dashboard-alert {
    margin-top: .5rem;
}

/* Reset instalacji testowej — przycisk rozwija formularz potwierdzenia. */
.dashboard-factory-reset > details > summary {
    list-style: none;
}

.dashboard-factory-reset > details > summary::-webkit-details-marker {
    display: none;
}

/* Punkty zapisu serwera testowego (#331): lista pod resetem, akcje rozwijają formularze. */
.dashboard-factory-reset-heading {
    margin: 0 0 .35rem;
    font-size: .95rem;
    font-weight: 600;
}

.dashboard-snapshots {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color);
}

.dashboard-snapshots details > summary {
    list-style: none;
}

.dashboard-snapshots details > summary::-webkit-details-marker {
    display: none;
}

.dashboard-snapshot-list {
    margin: .75rem 0 0;
}

.dashboard-snapshot {
    padding: .6rem 0;
    border-top: 1px solid var(--bs-border-color);
}

.dashboard-snapshot-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    overflow-wrap: anywhere;
}

.dashboard-snapshot-description {
    overflow-wrap: anywhere;
}

.dashboard-snapshot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .4rem;
}

.dashboard-snapshot-actions > details[open] {
    flex-basis: 100%;
}

/* Pasek małych statystyk: 4 w rzędzie, na telefonie 2×2. */
.dashboard-stats.ui-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: .75rem;
}

.dashboard-stats .ui-stat {
    align-items: center;
    padding: .65rem .85rem;
}

.dashboard-stats .ui-stat-icon {
    flex-basis: 2rem;
    width: 2rem;
    height: 2rem;
    font-size: .95rem;
}

.dashboard-stats .ui-stat-value {
    font-size: 1.3rem;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
    gap: 1.5rem;
}

.dashboard-columns.is-main-only,
.dashboard-columns.is-side-only {
    grid-template-columns: minmax(0, 1fr);
}

.dashboard-column {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
}

/* Pusty stan = jedna linijka tekstu, bez karty. */
.dashboard-oneline {
    margin: 0;
    padding: .65rem .9rem;
    border: 1px solid var(--app-line);
    border-radius: var(--ui-radius-sm, 8px);
    background: var(--app-surface);
    color: var(--app-muted);
}

.dashboard-list > li + li {
    border-top: 1px solid var(--app-line);
}

.dashboard-list-item,
.dashboard-list-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 0;
}

.dashboard-list-item {
    color: var(--app-ink);
    text-decoration: none;
}

.dashboard-list-item:hover,
.dashboard-list-item:focus-visible {
    color: var(--app-accent);
}

.dashboard-list-icon {
    color: var(--app-muted);
    font-size: 1.1rem;
}

.dashboard-list-item.is-danger .dashboard-list-icon {
    color: var(--app-danger);
}

.dashboard-list-item.is-warning .dashboard-list-icon {
    color: var(--app-warning);
}

.dashboard-list-count {
    min-width: 2rem;
    padding: .15rem .45rem;
    border-radius: 999px;
    background: var(--app-soft-blue);
    color: var(--app-accent-dark);
    font-weight: 700;
    text-align: center;
}

.dashboard-list-when {
    min-width: 7rem;
    color: var(--app-accent-dark);
    font-size: .88rem;
    font-weight: 600;
}

/* Najbliższa służba */
.dashboard-shift {
    display: grid;
    grid-template-columns: minmax(7.5rem, auto) 1fr;
    gap: .25rem 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface-muted);
    color: var(--app-ink);
    text-decoration: none;
}

.dashboard-shift:hover,
.dashboard-shift:focus-visible {
    border-color: var(--app-accent);
    color: var(--app-ink);
}

.dashboard-shift-when {
    font-weight: 700;
    color: var(--app-accent-dark);
}

.dashboard-shift-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: .2rem 1rem;
    margin-top: .35rem;
    color: var(--app-muted);
    font-size: .88rem;
}

.dashboard-shift-facts i {
    margin-right: .4rem;
}

/* Otwarte na zapisy */
.dashboard-events > li + li {
    border-top: 1px solid var(--app-line);
}

.dashboard-event {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .5rem .9rem;
    padding: .75rem 0;
}

.dashboard-calendar {
    display: grid;
    place-items: center;
    width: 3rem;
    padding: .3rem 0;
    border: 1px solid var(--app-line);
    border-top: 4px solid var(--app-accent);
    border-radius: 8px;
    background: var(--app-surface);
    line-height: 1.1;
    text-align: center;
}

.dashboard-calendar strong {
    font-size: 1.2rem;
}

.dashboard-calendar small {
    color: var(--app-muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.dashboard-event-name {
    color: var(--app-ink);
    font-weight: 600;
    text-decoration: none;
}

.dashboard-event-name:hover,
.dashboard-event-name:focus-visible {
    color: var(--app-accent);
}

.dashboard-event-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-top: .3rem;
}

.dashboard-signup-form {
    grid-column: 2 / 4;
    padding: .75rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface-muted);
}

/* Twój profil */
.dashboard-checklist > li + li {
    border-top: 1px solid var(--app-line);
}

.dashboard-checklist-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem 0;
    color: var(--app-ink);
    text-decoration: none;
}

a.dashboard-checklist-item:hover,
a.dashboard-checklist-item:focus-visible {
    color: var(--app-accent);
}

a.dashboard-checklist-item > .bi-circle {
    color: var(--app-muted);
}

.dashboard-checklist li.is-done .dashboard-checklist-item {
    color: var(--app-muted);
}

.dashboard-checklist li.is-done .bi-check-circle-fill {
    color: var(--app-success);
}

.dashboard-checklist-detail {
    display: block;
    margin: -.25rem 0 .45rem 1.6rem;
    color: var(--app-muted);
}

.dashboard-checklist-detail.is-danger {
    color: var(--app-danger);
}

.dashboard-checklist-detail.is-warning {
    color: var(--app-warning);
}

@media (max-width: 991.98px) {
    .dashboard-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 575.98px) {
    .dashboard-stats.ui-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
    }

    /* Mały pasek 2×2: ikona obok liczby, nie nad nią (nadpisuje ogólny układ kafelków na telefonie). */
    .dashboard-stats .ui-stat {
        flex-direction: row;
        align-items: center;
        gap: .55rem;
        padding: .55rem .65rem;
    }

    .dashboard-stats .ui-stat-icon {
        flex-basis: 1.75rem;
        width: 1.75rem;
        height: 1.75rem;
        font-size: .85rem;
    }

    .dashboard-stats .ui-stat-label {
        font-size: .76rem;
        line-height: 1.2;
    }

    .dashboard-stats .ui-stat-value {
        font-size: 1.15rem;
    }

    .dashboard-shift {
        grid-template-columns: 1fr;
    }

    .dashboard-alert {
        flex-wrap: wrap;
    }

    .dashboard-alert-action {
        margin-left: auto;
    }

    .dashboard-event {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .dashboard-event > .btn {
        grid-column: 2;
        justify-self: start;
    }

    .dashboard-signup-form {
        grid-column: 1 / -1;
    }
}

/* Wyposażenie (#87): zamknięcie wydania w tabeli, historia egzemplarza, lista przedmiotów w ustawieniach. */
.equipment-close > summary,
.equipment-item > summary {
    list-style: none;
    cursor: pointer;
}

.equipment-close > summary::-webkit-details-marker,
.equipment-item > summary::-webkit-details-marker {
    display: none;
}

.equipment-close-form {
    min-width: 16rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--app-line);
    border-radius: 0.75rem;
    background: var(--bs-body-bg);
}

.equipment-history li {
    position: relative;
    padding: 0 0 0.75rem 1rem;
    border-left: 2px solid var(--app-line);
}

.equipment-history li::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 0.45rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--app-accent);
}

.equipment-decision-note {
    min-width: 12rem;
}

/* Liczba sztuk przy „Kup odpłatnie” (#128). */
.equipment-qty {
    width: 5rem;
}

/* Licznik w menu (#107): oczekujące rejestracje przy „Pracownicy” i „Rejestracje”, jak licznik dzwonka. */
.app-menu-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.4rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--app-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

/* Grafik służb na obiekcie (#138, wygląd #148): kafelki zmian w kolorach, pasek wpisów, obsada — tylko braki,
   przyklejona kolumna pracowników i nagłówek dni, lista dni na telefonie, wydruk A4 poziomo. */
.object-schedule-page {
    --tile-day-bg: #fde68a; --tile-day-ink: #713f12;
    --tile-night-bg: #ddd6fe; --tile-night-ink: #4c1d95;
    --tile-full-bg: #bfdbfe; --tile-full-ink: #1e3a8a;
    --tile-teal-bg: #99f6e4; --tile-teal-ink: #134e4a;
    --tile-orange-bg: #fed7aa; --tile-orange-ink: #7c2d12;
    --tile-pink-bg: #fbcfe8; --tile-pink-ink: #831843;
    --tile-gray-bg: #e5e7eb; --tile-gray-ink: #374151;
    --tile-sick-bg: #fecaca; --tile-sick-ink: #7f1d1d;
    --tile-leave-bg: #bbf7d0; --tile-leave-ink: #14532d;
    --tile-off-ink: #6b7280;
}

html[data-app-theme="dark"] .object-schedule-page {
    --tile-day-bg: #4a3b0a; --tile-day-ink: #fde68a;
    --tile-night-bg: #3b2a6b; --tile-night-ink: #ddd6fe;
    --tile-full-bg: #1e3a5f; --tile-full-ink: #bfdbfe;
    --tile-teal-bg: #134e4a; --tile-teal-ink: #99f6e4;
    --tile-orange-bg: #5c2a0c; --tile-orange-ink: #fed7aa;
    --tile-pink-bg: #5b1a3d; --tile-pink-ink: #fbcfe8;
    --tile-gray-bg: #374151; --tile-gray-ink: #e5e7eb;
    --tile-sick-bg: #5b1717; --tile-sick-ink: #fecaca;
    --tile-leave-bg: #14532d; --tile-leave-ink: #bbf7d0;
    --tile-off-ink: #9ca3af;
}

.object-schedule-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.45rem;
    height: 1.35rem;
    padding: 0 .2rem;
    border-radius: .35rem;
    font-weight: 700;
    font-size: .75rem;
    line-height: 1;
}

.object-schedule-tile:empty {
    min-width: 0;
    padding: 0;
}

.tile-day { background: var(--tile-day-bg); color: var(--tile-day-ink); }
.tile-night { background: var(--tile-night-bg); color: var(--tile-night-ink); }
.tile-full { background: var(--tile-full-bg); color: var(--tile-full-ink); }
.tile-teal { background: var(--tile-teal-bg); color: var(--tile-teal-ink); }
.tile-orange { background: var(--tile-orange-bg); color: var(--tile-orange-ink); }
.tile-pink { background: var(--tile-pink-bg); color: var(--tile-pink-ink); }
.tile-gray { background: var(--tile-gray-bg); color: var(--tile-gray-ink); }
.tile-sick { background: var(--tile-sick-bg); color: var(--tile-sick-ink); }
.tile-leave { background: var(--tile-leave-bg); color: var(--tile-leave-ink); }
.tile-off { background: transparent; color: var(--tile-off-ink); font-size: 1.1rem; }

.object-schedule-toolbar {
    position: sticky;
    top: var(--app-topbar-height, 76px);
    z-index: 6;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin-bottom: .75rem;
    padding: .5rem .75rem;
    border: 1px solid var(--app-line);
    border-radius: 10px;
    background: var(--app-surface);
    box-shadow: var(--app-card-shadow);
}

.object-schedule-entries,
.object-schedule-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
}

.object-schedule-tools {
    padding-left: .75rem;
    border-left: 1px solid var(--app-line);
}

.object-schedule-save {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}

.schedule-entry {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .65rem .3rem .55rem;
    border: 1px solid transparent;
    border-radius: .5rem;
    font-size: .82rem;
    font-weight: 700;
    cursor: grab;
}

.schedule-entry.tile-off {
    border-color: var(--app-line);
    font-size: .82rem;
}

.schedule-entry:hover,
.schedule-entry:focus-visible {
    filter: brightness(.95);
    outline: 2px solid var(--app-accent);
    outline-offset: 1px;
}

.schedule-entry kbd {
    position: absolute;
    top: -.45rem;
    right: -.4rem;
    padding: 0 .25rem;
    border: 1px solid var(--app-line);
    border-radius: .25rem;
    background: var(--app-surface);
    color: var(--app-muted);
    font-size: .6rem;
    font-weight: 600;
    line-height: 1.3;
    box-shadow: none;
}

.object-schedule-popover {
    position: relative;
}

.object-schedule-popover > summary {
    list-style: none;
}

.object-schedule-popover > summary::-webkit-details-marker {
    display: none;
}

.object-schedule-popover-body {
    position: absolute;
    z-index: 20;
    width: 19rem;
    margin-top: .25rem;
    padding: .75rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .14);
}

.object-schedule-tools .object-schedule-popover-body {
    right: 0;
}

/* Tabela: przyklejona kolumna pracowników i nagłówek dni (przewijanie wewnątrz ramki). */
.object-schedule-wrap {
    max-height: calc(100vh - var(--app-topbar-height, 76px) - 9rem);
    overflow: auto;
    margin-bottom: .75rem;
    border: 1px solid var(--app-line);
    border-radius: 10px;
    background: var(--app-surface);
}

.object-schedule-grid {
    margin: 0;
    font-size: .82rem;
    background: var(--app-surface);
    border-collapse: separate;
    border-spacing: 0;
}

.object-schedule-grid th,
.object-schedule-grid td {
    padding: .25rem .2rem;
    white-space: nowrap;
    border-bottom: 1px solid var(--app-line);
    background-clip: padding-box;
}

.object-schedule-grid thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--app-surface);
    border-bottom: 2px solid var(--app-line);
    font-size: .75rem;
}

.object-schedule-grid .object-schedule-name {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 11rem;
    max-width: 16rem;
    white-space: normal;
    background: var(--app-surface);
    border-right: 1px solid var(--app-line);
    text-align: left;
}

.object-schedule-grid thead .object-schedule-name {
    z-index: 3;
}

.object-schedule-grid .is-weekend {
    background-color: var(--app-weekend-soft);
}

/* Święta z kalendarza dni wolnych (#144) — mają pierwszeństwo przed weekendem. */
.object-schedule-grid .is-holiday {
    background-color: var(--app-holiday-soft);
}

.object-schedule-grid th.is-holiday {
    color: var(--app-holiday-ink);
}

.object-schedule-grid th.is-today {
    box-shadow: inset 0 -3px 0 var(--app-accent);
    color: var(--app-accent);
}

.object-schedule-grid .object-schedule-total {
    font-weight: 600;
    color: var(--app-muted);
}

.object-schedule-cell {
    position: relative;
    min-width: 2rem;
    text-align: center;
}

.object-schedule-cell[data-user] {
    cursor: pointer;
}

.object-schedule-cell[data-user]:hover,
.object-schedule-cell[data-user]:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: -2px;
}

.object-schedule-cell.is-selected {
    background-color: var(--app-soft-blue);
    box-shadow: inset 0 0 0 1px var(--app-accent);
}

.object-schedule-cell.is-changed .object-schedule-tile {
    box-shadow: 0 0 0 2px var(--app-warning);
}

/* Ostrzeżenie przy komórce: żółta kropka w rogu kafelka, powód w dymku. */
.object-schedule-warn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: var(--app-warning);
    box-shadow: 0 0 0 1px var(--app-surface);
}

/* Prośba o wolne / wniosek urlopowy (#160) — ikonka w lewym dolnym rogu komórki. */
.object-schedule-request {
    position: absolute;
    bottom: 1px;
    left: 2px;
    font-size: .62rem;
    line-height: 1;
    color: var(--app-accent);
}

/* Podgląd importu grafiku (#178) — zmienione komórki. */
.object-schedule-import-grid td.is-import-changed {
    background: var(--app-soft-blue);
    font-weight: 700;
    outline: 1px solid var(--app-accent);
}

.object-schedule-swap {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: .6rem;
    line-height: 1;
    color: var(--app-warning);
}

.object-schedule-cell.has-leave-request .object-schedule-request {
    color: var(--app-success);
}

/* Plan urlopów (#437): kalendarz — zatwierdzony, zgłoszony, kolizja w obsadzie; w grafiku obiektu — planowany urlop. */
.leave-plan-calendar td.leave-plan-approved,
.leave-plan-legend.leave-plan-approved { background: var(--app-success-soft); color: var(--app-success); font-weight: 600; }
.leave-plan-calendar td.leave-plan-submitted,
.leave-plan-legend.leave-plan-submitted { background: var(--app-soft-blue); color: var(--app-accent); }
.leave-plan-calendar td.leave-plan-collision,
.leave-plan-legend.leave-plan-collision { background: var(--app-danger-soft); color: var(--app-danger); font-weight: 700; }
.leave-plan-legend { display: inline-block; padding: 0 .4rem; border-radius: .25rem; }
.object-schedule-cell.has-planned-leave { box-shadow: inset 0 -3px 0 var(--app-success); }
.object-schedule-legend-planned { display: inline-block; box-shadow: inset 0 -3px 0 var(--app-success); }

.object-schedule-person-warn {
    margin-left: .25rem;
    color: var(--app-warning);
    cursor: help;
}

.object-schedule-cell.is-flash {
    animation: object-schedule-flash 1s ease-in-out 3;
}

@keyframes object-schedule-flash {
    50% { box-shadow: inset 0 0 0 3px var(--app-warning); }
}

.object-schedule-grid[data-schedule-grid] {
    user-select: none;
}

.object-schedule-grid.is-border-hover .object-schedule-cell[data-user] {
    cursor: move;
}

/* Podgląd wypełniania i przenoszenia (jak w arkuszu); z Ctrl — kopia; upuszczenie wpisu z paska. */
.object-schedule-cell.is-preview,
.object-schedule-cell.is-drop-target {
    outline: 2px dashed var(--app-accent);
    outline-offset: -3px;
}

.object-schedule-grid.is-copying .object-schedule-cell.is-preview {
    outline-color: var(--app-success);
}

.object-schedule-fill-handle {
    position: absolute;
    right: -4px;
    bottom: -4px;
    z-index: 2;
    width: 8px;
    height: 8px;
    border: 1px solid var(--app-surface);
    background: var(--app-accent);
    cursor: crosshair;
}

/* Godziny wpisane ręcznie i urlop pod kafelkiem; suma godzin dnia. */
.object-schedule-cell-hours {
    display: block;
    margin-top: 1px;
    font-size: .6rem;
    font-weight: 500;
    line-height: 1;
    color: var(--app-muted);
}

/* Noc zmiany czasu (#161): faktyczna długość zmiany wyróżniona. */
.object-schedule-cell-hours.is-dst,
.object-schedule-dst {
    color: var(--app-warning);
    font-weight: 700;
}

.object-schedule-cell-hours:empty {
    display: none;
}

.object-schedule-day-hours td,
.object-schedule-day-hours th {
    border-top: 2px solid var(--app-line);
    font-weight: 600;
    white-space: nowrap;
}

/* Obsada: ✓ pełna (zielony), −N brak (czerwony), +N nadmiar (neutralny). */
.object-schedule-coverage td {
    font-weight: 700;
}

.object-schedule-coverage td.is-full {
    color: var(--app-success);
}

.object-schedule-coverage td.is-short {
    background-color: var(--app-danger-soft);
    color: var(--app-danger);
}

.object-schedule-coverage td.is-over {
    color: var(--app-muted);
}

/* Godziny wg formy zatrudnienia (#149): wiersze umów, dni poza umową, zwijane kolumny szczegółów. */
.object-schedule-contract-row.is-next > * {
    border-top: 1px dashed var(--app-line);
}

.object-schedule-contract,
.object-schedule-period {
    font-weight: 400;
}

.object-schedule-move {
    margin: 0.15rem 0 0;
    font-weight: 400;
}

.object-schedule-cell.is-qualification-blocked {
    box-shadow: inset 0 -3px 0 var(--bs-danger, #dc3545);
}

.object-schedule-cell.is-qualification-blocked.is-blocking {
    background: repeating-linear-gradient(135deg, var(--app-surface-muted), var(--app-surface-muted) 4px, transparent 4px, transparent 8px);
}

.object-schedule-cell.is-qualification-blocked .object-schedule-tile:not(:empty) {
    text-decoration: line-through;
}

.object-schedule-cell.is-locked {
    background: repeating-linear-gradient(135deg, var(--app-surface-muted), var(--app-surface-muted) 4px, transparent 4px, transparent 8px);
    cursor: not-allowed;
}

.object-schedule-grid .object-schedule-detail {
    display: none;
    white-space: nowrap;
}

.object-schedule-grid.show-hour-details .object-schedule-detail {
    display: table-cell;
}

.object-schedule-grid.has-stale-details .object-schedule-detail {
    opacity: 0.45;
}

/* Legenda, ostrzeżenia (zwinięte), zakładki. */
.object-schedule-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem 1rem;
    color: var(--app-muted);
}

.object-schedule-warnings > summary {
    cursor: pointer;
}

/* Telefon: lista dni zamiast tabeli. */
.object-schedule-days {
    display: grid;
    gap: .5rem;
    margin-bottom: 1rem;
}

.object-schedule-day-card {
    padding: .6rem .75rem;
    border: 1px solid var(--app-line);
    border-radius: 10px;
    background: var(--app-surface);
}

.object-schedule-day-card.is-weekend {
    background: var(--app-weekend-soft);
}

.object-schedule-day-card.is-holiday {
    background: var(--app-holiday-soft);
}

.object-schedule-day-card.is-today {
    border-color: var(--app-accent);
    box-shadow: inset 3px 0 0 var(--app-accent);
}

.object-schedule-day-card li {
    margin-top: .25rem;
}

.object-schedule-dialog {
    width: min(26rem, calc(100vw - 2rem));
    padding: 1rem;
    border: 1px solid var(--app-line);
    border-radius: 12px;
    background: var(--app-surface);
    color: var(--app-ink);
}

.object-schedule-dialog::backdrop {
    background: var(--app-overlay);
}

/* Wydruk: arkusz A4 poziomo, cały miesiąc, kolory zachowane (albo czarno-biało: litery + wzór tła). */
@media print {
    @page { size: A4 landscape; margin: 8mm; }
    .object-schedule-page { padding: 0 !important; }
    .object-schedule-page .object-schedule-grid { font-size: .62rem; }
    .object-schedule-wrap { max-height: none; overflow: visible !important; border: 0; display: block !important; }
    .object-schedule-grid th,
    .object-schedule-grid td { padding: .1rem .05rem; }
    .object-schedule-grid thead th,
    .object-schedule-grid .object-schedule-name { position: static; }
    .object-schedule-grid .object-schedule-detail { display: table-cell; }
    .object-schedule-tile { min-width: 1.1rem; height: 1rem; font-size: .6rem; }
    .object-schedule-page,
    .object-schedule-page * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .schedule-print-bw .object-schedule-page * { -webkit-print-color-adjust: economy; print-color-adjust: economy; }
    .schedule-print-bw .object-schedule-tile { border: 1px solid #000; background: none !important; color: #000 !important; }
    .schedule-print-bw .tile-night { background: repeating-linear-gradient(45deg, #fff, #fff 2px, #bbb 2px, #bbb 3px) !important; }
    .schedule-print-bw .tile-full { background: repeating-linear-gradient(0deg, #fff, #fff 2px, #bbb 2px, #bbb 3px) !important; }
    .schedule-print-bw .tile-sick,
    .schedule-print-bw .tile-leave { border-style: dashed; }
    .schedule-print-bw .tile-off { border: 0; }
    .schedule-print-bw .object-schedule-grid .is-weekend,
    .schedule-print-bw .object-schedule-grid .is-holiday { --schedule-print-free: #eee; background: var(--schedule-print-free) !important; }
}

/* Dni wolne od pracy (#144): bieżący miesiąc w tabeli wymiaru i kalendarz roku (weekend żółty, święto czerwone). */
.work-time-hours tr.is-current > * {
    background: var(--app-soft-blue);
}

.work-time-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.work-time-swatch {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 0.2rem;
    border: 1px solid var(--app-line);
}

.work-time-swatch.is-weekend {
    background: var(--app-weekend-soft);
}

.work-time-swatch.is-holiday {
    background: var(--app-holiday-soft);
    margin-left: 0.5rem;
}

.work-time-year {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr));
    gap: 1rem;
}

.work-time-month {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    font-size: 0.85rem;
    text-align: center;
}

.work-time-month caption {
    caption-side: top;
    padding: 0 0 0.35rem;
    color: var(--app-ink);
    font-weight: 700;
    text-align: left;
}

.work-time-month caption small {
    color: var(--app-muted);
    font-weight: 500;
}

.work-time-month th {
    color: var(--app-muted);
    font-weight: 600;
}

.work-time-month th abbr {
    text-decoration: none;
}

.work-time-month td {
    padding: 0.2rem 0;
    border-radius: 0.3rem;
}

.work-time-month td.is-weekend {
    background: var(--app-weekend-soft);
    color: var(--app-weekend-ink);
}

.work-time-month td.is-holiday {
    background: var(--app-holiday-soft);
    color: var(--app-holiday-ink);
    font-weight: 700;
    cursor: help;
}

.work-time-month td.is-today {
    box-shadow: inset 0 0 0 2px var(--app-accent);
}

/* #186: przycisk obok pola w rzędzie flex — naturalna szerokość, tekst w jednej linii. */
.d-flex > .btn,
.d-flex > form > .btn,
.input-group > .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* #186: dodawanie osób przy rekordzie (zastępcy, dowódcy zmiany) — jeden wzorzec „+ Dodaj”. */
.object-people-add {
    margin-top: 0.25rem;
}

.object-people-add > summary {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--bs-link-color);
    list-style: none;
}

.object-people-add > summary::-webkit-details-marker {
    display: none;
}

.object-people-add[open] > summary {
    margin-bottom: 0.25rem;
}

/* #181: kalendarz „Zaplanuj wolne” (okno w Kalendarzu). */
.time-off-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
}

.time-off-head {
    font-size: 0.75rem;
    text-align: center;
    color: var(--bs-secondary-color);
}

.time-off-day {
    position: relative;
    padding: 0.4rem 0;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.time-off-day:disabled {
    opacity: 0.45;
}

.time-off-day.is-shift::after,
.time-off-legend.is-shift {
    background: var(--bs-primary);
}

.time-off-day.is-taken::after,
.time-off-legend.is-taken {
    background: var(--bs-secondary);
}

.time-off-day.is-late,
.time-off-legend.is-late {
    border-style: dashed;
    border-color: var(--bs-warning);
}

.time-off-day::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    border-radius: 50%;
}

.time-off-day.is-selected {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.time-off-legend {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 50%;
    vertical-align: middle;
}

.object-schedule-cell[data-own-day] {
    cursor: pointer;
}

/* #181: kliknięcie dnia w Kalendarzu — menu „Poproś o wolne / wniosek urlopowy / zamiana”. */
.mass-events-calendar-day.is-plannable {
    cursor: pointer;
}

.mass-events-calendar-day.is-plannable:focus-visible {
    outline: 2px solid var(--bs-primary);
}

.calendar-day-menu {
    z-index: 1060;
}

/* Pasek komunikatu na profilu z przyciskiem akcji (#236) — na telefonie przycisk pod tekstem. */
.profile-notice-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
}

.profile-notice-text {
    flex: 1 1 16rem;
    min-width: 0;
}

.profile-notice-button {
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .profile-notice-button {
        margin-left: 0;
    }
}

/* Test połączenia ze skrzynką SMTP (#235) — wynik krok po kroku. */
.smtp-test-step {
    display: flex;
    gap: .6rem;
    padding: .45rem 0;
}

.smtp-test-step + .smtp-test-step {
    border-top: 1px solid var(--app-line);
}

.smtp-test-step.is-error strong {
    color: var(--app-danger, #dc3545);
}

.smtp-test-icon {
    flex: 0 0 auto;
}

.smtp-test-response {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .8rem;
    background: var(--app-surface-muted, rgba(127, 127, 127, .08));
    padding: .5rem;
    border-radius: 6px;
}

/* Kreator „Pierwsza konfiguracja” (#233). */
.first-setup-wizard {
    max-width: 960px;
}

.first-setup-steps {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .75rem;
}

.first-setup-steps a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem .3rem .3rem;
    border: 1px solid var(--app-line);
    border-radius: 999px;
    color: var(--app-muted);
    text-decoration: none;
    font-size: .88rem;
}

.first-setup-steps .is-current a {
    border-color: var(--app-primary, #2563eb);
    color: var(--app-ink);
    font-weight: 600;
}

.first-setup-step-number {
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--app-surface-muted, rgba(127, 127, 127, .12));
    font-size: .8rem;
}

.first-setup-steps .is-done .first-setup-step-number {
    background: var(--app-success, #198754);
    color: #fff;
}

.first-setup-steps .is-current .first-setup-step-number {
    background: var(--app-primary, #2563eb);
    color: #fff;
}

.first-setup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

@media (max-width: 575.98px) {
    .first-setup-step-label {
        display: none;
    }

    .first-setup-steps .is-current .first-setup-step-label {
        display: inline;
    }
}

/* #250: najechanie i pozycja wybrana wyglądają inaczej — najechanie to delikatne tło bez obramowania,
   pozycja wybrana ma mocniejsze tło, kolor akcentu, obramowanie i znacznik z lewej / od dołu. */
.app-context-link:hover:not(.active),
.app-side-menu a:hover:not(.active),
.app-user-menu .dropdown-item:hover:not(.active),
.settings-menu a:hover:not(.active),
.profile-section-nav a:hover:not(.active) {
    background: var(--app-surface-muted);
    border-color: transparent;
    color: var(--app-ink);
}

.app-context-link.active,
.app-side-menu a.active,
.app-user-menu .dropdown-item.active,
.settings-menu a.active,
.profile-section-nav a.active {
    background: color-mix(in srgb, var(--app-accent) 16%, var(--app-surface));
    border-color: color-mix(in srgb, var(--app-accent) 45%, var(--app-line));
    color: var(--app-accent);
}

.app-context-link.active {
    box-shadow: inset 0 -2px 0 var(--app-accent);
}

.app-side-menu a.active,
.settings-menu a.active,
.profile-section-nav a.active {
    box-shadow: inset 3px 0 0 var(--app-accent);
}

/* Panel Zarządu (#246): trend 12 miesięcy — pasek proporcjonalny do maksimum kolumny. */
.board-trend-bar {
    position: relative;
    min-width: 7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    overflow: hidden;
}

/* Pasek trendu (#335): wartość w <progress value>, nie w style=. */
.board-trend-bar > progress {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    appearance: none;
    border: 0;
    background: transparent;
}

.board-trend-bar > progress::-webkit-progress-bar { background: transparent; }
.board-trend-bar > progress::-webkit-progress-value { background: var(--app-soft-blue); }
.board-trend-bar > progress::-moz-progress-bar { background: var(--app-soft-blue); }
.board-trend-bar > span { position: relative; }

@media print {
    .board-dashboard .no-print,
    .app-navbar,
    .app-sidebar,
    footer {
        display: none !important;
    }

    .board-dashboard .panel-block {
        break-inside: avoid;
    }

    .board-trend-bar {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Podpowiedzi przy ustawianiu hasła (#299) — stan wymagania ma ikonę i tekst, nie tylko kolor. */
.password-hints { margin-top: .4rem; font-size: .875rem; }
.password-hints-list { list-style: none; margin: 0 0 .25rem; padding: 0; display: flex; flex-wrap: wrap; gap: .15rem 1rem; color: var(--app-muted); }
.password-hints-list li { display: inline-flex; align-items: center; gap: .3rem; }
.password-hints-list li.is-met { color: var(--app-success); }
.password-hints-list li.password-hints-server { flex-basis: 100%; }
.password-match { margin: 0 0 .25rem; font-weight: 600; }
.password-match.is-met { color: var(--app-success); }
.password-match.is-unmet { color: var(--app-danger); }

/* ===== #335: style z atrybutów style= i bloków <style> — tylko tutaj (ZASADY_ARCHITEKTURY.md → Wygląd) ===== */

/* Klasy pomocnicze: szerokości pól, kolumn i kontenerów. */
.u-w-2rem { width: 2rem; }
.u-w-3rem { width: 3rem; }
.u-w-5rem { width: 5rem; }
.u-w-6rem { width: 6rem; }
.u-w-7rem { width: 7rem; }
.u-w-8rem { width: 8rem; }
.u-w-9rem { width: 9rem; }
.u-w-10rem { width: 10rem; }
.u-w-14rem { width: 14rem; }
.u-w-16rem { width: 16rem; }
.u-w-18rem { width: 18rem; }
.u-w-18p { width: 18%; }
.u-w-30p { width: 30%; }
.u-w-35p { width: 35%; }
.u-minw-4rem { min-width: 4rem; }
.u-minw-6rem { min-width: 6rem; }
.u-minw-15rem { min-width: 15rem; }
.u-minw-16rem { min-width: 16rem; }
.u-minw-18rem { min-width: 18rem; }
.u-maxw-18rem { max-width: 18rem; }
.u-maxw-20rem { max-width: 20rem; }
.u-maxw-40rem { max-width: 40rem; }
/* Kadry — „Przejdź do pracownika” (#416): lista podpowiedzi nad treścią strony. */
.hr-employee-jump .list-group { z-index: 1050; max-height: 22rem; overflow-y: auto; }
.u-maxw-48rem { max-width: 48rem; }
.u-maxw-52rem { max-width: 52rem; }
.u-maxw-56rem { max-width: 56rem; }
.u-maxw-60rem { max-width: 60rem; }
.u-maxw-72rem { max-width: 72rem; }
.u-maxh-12rem { max-height: 12rem; }
.u-maxh-14rem { max-height: 14rem; }
.u-maxh-24rem { max-height: 24rem; }
.u-scroll-y { overflow-y: auto; }
.u-size-2rem { width: 2rem; height: 2rem; }
.u-fs-sm { font-size: .75rem; }
.u-pre-line { white-space: pre-line; }
.u-thumb-9rem { width: 9rem; height: 9rem; object-fit: cover; }

/* Komponenty. */
.app-doc-frame { width: 100%; height: 70vh; border: 1px solid var(--app-line); }
.recruitment-stage-column { width: 15rem; min-height: 8rem; }
.profile-edit-offcanvas { --bs-offcanvas-width: min(36rem, 100vw); }

/* Pasek postępu (app_progress() w app/Core/view.php) — wartość w atrybucie value. */
.app-progress {
    display: block;
    width: 100%;
    height: 1rem;
    appearance: none;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: var(--app-surface-muted);
    color: var(--app-accent);
}

.app-progress::-webkit-progress-bar { background: var(--app-surface-muted); border-radius: 999px; }
.app-progress::-webkit-progress-value { background: var(--app-accent); border-radius: 999px; }
.app-progress::-moz-progress-bar { background: var(--app-accent); border-radius: 999px; }
.app-progress.is-success::-webkit-progress-value { background: var(--app-success); }
.app-progress.is-success::-moz-progress-bar { background: var(--app-success); }
.app-progress.app-progress-sm { height: .75rem; }

/* Wydruk zbiorczy dokumentów kadrowych (#441): na ekranie kreska między dokumentami, w druku każdy od nowej strony. */
.print-document-page + .print-document-page { border-top: 1px dashed var(--bs-border-color); margin-top: 2rem; padding-top: 2rem; }

/* Strony do druku (karty, protokoły, legitymacje, identyfikatory): druk bez menu i nagłówka. */
@media print {
    body:has(.print-document) .app-navbar,
    body:has(.print-document) .app-sidebar,
    body:has(.print-document) .navbar,
    body:has(.print-document) footer,
    .print-document .no-print { display: none !important; }
    .print-document-page + .print-document-page { break-before: page; page-break-before: always; border-top: 0; margin-top: 0; padding-top: 0; }
    .timesheet-card { font-size: 10px; }
    .timesheet-card table { page-break-inside: auto; }
    .timesheet-card tr { page-break-inside: avoid; }
    .id-card-print { font-size: 11px; }
    .badges { gap: 4mm !important; }
    .warehouse-page .nav, body:has(.warehouse-page) .site-header, body:has(.warehouse-page) .app-sidebar, body:has(.warehouse-page) footer { display: none !important; }
}

.timesheet-card td.is-free { background: var(--bs-tertiary-bg); }
.attendance td { height: 2.2rem; }

/* Legitymacja i identyfikator na imprezę — wydruk na kartę 85,6 × 54 mm: stałe kolory czerni i bieli celowo
   (karta fizyczna, niezależna od motywu). */
.id-card,
.event-badge { --print-card-paper: #fff; --print-card-order: #ffd800; --print-card-information: #9fd3ff; width: 85.6mm; height: 54mm; border: 1px solid #333; border-radius: 3mm; padding: 3mm; display: flex; gap: 3mm; background: var(--print-card-paper); color: #000; }
.id-card { font-size: 9px; }
.event-badge { font-size: 8.5px; page-break-inside: avoid; }
.id-card .photo,
.event-badge .photo { width: 22mm; height: 28mm; border: 1px solid #999; object-fit: cover; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 7px; }
.id-card h2 { font-size: 9.5px; font-weight: 700; text-transform: uppercase; margin: 0 0 1.5mm; }
.id-card-print .signature { border-top: 1px dotted #555; padding-top: 1mm; margin-top: 12mm; font-size: 10px; text-align: center; }
.badges { display: flex; flex-wrap: wrap; gap: 1rem; }
.event-badge .service { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 1mm 2mm; border: 1px solid #000; display: inline-block; margin-bottom: 1.5mm; }
.event-badge .service.order { background: var(--print-card-order); }
.event-badge .service.information { background: var(--print-card-information); }

/* Magazyn: formularze rozwijane przy pozycji stanu. */
.warehouse-inline { position: relative; display: inline-block; }
.warehouse-inline > summary { list-style: none; }
.warehouse-inline > summary::-webkit-details-marker { display: none; }
.warehouse-inline-form { position: absolute; right: 0; z-index: 20; width: min(18rem, 80vw); margin-top: .25rem; padding: .75rem; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .5rem; box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .12); }
.warehouse-unit-list { max-height: 12rem; overflow-y: auto; }
.warehouse-qty { width: 5.5rem; }

/* Schemat organizacyjny (#212). */
.org-tree { list-style: none; padding-left: 1.25rem; border-left: 1px dashed var(--bs-border-color); margin: .25rem 0 .25rem .75rem; }
.org-tree > li { margin: .35rem 0; }
.org-root { list-style: none; padding-left: 0; }
.org-node { display: inline-flex; align-items: center; padding: .25rem .5rem; border: 1px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-body-bg); }
.org-node.is-match { outline: 2px solid var(--bs-warning); }
.org-chart details > summary { list-style: none; cursor: pointer; }
.org-chart details > summary::-webkit-details-marker { display: none; }

/* Przyjęcie pracownika (#375): kroki po zatwierdzeniu rejestracji w „Przeglądzie” profilu. */
.employee-setup-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.employee-setup-step + .employee-setup-step {
    border-top: 1px solid var(--app-line);
}

.employee-setup-step.is-done strong {
    font-weight: 500;
}

/* Instalacja testowa (#418): stały znacznik „WERSJA TESTOWA” u góry ekranu, także na logowaniu i na telefonie. */
.app-test-installation-badge {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1090;
    padding: .1rem .75rem;
    border-radius: 0 0 .5rem .5rem;
    background: var(--app-warning);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    pointer-events: none;
}

/* Przełączone konto testowe (#418): pasek u góry ekranu z powrotem do własnego konta. */
.app-test-account-bar {
    position: sticky;
    top: 0;
    z-index: 1080;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    padding: .5rem 1rem;
    background: var(--app-ink);
    color: var(--app-surface);
    font-size: .875rem;
}
.app-test-account-bar .form-select { max-width: 22rem; }

/* Pasek „Testujesz: …” (#449): kroki testu i wynik na każdej stronie. */
.app-test-checklist-bar {
    position: sticky;
    top: 0;
    z-index: 1079;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding: .5rem 1rem;
    background: var(--app-primary, var(--bs-primary));
    color: var(--app-surface);
    font-size: .875rem;
}
.app-test-checklist-bar details { flex: 1 1 24rem; }
.app-test-checklist-bar textarea { max-width: 28rem; }

/* Formularz adresu (#475, render_address_fields()) — podpowiedź pod polem miejscowości znika, gdy pusta. */
.address-fields .address-hint:empty {
    display: none;
}

/* „Pokaż hasło” (#480) — przycisk-oko w input-group przy polu hasła. */
.input-group > .password-toggle { min-width: 2.75rem; }

/* Dokumenty prawne i baner o ciasteczkach (#481). */
.legal-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1rem; padding: 1rem; font-size: .875rem; }
.cookie-notice { position: fixed; left: .75rem; right: .75rem; bottom: .75rem; z-index: 1080; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .6rem .9rem; font-size: .85rem; background: var(--bs-body-bg, #fff); color: var(--bs-body-color, inherit); border: 1px solid var(--bs-border-color, #dee2e6); border-radius: .5rem; box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .15); }
.cookie-notice[hidden] { display: none; }
.cookie-notice-actions { display: flex; gap: .5rem; }
@media (min-width: 768px) { .cookie-notice { left: auto; max-width: 34rem; } }

/* Udział w rozwoju (/udzial): wykresy SVG, kolory osób jak paski postępu na kartach */
.contribution-chart { display: block; width: 100%; height: auto; overflow: visible; }
.contribution-chart .chart-grid { stroke: var(--app-line); stroke-width: 1; }
.contribution-chart .chart-axis { fill: var(--app-muted); font-size: 11px; }
.contribution-chart .chart-bar { transition: opacity .15s ease; }
.contribution-chart .chart-bar:hover { opacity: .75; }
.contribution-chart .chart-track { fill: var(--app-surface-muted); }
.contribution-series-0 { fill: var(--app-success); }
.contribution-series-1 { fill: var(--app-accent); }
.contribution-kinds { display: grid; gap: .85rem; }
@media (min-width: 992px) { .contribution-kinds { grid-template-columns: 1fr 1fr; column-gap: 2rem; } }
.contribution-kind-bar { height: .85rem; margin: .3rem 0; border-radius: 4px; overflow: hidden; }
.contribution-swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: 3px; vertical-align: -1px; }
.contribution-swatch.contribution-series-0 { background: var(--app-success); }
.contribution-swatch.contribution-series-1 { background: var(--app-accent); }
