/* =========================================================
   MASTER CSS v2 — jeden główny plik stylów aplikacji
   Zawiera bazę z dotychczasowych wspólnych CSS oraz wspólne komponenty UI.
   Pliki CSS modułów powinny zawierać tylko elementy unikatowe dla modułu.
   ========================================================= */


/* ===== INLINE: public/css/style.css ===== */

/* PREMIUM BASE v1 — wspólny font i zmienne wizualne */
:root {
    --font-main: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --premium-bg-main: #070b14;
    --premium-bg-soft: #0d1424;
    --premium-bg-deep: #030712;

    --premium-surface: rgba(255, 255, 255, 0.065);
    --premium-surface-strong: rgba(255, 255, 255, 0.095);
    --premium-surface-soft: rgba(255, 255, 255, 0.04);

    --premium-border-soft: rgba(255, 255, 255, 0.10);
    --premium-border-strong: rgba(255, 255, 255, 0.18);

    --premium-text-main: #f7f9ff;
    --premium-text-muted: #9fb0d0;
    --premium-text-soft: #c7d7ef;

    --premium-accent: #4f8cff;
    --premium-accent-2: #2dd4bf;
    --premium-danger: #ef4444;
    --premium-warning: #f59e0b;
    --premium-success: #22c55e;

    --premium-radius-sm: 14px;
    --premium-radius-md: 20px;
    --premium-radius-lg: 28px;

    --premium-shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.26);
    --premium-shadow-card: 0 24px 70px rgba(0, 0, 0, 0.32);
    --premium-glass-blur: blur(18px);
}

:where(body, button, input, select, textarea) {
    font-family: var(--font-main);
}


/* PREMIUM ICON SYSTEM v2 — jednolite ikony SVG zamiast emoji */
.app-icon {
    width: 1em;
    height: 1em;
    display: block;
    flex: 0 0 auto;
    color: currentColor;
    stroke: currentColor;
}

.menu-link-icon,
.mobile-bottom-icon,
.mobile-menu-btn,
.mobile-profile-btn,
.dashboard-insight-icon,
.quick-icon,
.action-icon,
.attention-icon,
.activity-icon,
.action-tile-icon,
.settlement-action-icon,
.stat-card-create-icon,
.history-icon,
.module-page-icon,
.module-icon,
.icon-chip-btn,
.modal-close {
    line-height: 1;
}

.menu-link-icon .app-icon,
.mobile-bottom-icon .app-icon {
    width: 20px;
    height: 20px;
}

.mobile-menu-btn .app-icon,
.mobile-profile-btn .app-icon,
.icon-chip-btn .app-icon,
.modal-close .app-icon {
    width: 20px;
    height: 20px;
}

.dashboard-insight-icon .app-icon,
.quick-icon .app-icon,
.action-icon .app-icon,
.attention-icon .app-icon,
.activity-icon .app-icon,
.history-icon .app-icon {
    width: 22px;
    height: 22px;
}

.action-tile-icon .app-icon,
.settlement-action-icon .app-icon,
.stat-card-create-icon .app-icon,
.module-page-icon .app-icon,
.module-icon .app-icon {
    width: 24px;
    height: 24px;
}

.auth-feature-item .app-icon {
    width: 20px;
    height: 20px;
}


* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-main);
    background:
        radial-gradient(circle at top left, rgba(0, 170, 255, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(140, 82, 255, 0.12), transparent 35%),
        var(--premium-bg-main);
    background-attachment: fixed, fixed, fixed;
    color: var(--premium-text-main);
    overflow-x: hidden;
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
}

body.menu-open {
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

button,
input,
textarea,
select {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.mobile-header {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

.sidebar {
    background: rgba(10, 16, 32, 0.88);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px;
    backdrop-filter: blur(16px);
    min-width: 0;
}

.logo-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
}

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #38bdf8, #8b5cf6);
    color: white;
    font-weight: bold;
    flex: 0 0 48px;
}

.logo-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.logo-sub {
    font-size: 12px;
    color: #9fb0d0;
    margin-top: 2px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-link {
    padding: 12px 14px;
    color: #dce7ff;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    transition: 0.2s;
    word-break: break-word;
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.09);
}

.menu-link.danger {
    color: #ffb4b4;
}

.main-content {
    padding: 28px;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.user-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: rgba(255,255,255,0.05);
    padding: 12px 16px;
    border-radius: 14px;
    max-width: 100%;
    word-break: break-word;
}

.user-chip small {
    color: #9fb0d0;
}

.hero-card,
.glass-card,
.module-card,
.tile-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    border-radius: 22px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.hero-card {
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.hero-card h2 {
    margin: 4px 0 10px;
    line-height: 1.2;
}

.hero-badge {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(56,189,248,0.15);
    color: #8ee7ff;
    font-weight: 700;
    white-space: nowrap;
}

.eyebrow {
    color: #9fb0d0;
    font-size: 12px;
    letter-spacing: 1px;
}

.glass-card {
    padding: 22px;
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid label {
    display: grid;
    gap: 8px;
}

.form-grid span {
    color: #c7d5ef;
    font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.06);
    border-radius: 14px;
    color: white;
    min-height: 48px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 0;
    cursor: pointer;
    font-weight: 700;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    color: white;
}

.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: white;
}

.btn-danger {
    background: rgba(255, 82, 82, 0.18);
    color: #ffd5d5;
}

.btn-link {
    background: rgba(56,189,248,0.12);
    color: #8ee7ff;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    overflow-wrap: anywhere;
}

.alert.error {
    background: rgba(255, 82, 82, 0.15);
    color: #ffd1d1;
}

.alert.success {
    background: rgba(34, 197, 94, 0.15);
    color: #bbffd1;
}

.muted {
    color: #9fb0d0;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tile-card {
    padding: 20px;
    color: var(--premium-text-main);
    transition: transform 0.2s ease;
    min-width: 0;
    position: relative;
}

.tile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.tile-live-badge {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.28);
}

.tile-live-badge.is-hidden {
    display: none;
}

.tile-live-meta {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.45;
    color: #8ee7ff;
}

.live-communications-tile.tile-has-alert,
.dashboard-live-panel.tile-has-alert {
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 14px 44px rgba(56, 189, 248, 0.14);
}

.dashboard-live-panel {
    margin-top: 18px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.dashboard-live-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.dashboard-live-label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9fb0d0;
}

.dashboard-live-title {
    font-size: 16px;
    font-weight: 700;
    margin-top: 4px;
}

.dashboard-live-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
    color: #dce7ff;
}

.tile-card:hover {
    transform: translateY(-2px);
}

.tile-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.tile-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.tile-desc {
    color: #b9c9e6;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.info-list {
    display: grid;
    gap: 10px;
    color: #dce7ff;
    overflow-wrap: anywhere;
}

.empty-box {
    padding: 20px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    color: #9fb0d0;
    margin-bottom: 24px;
}

.module-list {
    display: grid;
    gap: 16px;
}

.module-card {
    padding: 18px;
}

.module-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 12px;
}

.module-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.08);
    font-size: 24px;
    flex: 0 0 54px;
}

.module-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.module-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #9fb0d0;
    font-size: 13px;
    margin-top: 4px;
}

.module-desc {
    color: #dce7ff;
    margin-bottom: 16px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.module-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.status {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status.on {
    background: rgba(34, 197, 94, 0.15);
    color: #92ffb4;
}

.status.off {
    background: rgba(255, 184, 0, 0.15);
    color: #ffd98a;
}

.auth-wrap {
    min-height: 100vh;
    padding: 24px;
}

.auth-layout-split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, 460px);
    align-items: stretch;
    gap: 24px;
    width: min(1180px, 100%);
    margin: 0 auto;
}

.auth-panel {
    min-width: 0;
}

.auth-panel-info,
.auth-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.auth-panel-info {
    position: relative;
    overflow: hidden;
    padding: 40px;
    display: flex;
    align-items: stretch;
}

.auth-panel-info::before {
    content: '';
    position: absolute;
    inset: auto -80px -120px auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.2), transparent 70%);
    pointer-events: none;
}

.auth-panel-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.auth-kicker {
    color: #8ee7ff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.auth-title-main {
    margin: 0;
    font-size: clamp(34px, 4.2vw, 56px);
    line-height: 1.04;
    max-width: 11ch;
}

.auth-lead {
    margin: 18px 0 0;
    max-width: 650px;
    color: #b9c9e6;
    font-size: 17px;
    line-height: 1.65;
}

.auth-feature-grid {
    margin-top: 34px;
    display: grid;
    gap: 16px;
}

.auth-feature-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
    padding: 18px 20px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}

.auth-feature-card h2 {
    margin: 0 0 6px;
    font-size: 18px;
    line-height: 1.2;
}

.auth-feature-card p {
    margin: 0;
    color: #b9c9e6;
    line-height: 1.55;
}

.auth-feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.08);
    font-size: 24px;
}

.auth-panel-form {
    display: flex;
    align-items: center;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 32px;
}

.auth-card-login {
    margin-left: auto;
}

.auth-form-head {
    margin-bottom: 18px;
}

.auth-form-head h2 {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.1;
}

.auth-form-grid {
    margin-top: 20px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #38bdf8, #8b5cf6);
    font-size: 20px;
    font-weight: 700;
}

.mobile-menu-btn,
.mobile-profile-btn {
    border: 0;
    background: rgba(255,255,255,0.08);
    color: var(--premium-text-main);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    font-size: 18px;
}

.mobile-profile-btn.ghost {
    visibility: hidden;
}

@media (max-width: 1200px) {
    .tile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 1001;
        display: grid;
        grid-template-columns: 44px 1fr 44px;
        align-items: center;
        gap: 12px;
        padding: env(safe-area-inset-top) 16px 12px;
        background: rgba(10, 16, 32, 0.92);
        backdrop-filter: blur(18px);
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .mobile-header-title {
        font-size: 16px;
        font-weight: 700;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1000;
    }

    .app-shell {
        display: block;
        min-height: calc(100vh - 56px);
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: min(86vw, 320px);
        height: 100vh;
        z-index: 1002;
        transition: left 0.25s ease;
        overflow-y: auto;
        border-right: 1px solid rgba(255,255,255,0.08);
        padding-top: calc(env(safe-area-inset-top) + 20px);
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        padding: 18px 16px 28px;
    }

    .topbar {
        display: none;
    }

    .tile-grid,
    .grid-2,
    .dashboard-live-stats {
        grid-template-columns: 1fr;
    }

    .module-head {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .hero-card {
        flex-direction: column;
        align-items: stretch;
        padding: 18px;
    }

    .hero-badge {
        align-self: flex-start;
    }

    .glass-card,
    .module-card,
    .tile-card {
        border-radius: 18px;
    }

    .module-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .module-actions form,
    .module-actions a {
        width: 100%;
    }

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

    .user-chip {
        align-items: flex-start;
    }
}

@media (max-width: 980px) {
    .auth-layout-split {
        grid-template-columns: 1fr;
    }

    .auth-panel-info {
        padding: 28px;
    }

    .auth-title-main {
        max-width: none;
    }

    .auth-card-login {
        margin-left: 0;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .auth-wrap {
        padding: 16px;
    }

    .auth-panel-info,
    .auth-card {
        padding: 22px 18px;
        border-radius: 22px;
    }

    .auth-feature-card {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 16px 14px 24px;
    }

    .logo-card {
        margin-bottom: 20px;
    }

    .tile-card {
        padding: 18px;
    }

    .tile-title {
        font-size: 17px;
    }

    .hero-card,
    .glass-card,
    .module-card {
        padding: 16px;
    }

    .module-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .topbar h1,
    .hero-card h2 {
        font-size: 22px;
    }
}

@media (max-width: 420px) {
    .mobile-header {
        padding-left: 12px;
        padding-right: 12px;
    }

    .main-content {
        padding-left: 12px;
        padding-right: 12px;
    }

    .menu-link {
        padding: 11px 12px;
    }

    .auth-title-main {
        font-size: 30px;
    }

    .auth-logo {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }
}
.hero-card-compact {
    padding: 20px 24px;
    align-items: center;
}

.section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.quick-card {
    display: block;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.05);
    color: var(--premium-text-main);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.quick-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.14);
}

.quick-card-warning {
    background: linear-gradient(180deg, rgba(245,158,11,0.16), rgba(255,255,255,0.05));
}

.quick-card-info {
    background: linear-gradient(180deg, rgba(56,189,248,0.16), rgba(255,255,255,0.05));
}

.quick-icon {
    font-size: 24px;
    margin-bottom: 12px;
}

.quick-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.quick-text {
    font-size: 14px;
    line-height: 1.45;
    color: #c7d5ef;
}

.tile-card-clean .tile-desc {
    min-height: 42px;
}

.grid-2-compact,
.admin-top-grid {
    align-items: start;
}

.compact-card h3 {
    margin-top: 0;
    margin-bottom: 16px;
}

.compact-info-list {
    gap: 12px;
}

.compact-form-grid {
    gap: 14px;
}

.mini-stats-inline {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    color: #9fb0d0;
    font-size: 14px;
}

.module-accordion-list {
    display: grid;
    gap: 12px;
}

.module-accordion {
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    border-radius: 18px;
    overflow: hidden;
}

.module-accordion-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    cursor: pointer;
}

.module-accordion-summary::-webkit-details-marker {
    display: none;
}

.module-summary-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.module-icon-small {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 22px;
}

.module-title-small {
    font-size: 16px;
}

.module-accordion-body {
    padding: 0 18px 18px;
}

@media (max-width: 1180px) {
    .quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .quick-grid,
    .tile-grid,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .section-row,
    .module-accordion-summary {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ===== RCP v1.2 / Stan obecności RCP ===== */
.rcp-presence-card {
    margin-bottom: 24px;
}

.rcp-presence-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.rcp-stat {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rcp-stat strong {
    font-size: 26px;
    line-height: 1;
}

.rcp-stat-label {
    font-size: 13px;
    color: #c7d5ef;
}

.rcp-stat-success { background: linear-gradient(180deg, rgba(34,197,94,0.16), rgba(255,255,255,0.04)); }
.rcp-stat-info { background: linear-gradient(180deg, rgba(56,189,248,0.16), rgba(255,255,255,0.04)); }
.rcp-stat-warning { background: linear-gradient(180deg, rgba(245,158,11,0.16), rgba(255,255,255,0.04)); }
.rcp-stat-danger { background: linear-gradient(180deg, rgba(239,68,68,0.16), rgba(255,255,255,0.04)); }
.rcp-stat-muted { background: linear-gradient(180deg, rgba(148,163,184,0.16), rgba(255,255,255,0.04)); }

.rcp-presence-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.rcp-presence-column {
    min-width: 0;
}

.rcp-presence-heading {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
}

.rcp-presence-heading.success { color: #b9ffd1; }
.rcp-presence-heading.info { color: #8ee7ff; }
.rcp-presence-heading.warning { color: #ffd98a; }
.rcp-presence-heading.danger { color: #ffd0d0; }

.rcp-presence-list,
.rcp-last-events {
    display: grid;
    gap: 10px;
}

.rcp-presence-item,
.rcp-last-event {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
}

.rcp-presence-item.tone-success { border-color: rgba(34,197,94,0.18); }
.rcp-presence-item.tone-info { border-color: rgba(56,189,248,0.18); }
.rcp-presence-item.tone-warning { border-color: rgba(245,158,11,0.18); }
.rcp-presence-item.tone-danger { border-color: rgba(239,68,68,0.18); }

.rcp-presence-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.rcp-presence-detail {
    font-size: 13px;
    line-height: 1.45;
    color: #c7d5ef;
}

.rcp-presence-time {
    font-size: 13px;
    color: #9fb0d0;
    white-space: nowrap;
}

.empty-box.small {
    padding: 14px 16px;
    margin-bottom: 0;
    border-radius: 16px;
}

.rcp-presence-row-gap {
    margin-top: 4px;
}

@media (max-width: 1180px) {
    .rcp-presence-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .rcp-presence-stats,
    .rcp-presence-grid {
        grid-template-columns: 1fr;
    }

    .rcp-presence-item,
    .rcp-last-event {
        flex-direction: column;
        align-items: flex-start;
    }

    .rcp-presence-time {
        white-space: normal;
    }
}

.menu-section-label {
    margin: 20px 0 10px;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8ea0c4;
}
.menu-link.active {
    background: linear-gradient(135deg, rgba(56,189,248,.18), rgba(129,140,248,.18));
    border: 1px solid rgba(56,189,248,.22);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.status-pill {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.status-pill-success { background: rgba(34,197,94,.16); color: #b4ffd1; }
.status-pill-warning { background: rgba(245,158,11,.18); color: #ffe0a3; }
.status-pill-danger { background: rgba(239,68,68,.18); color: #ffd4d4; }
.status-pill-info { background: rgba(56,189,248,.16); color: #a6edff; }
.status-pill-muted { background: rgba(255,255,255,.08); color: #dce7ff; }

.employee-rcp-card,
.profile-main-card,
.profile-qr-card,
.colored-section,
.rcp-detail-card {
    background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.045));
}
.employee-rcp-grid,
.profile-layout-grid,
.rcp-detail-layout {
    display: grid;
    grid-template-columns: 1.45fr .9fr;
    gap: 18px;
}
.employee-stat-row,
.rcp-detail-summary-grid,
.profile-data-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
}
.profile-data-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.employee-stat-card,
.profile-data-item {
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
}
.employee-stat-card strong,
.profile-data-item strong {
    display: block;
    margin: 6px 0 4px;
    font-size: 18px;
    line-height: 1.2;
}
.employee-stat-card small,
.profile-data-item span {
    color: #aebfe0;
    display: block;
    line-height: 1.4;
}
.employee-stat-label {
    font-size: 12px;
    color: #9fb0d0;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.theme-blue { background: linear-gradient(180deg, rgba(56,189,248,.16), rgba(255,255,255,.04)); }
.theme-violet { background: linear-gradient(180deg, rgba(139,92,246,.16), rgba(255,255,255,.04)); }
.theme-green { background: linear-gradient(180deg, rgba(34,197,94,.16), rgba(255,255,255,.04)); }
.employee-attention-list,
.employee-activity-list { margin-top: 16px; }
.employee-last-box { margin-top: 16px; }
.day-off-banner {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(34,197,94,.16), rgba(255,255,255,.04));
    border: 1px solid rgba(34,197,94,.18);
}
.day-off-icon {
    width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
    background: rgba(255,255,255,.09); font-size: 22px; flex: 0 0 44px;
}
.employee-qr-panel { display: grid; gap: 16px; }
.employee-qr-card,
.employee-mini-profile { border-radius: 20px; padding: 18px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.employee-qr-box,
.profile-qr-box {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    background: rgba(255,255,255,.97);
    border-radius: 18px;
    padding: 16px;
}
.qr-inline svg,
.qr-image { width: 100%; max-width: 220px; height: auto; display: block; }
.mini-profile-list { display: grid; gap: 12px; margin: 14px 0 16px; }
.mini-profile-list div,
.profile-data-item {
    overflow-wrap: anywhere;
}
.mini-profile-list span { display:block; font-size:12px; color:#9fb0d0; margin-bottom:3px; }
.btn-block { width: 100%; }
.quick-card-success { background: linear-gradient(180deg, rgba(34,197,94,.16), rgba(255,255,255,.05)); }
.quick-card-info { background: linear-gradient(180deg, rgba(56,189,248,.16), rgba(255,255,255,.05)); }
.quick-card-warning { background: linear-gradient(180deg, rgba(245,158,11,.16), rgba(255,255,255,.05)); }
.quick-card-danger { background: linear-gradient(180deg, rgba(239,68,68,.16), rgba(255,255,255,.05)); }
.action-card-success { background: linear-gradient(180deg, rgba(34,197,94,.16), rgba(255,255,255,.04)); }
.action-card-info { background: linear-gradient(180deg, rgba(56,189,248,.16), rgba(255,255,255,.04)); }
.action-card-warning { background: linear-gradient(180deg, rgba(245,158,11,.16), rgba(255,255,255,.04)); }
.action-card-danger { background: linear-gradient(180deg, rgba(239,68,68,.16), rgba(255,255,255,.04)); }
.attention-item-danger { background: linear-gradient(180deg, rgba(239,68,68,.14), rgba(255,255,255,.03)); }
.attention-item-info { background: linear-gradient(180deg, rgba(56,189,248,.14), rgba(255,255,255,.03)); }
.attention-item-warning { background: linear-gradient(180deg, rgba(245,158,11,.14), rgba(255,255,255,.03)); }
.employee-activity-item { background: rgba(255,255,255,.04); }

.rcp-presence-item { display:flex; justify-content:space-between; gap:12px; padding:14px 16px; border-radius:16px; border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.03); color:#eef3ff; }
.rcp-presence-item.is-selected { box-shadow: 0 0 0 1px rgba(56,189,248,.35), 0 12px 32px rgba(56,189,248,.12); }
.rcp-presence-item.tone-success { background: linear-gradient(180deg, rgba(34,197,94,.14), rgba(255,255,255,.03)); }
.rcp-presence-item.tone-info { background: linear-gradient(180deg, rgba(56,189,248,.14), rgba(255,255,255,.03)); }
.rcp-presence-item.tone-danger { background: linear-gradient(180deg, rgba(239,68,68,.14), rgba(255,255,255,.03)); }
.rcp-presence-item.tone-warning { background: linear-gradient(180deg, rgba(245,158,11,.14), rgba(255,255,255,.03)); }
.rcp-presence-stats { display:grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap:12px; margin: 18px 0; }
.rcp-stat { border-radius: 18px; padding: 14px 16px; border:1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.04); }
.rcp-stat-label { display:block; font-size:12px; color:#9fb0d0; margin-bottom:6px; }
.rcp-stat strong { font-size: 24px; }
.rcp-stat-success { background: linear-gradient(180deg, rgba(34,197,94,.15), rgba(255,255,255,.04)); }
.rcp-stat-info { background: linear-gradient(180deg, rgba(56,189,248,.15), rgba(255,255,255,.04)); }
.rcp-stat-warning { background: linear-gradient(180deg, rgba(245,158,11,.15), rgba(255,255,255,.04)); }
.rcp-stat-danger { background: linear-gradient(180deg, rgba(239,68,68,.15), rgba(255,255,255,.04)); }
.rcp-presence-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:16px; }
.rcp-presence-column { display:grid; gap:10px; }
.rcp-presence-heading { font-weight:700; }
.rcp-presence-heading.success { color:#b4ffd1; }
.rcp-presence-heading.info { color:#a6edff; }
.rcp-presence-heading.warning { color:#ffe0a3; }
.rcp-presence-heading.danger { color:#ffd0d0; }
.rcp-presence-list,
.rcp-history-list,
.rcp-last-events { display:grid; gap:10px; }
.rcp-last-event,
.rcp-history-item { border-radius:16px; padding:14px 16px; border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.03); }
.rcp-history-item.tone-danger { background: linear-gradient(180deg, rgba(239,68,68,.14), rgba(255,255,255,.03)); }
.rcp-history-item.tone-warning { background: linear-gradient(180deg, rgba(245,158,11,.14), rgba(255,255,255,.03)); }
.rcp-history-item.tone-success { background: linear-gradient(180deg, rgba(34,197,94,.14), rgba(255,255,255,.03)); }
.rcp-history-item.tone-info { background: linear-gradient(180deg, rgba(56,189,248,.14), rgba(255,255,255,.03)); }
.rcp-history-top,
.rcp-history-meta,
.rcp-detail-header { display:flex; justify-content:space-between; gap:14px; align-items:center; }
.rcp-history-meta { font-size: 13px; color:#aebfe0; margin: 8px 0 6px; flex-wrap:wrap; }
.rcp-detail-name { font-size: 22px; font-weight: 700; }
.rcp-subtitle { margin-bottom: 12px; }

@media (max-width: 1100px) {
    .employee-rcp-grid,
    .profile-layout-grid,
    .rcp-detail-layout,
    .dashboard-panels-grid,
    .grid-2,
    .rcp-presence-grid,
    .rcp-presence-stats { grid-template-columns: 1fr; }
    .employee-stat-row,
    .rcp-detail-summary-grid,
    .profile-data-grid,
    .quick-grid,
    .action-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
    .employee-stat-row,
    .rcp-detail-summary-grid,
    .profile-data-grid,
    .quick-grid,
    .action-grid { grid-template-columns: 1fr; }
    .rcp-history-top,
    .rcp-detail-header,
    .rcp-history-meta,
    .section-row { flex-direction: column; align-items: flex-start; }
    .employee-qr-box,
    .profile-qr-box { min-height: 220px; }
}


/* ===== RCP v1.5 worker layout ===== */
.rcp-top-row { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(280px,340px); gap:18px; align-items:stretch; }
.dashboard-two-col { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; align-items:start; }
.dashboard-section-card { margin-bottom:0; }
.compact-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.quick-grid.compact-grid, .action-grid.compact-grid { gap:14px; }
.quick-card, .action-card { min-height:118px; }
.quick-title { font-size:16px; margin-bottom:6px; }
.quick-text { font-size:13px; line-height:1.45; }
.qr-card-box { margin-top:18px; display:flex; align-items:center; justify-content:center; min-height:210px; padding:18px; border-radius:20px; background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08); }
.qr-inline svg, .qr-image { display:block; width:168px; height:168px; background:#fff; padding:10px; border-radius:18px; box-shadow:0 12px 30px rgba(0,0,0,0.18); }
.dayoff-title { font-size:30px; font-weight:800; line-height:1.1; margin-bottom:10px; }
.dayoff-text { font-size:15px; line-height:1.55; color:#c7d5ef; max-width:560px; }
.rcp-compare-banner { margin-top:14px; padding:13px 15px; border-radius:16px; background:linear-gradient(180deg, rgba(139,92,246,.16), rgba(255,255,255,.04)); border:1px solid rgba(139,92,246,.18); color:#efe8ff; }
@media (max-width:1180px) { .rcp-top-row, .dashboard-two-col { grid-template-columns:1fr; } }
@media (max-width:760px) { .compact-grid { grid-template-columns:1fr; } .dayoff-title { font-size:24px; } .qr-card-box { min-height:180px; } }
/* ===== FIX STYLU: SZYBKIE AKCJE / UWAGA / AKTYWNOŚĆ ===== */

.dashboard-section-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 34px rgba(0,0,0,0.18);
    padding: 20px;
    margin-bottom: 22px;
}

.dashboard-section-card .section-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 4px;
}

.dashboard-section-card .section-subtitle {
    font-size: 13px;
    color: #9fb0d0;
    line-height: 1.45;
}

.action-grid,
.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.action-card,
.quick-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 128px;
    padding: 18px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--premium-text-main);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.action-card:hover,
.quick-card:hover,
.attention-item:hover,
.activity-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(0,0,0,0.22);
    border-color: rgba(255,255,255,0.16);
}

.action-card-info,
.quick-card-info {
    background: linear-gradient(180deg, rgba(56,189,248,0.16), rgba(255,255,255,0.05));
}

.action-card-warning,
.quick-card-warning {
    background: linear-gradient(180deg, rgba(245,158,11,0.16), rgba(255,255,255,0.05));
}

.action-card-success,
.quick-card-success {
    background: linear-gradient(180deg, rgba(34,197,94,0.16), rgba(255,255,255,0.05));
}

.action-icon,
.quick-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    font-size: 21px;
    background: rgba(255,255,255,0.11);
    margin-bottom: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.quick-title {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 7px;
}

.quick-text {
    font-size: 13px;
    line-height: 1.45;
    color: #d3dff5;
}

.attention-list,
.activity-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.attention-item,
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 15px 16px;
    border-radius: 18px;
    text-decoration: none;
    color: var(--premium-text-main);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 22px rgba(0,0,0,0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.attention-item-warning {
    background: linear-gradient(180deg, rgba(245,158,11,0.14), rgba(255,255,255,0.04));
}

.attention-item-danger {
    background: linear-gradient(180deg, rgba(239,68,68,0.16), rgba(255,255,255,0.04));
}

.attention-item-success {
    background: linear-gradient(180deg, rgba(34,197,94,0.14), rgba(255,255,255,0.04));
}

.activity-item {
    background: rgba(255,255,255,0.045);
}

.attention-icon,
.activity-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 19px;
    background: rgba(255,255,255,0.10);
    flex: 0 0 42px;
}

.attention-content,
.activity-content {
    min-width: 0;
    flex: 1;
}

.attention-title,
.activity-title {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 5px;
    line-height: 1.3;
}

.attention-text,
.activity-text {
    font-size: 13px;
    line-height: 1.45;
    color: #d1ddf3;
}

.activity-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.activity-meta {
    font-size: 12px;
    color: #8ee7ff;
    white-space: nowrap;
}

.attention-tag {
    align-self: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.attention-tag.info {
    background: rgba(56,189,248,0.16);
    color: #8ee7ff;
}

.attention-tag.warning {
    background: rgba(245,158,11,0.18);
    color: #ffd98a;
}

.attention-tag.danger {
    background: rgba(239,68,68,0.18);
    color: #ffd0d0;
}

.empty-box {
    margin-top: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: #aebddb;
}

@media (max-width: 900px) {
    .action-grid,
    .quick-grid {
        grid-template-columns: 1fr;
    }

    .activity-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .attention-item,
    .activity-item {
        flex-direction: row;
    }
}
html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    overflow-x: hidden;
}

body.portal-body.auth-body {
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
}

.auth-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    background:
        radial-gradient(circle at top left, rgba(82, 132, 255, 0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(64, 224, 208, 0.12), transparent 30%),
        linear-gradient(180deg, #07111f 0%, #0b1728 100%);
}

.auth-hero,
.auth-wrap {
    min-width: 0;
}

.auth-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px;
    color: #f5f7ff;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-hero-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #dbe7ff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 20px;
}

.auth-hero-content h1 {
    margin: 0 0 16px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.05;
}

.auth-hero-content p {
    margin: 0 0 28px;
    max-width: 620px;
    font-size: 17px;
    line-height: 1.7;
    color: rgba(235, 241, 255, 0.82);
}

.auth-feature-list {
    display: grid;
    gap: 14px;
    max-width: 560px;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.auth-feature-item span {
    font-size: 20px;
}

.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
}

.auth-card-polished {
    padding: 32px;
    border-radius: 28px;
    background: rgba(11, 23, 40, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
}

.auth-logo {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    font-weight: 800;
    font-size: 20px;
    color: #fff;
    background: linear-gradient(135deg, #5b8cff 0%, #6f6bff 100%);
}

.auth-heading h2 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 30px;
}

.auth-heading .muted {
    margin: 0 0 22px;
    color: rgba(221, 230, 255, 0.72);
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-submit {
    margin-top: 8px;
    width: 100%;
}

@media (max-width: 980px) {
    body.portal-body.auth-body {
        overflow-y: auto;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        padding: 32px 24px 20px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .auth-wrap {
        padding: 24px;
        align-items: flex-start;
    }

    .auth-card {
        max-width: 100%;
    }
}
/* =========================================================
   PREMIUM LOGIN — mobile first polish
   Zmiany dotyczą wyłącznie strony logowania.
   ========================================================= */
body.portal-body.auth-body.premium-login-body {
    min-height: 100dvh;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(circle at 12% 8%, rgba(77, 139, 255, 0.28), transparent 28%),
        radial-gradient(circle at 88% 18%, rgba(45, 212, 191, 0.18), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(124, 92, 255, 0.20), transparent 36%),
        linear-gradient(145deg, #050b16 0%, #081426 46%, #101a35 100%);
    background-attachment: fixed;
    color: #f6f8ff;
}

.premium-login-shell {
    position: relative;
    isolation: isolate;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
    align-items: stretch;
    background: transparent;
}

.auth-bg-orb,
.auth-bg-grid {
    position: fixed;
    pointer-events: none;
    z-index: -1;
}

.auth-bg-orb {
    width: 360px;
    height: 360px;
    border-radius: 999px;
    filter: blur(8px);
    opacity: 0.75;
}

.auth-bg-orb-one {
    top: -120px;
    left: -110px;
    background: radial-gradient(circle, rgba(79, 140, 255, 0.45), transparent 68%);
}

.auth-bg-orb-two {
    right: -140px;
    bottom: -130px;
    background: radial-gradient(circle, rgba(45, 212, 191, 0.35), transparent 68%);
}

.auth-bg-grid {
    inset: 0;
    opacity: 0.18;
    background-image:
        linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 50% 38%, black 0%, transparent 72%);
}

.premium-login-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(34px, 5vw, 72px);
    border-right: 1px solid rgba(255, 255, 255, 0.10);
}

.premium-login-hero::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 12%;
    width: 1px;
    height: 76%;
    background: linear-gradient(180deg, transparent, rgba(99, 184, 255, 0.65), transparent);
}

.premium-badge {
    position: relative;
    gap: 9px;
    padding: 9px 15px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.075);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 16px 40px rgba(0,0,0,0.12);
    backdrop-filter: blur(18px);
}

.premium-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.12), 0 0 18px rgba(52, 211, 153, 0.7);
}

.auth-eyebrow,
.auth-card-eyebrow {
    margin: 0 0 10px;
    color: #8ee7ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.premium-hero-content h1 {
    max-width: 12ch;
    margin-bottom: 18px;
    font-size: clamp(42px, 5.7vw, 76px);
    letter-spacing: -0.055em;
    line-height: 0.96;
    text-wrap: balance;
}

.premium-hero-content p {
    max-width: 660px;
    font-size: clamp(16px, 1.55vw, 20px);
    color: rgba(238, 246, 255, 0.80);
}

.premium-feature-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    max-width: 680px;
}

.premium-feature-list .auth-feature-item {
    min-height: 74px;
    padding: 17px 18px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,0.105), rgba(255,255,255,0.045));
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 14px 38px rgba(0,0,0,0.14);
}

.premium-feature-list .auth-feature-item span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
}

.premium-login-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: clamp(24px, 4vw, 56px);
}

.premium-login-card {
    position: relative;
    overflow: hidden;
    width: min(100%, 470px);
    max-width: 470px;
    padding: 34px;
    border-radius: 34px;
    background: linear-gradient(145deg, rgba(11, 23, 40, 0.88), rgba(12, 18, 36, 0.72));
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(26px) saturate(145%);
}

.auth-card-shine {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 0%, rgba(255,255,255,0.18), transparent 30%),
        linear-gradient(135deg, rgba(255,255,255,0.12), transparent 42%);
    opacity: 0.7;
}

.auth-card-top,
.premium-auth-heading,
.premium-auth-form,
.auth-mobile-note,
.premium-alert {
    position: relative;
    z-index: 1;
}

.auth-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
}

.premium-auth-logo {
    width: 64px;
    height: 64px;
    margin: 0;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.24), rgba(255,255,255,0.04)),
        linear-gradient(135deg, #4f8cff 0%, #7c5cff 52%, #2dd4bf 100%);
    box-shadow: 0 18px 38px rgba(79, 140, 255, 0.28), inset 0 1px 0 rgba(255,255,255,0.28);
}

.auth-secure-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.10);
    border: 1px solid rgba(52, 211, 153, 0.18);
    color: #baffd8;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.auth-secure-pill span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.9);
}

.premium-auth-heading h2 {
    margin: 0 0 8px;
    color: #fff;
    font-size: clamp(32px, 4vw, 42px);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.premium-auth-heading .muted {
    margin: 0 0 24px;
    color: rgba(226, 236, 255, 0.72);
    line-height: 1.5;
}

.premium-auth-form {
    gap: 17px;
}

.premium-field {
    gap: 8px;
}

.premium-field span {
    color: rgba(230, 240, 255, 0.86);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.02em;
}

.premium-field input[type="text"],
.premium-field input[type="password"] {
    min-height: 56px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.075);
    color: #fff;
    font-size: 16px;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.premium-field input::placeholder {
    color: rgba(221, 231, 255, 0.42);
}

.premium-field input:focus {
    border-color: rgba(99, 184, 255, 0.78);
    background: rgba(255,255,255,0.105);
    box-shadow:
        0 0 0 4px rgba(99, 184, 255, 0.14),
        inset 0 1px 0 rgba(255,255,255,0.10);
}

.premium-auth-submit {
    min-height: 58px;
    margin-top: 6px;
    width: 100%;
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.22), rgba(255,255,255,0.03)),
        linear-gradient(135deg, #4f8cff 0%, #7c5cff 52%, #2dd4bf 100%);
    color: #fff;
    box-shadow: 0 18px 40px rgba(79, 140, 255, 0.34);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.premium-auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 48px rgba(79, 140, 255, 0.42);
    filter: saturate(1.06);
}

.premium-auth-submit:active {
    transform: translateY(1px) scale(0.99);
}

.auth-mobile-note {
    margin-top: 18px;
    padding: 13px 14px;
    border-radius: 18px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(224, 235, 255, 0.68);
    font-size: 13px;
    line-height: 1.45;
}

.premium-alert {
    border: 1px solid rgba(255, 118, 118, 0.22);
    background: rgba(255, 82, 82, 0.13);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

@media (max-width: 1080px) {
    .premium-login-shell {
        grid-template-columns: minmax(0, 0.95fr) minmax(370px, 1.05fr);
    }

    .premium-feature-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    body.portal-body.auth-body.premium-login-body {
        background-attachment: scroll;
    }

    .premium-login-shell {
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
    }

    .premium-login-wrap {
        order: 1;
        width: 100%;
        min-height: auto;
        padding: calc(18px + env(safe-area-inset-top)) 16px 18px;
        align-items: flex-start;
    }

    .premium-login-hero {
        order: 2;
        width: 100%;
        padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
        border-right: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .premium-login-hero::after {
        display: none;
    }

    .premium-badge,
    .auth-eyebrow {
        display: none;
    }

    .premium-hero-content h1 {
        margin: 0 0 8px;
        max-width: none;
        font-size: 24px;
        letter-spacing: -0.035em;
    }

    .premium-hero-content p {
        margin: 0;
        max-width: none;
        font-size: 13px;
        line-height: 1.45;
        color: rgba(235, 241, 255, 0.62);
    }

    .premium-feature-list {
        margin-top: 14px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .premium-feature-list .auth-feature-item {
        min-height: 58px;
        padding: 11px 12px;
        border-radius: 18px;
        gap: 9px;
    }

    .premium-feature-list .auth-feature-item span {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        border-radius: 12px;
        font-size: 16px;
    }

    .premium-feature-list .auth-feature-item strong {
        font-size: 12px;
        line-height: 1.25;
    }

    .premium-login-card {
        width: 100%;
        max-width: none;
        padding: 24px;
        border-radius: 28px;
    }

    .auth-card-top {
        margin-bottom: 22px;
    }

    .premium-auth-logo {
        width: 58px;
        height: 58px;
        border-radius: 20px;
    }

    .premium-auth-heading h2 {
        font-size: 34px;
    }

    .premium-auth-heading .muted {
        margin-bottom: 22px;
        font-size: 14px;
    }

    .premium-field input[type="text"],
    .premium-field input[type="password"] {
        min-height: 56px;
        border-radius: 18px;
        font-size: 16px;
    }

    .premium-auth-submit {
        min-height: 58px;
    }
}

@media (max-width: 480px) {
    .premium-login-wrap {
        padding-left: 12px;
        padding-right: 12px;
    }

    .premium-login-card {
        padding: 22px;
        border-radius: 26px;
    }

    .auth-secure-pill {
        max-width: 150px;
        font-size: 11px;
        padding-inline: 10px;
    }

    .premium-auth-heading h2 {
        font-size: 32px;
    }

    .premium-feature-list {
        grid-template-columns: 1fr;
    }

    .auth-mobile-note {
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .premium-login-card {
        padding: 18px;
    }

    .auth-card-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-secure-pill {
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .premium-auth-submit,
    .premium-field input[type="text"],
    .premium-field input[type="password"] {
        transition: none;
    }
}


/* Mobile bottom navigation */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 980px) {
    .app-shell {
        min-height: 100dvh;
    }

    .main-content {
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav {
        position: fixed;
        left: max(10px, env(safe-area-inset-left));
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
        z-index: 999;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
        padding: 8px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 24px;
        background:
            linear-gradient(180deg, rgba(20, 28, 52, 0.86), rgba(8, 13, 28, 0.82));
        box-shadow:
            0 20px 50px rgba(0, 0, 0, 0.42),
            inset 0 1px 0 rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(22px) saturate(150%);
        -webkit-backdrop-filter: blur(22px) saturate(150%);
    }

    .mobile-bottom-link {
        appearance: none;
        border: 0;
        min-width: 0;
        min-height: 54px;
        padding: 7px 4px 6px;
        border-radius: 18px;
        color: rgba(226, 236, 255, 0.72);
        background: transparent;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        font: inherit;
        line-height: 1;
        text-align: center;
        cursor: pointer;
        touch-action: manipulation;
        transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
    }

    .mobile-bottom-link:active {
        transform: scale(0.96);
    }

    .mobile-bottom-link.active {
        color: #ffffff;
        background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(139, 92, 246, 0.28));
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.08),
            0 10px 26px rgba(56, 189, 248, 0.14);
    }

    .mobile-bottom-icon {
        display: block;
        font-size: 20px;
        line-height: 1;
        filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.22));
    }

    .mobile-bottom-label {
        display: block;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 10.5px;
        font-weight: 800;
        letter-spacing: -0.02em;
    }

    .mobile-bottom-more {
        color: rgba(230, 238, 255, 0.86);
    }

    .sidebar-backdrop.show {
        z-index: 1200;
    }

    .sidebar {
        z-index: 1201;
        padding-bottom: calc(110px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 380px) {
    .mobile-bottom-nav {
        left: max(6px, env(safe-area-inset-left));
        right: max(6px, env(safe-area-inset-right));
        bottom: max(6px, env(safe-area-inset-bottom));
        padding: 6px;
        gap: 4px;
        border-radius: 20px;
    }

    .mobile-bottom-link {
        min-height: 50px;
        border-radius: 15px;
    }

    .mobile-bottom-icon {
        font-size: 18px;
    }

    .mobile-bottom-label {
        font-size: 9.5px;
    }
}

/* Dashboard premium data cards */
.dashboard-insights-section {
    margin: 0 0 22px;
}

.dashboard-insights-shell {
    overflow: hidden;
}

.dashboard-insights-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.dashboard-insights-grid-admin {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-insight-card {
    position: relative;
    overflow: hidden;
    min-height: 148px;
    padding: 18px;
    border-radius: 24px;
    color: #f5f8ff;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.12);
    background: linear-gradient(180deg, rgba(255,255,255,.105), rgba(255,255,255,.045));
    box-shadow: 0 16px 38px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.08);
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    isolation: isolate;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.dashboard-insight-card::before {
    content: "";
    position: absolute;
    inset: -40% -30% auto auto;
    width: 130px;
    height: 130px;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    filter: blur(3px);
    z-index: -1;
}

.dashboard-insight-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,.24);
    box-shadow: 0 22px 48px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.12);
}

.dashboard-insight-top {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin-bottom: 16px;
}

.dashboard-insight-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 20px;
    background: rgba(255,255,255,.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.dashboard-insight-label {
    min-width: 0;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .035em;
    text-transform: uppercase;
    color: rgba(236,243,255,.72);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-insight-value {
    font-size: clamp(24px, 3.2vw, 36px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.045em;
    margin-bottom: 10px;
    color: #ffffff;
}

.dashboard-insight-text {
    font-size: 13px;
    line-height: 1.42;
    color: rgba(225,235,255,.78);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dashboard-insight-success {
    background: linear-gradient(145deg, rgba(34,197,94,.25), rgba(255,255,255,.055));
}

.dashboard-insight-info {
    background: linear-gradient(145deg, rgba(56,189,248,.24), rgba(255,255,255,.055));
}

.dashboard-insight-warning {
    background: linear-gradient(145deg, rgba(245,158,11,.26), rgba(255,255,255,.055));
}

.dashboard-insight-danger {
    background: linear-gradient(145deg, rgba(239,68,68,.27), rgba(255,255,255,.055));
}

.dashboard-insight-muted {
    background: linear-gradient(145deg, rgba(148,163,184,.16), rgba(255,255,255,.045));
}

@media (max-width: 1280px) {
    .dashboard-insights-grid,
    .dashboard-insights-grid-admin {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .dashboard-insights-grid,
    .dashboard-insights-grid-admin {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .dashboard-insight-card {
        min-height: 138px;
        padding: 15px;
        border-radius: 22px;
    }

    .dashboard-insight-top {
        gap: 8px;
        margin-bottom: 14px;
    }

    .dashboard-insight-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        border-radius: 14px;
        font-size: 18px;
    }

    .dashboard-insight-label {
        font-size: 10.5px;
    }

    .dashboard-insight-value {
        font-size: 26px;
    }

    .dashboard-insight-text {
        font-size: 12px;
        -webkit-line-clamp: 3;
    }
}

@media (max-width: 390px) {
    .dashboard-insights-grid,
    .dashboard-insights-grid-admin {
        grid-template-columns: 1fr;
    }

    .dashboard-insight-card {
        min-height: 120px;
    }
}


/* =========================================================
   PWA + MOBILE APP LOGIN — krok 4
   Tryb aplikacji oraz odchudzone logowanie na telefonie.
   ========================================================= */
@media (display-mode: standalone) {
    body {
        min-height: 100dvh;
    }

    .mobile-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }
}

html.is-standalone-app .mobile-header {
    padding-top: max(12px, env(safe-area-inset-top));
}

@media (max-width: 820px) {
    body.portal-body.auth-body.premium-login-body {
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        background:
            radial-gradient(circle at 50% -8%, rgba(79, 140, 255, 0.36), transparent 35%),
            radial-gradient(circle at 100% 18%, rgba(45, 212, 191, 0.20), transparent 30%),
            linear-gradient(160deg, #050b16 0%, #071326 55%, #0d1730 100%);
    }

    .premium-login-shell {
        min-height: 100dvh;
        display: grid;
        place-items: center;
        padding: calc(18px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
    }

    .premium-login-hero,
    .auth-bg-grid,
    .auth-bg-orb-two {
        display: none !important;
    }

    .auth-bg-orb-one {
        display: block;
        width: 300px;
        height: 300px;
        top: -120px;
        left: 50%;
        transform: translateX(-50%);
        opacity: .74;
        filter: blur(10px);
    }

    .premium-login-wrap {
        width: 100%;
        max-width: 430px;
        min-height: auto;
        padding: 0;
        align-items: center;
        justify-content: center;
    }

    .premium-login-card {
        width: 100%;
        max-width: 430px;
        padding: 26px 22px 22px;
        border-radius: 32px;
        background:
            linear-gradient(150deg, rgba(18, 31, 57, .92), rgba(8, 14, 30, .84)),
            rgba(8, 14, 28, .92);
        box-shadow:
            0 28px 90px rgba(0,0,0,.46),
            inset 0 1px 0 rgba(255,255,255,.14);
    }

    .auth-card-top {
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        margin-bottom: 20px;
        text-align: center;
    }

    .premium-auth-logo {
        width: 76px;
        height: 76px;
        border-radius: 24px;
        font-size: 24px;
    }

    .auth-secure-pill {
        min-height: 30px;
        padding: 6px 11px;
        font-size: 11px;
        color: rgba(202, 255, 225, .92);
    }

    .premium-auth-heading {
        text-align: center;
    }

    .auth-card-eyebrow {
        margin-bottom: 8px;
        font-size: 11px;
        letter-spacing: .14em;
    }

    .premium-auth-heading h2 {
        font-size: 34px;
        margin-bottom: 8px;
    }

    .premium-auth-heading .muted {
        max-width: 260px;
        margin: 0 auto 22px;
        color: rgba(226,236,255,.66);
    }

    .premium-field span {
        display: none;
    }

    .premium-field input[type="text"],
    .premium-field input[type="password"] {
        min-height: 60px;
        padding: 17px 18px;
        border-radius: 20px;
        text-align: center;
        font-weight: 800;
        letter-spacing: .02em;
        background: rgba(255,255,255,.08);
    }

    .premium-field input::placeholder {
        color: rgba(230, 238, 255, .48);
        font-weight: 800;
    }

    .premium-auth-submit {
        min-height: 60px;
        margin-top: 2px;
        border-radius: 21px;
        font-size: 16px;
        font-weight: 900;
    }

    .auth-mobile-note {
        display: none;
    }
}

@media (max-width: 390px) {
    .premium-login-shell {
        padding-left: 12px;
        padding-right: 12px;
    }

    .premium-login-card {
        padding: 22px 18px 18px;
        border-radius: 28px;
    }

    .premium-auth-logo {
        width: 68px;
        height: 68px;
        border-radius: 22px;
        font-size: 22px;
    }

    .premium-auth-heading h2 {
        font-size: 30px;
    }

    .premium-field input[type="text"],
    .premium-field input[type="password"],
    .premium-auth-submit {
        min-height: 56px;
    }
}


@media (max-width: 820px) and (max-height: 650px) {
    .premium-login-shell {
        place-items: start center;
    }
}

/* =========================================================
   FIX PWA LOGIN MOBILE — wygląd jak ekran aplikacji
   Dotyczy wyłącznie strony logowania na małych ekranach.
   ========================================================= */
@media (max-width: 820px) {
    body.portal-body.auth-body.premium-login-body {
        min-height: 100dvh;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        background:
            radial-gradient(circle at 18% -6%, rgba(79, 140, 255, 0.38), transparent 34%),
            radial-gradient(circle at 92% 18%, rgba(45, 212, 191, 0.22), transparent 31%),
            linear-gradient(160deg, #050b16 0%, #081426 50%, #101a35 100%);
    }

    body.portal-body.auth-body.premium-login-body .premium-login-shell {
        min-height: 100dvh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
    }

    body.portal-body.auth-body.premium-login-body .premium-login-hero {
        display: none !important;
    }

    body.portal-body.auth-body.premium-login-body .premium-login-wrap {
        width: 100%;
        min-height: auto;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    body.portal-body.auth-body.premium-login-body .premium-login-card {
        width: min(100%, 420px);
        max-width: 420px;
        padding: 28px 22px 24px;
        border-radius: 30px;
        background: linear-gradient(145deg, rgba(11, 23, 40, 0.91), rgba(12, 18, 36, 0.76));
    }

    body.portal-body.auth-body.premium-login-body .auth-card-top {
        justify-content: center;
        margin-bottom: 22px;
    }

    body.portal-body.auth-body.premium-login-body .premium-auth-logo {
        width: 72px;
        height: 72px;
        border-radius: 24px;
        font-size: 21px;
    }

    body.portal-body.auth-body.premium-login-body .auth-secure-pill {
        display: none;
    }

    body.portal-body.auth-body.premium-login-body .premium-auth-heading {
        text-align: center;
    }

    body.portal-body.auth-body.premium-login-body .auth-card-eyebrow {
        margin-bottom: 8px;
        font-size: 11px;
        letter-spacing: 0.18em;
    }

    body.portal-body.auth-body.premium-login-body .premium-auth-heading h2 {
        margin-bottom: 8px;
        font-size: clamp(30px, 8.8vw, 38px);
        letter-spacing: -0.045em;
    }

    body.portal-body.auth-body.premium-login-body .premium-auth-heading .muted {
        margin: 0 0 24px;
        font-size: 14px;
        line-height: 1.4;
        color: rgba(226, 236, 255, 0.68);
    }

    body.portal-body.auth-body.premium-login-body .premium-auth-form {
        gap: 14px;
    }

    body.portal-body.auth-body.premium-login-body .premium-field span {
        font-size: 12px;
    }

    body.portal-body.auth-body.premium-login-body .premium-field input[type="text"],
    body.portal-body.auth-body.premium-login-body .premium-field input[type="password"] {
        min-height: 58px;
        border-radius: 19px;
        font-size: 16px;
    }

    body.portal-body.auth-body.premium-login-body .premium-auth-submit {
        min-height: 60px;
        margin-top: 4px;
        border-radius: 20px;
        font-size: 16px;
    }

    body.portal-body.auth-body.premium-login-body .auth-mobile-note {
        display: none;
    }

    body.portal-body.auth-body.premium-login-body .auth-bg-grid {
        opacity: 0.10;
        background-size: 36px 36px;
    }

    body.portal-body.auth-body.premium-login-body .auth-bg-orb {
        opacity: 0.62;
        filter: blur(10px);
    }
}

@media (max-width: 380px) {
    body.portal-body.auth-body.premium-login-body .premium-login-shell {
        padding-left: 10px;
        padding-right: 10px;
    }

    body.portal-body.auth-body.premium-login-body .premium-login-card {
        padding: 24px 18px 20px;
        border-radius: 26px;
    }

    body.portal-body.auth-body.premium-login-body .premium-auth-logo {
        width: 64px;
        height: 64px;
        border-radius: 22px;
    }
}


/* =========================================================
   FIX MOBILE LOGIN FULL BLEED — usuwa białe marginesy góra/dół
   Dotyczy wyłącznie strony logowania/PWA.
   ========================================================= */
html.premium-login-page {
    min-height: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: #050b16;
}

html.premium-login-page,
html.premium-login-page body.portal-body.auth-body.premium-login-body {
    background:
        radial-gradient(circle at 18% -6%, rgba(79, 140, 255, 0.38), transparent 34%),
        radial-gradient(circle at 92% 18%, rgba(45, 212, 191, 0.22), transparent 31%),
        linear-gradient(160deg, #050b16 0%, #081426 50%, #101a35 100%);
    background-color: #050b16;
}

body.portal-body.auth-body.premium-login-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    width: 100%;
    background-attachment: scroll;
}

body.portal-body.auth-body.premium-login-body::before {
    content: '';
    position: fixed;
    inset: -120px;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% -6%, rgba(79, 140, 255, 0.38), transparent 34%),
        radial-gradient(circle at 92% 18%, rgba(45, 212, 191, 0.22), transparent 31%),
        linear-gradient(160deg, #050b16 0%, #081426 50%, #101a35 100%);
    background-color: #050b16;
}

body.portal-body.auth-body.premium-login-body .premium-login-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    background: transparent;
}

@media (max-width: 820px) {
    html.premium-login-page {
        background-color: #050b16;
        overscroll-behavior-y: none;
    }

    body.portal-body.auth-body.premium-login-body {
        min-height: 100svh;
        min-height: 100dvh;
        background-color: #050b16;
        overscroll-behavior-y: none;
    }

    body.portal-body.auth-body.premium-login-body .premium-login-shell {
        min-height: 100svh;
        min-height: 100dvh;
        box-sizing: border-box;
        padding-top: max(18px, env(safe-area-inset-top));
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }
}

@supports (-webkit-touch-callout: none) {
    html.premium-login-page,
    body.portal-body.auth-body.premium-login-body {
        background-color: #050b16;
    }

    body.portal-body.auth-body.premium-login-body .premium-login-shell {
        min-height: -webkit-fill-available;
    }
}


/* =========================================================
   GLOBAL LOADING + PWA UPDATE
   ========================================================= */
.app-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 20% 0%, rgba(79, 140, 255, 0.28), transparent 34%),
        radial-gradient(circle at 85% 95%, rgba(45, 212, 191, 0.18), transparent 34%),
        rgba(5, 11, 22, 0.88);
    backdrop-filter: blur(20px) saturate(150%);
    opacity: 1;
    visibility: visible;
    transform: translateZ(0);
    transition: opacity .28s ease, visibility .28s ease;
}

.app-loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.app-loading-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-loading-card {
    width: min(100%, 250px);
    min-height: 220px;
    padding: 28px 22px;
    border-radius: 34px;
    display: grid;
    place-items: center;
    gap: 17px;
    text-align: center;
    color: #f6f8ff;
    background: linear-gradient(145deg, rgba(15, 27, 50, .88), rgba(8, 14, 30, .74));
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 30px 90px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.12);
    animation: appLoaderCardIn .34s cubic-bezier(.2,.9,.2,1) both;
}

.app-loading-logo {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    font-weight: 900;
    letter-spacing: -.04em;
    background:
        linear-gradient(135deg, rgba(255,255,255,.24), rgba(255,255,255,.04)),
        linear-gradient(135deg, #4f8cff 0%, #7c5cff 52%, #2dd4bf 100%);
    box-shadow: 0 18px 38px rgba(79,140,255,.28), inset 0 1px 0 rgba(255,255,255,.28);
    animation: appLoaderLogoPulse 1.45s ease-in-out infinite;
}

.app-loading-spinner {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 3px solid rgba(255,255,255,.16);
    border-top-color: #8ee7ff;
    animation: appLoaderSpin .82s linear infinite;
}

.app-loading-text {
    font-size: 13px;
    font-weight: 800;
    color: rgba(230, 240, 255, .78);
}

@keyframes appLoaderSpin {
    to { transform: rotate(360deg); }
}

@keyframes appLoaderCardIn {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes appLoaderLogoPulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.045); filter: brightness(1.08); }
}

html.app-is-loading,
html.app-is-loading body {
    cursor: progress;
}


.pwa-update-banner {
    position: fixed;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 99998;
    width: min(calc(100vw - 28px), 480px);
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(10, 16, 32, .94);
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 22px 70px rgba(0,0,0,.38);
    backdrop-filter: blur(18px);
    color: var(--premium-text-main);
}

.pwa-update-banner strong,
.pwa-update-banner span {
    display: block;
}

.pwa-update-banner strong {
    font-size: 14px;
    margin-bottom: 3px;
}

.pwa-update-banner span {
    font-size: 12px;
    color: rgba(220, 231, 255, .72);
    line-height: 1.35;
}

.pwa-update-banner button {
    border: 0;
    border-radius: 16px;
    min-height: 42px;
    padding: 0 14px;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    cursor: pointer;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .app-loading-card {
        width: min(100%, 220px);
        min-height: 205px;
        border-radius: 30px;
    }

    .app-loading-logo {
        width: 66px;
        height: 66px;
        border-radius: 22px;
    }

    .pwa-update-banner {
        align-items: stretch;
        flex-direction: column;
        bottom: calc(86px + env(safe-area-inset-bottom));
    }

    .pwa-update-banner button {
        width: 100%;
    }

    body.portal-body.auth-body.premium-login-body .pwa-update-banner {
        bottom: calc(18px + env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-loading-spinner {
        animation-duration: 1.8s;
    }

    .app-loading-card,
    .app-loading-logo {
        animation: none;
    }
}

/* Login PWA gate: blokada logowania z telefonu poza trybem aplikacji */
.login-pwa-gate {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 20% 10%, rgba(56, 189, 248, .28), transparent 34%),
        radial-gradient(circle at 80% 0%, rgba(129, 140, 248, .24), transparent 32%),
        rgba(3, 7, 18, .94);
    backdrop-filter: blur(22px);
    color: #f8fbff;
}

.login-pwa-gate.is-visible {
    display: flex;
}

.pwa-login-gate-open,
.pwa-login-gate-open body {
    overflow: hidden;
    touch-action: none;
}

.login-pwa-gate-card {
    width: min(100%, 520px);
    max-height: calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow: auto;
    border-radius: 32px;
    padding: 28px 20px 20px;
    text-align: center;
    background: linear-gradient(180deg, rgba(15, 23, 42, .96), rgba(2, 6, 23, .98));
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 32px 100px rgba(0, 0, 0, .54), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.login-pwa-gate-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    font-weight: 950;
    letter-spacing: -.05em;
    color: #02111f;
    background: linear-gradient(135deg, #7dd3fc, #a7f3d0);
    box-shadow: 0 22px 50px rgba(45, 212, 191, .26), inset 0 1px 0 rgba(255, 255, 255, .32);
}

.login-pwa-gate-eyebrow {
    margin: 0 0 8px;
    color: rgba(191, 219, 254, .9);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.login-pwa-gate-card h2 {
    margin: 0;
    font-size: clamp(25px, 7vw, 38px);
    line-height: 1.02;
    letter-spacing: -.055em;
}

.login-pwa-gate-lead {
    margin: 14px auto 0;
    max-width: 430px;
    color: rgba(226, 232, 240, .82);
    line-height: 1.55;
    font-weight: 750;
}

.login-pwa-gate-warning {
    margin-top: 16px;
    padding: 13px 14px;
    border-radius: 20px;
    color: rgba(254, 249, 195, .96);
    background: rgba(251, 191, 36, .11);
    border: 1px solid rgba(251, 191, 36, .22);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 850;
}

.login-pwa-gate-actions {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.login-pwa-gate-primary,
.login-pwa-gate-secondary {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 18px;
    padding: 0 16px;
    font-weight: 950;
    cursor: pointer;
}

.login-pwa-gate-primary {
    color: #02111f;
    background: linear-gradient(135deg, #7dd3fc, #a7f3d0);
    box-shadow: 0 16px 34px rgba(45, 212, 191, .22);
}

.login-pwa-gate-secondary {
    color: #f8fbff;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .14);
}

.login-pwa-gate-primary:disabled,
.login-pwa-gate-secondary:disabled {
    cursor: progress;
    opacity: .72;
}

.login-pwa-gate-hint {
    margin: 12px 0 0;
    color: rgba(203, 213, 225, .76);
    font-size: 12px;
    line-height: 1.45;
    font-weight: 700;
}

.login-pwa-gate-manual {
    margin-top: 14px;
    text-align: left;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .11);
}

.login-pwa-gate-manual strong {
    display: block;
    margin-bottom: 10px;
}

.login-pwa-gate-manual ol {
    margin: 0;
    padding-left: 20px;
    color: rgba(226, 232, 240, .86);
    line-height: 1.55;
    font-weight: 750;
}

@media (min-width: 821px) and (pointer: fine) {
    .login-pwa-gate.is-visible {
        display: none;
    }

    .pwa-login-gate-open,
    .pwa-login-gate-open body {
        overflow: auto;
        touch-action: auto;
    }
}

@media (display-mode: standalone) {
    .login-pwa-gate,
    .login-pwa-gate.is-visible {
        display: none !important;
    }
}

/* Punkt 5: osobne sekcje Backup i Moduły */
.admin-tool-links,
.backup-list {
    display: grid;
    gap: 14px;
}

.admin-tool-link,
.backup-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.055);
    color: inherit;
    text-decoration: none;
}

.admin-tool-link {
    justify-content: flex-start;
}

.admin-tool-link > span {
    width: 46px;
    height: 46px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    flex: 0 0 auto;
}

.admin-tool-link strong,
.backup-card strong {
    display: block;
}

.admin-tool-link small,
.backup-card small {
    display: block;
    color: rgba(255, 255, 255, 0.68);
    margin-top: 4px;
}

.admin-tool-link:hover,
.backup-card:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.22);
}

.backup-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.backup-main .module-title {
    word-break: break-word;
}

.backup-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.inline-form button.premium-hero-action {
    border: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.backup-scope-list code {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 760px) {
    .backup-card {
        align-items: stretch;
        flex-direction: column;
    }

    .backup-actions,
    .backup-actions form,
    .backup-actions a,
    .backup-actions button {
        width: 100%;
    }
}


/* ===== INLINE: public/css/premium-ui.css ===== */

/* =========================================================
   PREMIUM UI v6.1 — karty, formularze, sidebar, dashboard i bezpieczne mikroanimacje
   ========================================================= */
:root {
    --portal-surface: linear-gradient(145deg, rgba(255,255,255,.092), rgba(255,255,255,.042));
    --portal-surface-soft: linear-gradient(145deg, rgba(255,255,255,.072), rgba(255,255,255,.032));
    --portal-surface-hover: linear-gradient(145deg, rgba(255,255,255,.118), rgba(255,255,255,.052));
    --portal-border: rgba(255,255,255,.12);
    --portal-border-strong: rgba(255,255,255,.19);
    --portal-text: #f7f9ff;
    --portal-muted: rgba(199,215,239,.78);
    --portal-muted-strong: rgba(220,231,255,.88);
    --portal-input-bg: rgba(6, 13, 27, .58);
    --portal-input-bg-focus: rgba(8, 18, 38, .78);
    --portal-input-border: rgba(255,255,255,.13);
    --portal-accent: linear-gradient(135deg, #4f8cff 0%, #7c5cff 54%, #2dd4bf 100%);
    --portal-accent-soft: linear-gradient(135deg, rgba(79,140,255,.20), rgba(45,212,191,.11));
    --portal-danger: linear-gradient(135deg, rgba(239,68,68,.94), rgba(244,63,94,.86));
    --portal-warning: linear-gradient(135deg, rgba(245,158,11,.92), rgba(249,115,22,.84));
    --portal-success: linear-gradient(135deg, rgba(16,185,129,.92), rgba(34,197,94,.84));
    --portal-radius-xs: 12px;
    --portal-radius-sm: 16px;
    --portal-radius-md: 22px;
    --portal-radius-lg: 28px;
    --portal-shadow-card: 0 22px 70px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.075);
    --portal-shadow-soft: 0 14px 38px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.055);
    --portal-shadow-button: 0 16px 36px rgba(79,140,255,.26), inset 0 1px 0 rgba(255,255,255,.20);
}

:where(body, button, input, select, textarea) {
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

:where(a, button, input, select, textarea) {
    transition:
        background .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease,
        opacity .18s ease;
}

/* Główne kontenery i karty */
:where(
    .hero-card,
    .glass-card,
    .module-card,
    .tile-card,
    .quick-card,
    .logo-card,
    .user-chip,
    .empty-box,
    .dashboard-live-panel,
    .module-accordion,
    .auth-panel-info,
    .auth-card,
    .auth-feature-card,
    .profile-style-card,
    .toolbar-card,
    .module-intro-card,
    .admin-picker-card,
    .worker-top-summary-card,
    .comm-hero-card,
    .comm-layout-card,
    .comm-card,
    .comm-filter-card,
    .upload-card,
    .preview-card,
    .template-card,
    .report-card,
    .publish-state-card,
    .action-tile,
    .requests-page .action-card,
    .request-row,
    .filter-box,
    .compact-form,
    .info-card,
    .timeline-card,
    .open-swap-card,
    .queue-card,
    .stat-card,
    .settlement-hero,
    .settlement-main-card,
    .settlement-list-card,
    .settlement-summary-card,
    .settlement-modal-card,
    .settlement-action-tile,
    .settlement-stat-card,
    .settlement-panel-card,
    .settlement-empty,
    .settlement-employee-card,
    .settlement-status-card,
    .users-hero-card,
    .users-toolbar-card,
    .users-list-card,
    .users-form-card,
    .modal-card,
    .modal-window,
    .settlement-modal-card,
    .qr-card,
    .comment-box
) {
    border-radius: var(--portal-radius-lg) !important;
    border: 1px solid var(--portal-border) !important;
    box-shadow: var(--portal-shadow-card) !important;
    backdrop-filter: blur(20px) saturate(138%);
}

:where(
    .hero-card,
    .glass-card,
    .module-card,
    .auth-panel-info,
    .auth-card,
    .profile-style-card,
    .toolbar-card,
    .module-intro-card,
    .comm-hero-card,
    .comm-layout-card,
    .settlement-hero,
    .settlement-main-card,
    .settlement-list-card,
    .settlement-summary-card,
    .settlement-modal-card,
    .settlement-panel-card,
    .users-hero-card,
    .users-toolbar-card,
    .users-list-card,
    .users-form-card,
    .modal-card,
    .modal-window
) {
    background:
        radial-gradient(circle at 100% 0%, rgba(79,140,255,.13), transparent 34%),
        var(--portal-surface) !important;
}

:where(
    .tile-card,
    .quick-card,
    .summary-box,
    .rcp-stat,
    .action-tile,
    .requests-page .action-card,
    .queue-card,
    .stat-card,
    .comm-card,
    .settlement-action-tile,
    .settlement-stat-card,
    .settlement-employee-card,
    .settlement-status-card,
    .auth-feature-card,
    .module-accordion,
    .dashboard-live-panel,
    .qr-card,
    .comment-box
) {
    box-shadow: var(--portal-shadow-soft) !important;
}

:where(
    .tile-card,
    .quick-card,
    .module-card,
    .profile-style-card,
    .comm-card,
    .action-tile,
    .requests-page .action-card,
    .queue-card,
    .stat-card,
    .settlement-employee-card
):hover {
    border-color: var(--portal-border-strong) !important;
    transform: translateY(-2px);
}

:where(.module-card, .glass-card, .hero-card, .comm-hero-card, .settlement-hero, .users-hero-card)::before {
    opacity: .75;
}

/* Ikony w kartach */
:where(
    .module-icon,
    .module-page-icon,
    .quick-icon,
    .action-icon,
    .attention-icon,
    .activity-icon,
    .auth-feature-icon,
    .comm-icon-tile,
    .action-tile-icon,
    .settlement-action-icon,
    .stat-card-create-icon,
    .users-hero-icon,
    .logo-icon
) {
    border-radius: 18px !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.045)),
        var(--portal-accent-soft) !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 14px 30px rgba(79,140,255,.16) !important;
}

/* Przyciski */
:where(
    .btn-primary,
    .primary-btn,
    .action-submit,
    .modal-submit,
    .hero-btn,
    .tile-action-btn,
    .month-switcher-submit,
    .publish-state-btn,
    .settlement-inline-btn,
    .mini-btn-primary,
    .btn-success,
    button.primary,
    button[type="submit"]:not(.ghost-btn):not(.secondary):not(.danger)
) {
    min-height: 46px;
    padding: 11px 18px;
    border-radius: var(--portal-radius-sm) !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,.21), rgba(255,255,255,.045)),
        var(--portal-accent) !important;
    color: #fff !important;
    font-weight: 850 !important;
    letter-spacing: -.01em;
    box-shadow: var(--portal-shadow-button) !important;
}

:where(
    .btn-secondary,
    .secondary-btn,
    .btn-ghost,
    .ghost-btn,
    .action-cancel,
    .modal-cancel,
    .tile-action-btn-secondary,
    .soft-action-btn,
    .mini-btn,
    .mini-btn-glass,
    .tab-btn,
    .icon-chip-btn,
    .button-link.ghost,
    button.secondary,
    .settlement-close-btn,
    .modal-close
) {
    min-height: 42px;
    border-radius: var(--portal-radius-sm) !important;
    border: 1px solid rgba(255,255,255,.13) !important;
    background: linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.045)) !important;
    color: var(--portal-text) !important;
    font-weight: 800 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.075), 0 10px 26px rgba(0,0,0,.14) !important;
}

:where(
    .btn-danger,
    .mini-danger,
    .inline-remove-btn,
    button.danger
) {
    border-radius: var(--portal-radius-sm) !important;
    border: 1px solid rgba(255,255,255,.16) !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.035)),
        var(--portal-danger) !important;
    color: #fff !important;
    box-shadow: 0 14px 32px rgba(239,68,68,.22), inset 0 1px 0 rgba(255,255,255,.13) !important;
}

:where(.mini-warning, button.warning) {
    border-radius: var(--portal-radius-sm) !important;
    background: var(--portal-warning) !important;
    color: #fff !important;
}

:where(
    .btn-primary,
    .primary-btn,
    .action-submit,
    .modal-submit,
    .hero-btn,
    .tile-action-btn,
    .month-switcher-submit,
    .publish-state-btn,
    .settlement-inline-btn,
    .mini-btn-primary,
    .btn-success,
    .btn-secondary,
    .secondary-btn,
    .btn-ghost,
    .ghost-btn,
    .action-cancel,
    .modal-cancel,
    .tile-action-btn-secondary,
    .soft-action-btn,
    .mini-btn,
    .tab-btn,
    .icon-chip-btn,
    button.primary,
    button.secondary,
    button.danger,
    .button-link
):hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

:where(button, .btn, .mini-btn, .tile-action-btn, .tile-action-btn-secondary, .soft-action-btn, .ghost-btn, .button-link):disabled,
:where(button, .btn, .mini-btn, .tile-action-btn, .tile-action-btn-secondary, .soft-action-btn, .ghost-btn, .button-link).is-disabled {
    opacity: .54 !important;
    cursor: not-allowed !important;
    transform: none !important;
    filter: none !important;
}

/* Pola formularzy */
:where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea
) {
    width: 100%;
    min-height: 46px;
    border-radius: var(--portal-radius-sm) !important;
    border: 1px solid var(--portal-input-border) !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)),
        var(--portal-input-bg) !important;
    color: var(--portal-text) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.052), 0 10px 24px rgba(0,0,0,.10) !important;
    outline: none !important;
}

:where(textarea) {
    line-height: 1.5;
}

:where(select) {
    color-scheme: dark;
}

:where(option) {
    background: #0b1426;
    color: #f7f9ff;
}

:where(input::placeholder, textarea::placeholder) {
    color: rgba(199,215,239,.50) !important;
}

:where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
    select:focus,
    textarea:focus
) {
    background:
        linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018)),
        var(--portal-input-bg-focus) !important;
    border-color: rgba(79,140,255,.56) !important;
    box-shadow:
        0 0 0 4px rgba(79,140,255,.16),
        inset 0 1px 0 rgba(255,255,255,.07),
        0 14px 30px rgba(0,0,0,.14) !important;
}

:where(label span, .field span, .form-grid span, .compact-form span, .report-label, .component-type, .summary-label, .settlement-filter-grid span, .settlement-form-grid span) {
    color: var(--portal-muted-strong) !important;
    letter-spacing: .045em;
}

:where(.muted, .small, .module-muted, .section-subcopy, .tile-desc, .quick-text, .comm-card-main p, .settlement-subcopy, .auth-lead, .auth-feature-card p) {
    color: var(--portal-muted) !important;
}

/* Modale i tła modalne */
:where(.modal-backdrop, .overlay, .settlement-modal-backdrop) {
    background: rgba(2, 6, 23, .74) !important;
    backdrop-filter: blur(14px) saturate(135%);
}

:where(.modal-card, .modal-window, .settlement-modal-card) {
    background:
        radial-gradient(circle at top right, rgba(79,140,255,.15), transparent 34%),
        linear-gradient(145deg, rgba(10,18,34,.96), rgba(7,13,26,.94)) !important;
}

/* Stany i komunikaty */
:where(.alert, .module-alert) {
    border-radius: var(--portal-radius-sm) !important;
    border: 1px solid rgba(255,255,255,.13) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 12px 30px rgba(0,0,0,.14);
}

:where(.status, .status-chip, .status-badge, .hero-badge, .section-kicker, .premium-badge) {
    border-radius: 999px !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

/* Drobne wygładzenie tabel bez pełnego redesignu */
:where(.table-wrap, .table-card, .settlement-table-wrap) {
    border-radius: var(--portal-radius-md) !important;
    border: 1px solid rgba(255,255,255,.09) !important;
    background: rgba(255,255,255,.025) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

:where(table th) {
    color: rgba(220,231,255,.88) !important;
}

@media (max-width: 760px) {
    :where(
        .btn-primary,
        .primary-btn,
        .action-submit,
        .modal-submit,
        .hero-btn,
        .tile-action-btn,
        .tile-action-btn-secondary,
        .soft-action-btn,
        .secondary-btn,
        .btn-secondary,
        .ghost-btn,
        .mini-btn,
        button.primary,
        button.secondary,
        button.danger
    ) {
        min-height: 48px;
    }

    :where(
        .hero-card,
        .glass-card,
        .module-card,
        .tile-card,
        .quick-card,
        .profile-style-card,
        .comm-hero-card,
        .settlement-hero,
        .users-hero-card,
        .modal-card,
        .modal-window
    ) {
        border-radius: 22px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    :where(a, button, input, select, textarea, .module-card, .tile-card, .quick-card, .comm-card, .action-tile, .stat-card, .queue-card) {
        transition: none !important;
    }
}

/* =========================================================
   PREMIUM SIDEBAR v6.1 — nawigacja boczna i mobile bottom bar
   ========================================================= */
:root {
    --sidebar-width: 288px;
    --sidebar-bg: linear-gradient(180deg, rgba(12, 19, 38, .94), rgba(6, 10, 24, .90));
    --sidebar-border: rgba(255,255,255,.105);
    --sidebar-link: rgba(220,231,255,.80);
    --sidebar-link-muted: rgba(159,176,208,.72);
    --sidebar-link-hover: rgba(255,255,255,.085);
    --sidebar-active-bg: linear-gradient(135deg, rgba(79,140,255,.23), rgba(45,212,191,.105));
    --sidebar-active-border: rgba(114,177,255,.25);
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 22px 18px;
    background:
        radial-gradient(circle at 28px 18px, rgba(79,140,255,.18), transparent 26%),
        radial-gradient(circle at 100% 18%, rgba(45,212,191,.12), transparent 30%),
        var(--sidebar-bg) !important;
    border-right: 1px solid var(--sidebar-border) !important;
    box-shadow:
        22px 0 70px rgba(0,0,0,.24),
        inset -1px 0 0 rgba(255,255,255,.035);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.20) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.16);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.logo-card {
    position: relative;
    overflow: hidden;
    min-height: 78px;
    padding: 14px !important;
    margin-bottom: 14px !important;
    border-radius: 24px !important;
    background:
        radial-gradient(circle at 100% 0%, rgba(45,212,191,.16), transparent 36%),
        linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.045)) !important;
}

.logo-card::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.11), transparent 38%, rgba(255,255,255,.035));
    opacity: .7;
}

.logo-icon {
    position: relative;
    z-index: 1;
    width: 48px !important;
    height: 48px !important;
    flex: 0 0 48px !important;
    border-radius: 18px !important;
    font-size: 18px !important;
    letter-spacing: -.04em;
}

.logo-title,
.logo-sub {
    position: relative;
    z-index: 1;
}

.logo-title {
    font-size: 17px !important;
    font-weight: 900 !important;
    letter-spacing: -.035em;
}

.logo-sub {
    font-size: 11px !important;
    color: var(--sidebar-link-muted) !important;
    font-weight: 750;
    letter-spacing: .02em;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.09);
    background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.032));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.065), 0 12px 34px rgba(0,0,0,.16);
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.20), rgba(255,255,255,.05)),
        var(--portal-accent-soft);
    border: 1px solid rgba(255,255,255,.12);
    color: #fff;
    font-size: 13px;
    font-weight: 950;
    letter-spacing: -.03em;
    box-shadow: 0 12px 26px rgba(79,140,255,.14);
}

.sidebar-user-meta {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.sidebar-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: 13px;
    font-weight: 850;
    letter-spacing: -.02em;
}

.sidebar-user-role {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sidebar-link-muted);
    font-size: 11px;
    font-weight: 750;
    text-transform: capitalize;
}

.menu-section-label {
    margin: 18px 10px 9px !important;
    color: rgba(159,176,208,.70) !important;
    font-size: 10.5px !important;
    font-weight: 900;
    letter-spacing: .14em !important;
}

.menu {
    gap: 6px !important;
}

.menu-link {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 11px;
    min-height: 48px;
    padding: 11px 12px 11px 13px !important;
    color: var(--sidebar-link) !important;
    border-radius: 17px !important;
    border: 1px solid transparent;
    background: transparent !important;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -.015em;
    overflow: hidden;
}

.menu-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 0;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(180deg, var(--premium-accent), var(--premium-accent-2));
    box-shadow: 0 0 18px rgba(79,140,255,.52);
    transform: translateY(-50%);
    opacity: 0;
    transition: height .18s ease, opacity .18s ease;
}

.menu-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,0) 42%);
    opacity: 0;
    transition: opacity .18s ease;
}

.menu-link:hover {
    color: #fff !important;
    background: var(--sidebar-link-hover) !important;
    border-color: rgba(255,255,255,.07);
    transform: translateX(2px);
}

.menu-link:hover::after {
    opacity: .55;
}

.menu-link.active {
    color: #fff !important;
    background: var(--sidebar-active-bg) !important;
    border-color: var(--sidebar-active-border) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.12),
        0 12px 30px rgba(45,95,180,.18) !important;
}

.menu-link.active::before {
    height: 26px;
    opacity: 1;
}

.menu-link.active::after {
    opacity: .78;
}

.menu-link-icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 13px;
    color: rgba(220,231,255,.80);
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.07);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.menu-link:hover .menu-link-icon,
.menu-link.active .menu-link-icon {
    color: #fff;
    background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.055));
    border-color: rgba(255,255,255,.13);
    box-shadow: 0 12px 24px rgba(79,140,255,.14), inset 0 1px 0 rgba(255,255,255,.12);
}

.menu-link-icon .app-icon {
    width: 18px !important;
    height: 18px !important;
    stroke-width: 2.15;
}

.menu-link-text {
    position: relative;
    z-index: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-link.danger {
    margin-top: 2px;
    color: rgba(255,190,190,.88) !important;
}

.menu-link.danger:hover {
    background: linear-gradient(135deg, rgba(239,68,68,.17), rgba(244,63,94,.08)) !important;
    border-color: rgba(248,113,113,.18);
}

.menu-link.danger .menu-link-icon {
    color: rgba(255,190,190,.92);
}

.mobile-header {
    box-shadow: 0 14px 40px rgba(0,0,0,.22), inset 0 -1px 0 rgba(255,255,255,.055);
}

.mobile-menu-btn,
.mobile-profile-btn {
    border: 1px solid rgba(255,255,255,.12) !important;
    background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.045)) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 10px 24px rgba(0,0,0,.16);
}

.mobile-bottom-nav {
    border-radius: 26px !important;
}

.mobile-bottom-link {
    position: relative;
    overflow: hidden;
}

.mobile-bottom-link::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 5px;
    width: 18px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--premium-accent), var(--premium-accent-2));
    transform: translateX(-50%) scaleX(.4);
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
}

.mobile-bottom-link.active::before {
    opacity: .95;
    transform: translateX(-50%) scaleX(1);
}

.mobile-bottom-icon {
    display: grid !important;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 11px;
}

.mobile-bottom-link.active .mobile-bottom-icon {
    background: rgba(255,255,255,.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

@media (max-width: 980px) {
    .sidebar {
        position: fixed;
        height: 100dvh;
        padding: calc(env(safe-area-inset-top) + 18px) 16px calc(110px + env(safe-area-inset-bottom)) !important;
        border-radius: 0 28px 28px 0;
        box-shadow: 32px 0 70px rgba(0,0,0,.42), inset -1px 0 0 rgba(255,255,255,.045);
    }

    .sidebar-backdrop.show {
        background: rgba(2,6,18,.62) !important;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .logo-card {
        min-height: 74px;
    }
}

/* === Premium UI step 5: czytelniejszy dashboard === */
.premium-dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 28px;
}

.premium-dashboard-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 32px;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(79, 140, 255, 0.34), transparent 34%),
        radial-gradient(circle at 82% 20%, rgba(45, 212, 191, 0.22), transparent 30%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.115), rgba(255, 255, 255, 0.045));
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.premium-dashboard-hero::before {
    content: "";
    position: absolute;
    inset: -40% auto auto -18%;
    width: 360px;
    height: 360px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    filter: blur(18px);
    pointer-events: none;
}

.premium-dashboard-hero::after {
    content: "";
    position: absolute;
    inset: auto -10% -48% auto;
    width: 420px;
    height: 420px;
    border-radius: 999px;
    background: rgba(124, 92, 255, 0.14);
    filter: blur(20px);
    pointer-events: none;
}

.premium-hero-content,
.premium-hero-status {
    position: relative;
    z-index: 1;
}

.premium-hero-content h2 {
    margin: 7px 0 10px;
    font-size: clamp(2rem, 4.5vw, 4.4rem);
    line-height: 0.95;
    letter-spacing: -0.075em;
    color: var(--text-main, #f7f9ff);
}

.premium-hero-content p {
    max-width: 660px;
    margin: 0;
    color: var(--text-muted, #9fb0d0);
    font-size: 1.02rem;
    line-height: 1.65;
}

.premium-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.premium-hero-action {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 9px 14px 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.075);
    color: rgba(247, 249, 255, 0.9);
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.premium-hero-action:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.11);
}

.premium-hero-action span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.premium-hero-action .app-icon {
    width: 16px;
    height: 16px;
}

.premium-hero-action-primary {
    background: linear-gradient(135deg, rgba(79, 140, 255, 0.28), rgba(45, 212, 191, 0.14));
    border-color: rgba(79, 140, 255, 0.32);
}

.premium-hero-status {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 230px;
    padding: 22px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(180deg, rgba(7, 11, 20, 0.42), rgba(7, 11, 20, 0.18));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.premium-hero-date {
    color: rgba(247, 249, 255, 0.62);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.premium-hero-status-label {
    margin-top: auto;
    color: rgba(247, 249, 255, 0.68);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.premium-hero-status-value {
    margin-top: 6px;
    font-size: clamp(2.1rem, 6vw, 4.2rem);
    line-height: 0.95;
    font-weight: 950;
    letter-spacing: -0.08em;
    color: #fff;
}

.premium-hero-status-text {
    margin-top: 12px;
    color: rgba(247, 249, 255, 0.72);
    line-height: 1.45;
    font-size: 0.95rem;
}

.premium-hero-status-success { background: linear-gradient(180deg, rgba(34, 197, 94, 0.20), rgba(255, 255, 255, 0.055)); }
.premium-hero-status-warning { background: linear-gradient(180deg, rgba(245, 158, 11, 0.22), rgba(255, 255, 255, 0.055)); }
.premium-hero-status-info { background: linear-gradient(180deg, rgba(79, 140, 255, 0.22), rgba(255, 255, 255, 0.055)); }

.premium-insights-row,
.premium-admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.premium-insights-row-admin { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.premium-insight-card,
.premium-admin-kpi {
    position: relative;
    overflow: hidden;
    min-height: 146px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.062);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.09);
    color: var(--text-main, #f7f9ff);
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.premium-insight-card:hover,
.premium-admin-kpi:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.09);
}

.premium-insight-card::before,
.premium-admin-kpi::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    opacity: .95;
    background: linear-gradient(90deg, var(--accent, #4f8cff), var(--accent-2, #2dd4bf));
}

.premium-insight-icon,
.premium-admin-kpi > span {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.premium-insight-icon .app-icon,
.premium-admin-kpi .app-icon { width: 20px; height: 20px; }

.premium-insight-label {
    display: block;
    min-height: 18px;
    color: rgba(247, 249, 255, 0.62);
    font-size: 0.77rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.premium-insight-card strong,
.premium-admin-kpi strong {
    display: block;
    margin-top: 8px;
    font-size: 2.05rem;
    line-height: 1;
    letter-spacing: -0.06em;
    color: #fff;
}

.premium-insight-card small,
.premium-admin-kpi small {
    display: block;
    margin-top: 10px;
    color: rgba(247, 249, 255, 0.64);
    line-height: 1.45;
    font-size: 0.86rem;
}

.premium-insight-success::before,
.premium-admin-kpi-success::before { background: linear-gradient(90deg, #22c55e, #2dd4bf); }
.premium-insight-warning::before,
.premium-admin-kpi-warning::before { background: linear-gradient(90deg, #f59e0b, #facc15); }
.premium-insight-danger::before,
.premium-admin-kpi-danger::before { background: linear-gradient(90deg, #ef4444, #fb7185); }
.premium-insight-info::before,
.premium-admin-kpi-info::before { background: linear-gradient(90deg, #4f8cff, #2dd4bf); }

.premium-admin-kpi {
    display: flex;
    min-height: 126px;
    gap: 15px;
    align-items: flex-start;
}

.premium-admin-kpi > span { flex: 0 0 auto; margin-bottom: 0; }
.premium-admin-kpi strong { margin-top: 0; }

.premium-dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
    gap: 22px;
    align-items: stretch;
}

.premium-admin-main-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr); }

.premium-panel {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.082), rgba(255, 255, 255, 0.046)),
        rgba(255, 255, 255, 0.03);
    box-shadow: 0 24px 68px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.premium-panel-primary {
    background:
        radial-gradient(circle at top left, rgba(79, 140, 255, 0.18), transparent 35%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045));
}

.premium-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.premium-panel-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.92);
}

.premium-panel-icon .app-icon { width: 22px; height: 22px; }

.premium-rcp-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
}

.premium-rcp-summary,
.premium-qr-panel {
    border: 1px solid rgba(255, 255, 255, 0.105);
    border-radius: 24px;
    padding: 18px;
    background: rgba(0, 0, 0, 0.13);
}

.premium-rcp-status-line {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
}

.premium-rcp-status-line span:not(.premium-status-dot) {
    display: block;
    color: rgba(247, 249, 255, 0.62);
    font-size: .8rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.premium-rcp-status-line strong {
    display: block;
    margin-top: 4px;
    color: #fff;
    font-size: 1.2rem;
    letter-spacing: -0.03em;
}

.premium-status-dot {
    position: relative;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--accent, #4f8cff);
    box-shadow: 0 0 0 7px rgba(79, 140, 255, 0.14);
}

.premium-status-success { background: #22c55e; box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.15); }
.premium-status-warning { background: #f59e0b; box-shadow: 0 0 0 7px rgba(245, 158, 11, 0.15); }
.premium-status-info { background: #4f8cff; box-shadow: 0 0 0 7px rgba(79, 140, 255, 0.15); }

.premium-mini-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 15px 0;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(247, 249, 255, 0.70);
}
.premium-mini-info strong { color: #fff; }
.premium-inline-alert { border-radius: 18px !important; }

.premium-activity-compact .activity-item,
.premium-list-clean .activity-item,
.premium-list-clean .attention-item {
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.premium-qr-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.premium-qr-box {
    align-self: center;
    width: 100%;
    max-width: 210px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.premium-side-panel { display: flex; flex-direction: column; }
.premium-action-list { display: flex; flex-direction: column; gap: 11px; }

.premium-action-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 13px;
    min-height: 70px;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(247, 249, 255, 0.92);
    text-decoration: none;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.premium-action-row:hover {
    transform: translateX(3px);
    border-color: rgba(255, 255, 255, 0.20);
    background: rgba(255, 255, 255, 0.085);
}

.premium-action-icon,
.premium-action-row i {
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #fff;
}

.premium-action-icon { width: 42px; height: 42px; background: rgba(79, 140, 255, 0.18); }
.premium-action-row i { width: 22px; height: 22px; opacity: .62; }
.premium-action-icon .app-icon,
.premium-action-row i .app-icon { width: 18px; height: 18px; }
.premium-action-row strong,
.premium-action-row small { display: block; }
.premium-action-row strong { color: #fff; font-size: .96rem; }
.premium-action-row small { margin-top: 4px; color: rgba(247, 249, 255, .58); line-height: 1.3; }
.premium-action-success .premium-action-icon { background: rgba(34, 197, 94, 0.17); }
.premium-action-warning .premium-action-icon { background: rgba(245, 158, 11, 0.18); }
.premium-action-danger .premium-action-icon { background: rgba(239, 68, 68, 0.18); }

.premium-dashboard-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}
.premium-section-wide { grid-column: 1 / -1; }
.premium-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }

.premium-small-card {
    display: flex;
    flex-direction: column;
    min-height: 138px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 21px;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(247, 249, 255, 0.88);
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.premium-small-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.20);
    background: rgba(255, 255, 255, 0.085);
}

.premium-small-card span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: auto;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.08);
}
.premium-small-card .app-icon { width: 19px; height: 19px; }
.premium-small-card strong { display: block; margin-top: 18px; color: #fff; font-size: 1rem; }
.premium-small-card small { display: block; margin-top: 6px; color: rgba(247, 249, 255, 0.60); line-height: 1.45; }

.premium-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 24px;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.04);
}

.premium-empty-state span {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 13px;
    border-radius: 19px;
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}
.premium-empty-state .app-icon { width: 25px; height: 25px; }
.premium-empty-state strong { color: #fff; font-size: 1.05rem; }
.premium-empty-state small { display: block; max-width: 390px; margin-top: 7px; color: rgba(247, 249, 255, 0.62); line-height: 1.5; }

.premium-install-form { margin-top: 8px; }
.premium-live-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.premium-live-stats div { padding: 15px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.10); background: rgba(255, 255, 255, 0.055); }
.premium-live-stats span,
.premium-live-stats strong { display: block; }
.premium-live-stats span { color: rgba(247, 249, 255, 0.62); font-size: 0.78rem; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.premium-live-stats strong { margin-top: 8px; color: #fff; font-size: 2rem; line-height: 1; letter-spacing: -0.06em; }

.premium-rcp-presence-card,
.premium-detail-panel,
.premium-modules-panel { padding: 24px; }
.premium-rcp-status-grid { margin-top: 4px; }
.premium-rcp-presence-grid { margin-top: 18px; }
.premium-last-events { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.premium-module-list .module-accordion { background: rgba(255, 255, 255, 0.045); }

@media (max-width: 1280px) {
    .premium-insights-row,
    .premium-insights-row-admin,
    .premium-admin-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .premium-dashboard-main-grid,
    .premium-admin-main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
    .premium-dashboard { gap: 18px; }
    .premium-dashboard-hero { grid-template-columns: 1fr; border-radius: 26px; padding: 22px; }
    .premium-hero-status { min-height: 190px; }
    .premium-rcp-layout,
    .premium-dashboard-section-grid,
    .premium-card-grid { grid-template-columns: 1fr; }
    .premium-section-wide { grid-column: auto; }
    .premium-qr-panel { align-items: center; }
}

@media (max-width: 700px) {
    .premium-dashboard-hero,
    .premium-panel { border-radius: 22px; padding: 18px; }
    .premium-insights-row,
    .premium-insights-row-admin,
    .premium-admin-kpi-grid,
    .premium-live-stats,
    .premium-last-events { grid-template-columns: 1fr; }
    .premium-insight-card,
    .premium-admin-kpi { min-height: auto; }
    .premium-hero-actions { display: grid; grid-template-columns: 1fr; }
    .premium-panel-head { flex-direction: column; }
    .premium-action-row { grid-template-columns: 40px minmax(0, 1fr); }
    .premium-action-row i { display: none; }
}

/* =========================================================
   PREMIUM UI v6.1 — subtelne animacje i detale premium
   ========================================================= */
:root {
    --premium-ease-out: cubic-bezier(.16, 1, .3, 1);
    --premium-ease-soft: cubic-bezier(.22, .61, .36, 1);
    --premium-motion-fast: 160ms;
    --premium-motion-mid: 320ms;
    --premium-motion-slow: 720ms;
    --premium-pointer-x: 50vw;
    --premium-pointer-y: 24vh;
}

html {
    scroll-behavior: smooth;
}

@supports (font-variant-numeric: tabular-nums) {
    :where(
        .premium-hero-status-value,
        .premium-insight-card strong,
        .premium-admin-kpi strong,
        .premium-live-stats strong,
        .rcp-stat-value,
        .stat-value,
        .summary-value,
        .settlement-stat-value,
        .dashboard-stat-value,
        .kpi-value
    ) {
        font-variant-numeric: tabular-nums;
    }
}

.premium-ambient-light {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .72;
    background:
        radial-gradient(620px circle at var(--premium-pointer-x) var(--premium-pointer-y), rgba(79, 140, 255, .145), transparent 45%),
        radial-gradient(520px circle at calc(var(--premium-pointer-x) + 16vw) calc(var(--premium-pointer-y) + 8vh), rgba(45, 212, 191, .075), transparent 48%);
    transition: opacity .35s ease;
    mix-blend-mode: screen;
}

body.premium-pointer-idle .premium-ambient-light {
    opacity: .42;
}

.app-shell,
.auth-shell {
    position: relative;
    z-index: 1;
}

/* Hotfix v6.1: elementy fixed/sticky nie mogą dostać position: relative,
   bo wtedy loader, baner PWA i dolna nawigacja wchodzą w normalny układ strony. */
.app-loading-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
}

.pwa-update-banner {
    position: fixed !important;
    z-index: 99998 !important;
}

@media (max-width: 980px) {
    .mobile-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 1001 !important;
    }

    .mobile-bottom-nav {
        position: fixed !important;
        z-index: 999 !important;
    }
}

:where(.topbar, .premium-dashboard, .auth-card, .auth-hero, .sidebar, .mobile-bottom-nav) {
    animation: premiumPageRise .46s var(--premium-ease-out) both;
}

.premium-motion-ready .premium-reveal {
    opacity: 0;
    transform: translateY(16px) scale(.985);
    filter: blur(7px);
    transition:
        opacity .56s var(--premium-ease-out),
        transform .56s var(--premium-ease-out),
        filter .56s var(--premium-ease-out),
        border-color .18s ease,
        background .18s ease,
        box-shadow .18s ease;
    transition-delay: calc(min(var(--premium-reveal-index, 0), 8) * 45ms);
}

.premium-motion-ready .premium-reveal.is-in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

:where(
    .premium-dashboard-hero,
    .premium-panel,
    .premium-insight-card,
    .premium-admin-kpi,
    .hero-card,
    .glass-card,
    .module-card,
    .quick-card,
    .tile-card,
    .comm-card,
    .action-tile,
    .requests-page .action-card,
    .stat-card,
    .queue-card,
    .settlement-main-card,
    .settlement-list-card,
    .settlement-summary-card,
    .users-list-card,
    .users-form-card,
    .modal-card,
    .modal-window,
    .auth-card,
    .auth-feature-item,
    .premium-small-card,
    .premium-action-row
) {
    will-change: transform, box-shadow, border-color;
}

:where(
    .premium-dashboard-hero,
    .premium-panel,
    .premium-insight-card,
    .premium-admin-kpi,
    .hero-card,
    .glass-card,
    .module-card,
    .quick-card,
    .tile-card,
    .comm-card,
    .action-tile,
    .requests-page .action-card,
    .stat-card,
    .queue-card,
    .settlement-main-card,
    .settlement-list-card,
    .settlement-summary-card,
    .users-list-card,
    .users-form-card,
    .modal-card,
    .modal-window,
    .auth-card,
    .premium-small-card
):hover {
    box-shadow:
        0 26px 78px rgba(0, 0, 0, .32),
        0 0 0 1px rgba(255,255,255,.035),
        inset 0 1px 0 rgba(255,255,255,.11) !important;
}

:where(
    .premium-dashboard-hero,
    .premium-panel,
    .premium-insight-card,
    .premium-admin-kpi,
    .hero-card,
    .glass-card,
    .module-card,
    .quick-card,
    .tile-card,
    .comm-card,
    .action-tile,
    .requests-page .action-card,
    .stat-card,
    .queue-card,
    .settlement-main-card,
    .settlement-list-card,
    .settlement-summary-card,
    .users-list-card,
    .users-form-card,
    .modal-card,
    .modal-window,
    .auth-card,
    .premium-small-card,
    .premium-action-row,
    .menu-link,
    .mobile-bottom-link,
    .btn-primary,
    .primary-btn,
    .action-submit,
    .modal-submit,
    .hero-btn,
    .tile-action-btn,
    .btn-secondary,
    .secondary-btn,
    .ghost-btn,
    .mini-btn,
    button
) {
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

:where(a, button, .menu-link, .mobile-bottom-link, .premium-action-row, .premium-small-card, .premium-hero-action) {
    -webkit-tap-highlight-color: transparent;
}

:where(
    button,
    .btn-primary,
    .primary-btn,
    .action-submit,
    .modal-submit,
    .hero-btn,
    .tile-action-btn,
    .btn-secondary,
    .secondary-btn,
    .ghost-btn,
    .mini-btn,
    .soft-action-btn,
    .premium-hero-action,
    .premium-action-row,
    .premium-small-card,
    .menu-link,
    .mobile-bottom-link
):active {
    transform: translateY(1px) scale(.985) !important;
}

:where(
    button,
    .btn-primary,
    .primary-btn,
    .action-submit,
    .modal-submit,
    .hero-btn,
    .tile-action-btn,
    .btn-secondary,
    .secondary-btn,
    .ghost-btn,
    .mini-btn,
    .soft-action-btn,
    .premium-hero-action,
    .premium-action-row,
    .premium-small-card,
    .menu-link,
    .mobile-bottom-link
) {
    position: relative;
    overflow: hidden;
}

.premium-ripple-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    left: var(--premium-ripple-x, 50%);
    top: var(--premium-ripple-y, 50%);
    border-radius: 999px;
    pointer-events: none;
    background: rgba(255,255,255,.34);
    transform: translate(-50%, -50%) scale(1);
    animation: premiumRipple .62s var(--premium-ease-out) both;
    mix-blend-mode: screen;
}

:where(input, select, textarea, button, a, .menu-link, .mobile-bottom-link):focus-visible {
    outline: 0 !important;
    box-shadow:
        0 0 0 4px rgba(79,140,255,.22),
        0 0 0 1px rgba(255,255,255,.18),
        0 14px 34px rgba(0,0,0,.18) !important;
}

:where(.premium-hero-status-success, .premium-status-success, .status-success, .success) {
    animation: premiumSoftPulseSuccess 4.8s ease-in-out infinite;
}

:where(.premium-status-dot, .status-dot, .live-dot, .premium-badge-dot) {
    animation: premiumDotBreath 2.6s ease-in-out infinite;
}

:where(.premium-dashboard-hero, .hero-card, .auth-card, .settlement-hero, .users-hero-card) {
    isolation: isolate;
}

.premium-dashboard-hero .premium-hero-content h2,
.auth-hero-content h1,
.topbar h1 {
    text-wrap: balance;
}

:where(.premium-dashboard-hero, .auth-card, .hero-card, .settlement-hero, .users-hero-card)::selection,
:where(.premium-panel, .glass-card, .module-card, .modal-card)::selection {
    background: rgba(79,140,255,.35);
    color: #fff;
}

:where(.mobile-header, .topbar.is-scrolled) {
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.topbar.is-scrolled {
    border-color: rgba(255,255,255,.12) !important;
    background: rgba(7, 12, 24, .58) !important;
    box-shadow: 0 16px 44px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.055);
}

:where(.premium-insight-card, .premium-admin-kpi, .premium-small-card, .premium-action-row) .app-icon,
:where(.menu-link, .mobile-bottom-link, button) .app-icon {
    transition: transform .22s var(--premium-ease-out), opacity .18s ease;
}

:where(.premium-insight-card, .premium-admin-kpi, .premium-small-card, .premium-action-row, .menu-link, .mobile-bottom-link, button):hover .app-icon {
    transform: translateY(-1px) scale(1.045);
}

@keyframes premiumPageRise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes premiumRipple {
    from {
        opacity: .58;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(32);
    }
}

@keyframes premiumSoftPulseSuccess {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.045); }
}

@keyframes premiumDotBreath {
    0%, 100% { transform: scale(1); opacity: .92; }
    50% { transform: scale(1.18); opacity: 1; }
}

@media (hover: none) {
    .premium-ambient-light {
        opacity: .32;
    }

    :where(
        .premium-dashboard-hero,
        .premium-panel,
        .premium-insight-card,
        .premium-admin-kpi,
        .hero-card,
        .glass-card,
        .module-card,
        .quick-card,
        .tile-card,
        .comm-card,
        .premium-small-card,
        .premium-action-row
    ):hover {
        transform: none;
    }
}


/* Hotfix v6.1: na urządzeniach dotykowych animacje kliknięcia nie mogą zakłócać przewijania gestami. */
@media (hover: none), (pointer: coarse) {
    html {
        scroll-behavior: auto;
    }

    body,
    .app-shell,
    .main-content,
    .premium-dashboard,
    .sidebar {
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }

    .premium-ambient-light {
        display: none;
    }

    .premium-ripple-dot {
        display: none !important;
    }

    :where(
        .premium-dashboard-hero,
        .premium-panel,
        .premium-insight-card,
        .premium-admin-kpi,
        .hero-card,
        .glass-card,
        .module-card,
        .quick-card,
        .tile-card,
        .comm-card,
        .action-tile,
        .requests-page .action-card,
        .stat-card,
        .queue-card,
        .settlement-main-card,
        .settlement-list-card,
        .settlement-summary-card,
        .users-list-card,
        .users-form-card,
        .modal-card,
        .modal-window,
        .auth-card,
        .auth-feature-item,
        .premium-small-card,
        .premium-action-row
    ) {
        will-change: auto;
    }

    :where(
        button,
        .btn-primary,
        .primary-btn,
        .action-submit,
        .modal-submit,
        .hero-btn,
        .tile-action-btn,
        .btn-secondary,
        .secondary-btn,
        .ghost-btn,
        .mini-btn,
        .soft-action-btn,
        .premium-hero-action,
        .premium-action-row,
        .premium-small-card,
        .menu-link,
        .mobile-bottom-link
    ):active {
        transform: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .premium-ambient-light {
        display: none;
    }

    .premium-motion-ready .premium-reveal,
    .premium-motion-ready .premium-reveal.is-in-view,
    :where(.topbar, .premium-dashboard, .auth-card, .auth-hero, .sidebar, .mobile-bottom-nav),
    :where(.premium-status-dot, .status-dot, .live-dot, .premium-badge-dot),
    :where(.premium-hero-status-success, .premium-status-success, .status-success, .success) {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .premium-ripple-dot {
        display: none;
    }
}

/* =========================================================
   HOTFIX v6.2 — ostre menu boczne na mobile
   Problem: .app-shell miał własny z-index, przez co overlay był nad sidebarem
   i rozmywał samo menu. Na mobile zdejmujemy stacking context z powłoki,
   dajemy sidebar ponad overlay oraz wyłączamy blur na samym overlayu.
   ========================================================= */
@media (max-width: 980px) {
    .app-shell {
        position: static !important;
        z-index: auto !important;
        isolation: auto !important;
    }

    .sidebar-backdrop,
    .sidebar-backdrop.show {
        z-index: 1200 !important;
    }

    .sidebar-backdrop.show {
        background: rgba(2, 6, 18, .72) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .sidebar {
        z-index: 1301 !important;
        opacity: 1 !important;
        filter: none !important;
        transform: translate3d(0, 0, 0);
        isolation: isolate;
        background:
            radial-gradient(circle at 28px 18px, rgba(79,140,255,.18), transparent 26%),
            radial-gradient(circle at 100% 18%, rgba(45,212,191,.12), transparent 30%),
            linear-gradient(180deg, rgba(12, 19, 38, .985), rgba(6, 10, 24, .975)) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        will-change: left;
    }

    .sidebar.open {
        z-index: 1301 !important;
    }

    .mobile-header {
        z-index: 1100 !important;
    }

    .mobile-bottom-nav {
        z-index: 1090 !important;
    }

    body.menu-open .sidebar {
        pointer-events: auto;
    }
}

/* =========================================================
   POINT 7 — Powiadomienia push PWA
   ========================================================= */
.profile-push-card {
    position: relative;
    overflow: hidden;
}

.profile-push-card::before {
    content: "";
    position: absolute;
    inset: -35% -20% auto auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(79, 140, 255, .22), transparent 68%);
    pointer-events: none;
}

.push-state-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .07);
    color: rgba(244, 248, 255, .84);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    white-space: nowrap;
}

[data-push-state="enabled"] .push-state-pill {
    color: #d6fff0;
    background: rgba(34, 197, 94, .16);
    border-color: rgba(34, 197, 94, .28);
}

[data-push-state="blocked"] .push-state-pill,
[data-push-state="unsupported"] .push-state-pill {
    color: #ffe4e6;
    background: rgba(239, 68, 68, .15);
    border-color: rgba(239, 68, 68, .26);
}

.push-card-body {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 14px;
    align-items: center;
    margin: 18px 0;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, .10);
    background: linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
}

.push-card-icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, rgba(79,140,255,.95), rgba(45,212,191,.72));
    box-shadow: 0 18px 38px rgba(79, 140, 255, .22);
}

.push-card-icon .app-icon,
.push-card-icon svg {
    width: 25px;
    height: 25px;
}

.push-card-title {
    color: var(--text-main, #f7f9ff);
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 5px;
}

.push-card-text {
    color: var(--text-muted, #9fb0d0);
    font-size: 13px;
    line-height: 1.45;
}

.push-action-row {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.push-action-row button[hidden] {
    display: none !important;
}

.push-hint {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    color: rgba(159, 176, 208, .82);
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .push-card-body {
        grid-template-columns: 48px 1fr;
        padding: 14px;
    }

    .push-card-icon {
        width: 48px;
        height: 48px;
        border-radius: 17px;
    }

    .push-action-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .push-action-row button {
        width: 100%;
    }
}

/* =========================================================
   PROFILE PREMIUM v8 — dopracowany moduł profilu
   ========================================================= */
.profile-premium-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, .12);
    background:
        radial-gradient(circle at 18% 20%, rgba(79, 140, 255, .28), transparent 30%),
        radial-gradient(circle at 85% 10%, rgba(45, 212, 191, .18), transparent 32%),
        linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.045));
    box-shadow: 0 28px 82px rgba(0,0,0,.30);
    backdrop-filter: blur(22px);
    margin-bottom: 18px;
}

.profile-premium-hero::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.16), transparent 38%, rgba(255,255,255,.06));
    mask: linear-gradient(#000, transparent 52%);
}

.profile-hero-identity {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.profile-avatar-xl {
    width: 86px;
    height: 86px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 86px;
    color: #fff;
    font-size: 28px;
    font-weight: 950;
    letter-spacing: -.04em;
    background:
        linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,.04)),
        linear-gradient(135deg, rgba(79,140,255,.95), rgba(139,92,246,.85) 55%, rgba(45,212,191,.72));
    box-shadow: 0 22px 54px rgba(79,140,255,.28), inset 0 1px 0 rgba(255,255,255,.28);
    border: 1px solid rgba(255,255,255,.20);
}

.profile-premium-hero h2 {
    margin: 4px 0 10px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: .98;
    letter-spacing: -.055em;
}

.profile-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 7px 11px;
    border-radius: 999px;
    color: rgba(237, 244, 255, .88);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.10);
    font-size: 12px;
    font-weight: 800;
}

.profile-hero-meta .app-icon {
    width: 15px;
    height: 15px;
}

.profile-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-hero-button {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.profile-hero-button .app-icon {
    width: 18px;
    height: 18px;
}

.profile-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.06);
    color: rgba(244,248,255,.92);
    font-weight: 800;
}

.profile-notice.is-success {
    background: linear-gradient(135deg, rgba(34,197,94,.18), rgba(255,255,255,.05));
    border-color: rgba(34,197,94,.24);
}

.profile-notice.is-error {
    background: linear-gradient(135deg, rgba(239,68,68,.18), rgba(255,255,255,.05));
    border-color: rgba(239,68,68,.24);
}

.profile-notice-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.10);
    flex: 0 0 38px;
}

.profile-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.profile-stat-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 46px 1fr;
    align-items: center;
    gap: 12px;
    min-height: 104px;
    padding: 16px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.10);
    background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
    box-shadow: 0 18px 46px rgba(0,0,0,.20);
}

.profile-stat-card::before {
    content: "";
    position: absolute;
    inset: -35% -30% auto auto;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    opacity: .48;
    background: radial-gradient(circle, rgba(79,140,255,.30), transparent 68%);
    pointer-events: none;
}

.profile-stat-card.tone-success::before { background: radial-gradient(circle, rgba(34,197,94,.32), transparent 68%); }
.profile-stat-card.tone-warning::before { background: radial-gradient(circle, rgba(245,158,11,.34), transparent 68%); }
.profile-stat-card.tone-danger::before { background: radial-gradient(circle, rgba(239,68,68,.32), transparent 68%); }
.profile-stat-card.tone-muted::before { background: radial-gradient(circle, rgba(148,163,184,.24), transparent 68%); }

.profile-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}

.profile-stat-icon .app-icon {
    width: 22px;
    height: 22px;
}

.profile-stat-card span,
.profile-mini-list span,
.profile-pin-form label > span {
    display: block;
    color: rgba(159, 176, 208, .92);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.profile-stat-card strong {
    display: block;
    margin: 4px 0 2px;
    color: #fff;
    font-size: 21px;
    font-weight: 950;
    line-height: 1.05;
    letter-spacing: -.04em;
}

.profile-stat-card small {
    color: rgba(205, 219, 245, .84);
    font-size: 12px;
    line-height: 1.35;
}

.profile-premium-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(330px, .72fr);
    gap: 18px;
    align-items: start;
}

.profile-main-column,
.profile-side-column {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.profile-account-card,
.profile-security-card,
.profile-activity-card,
.profile-premium-qr-card,
.profile-rcp-mini-card,
.profile-push-card {
    border-radius: 28px !important;
}

.profile-section-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, rgba(79,140,255,.30), rgba(45,212,191,.14));
    border: 1px solid rgba(255,255,255,.12);
    flex: 0 0 44px;
}

.profile-section-icon .app-icon {
    width: 21px;
    height: 21px;
}

.premium-profile-data-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-pin-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: end;
    margin-top: 18px;
}

.profile-pin-form label {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.profile-pin-form input {
    width: 100%;
}

.profile-pin-form button {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    white-space: nowrap;
}

.profile-activity-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.profile-activity-item {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
}

.profile-activity-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #cfe7ff;
    background: rgba(255,255,255,.08);
}

.profile-activity-item strong {
    display: block;
    color: #fff;
    font-size: 14px;
    margin-bottom: 3px;
}

.profile-activity-item span {
    color: rgba(159,176,208,.9);
    font-size: 12px;
    line-height: 1.35;
}

.profile-premium-qr-card .profile-qr-box {
    min-height: 260px;
    background:
        radial-gradient(circle at top, rgba(79,140,255,.10), transparent 40%),
        rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.90), 0 18px 44px rgba(0,0,0,.20);
}

.profile-premium-qr-card .qr-inline svg {
    max-width: 210px;
}

.profile-card-hint {
    color: rgba(159,176,208,.88);
    font-size: 12px;
    line-height: 1.45;
    margin-top: 12px;
}

.profile-mini-list {
    display: grid;
    gap: 10px;
    margin: 16px 0;
}

.profile-mini-list div {
    padding: 13px 14px;
    border-radius: 17px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    overflow-wrap: anywhere;
}

.profile-mini-list strong {
    display: block;
    margin-top: 4px;
    color: #fff;
    line-height: 1.25;
}

.profile-push-body {
    margin-bottom: 14px;
}

@media (max-width: 1280px) {
    .profile-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .premium-profile-data-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-pin-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .profile-premium-layout {
        grid-template-columns: 1fr;
    }

    .profile-side-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-push-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .profile-premium-hero {
        display: grid;
        padding: 20px;
        border-radius: 26px;
    }

    .profile-hero-identity {
        align-items: flex-start;
        gap: 14px;
    }

    .profile-avatar-xl {
        width: 68px;
        height: 68px;
        flex-basis: 68px;
        border-radius: 22px;
        font-size: 23px;
    }

    .profile-hero-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .profile-hero-button {
        justify-content: center;
        width: 100%;
    }

    .profile-stat-grid,
    .profile-side-column,
    .premium-profile-data-grid,
    .profile-pin-form {
        grid-template-columns: 1fr;
    }

    .profile-stat-card {
        min-height: 92px;
    }

    .profile-pin-form button {
        width: 100%;
    }

    .profile-premium-qr-card .profile-qr-box {
        min-height: 220px;
    }
}

/* =========================================================
   DESKTOP HOTFIX — stałe menu boczne na PC
   Na ekranach desktopowych nie przewija/przesuwa się cała strona.
   Lewy sidebar zostaje nieruchomy, a przewijana jest tylko prawa zawartość.
   ========================================================= */
@media (min-width: 981px) {
    html,
    body {
        height: 100%;
        overflow: hidden !important;
    }

    body {
        width: 100%;
    }

    .mobile-header,
    .mobile-bottom-nav,
    .sidebar-backdrop {
        display: none !important;
    }

    .app-shell {
        width: 100%;
        height: 100vh;
        min-height: 100vh;
        display: grid;
        grid-template-columns: var(--sidebar-width, 288px) minmax(0, 1fr) !important;
        overflow: hidden;
    }

    .sidebar {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: var(--sidebar-width, 288px) !important;
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transform: none !important;
        flex-shrink: 0;
        overscroll-behavior: contain;
    }

    .main-content {
        width: 100%;
        height: 100vh;
        min-width: 0;
        overflow-y: auto !important;
        overflow-x: auto !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .page-width-shell {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .topbar,
    .premium-dashboard,
    .module-page,
    .users-page,
    .rcp-page,
    .requests-page,
    .settlement-page,
    .comm-page,
    .schedule-page {
        min-width: 0;
    }
}

/* =========================================================
   DESKTOP HOTFIX v2 — Start + Profil + wszystkie widoki z partials/top
   Wymusza jeden kontener przewijania po prawej stronie także dla
   dashboard-admin, dashboard-user i profile.ejs.
   ========================================================= */
@media (min-width: 981px) {
    html,
    body {
        height: 100% !important;
        min-height: 100% !important;
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    body {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body > .app-shell {
        width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        display: grid !important;
        grid-template-columns: var(--sidebar-width, 288px) minmax(0, 1fr) !important;
        overflow: hidden !important;
    }

    body > .app-shell > .sidebar {
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        align-self: start !important;
        width: var(--sidebar-width, 288px) !important;
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transform: none !important;
        z-index: 20 !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch;
    }

    body > .app-shell > .main-content {
        position: relative !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 100vh !important;
        min-height: 0 !important;
        max-height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch;
    }

    body > .app-shell > .main-content > .page-width-shell {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 100vh !important;
    }

    body > .mobile-header,
    body > .mobile-bottom-nav,
    body > .sidebar-backdrop {
        display: none !important;
    }

    .premium-dashboard,
    .premium-dashboard-admin,
    .premium-dashboard-user,
    .profile-premium-hero,
    .profile-stat-grid,
    .profile-premium-layout,
    .topbar {
        min-width: 0 !important;
        max-width: 100% !important;
    }
}

/* Biometria / WebAuthn */
.biometric-login-panel {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.biometric-login-btn,
.biometric-action-row .btn-primary,
.biometric-action-row .ghost-btn {
    width: 100%;
    justify-content: center;
}

.biometric-login-btn {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.biometric-login-note,
.biometric-card-body span,
.biometric-inline-message,
.profile-biometric-card .push-hint {
    font-size: 0.88rem;
    line-height: 1.45;
}

.biometric-login-note {
    margin: 0;
    color: var(--muted, rgba(255,255,255,0.68));
    text-align: center;
}

.biometric-inline-message {
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    color: var(--text, #fff);
}

.biometric-inline-message[data-tone="success"] {
    border-color: rgba(34,197,94,0.35);
    background: rgba(34,197,94,0.14);
}

.biometric-inline-message[data-tone="error"] {
    border-color: rgba(239,68,68,0.38);
    background: rgba(239,68,68,0.14);
}

.profile-biometric-card {
    overflow: hidden;
}

.biometric-card-body {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 22px;
    background: rgba(255,255,255,0.07);
    margin: 16px 0;
}

.biometric-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.12);
    flex: 0 0 auto;
}

.biometric-card-body strong,
.biometric-card-body span {
    display: block;
}

.biometric-card-body span {
    color: var(--muted, rgba(255,255,255,0.68));
    margin-top: 4px;
}

.biometric-pin-field {
    display: grid;
    gap: 7px;
    margin: 14px 0 12px;
}

.biometric-pin-field span {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text, #fff);
}

.biometric-pin-field input {
    width: 100%;
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.08);
    color: var(--text, #fff);
    padding: 0 14px;
    font: inherit;
    outline: none;
}

.biometric-pin-field input:focus {
    border-color: rgba(96,165,250,0.65);
    box-shadow: 0 0 0 4px rgba(96,165,250,0.14);
}

.biometric-pin-field small {
    color: var(--muted, rgba(255,255,255,0.68));
    font-size: 0.78rem;
    line-height: 1.4;
}

.biometric-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.biometric-action-row > * {
    flex: 1 1 190px;
}

@media (max-width: 640px) {
    .biometric-card-body {
        align-items: flex-start;
    }

    .biometric-action-row {
        display: grid;
    }
}

/* Profile: stats moved into Dane konta card */
.profile-stat-grid-inside-account {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin: 16px 0 18px;
}

.profile-account-card .profile-stat-card {
    min-height: 88px;
    padding: 14px;
    border-radius: 20px;
    box-shadow: none;
}


/* Profile account summary: grouped premium tiles */
.profile-account-sections {
    display: grid;
    gap: 18px;
}

.profile-account-group {
    display: grid;
    gap: 10px;
}

.profile-group-label {
    color: rgba(205, 219, 245, .86);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.profile-info-card {
    min-height: 96px;
}

.profile-click-effect {
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.profile-click-effect:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,.18);
    background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.045));
    box-shadow: 0 22px 55px rgba(0,0,0,.25);
}

.profile-click-effect:active {
    transform: scale(.985);
}

.profile-stat-grid-inside-account {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

/* Profile summary: all four tiles in one horizontal row */
.profile-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.profile-summary-grid.profile-stat-grid-inside-account {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 18px 0 0;
}

.profile-summary-tile {
    min-height: 112px !important;
    align-items: center;
    padding: 14px !important;
}

.profile-summary-tile .profile-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    flex: 0 0 46px;
}

.profile-summary-tile .profile-stat-icon .app-icon {
    width: 22px;
    height: 22px;
}

.profile-summary-tile strong {
    font-size: clamp(16px, 1.35vw, 24px);
    line-height: 1.08;
}

.profile-summary-tile small {
    display: block;
    margin-top: 4px;
}

@media (max-width: 980px) {
    .profile-summary-grid,
    .profile-summary-grid.profile-stat-grid-inside-account {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .profile-summary-grid,
    .profile-summary-grid.profile-stat-grid-inside-account {
        grid-template-columns: 1fr;
    }
}


/* FIX Profile: four summary tiles must stay in one horizontal row on desktop */
.profile-account-card .profile-four-tiles-row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
    align-items: stretch !important;
    width: 100% !important;
    margin: 18px 0 0 !important;
}

.profile-account-card .profile-four-tiles-row > .profile-summary-tile {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 104px !important;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 14px !important;
    border-radius: 22px !important;
}

.profile-account-card .profile-four-tiles-row .profile-stat-icon {
    width: 44px !important;
    height: 44px !important;
    border-radius: 16px !important;
}

.profile-account-card .profile-four-tiles-row span,
.profile-account-card .profile-four-tiles-row strong,
.profile-account-card .profile-four-tiles-row small {
    overflow-wrap: anywhere;
}

.profile-account-card .profile-four-tiles-row strong {
    font-size: clamp(15px, 1.1vw, 20px) !important;
}

.profile-account-card .profile-four-tiles-row small {
    font-size: 11px !important;
}

@media (max-width: 1120px) {
    .profile-account-card .profile-four-tiles-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 620px) {
    .profile-account-card .profile-four-tiles-row {
        grid-template-columns: 1fr !important;
    }
}

/* PROFILE FINAL FIX: Podsumowanie profilu - 4 kafelki w jednym rzędzie */
.profile-account-card .profile-four-tiles-row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    column-gap: 12px !important;
    row-gap: 12px !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 18px 0 0 !important;
}

.profile-account-card .profile-four-tiles-row > .profile-summary-tile {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 112px !important;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 14px !important;
    border-radius: 22px !important;
}

.profile-account-card .profile-four-tiles-row > .profile-summary-tile > div:last-child {
    min-width: 0 !important;
}

.profile-account-card .profile-four-tiles-row .profile-stat-icon {
    width: 44px !important;
    height: 44px !important;
    border-radius: 16px !important;
}

.profile-account-card .profile-four-tiles-row span,
.profile-account-card .profile-four-tiles-row strong,
.profile-account-card .profile-four-tiles-row small {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.profile-account-card .profile-four-tiles-row strong {
    white-space: nowrap !important;
    font-size: clamp(15px, 1.1vw, 20px) !important;
}

.profile-account-card .profile-four-tiles-row small {
    font-size: 11px !important;
    line-height: 1.3 !important;
}

@media (max-width: 900px) {
    .profile-account-card .profile-four-tiles-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 560px) {
    .profile-account-card .profile-four-tiles-row {
        grid-template-columns: 1fr !important;
    }
}


/* ===== INLINE: public/css/ui-theme.css ===== */

/* =========================================================
   HR CORE UI THEME v8 — wspólne zmienne i ujednolicenie wyglądu
   Punkt 8: jedna warstwa wizualna dla panelu, modułów i PWA.
   Nie zmienia backendu ani logiki JSON.
   ========================================================= */
:root {
    color-scheme: dark;

    --ui-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

    --ui-bg-0: #050914;
    --ui-bg-1: #07111f;
    --ui-bg-2: #0d1728;
    --ui-bg-glow-blue: rgba(79, 140, 255, .22);
    --ui-bg-glow-teal: rgba(45, 212, 191, .16);
    --ui-bg-glow-violet: rgba(124, 92, 255, .18);

    --ui-text: #f7f9ff;
    --ui-text-soft: #dce7ff;
    --ui-muted: #9fb0d0;
    --ui-muted-2: #7182a6;

    --ui-accent: #4f8cff;
    --ui-accent-2: #2dd4bf;
    --ui-accent-3: #7c5cff;
    --ui-success: #22c55e;
    --ui-warning: #f59e0b;
    --ui-danger: #ef4444;
    --ui-info: #38bdf8;

    --ui-surface: rgba(255, 255, 255, .065);
    --ui-surface-2: rgba(255, 255, 255, .092);
    --ui-surface-3: rgba(255, 255, 255, .118);
    --ui-surface-dark: rgba(5, 12, 25, .64);
    --ui-border: rgba(255, 255, 255, .11);
    --ui-border-strong: rgba(255, 255, 255, .19);

    --ui-radius-xs: 10px;
    --ui-radius-sm: 14px;
    --ui-radius-md: 20px;
    --ui-radius-lg: 28px;
    --ui-radius-xl: 34px;

    --ui-shadow-sm: 0 10px 26px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .045);
    --ui-shadow-md: 0 18px 52px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .065);
    --ui-shadow-lg: 0 26px 82px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .085);
    --ui-shadow-accent: 0 18px 44px rgba(79, 140, 255, .24), inset 0 1px 0 rgba(255, 255, 255, .18);

    --ui-blur: blur(22px) saturate(145%);
    --ui-speed: .18s;

    /* Alias dla starszych plików CSS — moduły korzystają z różnych nazw zmiennych. */
    --premium-bg-main: var(--ui-bg-0);
    --premium-bg-soft: var(--ui-bg-2);
    --premium-bg-deep: #030712;
    --premium-surface: var(--ui-surface);
    --premium-surface-strong: var(--ui-surface-2);
    --premium-surface-soft: rgba(255, 255, 255, .04);
    --premium-border-soft: var(--ui-border);
    --premium-border-strong: var(--ui-border-strong);
    --premium-text-main: var(--ui-text);
    --premium-text-muted: var(--ui-muted);
    --premium-text-soft: var(--ui-text-soft);
    --premium-accent: var(--ui-accent);
    --premium-accent-2: var(--ui-accent-2);
    --premium-danger: var(--ui-danger);
    --premium-warning: var(--ui-warning);
    --premium-success: var(--ui-success);
    --premium-radius-sm: var(--ui-radius-sm);
    --premium-radius-md: var(--ui-radius-md);
    --premium-radius-lg: var(--ui-radius-lg);
    --premium-shadow-soft: var(--ui-shadow-md);
    --premium-shadow-card: var(--ui-shadow-lg);
    --premium-glass-blur: var(--ui-blur);

    --portal-surface: linear-gradient(145deg, rgba(255,255,255,.094), rgba(255,255,255,.042));
    --portal-surface-soft: linear-gradient(145deg, rgba(255,255,255,.072), rgba(255,255,255,.032));
    --portal-surface-hover: linear-gradient(145deg, rgba(255,255,255,.124), rgba(255,255,255,.052));
    --portal-border: var(--ui-border);
    --portal-border-strong: var(--ui-border-strong);
    --portal-text: var(--ui-text);
    --portal-muted: rgba(199, 215, 239, .78);
    --portal-muted-strong: rgba(220, 231, 255, .90);
    --portal-input-bg: rgba(6, 13, 27, .62);
    --portal-input-bg-focus: rgba(8, 18, 38, .82);
    --portal-input-border: rgba(255, 255, 255, .14);
    --portal-accent: linear-gradient(135deg, var(--ui-accent) 0%, var(--ui-accent-3) 54%, var(--ui-accent-2) 100%);
    --portal-accent-soft: linear-gradient(135deg, rgba(79,140,255,.22), rgba(45,212,191,.12));
    --portal-danger: linear-gradient(135deg, rgba(239,68,68,.95), rgba(244,63,94,.86));
    --portal-warning: linear-gradient(135deg, rgba(245,158,11,.92), rgba(249,115,22,.84));
    --portal-success: linear-gradient(135deg, rgba(16,185,129,.92), rgba(34,197,94,.84));
    --portal-radius-xs: var(--ui-radius-xs);
    --portal-radius-sm: var(--ui-radius-sm);
    --portal-radius-md: var(--ui-radius-md);
    --portal-radius-lg: var(--ui-radius-lg);
    --portal-shadow-card: var(--ui-shadow-lg);
    --portal-shadow-soft: var(--ui-shadow-md);
    --portal-shadow-button: var(--ui-shadow-accent);
}

:where(html) {
    background: var(--ui-bg-0);
}

:where(body) {
    font-family: var(--ui-font);
    background:
        radial-gradient(circle at 8% 0%, var(--ui-bg-glow-blue), transparent 28%),
        radial-gradient(circle at 92% 8%, var(--ui-bg-glow-teal), transparent 30%),
        radial-gradient(circle at 50% 110%, var(--ui-bg-glow-violet), transparent 34%),
        linear-gradient(180deg, var(--ui-bg-1), var(--ui-bg-0) 56%, #030712);
    color: var(--ui-text);
}

:where(body, button, input, select, textarea) {
    font-family: var(--ui-font);
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

:where(a, button, input, select, textarea, summary, .menu-link, .tile-card, .quick-card, .module-card, .glass-card) {
    transition:
        background var(--ui-speed) ease,
        border-color var(--ui-speed) ease,
        box-shadow var(--ui-speed) ease,
        transform var(--ui-speed) ease,
        opacity var(--ui-speed) ease,
        color var(--ui-speed) ease;
}

:where(a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible) {
    outline: 3px solid rgba(79, 140, 255, .42);
    outline-offset: 3px;
}

/* Układ aplikacji */
.app-shell {
    grid-template-columns: 292px minmax(0, 1fr);
}

.page-width-shell {
    width: min(100%, 1560px);
    margin: 0 auto;
}

.main-content {
    padding: clamp(18px, 2.6vw, 34px);
}

.sidebar {
    background:
        radial-gradient(circle at 0 0, rgba(79,140,255,.16), transparent 32%),
        rgba(7, 14, 29, .84);
    border-right: 1px solid var(--ui-border);
    box-shadow: 18px 0 60px rgba(0, 0, 0, .18);
}

.logo-card,
.sidebar-user-card,
.user-chip,
.mobile-header,
.mobile-bottom-nav {
    border: 1px solid var(--ui-border);
    background: linear-gradient(145deg, rgba(255,255,255,.092), rgba(255,255,255,.038));
    box-shadow: var(--ui-shadow-sm);
    backdrop-filter: var(--ui-blur);
}

.logo-card {
    border-radius: var(--ui-radius-md);
}

.logo-icon,
.sidebar-user-avatar {
    background:
        linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,.05)),
        linear-gradient(135deg, var(--ui-accent), var(--ui-accent-3) 54%, var(--ui-accent-2));
    box-shadow: 0 14px 30px rgba(79, 140, 255, .20), inset 0 1px 0 rgba(255,255,255,.18);
}

.menu-section-label {
    margin: 22px 0 10px;
    color: rgba(199, 215, 239, .62);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: var(--ui-radius-sm);
    background: transparent;
    color: var(--ui-text-soft);
}

.menu-link:hover {
    background: rgba(255,255,255,.075);
    border-color: rgba(255,255,255,.09);
    transform: translateX(2px);
}

.menu-link.active {
    background:
        linear-gradient(135deg, rgba(79,140,255,.24), rgba(45,212,191,.12));
    border-color: rgba(99, 184, 255, .30);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 12px 28px rgba(79, 140, 255, .14);
}

.menu-link.danger {
    color: #ffc7c7;
}

.menu-link-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    background: rgba(255,255,255,.055);
    flex: 0 0 28px;
}

.menu-link.active .menu-link-icon {
    background: rgba(255,255,255,.14);
}

.topbar {
    margin-bottom: 26px;
}

.topbar h1 {
    font-size: clamp(24px, 2.2vw, 34px);
    letter-spacing: -.035em;
}

.datetime-chip strong,
.datetime-chip span {
    font-weight: 850;
}

/* Karty, panele i kafelki */
:where(
    .hero-card,
    .glass-card,
    .module-card,
    .tile-card,
    .quick-card,
    .empty-box,
    .dashboard-live-panel,
    .module-accordion,
    .premium-panel,
    .premium-dashboard-hero,
    .premium-admin-kpi,
    .premium-insight-card,
    .admin-tool-link,
    .backup-card,
    .auth-panel-info,
    .auth-card,
    .auth-feature-card,
    .profile-style-card,
    .toolbar-card,
    .module-intro-card,
    .comm-hero-card,
    .comm-layout-card,
    .comm-card,
    .comm-filter-card,
    .upload-card,
    .preview-card,
    .template-card,
    .report-card,
    .publish-state-card,
    .action-tile,
    .requests-page .action-card,
    .request-row,
    .filter-box,
    .compact-form,
    .info-card,
    .timeline-card,
    .open-swap-card,
    .queue-card,
    .stat-card,
    .settlement-hero,
    .settlement-main-card,
    .settlement-list-card,
    .settlement-summary-card,
    .settlement-modal-card,
    .settlement-action-tile,
    .settlement-stat-card,
    .settlement-panel-card,
    .settlement-empty,
    .settlement-employee-card,
    .settlement-status-card,
    .users-hero-card,
    .users-toolbar-card,
    .users-list-card,
    .users-form-card,
    .modal-card,
    .modal-window,
    .qr-card,
    .comment-box,
    .rcp-stat,
    .rcp-presence-item,
    .rcp-last-event
) {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius-lg) !important;
    background:
        radial-gradient(circle at 100% 0%, rgba(79,140,255,.105), transparent 34%),
        linear-gradient(145deg, rgba(255,255,255,.085), rgba(255,255,255,.037)) !important;
    box-shadow: var(--ui-shadow-md) !important;
    backdrop-filter: var(--ui-blur);
}

:where(.hero-card, .premium-dashboard-hero, .settlement-hero, .comm-hero-card, .users-hero-card) {
    border-radius: var(--ui-radius-xl) !important;
    box-shadow: var(--ui-shadow-lg) !important;
}

:where(
    .tile-card,
    .quick-card,
    .module-card,
    .admin-tool-link,
    .premium-insight-card,
    .backup-card,
    .comm-card,
    .action-tile,
    .requests-page .action-card,
    .settlement-action-tile,
    .settlement-employee-card,
    .users-list-card,
    .rcp-presence-item
):hover {
    border-color: var(--ui-border-strong) !important;
    transform: translateY(-2px);
    box-shadow: var(--ui-shadow-lg) !important;
}

:where(.section-title, .tile-title, .module-title, .attention-title, .activity-title) {
    letter-spacing: -.018em;
}

:where(.muted, .tile-desc, .module-desc, .section-subtitle, .quick-text, .attention-text, .activity-text, .module-meta, .info-list) {
    color: var(--ui-muted);
}

/* Przyciski */
:where(
    .btn-primary,
    .primary-btn,
    .action-submit,
    .modal-submit,
    .hero-btn,
    .tile-action-btn,
    .month-switcher-submit,
    .publish-state-btn,
    .settlement-inline-btn,
    .mini-btn-primary,
    .btn-success,
    button.primary,
    button[type="submit"]:not(.ghost-btn):not(.secondary):not(.danger):not(.btn-secondary):not(.btn-danger)
) {
    min-height: 46px;
    border-radius: var(--ui-radius-sm) !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,.05)),
        linear-gradient(135deg, var(--ui-accent), var(--ui-accent-3) 54%, var(--ui-accent-2)) !important;
    color: #fff !important;
    font-weight: 850 !important;
    box-shadow: var(--ui-shadow-accent) !important;
}

:where(
    .btn-secondary,
    .secondary-btn,
    .btn-ghost,
    .ghost-btn,
    .action-cancel,
    .modal-cancel,
    .tile-action-btn-secondary,
    .soft-action-btn,
    .mini-btn,
    .mini-btn-glass,
    .tab-btn,
    .icon-chip-btn,
    .button-link.ghost,
    button.secondary,
    .settlement-close-btn,
    .modal-close
) {
    min-height: 42px;
    border-radius: var(--ui-radius-sm) !important;
    border: 1px solid rgba(255,255,255,.13) !important;
    background: linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.045)) !important;
    color: var(--ui-text) !important;
    font-weight: 800 !important;
    box-shadow: var(--ui-shadow-sm) !important;
}

:where(.btn-link, .link-btn, a.button-link, .premium-hero-action) {
    border-radius: var(--ui-radius-sm) !important;
}

:where(.btn-danger, .danger-btn, button.danger) {
    border-radius: var(--ui-radius-sm) !important;
    background: linear-gradient(135deg, rgba(239,68,68,.88), rgba(244,63,94,.76)) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.15) !important;
}

:where(button, .btn-primary, .btn-secondary, .btn-danger, .btn-link, .premium-hero-action, .admin-tool-link) .app-icon {
    margin-right: 6px;
}

:where(button:hover, .btn-primary:hover, .btn-secondary:hover, .btn-danger:hover, .btn-link:hover, .premium-hero-action:hover) {
    transform: translateY(-1px);
}

/* Formularze */
:where(input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="date"], input[type="time"], input[type="file"], textarea, select) {
    min-height: 48px;
    border-radius: var(--ui-radius-sm) !important;
    border: 1px solid var(--portal-input-border) !important;
    background: var(--portal-input-bg) !important;
    color: var(--ui-text) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
}

:where(input, textarea, select)::placeholder {
    color: rgba(199, 215, 239, .50);
}

:where(input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="date"], input[type="time"], textarea, select):focus {
    border-color: rgba(79, 140, 255, .58) !important;
    background: var(--portal-input-bg-focus) !important;
    box-shadow: 0 0 0 4px rgba(79, 140, 255, .16), inset 0 1px 0 rgba(255,255,255,.07) !important;
}

:where(select option) {
    background: #0b1220;
    color: #fff;
}

/* Statusy i alerty */
:where(.status, .status-pill, .tile-live-badge, .hero-badge) {
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.alert {
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: var(--ui-shadow-sm);
}

.alert.success {
    background: linear-gradient(145deg, rgba(34,197,94,.18), rgba(255,255,255,.04));
    color: #b9ffd1;
}

.alert.error,
.alert.danger {
    background: linear-gradient(145deg, rgba(239,68,68,.18), rgba(255,255,255,.04));
    color: #ffd0d0;
}

.alert.warning {
    background: linear-gradient(145deg, rgba(245,158,11,.18), rgba(255,255,255,.04));
    color: #ffe0a3;
}

/* Tabele i listy */
:where(table) {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

:where(th) {
    color: var(--ui-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

:where(td, th) {
    border-bottom: 1px solid rgba(255,255,255,.07);
}

:where(code) {
    padding: 2px 7px;
    border-radius: 8px;
    color: #bfe9ff;
    background: rgba(56,189,248,.10);
    border: 1px solid rgba(56,189,248,.14);
}

/* Ekrany puste */
:where(.empty-box, .premium-empty-state) {
    text-align: left;
    color: var(--ui-muted);
}

.premium-empty-state {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 150px;
    padding: 26px;
    text-align: center;
}

.premium-empty-state span:first-child {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.08);
}

/* Mobile */
.mobile-header {
    background: rgba(7, 14, 29, .86);
}

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

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

    .sidebar {
        background:
            radial-gradient(circle at 0 0, rgba(79,140,255,.18), transparent 36%),
            rgba(7, 14, 29, .94);
    }

    .main-content {
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 900;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
        min-height: 64px;
        padding: 8px;
        border-radius: 24px;
        background: rgba(7, 14, 29, .84);
    }

    .mobile-bottom-link {
        display: grid;
        place-items: center;
        gap: 3px;
        min-width: 0;
        border: 0;
        border-radius: 18px;
        background: transparent;
        color: var(--ui-muted);
        font-size: 11px;
        font-weight: 800;
        text-align: center;
    }

    .mobile-bottom-link.active {
        color: #fff;
        background: rgba(79, 140, 255, .18);
    }

    .mobile-bottom-icon {
        width: 22px;
        height: 22px;
        display: grid;
        place-items: center;
    }

    .mobile-bottom-label {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .premium-dashboard-hero,
    .hero-card {
        border-radius: 24px !important;
    }
}

@media (max-width: 640px) {
    :root {
        --ui-radius-lg: 22px;
        --ui-radius-xl: 26px;
    }

    .mobile-bottom-nav {
        left: 8px;
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .tile-card,
    .glass-card,
    .module-card,
    .premium-panel {
        padding: 16px;
    }
}

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


/* ===== INLINE: public/css/module-layout.css ===== */

/* =========================================================
   HR CORE - PUNKT 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9: WSPÓLNY UKŁAD, NAGŁÓWKI, SZYBKIE AKCJE, STATYSTYKI, FILTRY, GŁÓWNA ZAWARTOŚĆ, ZAKŁADKI, FORMULARZE I MODALE
   Zakres: jeden rytm układu dla ekranów modułów i dashboardu, jednolity nagłówek modułu, szybkie akcje, karty statystyk, filtry/wyszukiwarki, główna zawartość modułów, zakładki w większych modułach jeden standard formularzy oraz spójne modale/popupy.
   Nie zmienia logiki JS/backendu, tylko kontenery, odstępy, siatki,
   układy dwukolumnowe, akcje, statystyki, filtry, formularze, modale/popupy i responsywność.
   ========================================================= */
:root {
    --module-shell-max: 1560px;
    --module-gap: clamp(14px, 1.4vw, 22px);
    --module-gap-sm: clamp(10px, 1vw, 14px);
    --module-card-pad: clamp(18px, 1.7vw, 26px);
    --module-card-pad-sm: clamp(14px, 1.3vw, 20px);
    --module-stat-min: 158px;
    --module-action-min: 246px;
    --module-side-min: 340px;
}

/* 1. Jeden kontener roboczy dla modułów i dashboardów */
body .module-page,
body .module-shell,
body .premium-dashboard {
    width: min(100%, var(--module-shell-max)) !important;
    max-width: var(--module-shell-max) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: grid !important;
    gap: var(--module-gap) !important;
    align-content: start !important;
    color: var(--ui-text, #f7f9ff);
}

body .module-page > *,
body .module-shell > *,
body .premium-dashboard > * {
    min-width: 0;
    box-sizing: border-box;
}

body .module-page > :where(.module-card, .profile-style-card, .toolbar-shell, .list-shell, .settlement-hero, .settlement-list-card, .settlement-summary-card, .settlement-main-card, .admin-shell, .monthly-schedule-card, .assign-quick-card),
body .module-shell > :where(.module-card, .profile-style-card, .toolbar-shell, .list-shell),
body .premium-dashboard > * {
    width: 100% !important;
}

/* 2. Spójna karta/sekcja modułu */
body :where(.module-card, .profile-style-card, .module-header-card, .toolbar-shell, .list-shell, .settlement-hero, .settlement-list-card, .settlement-summary-card, .settlement-main-card, .settlement-toolbar-card, .settlement-panel-card, .users-hero-card, .users-toolbar-card, .users-list-card, .users-form-card, .comm-layout-card, .comm-hero-card, .admin-shell, .monthly-schedule-card, .assign-quick-card, .worker-top-summary-card, .module-filters-card, .premium-panel, .glass-card) {
    padding: var(--module-card-pad) !important;
    overflow: hidden;
}

/* 3. Góra sekcji: tytuł + akcje/status w jednym rytmie */
body :where(.users-hero-head, .admin-hero, .settlement-hero, .module-intro-row, .module-intro-row-compact, .section-header, .section-header-inline, .section-header-schedule, .settlement-list-header, .module-titlebar, .premium-panel-head) {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: var(--module-gap) !important;
    flex-wrap: wrap !important;
    margin-bottom: var(--module-gap-sm) !important;
}

body :where(.module-titlebar-actions-only) {
    margin-bottom: var(--module-gap) !important;
}

body :where(.module-page-title-row, .admin-hero-copy, .section-header > div, .section-header-inline > div, .section-header-schedule > div, .module-titlebar > div, .settlement-hero > div:first-child, .premium-hero-content) {
    min-width: min(100%, 320px);
}

/* 4. Szybkie akcje: jedna siatka w każdym module */
body :where(.admin-actions-grid, .admin-actions-grid-2, .admin-actions-grid-4, .admin-actions-grid-5, .admin-actions-grid-6, .worker-actions-grid, .worker-actions-grid-v9, .settlement-actions-grid, .actions-grid, .action-grid, .module-actions, .premium-hero-actions) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--module-action-min)), 1fr)) !important;
    gap: var(--module-gap-sm) !important;
    width: 100% !important;
    margin: 0 !important;
    align-items: stretch !important;
}

body :where(.action-tile, .settlement-action-tile, .requests-page .action-card, .premium-hero-action) {
    min-height: 148px !important;
    height: 100% !important;
    box-sizing: border-box;
}

body :where(.action-tile, .settlement-action-tile) {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    grid-template-rows: auto 1fr auto !important;
    column-gap: 14px !important;
    row-gap: 10px !important;
    align-items: start !important;
}

body :where(.action-tile-icon, .action-icon, .settlement-action-icon) {
    grid-row: 1 / span 2;
    flex: 0 0 auto;
}

body :where(.action-tile-content, .settlement-action-content) {
    min-width: 0;
    display: grid;
    gap: 6px;
}

body :where(.tile-action-btn, .tile-action-row, .settlement-inline-btn) {
    grid-column: 2;
    justify-self: start;
    align-self: end;
}

/* 5. Statystyki/podsumowania: taka sama siatka */
body :where(.summary-grid, .summary-grid-colored, .users-top-stats, .comm-top-stats, .stats-grid, .settlement-stats-grid, .mini-stats-grid, .report-summary-grid, .rcp-presence-stats, .premium-rcp-status-grid, .premium-insights-row) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--module-stat-min)), 1fr)) !important;
    gap: var(--module-gap-sm) !important;
    width: 100% !important;
    margin: 0 !important;
    align-items: stretch !important;
}

body :where(.summary-box, .stat-card, .settlement-stat-card, .rcp-stat, .report-card, .settlement-status-card, .premium-insight-card) {
    min-height: 104px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

body :where(.summary-value, .stat-card strong, .settlement-stat-card strong, .premium-insight-card strong) {
    line-height: 1.05;
}

/* 6. Mniejsze karty/listy statusów */
body :where(.admin-queue-grid, .template-grid, .open-swaps-grid, .assign-quick-grid, .settlement-list-grid, .qr-grid, .upload-preview-grid) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)) !important;
    gap: var(--module-gap-sm) !important;
    width: 100% !important;
}

body :where(.queue-card, .template-card, .open-swap-card, .settlement-employee-card, .upload-card, .preview-card) {
    min-width: 0;
    height: 100%;
}

/* 7. Formularze i filtry */
body :where(.toolbar-shell, .users-toolbar-card, .settlement-toolbar-card, .module-intro-card, .worker-month-switcher-card, .module-filters-card) {
    display: grid !important;
    gap: var(--module-gap-sm) !important;
}

body :where(.filter-row, .filter-row-main, .users-filters, .settlement-filter-form, .month-switcher, .month-switcher-modern, .admin-employee-picker, .settlement-filter-grid, .module-filters-grid, .module-filter-row, .form-grid, .modal-form-grid, .settlement-form-grid, .comm-form-grid) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)) !important;
    gap: var(--module-gap-sm) !important;
    align-items: end !important;
    width: 100% !important;
}

body :where(.toolbar-buttons, .form-actions, .form-actions-end, .month-switcher-actions, .preset-row, .module-filter-presets, .settlement-form-actions) {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

body :where(.toolbar-buttons > *, .form-actions > *, .form-actions-end > *, .month-switcher-actions > *, .module-filter-actions > *) {
    min-width: max-content;
}

body :where(.field-wrap, .field-box, .filter-box, .month-switcher-pill, .settlement-filter-grid label, .settlement-form-grid label, .form-grid label, .modal-form-grid label, .module-filter-field) {
    min-width: 0;
}

/* 7b. Punkt 5: jeden standard filtrów i wyszukiwarek */
body :where(.module-filters-card, .toolbar-shell, .users-toolbar-card, .settlement-toolbar-card, .worker-month-switcher-card) {
    position: relative;
    border-radius: 28px !important;
}

body .module-filters-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    gap: var(--module-gap-sm) !important;
    margin-bottom: var(--module-gap-sm) !important;
}

body .module-filters-title {
    display: grid;
    gap: 4px;
    min-width: min(100%, 300px);
}

body .module-filters-kicker {
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 850;
    opacity: .72;
}

body .module-filters-title h3,
body .module-filters-title h2 {
    margin: 0 !important;
    font-size: clamp(1.02rem, 1.25vw, 1.18rem) !important;
    line-height: 1.16 !important;
    letter-spacing: -0.02em;
}

body .module-filters-title p {
    margin: 0 !important;
    max-width: 72ch;
    opacity: .76;
}

body .module-filters-meta,
body .module-filter-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

body :where(.module-filters-grid, .module-filter-row, .filter-row, .filter-row-main, .users-filters, .settlement-filter-form, .month-switcher, .month-switcher-modern) {
    align-items: end !important;
}

body :where(.module-filter-field, .field-wrap, .filter-box, .month-switcher-pill, .settlement-filter-grid label, .comm-filter-card) {
    display: grid !important;
    gap: 7px !important;
    align-content: end !important;
}

body :where(.module-filter-field > span, .field-wrap > span, .filter-box > span, .month-switcher-pill > span, .settlement-filter-grid label > span, .comm-filter-card > span) {
    font-size: 11px !important;
    line-height: 1.15 !important;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 850 !important;
    opacity: .72;
}

body :where(.module-filter-field input, .module-filter-field select, .field-wrap input, .field-wrap select, .filter-box input, .filter-box select, .month-switcher-pill select, .settlement-filter-grid input, .settlement-filter-grid select, .comm-filter-card select) {
    width: 100% !important;
    min-height: 42px !important;
    border-radius: 16px !important;
    box-sizing: border-box;
}

body .module-filter-actions {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

body :where(.module-filter-actions .btn, .module-filter-actions .secondary-btn, .module-filter-actions .month-switcher-submit, .module-filter-actions .ghost-btn) {
    min-height: 42px;
}

body .module-filter-presets {
    padding-top: 2px;
}

body :where(.preset-chip, .module-filter-chip) {
    min-height: 34px;
    border-radius: 999px !important;
}

body .module-filter-results {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 4px;
    font-size: 12px;
    opacity: .78;
}

body .module-filter-inline {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    align-items: end !important;
    justify-content: flex-end !important;
}

body .module-filter-inline .comm-filter-card {
    min-width: min(100%, 190px);
}

body .legend {
    margin-top: 2px;
}

@media (max-width: 760px) {
    body .module-filters-head,
    body .module-filter-results {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    body .module-filters-meta,
    body .module-filter-count {
        justify-self: start;
        white-space: normal;
    }

    body .module-filter-actions {
        justify-content: stretch !important;
    }

    body .module-filter-actions > * {
        flex: 1 1 160px;
    }
}

/* 8. Główne układy dwukolumnowe: lista/edycja, szczegóły/panel boczny */
body :where(.users-layout, .request-modal-layout, .comments-layout, .detail-grid, .settlement-detail-grid, .settlement-detail-grid--summary, .settlement-detail-grid--v4, .settlement-shared-grid, .comm-layout, .comm-layout-balanced, .rcp-detail-layout, .premium-dashboard-main-grid) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(min(100%, var(--module-side-min)), .42fr) !important;
    gap: var(--module-gap) !important;
    align-items: start !important;
    width: 100% !important;
}

body :where(.comm-layout-single) {
    grid-template-columns: minmax(0, 1fr) !important;
}

/* 9. Listy i tabele nie rozsadzają modułu */
body :where(.table-wrap, .profile-style-table-wrap, .monthly-schedule-wrap, .report-table-wrap, .comm-list-wrap, .list-shell) {
    width: 100% !important;
    max-width: 100% !important;
    overflow: auto !important;
    min-width: 0 !important;
}

body :where(.request-list, .comm-list, .history-timeline, .activity-list, .rcp-history-list, .rcp-presence-list) {
    display: grid;
    gap: var(--module-gap-sm);
}

/* 10. Tytuły sekcji */
body :where(.section-kicker, .queue-kicker, .mini-label) {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    margin-bottom: 6px;
}

body :where(.section-header h2, .section-header h3, .module-titlebar h2, .module-page-title, .admin-hero-copy h2, .settlement-hero h2, .premium-panel-head h2) {
    margin-top: 0 !important;
    margin-bottom: 6px !important;
}

body :where(.module-muted, .settlement-subcopy, .section-subcopy, .module-subtitle) {
    max-width: 72ch;
}

/* 11. Modale */
body :where(.modal-card, .modal-window, .settlement-modal-card, .ui-dialog) {
    max-width: min(100vw - 28px, 1120px) !important;
}

body :where(.modal-card-head, .ui-dialog-head, .modal-header) {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: var(--module-gap-sm) !important;
}

@media (max-width: 1180px) {
    body :where(.users-layout, .request-modal-layout, .comments-layout, .detail-grid, .settlement-detail-grid, .settlement-detail-grid--summary, .settlement-detail-grid--v4, .settlement-shared-grid, .comm-layout, .comm-layout-balanced, .rcp-detail-layout, .premium-dashboard-main-grid) {
        grid-template-columns: 1fr !important;
    }

    body :where(.settlement-hero) {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 760px) {
    :root {
        --module-action-min: 100%;
        --module-stat-min: 136px;
    }

    body .module-page,
    body .module-shell,
    body .premium-dashboard {
        gap: 14px !important;
    }

    body :where(.module-card, .profile-style-card, .module-header-card, .toolbar-shell, .list-shell, .settlement-hero, .settlement-list-card, .settlement-summary-card, .settlement-main-card, .settlement-toolbar-card, .settlement-panel-card, .users-hero-card, .users-toolbar-card, .users-list-card, .users-form-card, .comm-layout-card, .comm-hero-card, .admin-shell, .monthly-schedule-card, .assign-quick-card, .worker-top-summary-card, .module-filters-card, .premium-panel, .glass-card) {
        padding: 16px !important;
        border-radius: 22px !important;
    }

    body :where(.action-tile, .settlement-action-tile) {
        min-height: auto !important;
        grid-template-columns: auto minmax(0, 1fr) !important;
    }

    body :where(.tile-action-btn, .tile-action-row, .settlement-inline-btn) {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    body :where(.toolbar-buttons > *, .form-actions > *, .form-actions-end > *, .month-switcher-actions > *, .module-filter-actions > *) {
        flex: 1 1 100%;
    }

    body :where(.summary-grid, .summary-grid-colored, .users-top-stats, .comm-top-stats, .stats-grid, .settlement-stats-grid, .mini-stats-grid, .report-summary-grid, .rcp-presence-stats, .premium-rcp-status-grid, .premium-insights-row) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 480px) {
    body :where(.summary-grid, .summary-grid-colored, .users-top-stats, .comm-top-stats, .stats-grid, .settlement-stats-grid, .mini-stats-grid, .report-summary-grid, .rcp-presence-stats, .premium-rcp-status-grid, .premium-insights-row) {
        grid-template-columns: 1fr !important;
    }
}


/* =========================================================
   PUNKT 2: WSPÓLNY NAGŁÓWEK MODUŁU
   Wzór: ikona + nazwa + opis + kontekst + główne akcje po prawej.
   ========================================================= */
body :where(.module-header-card, .premium-dashboard-hero.module-header-card) {
    position: relative;
    isolation: isolate;
}

body .module-header-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 0%, rgba(56,189,248,0.18), transparent 34%),
        radial-gradient(circle at 92% 10%, rgba(139,92,246,0.16), transparent 30%);
    opacity: .85;
    z-index: -1;
}

body :where(.module-header-row, .module-header) {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: var(--module-gap) !important;
    flex-wrap: wrap !important;
    width: 100% !important;
}

body .module-header-main {
    min-width: min(100%, 320px);
    flex: 1 1 420px;
    display: grid;
    gap: 12px;
}

body .module-header-title-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

body .module-header-icon,
body .module-page-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.20);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 14px 30px rgba(0,0,0,0.14);
}

body .module-header-icon svg,
body .module-page-icon svg,
body .module-header-icon .app-icon,
body .module-page-icon .app-icon {
    width: 25px;
    height: 25px;
}

body :where(.module-header-kicker, .module-breadcrumb, .section-kicker) {
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 800;
    font-size: 11px;
    opacity: .78;
}

body .module-header-title,
body .module-page-title {
    margin: 0 !important;
    font-size: clamp(1.65rem, 2.4vw, 2.45rem) !important;
    line-height: 1.05 !important;
    letter-spacing: -0.04em;
}

body .module-header-subtitle,
body .module-subtitle,
body .settlement-subcopy {
    margin: 4px 0 0 !important;
    max-width: 74ch;
}

body .module-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

body .module-header-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.16);
    color: inherit;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

body .module-header-actions {
    flex: 0 1 520px;
    display: flex !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-left: auto;
}

body .module-header-actions-stacked {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    align-items: stretch !important;
}

body .module-header-actions :where(a, button, .module-header-action) {
    min-height: 42px;
    border-radius: 14px;
}

body .module-header-actions :where(.button-link, .secondary, .ghost, .secondary-btn, .month-switcher-submit, .btn-primary, .btn-secondary, .tile-action-btn, .publish-state-btn, .soft-action-btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

body .module-header-card-dashboard .premium-hero-actions,
body .premium-dashboard-hero.module-header-card .premium-hero-actions {
    margin-top: 18px !important;
}

body .module-header-embedded {
    margin-bottom: var(--module-gap-sm);
}

body .module-header-embedded + .module-titlebar {
    margin-top: var(--module-gap-sm);
}

@media (max-width: 920px) {
    body .module-header-actions {
        flex: 1 1 100%;
        justify-content: flex-start !important;
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    body .module-header-title-row {
        grid-template-columns: 1fr;
    }

    body .module-header-icon,
    body .module-page-icon {
        width: 48px;
        height: 48px;
        border-radius: 16px;
    }

    body .module-header-actions > * {
        flex: 1 1 100%;
    }
}

/* =========================================================
   PUNKT 3: WSPÓLNA SEKCJA SZYBKICH AKCJI
   Cel: wszystkie akcje modułu są prezentowane w jednym, przewidywalnym miejscu
   bez mieszania ich z filtrami, tabelami i sekcjami informacyjnymi.
   ========================================================= */
body :where(.module-actions-card, .quick-actions-card, .dashboard-actions-card, .rcp-actions-card, .requests-actions-card, .communications-actions-card, .schedule-actions-card, .settlements-actions-card, .users-actions-card) {
    display: grid !important;
    gap: var(--module-gap-sm) !important;
}

body .module-actions-head {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: var(--module-gap-sm) !important;
    flex-wrap: wrap !important;
    margin-bottom: 2px !important;
}

body .module-actions-title {
    display: grid;
    gap: 4px;
    min-width: min(100%, 300px);
}

body .module-actions-title .module-actions-kicker {
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 850;
    opacity: .72;
}

body .module-actions-title h3 {
    margin: 0 !important;
    font-size: clamp(1.05rem, 1.35vw, 1.28rem) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.025em;
}

body .module-actions-title p {
    margin: 0 !important;
    max-width: 72ch;
    opacity: .78;
}

body .module-actions-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

body :where(.module-actions-grid, .module-quick-actions-grid) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--module-action-min)), 1fr)) !important;
    gap: var(--module-gap-sm) !important;
    width: 100% !important;
    align-items: stretch !important;
}

body :where(.module-action-card, .action-tile, .settlement-action-tile, .premium-hero-action, .dashboard-action-card) {
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
}

body :where(.module-action-card, .dashboard-action-card) {
    min-height: 148px;
    height: 100%;
    padding: 18px;
    border-radius: 24px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    column-gap: 14px;
    row-gap: 10px;
    align-items: start;
    color: inherit;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.13);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 16px 36px rgba(0,0,0,0.12);
}

body :where(.module-action-card:hover, .dashboard-action-card:hover, .action-tile:hover, .settlement-action-tile:hover) {
    transform: translateY(-1px);
}

body .module-action-icon,
body .dashboard-action-icon {
    grid-row: 1 / span 2;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.16);
}

body .module-action-icon svg,
body .dashboard-action-icon svg,
body .module-action-icon .app-icon,
body .dashboard-action-icon .app-icon {
    width: 22px;
    height: 22px;
}

body .module-action-content,
body .dashboard-action-content {
    min-width: 0;
    display: grid;
    gap: 6px;
}

body .module-action-content strong,
body .dashboard-action-content strong {
    font-size: 1rem;
    line-height: 1.15;
}

body .module-action-content span,
body .dashboard-action-content span {
    opacity: .78;
    line-height: 1.35;
    font-size: .9rem;
}

body .module-action-cta,
body .dashboard-action-cta {
    grid-column: 2;
    justify-self: start;
    align-self: end;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-weight: 800;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.16);
}

body .module-action-card-primary,
body .dashboard-action-card-primary {
    background:
        linear-gradient(135deg, rgba(16,185,129,0.24), rgba(14,165,233,0.14)),
        rgba(255,255,255,0.08);
    border-color: rgba(125,255,214,0.24);
}

body .module-action-card-warning {
    background:
        linear-gradient(135deg, rgba(245,158,11,0.22), rgba(255,255,255,0.06)),
        rgba(255,255,255,0.08);
}

body .module-action-card-danger {
    background:
        linear-gradient(135deg, rgba(244,63,94,0.22), rgba(255,255,255,0.06)),
        rgba(255,255,255,0.08);
}

body .module-header-actions .module-header-link-to-actions {
    min-width: 170px;
}

body .module-actions-card + :where(.stats-grid, .summary-grid, .admin-queue-grid, .toolbar-shell, .settlement-main-card, .module-card, .premium-insights-row) {
    margin-top: 0 !important;
}

body :where(.admin-shell.admin-shell-v8-clean, .employee-shell.employee-shell-v9) .admin-actions-grid {
    margin-top: 0 !important;
}

@media (max-width: 760px) {
    body .module-actions-head {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    body .module-actions-meta {
        justify-self: start;
        white-space: normal;
    }

    body :where(.module-action-card, .dashboard-action-card) {
        min-height: auto;
        grid-template-columns: auto minmax(0, 1fr);
    }

    body :where(.module-action-cta, .dashboard-action-cta) {
        grid-column: 1 / -1;
        justify-self: stretch;
    }
}


/* =========================================================
   PUNKT 4: WSPÓLNE KARTY STATYSTYK
   Cel: każda sekcja liczbowa ma nagłówek, jedną siatkę i spójny układ:
   ikona / etykieta / wartość / opis pomocniczy.
   ========================================================= */
body :where(.module-stats-card, .dashboard-stats-card, .rcp-stats-card, .requests-stats-card, .communications-stats-card, .schedule-stats-card, .settlements-stats-card, .users-stats-card) {
    display: grid !important;
    gap: var(--module-gap-sm) !important;
}

body .module-stats-head {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: var(--module-gap-sm) !important;
    flex-wrap: wrap !important;
    margin-bottom: 2px !important;
}

body .module-stats-head-compact {
    margin-top: var(--module-gap-sm) !important;
}

body .module-stats-title {
    display: grid;
    gap: 4px;
    min-width: min(100%, 300px);
}

body .module-stats-kicker {
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 850;
    opacity: .72;
}

body .module-stats-title h3,
body .module-stats-title h2 {
    margin: 0 !important;
    font-size: clamp(1.05rem, 1.35vw, 1.28rem) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.025em;
}

body .module-stats-title p {
    margin: 0 !important;
    max-width: 72ch;
    opacity: .78;
}

body .module-stats-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

body :where(.module-stats-grid, .summary-grid, .summary-grid-colored, .users-top-stats, .comm-top-stats, .stats-grid, .settlement-stats-grid, .mini-stats-grid, .report-summary-grid, .rcp-presence-stats, .premium-rcp-status-grid, .premium-insights-row, .premium-admin-kpi-grid, .rcp-detail-summary-grid) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--module-stat-min)), 1fr)) !important;
    gap: var(--module-gap-sm) !important;
    width: 100% !important;
    margin: 0 !important;
    align-items: stretch !important;
}

body :where(.module-stat-card, .summary-box, .stat-card, .settlement-stat-card, .rcp-stat, .report-card, .settlement-status-card, .premium-insight-card, .premium-admin-kpi, .employee-stat-card) {
    position: relative;
    min-height: 112px;
    width: 100%;
    box-sizing: border-box;
    display: grid !important;
    align-content: center;
    gap: 7px;
    padding: 16px !important;
    border-radius: 22px !important;
    background: rgba(255,255,255,0.075);
    border: 1px solid rgba(255,255,255,0.13);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 14px 32px rgba(0,0,0,0.10);
    overflow: hidden;
}

body :where(.module-stat-card, .summary-box, .stat-card, .settlement-stat-card, .rcp-stat, .premium-admin-kpi, .employee-stat-card)::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 100% 0%, rgba(255,255,255,0.13), transparent 36%);
    opacity: .8;
}

body :where(.module-stat-icon, .summary-icon, .stat-icon, .premium-admin-kpi > span, .premium-insight-icon) {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.11);
    border: 1px solid rgba(255,255,255,0.14);
    margin-bottom: 2px;
}

body :where(.module-stat-icon svg, .summary-icon svg, .stat-icon svg, .premium-admin-kpi > span svg, .premium-insight-icon svg) {
    width: 20px;
    height: 20px;
}

body :where(.summary-label, .stat-label, .rcp-stat-label, .settlement-stat-card span, .premium-insight-label, .employee-stat-label, .premium-admin-kpi small, .module-stat-label) {
    order: -1;
    font-size: 11px !important;
    line-height: 1.2 !important;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 850 !important;
    opacity: .72;
}

body :where(.summary-value, .stat-value, .stat-card strong, .settlement-stat-card strong, .rcp-stat strong, .premium-insight-card strong, .premium-admin-kpi strong, .employee-stat-card strong, .module-stat-value) {
    font-size: clamp(1.45rem, 2.2vw, 2.05rem) !important;
    line-height: 1.02 !important;
    letter-spacing: -0.04em;
    font-weight: 900 !important;
}

body :where(.summary-description, .stat-description, .module-stat-description, .summary-box small, .stat-card small, .settlement-stat-card small, .premium-insight-card small, .employee-stat-card small, .premium-admin-kpi small) {
    font-size: 12px;
    line-height: 1.35;
    opacity: .74;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 650;
}

body :where(.stat-card-create) {
    cursor: pointer;
    text-align: left;
    color: inherit;
}

body .module-stats-card + .module-actions-card,
body .module-actions-card + .module-stats-card {
    margin-top: 0 !important;
}

@media (max-width: 760px) {
    body .module-stats-head {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    body .module-stats-meta {
        justify-self: start;
        white-space: normal;
    }

    body :where(.module-stats-grid, .summary-grid, .summary-grid-colored, .users-top-stats, .comm-top-stats, .stats-grid, .settlement-stats-grid, .mini-stats-grid, .report-summary-grid, .rcp-presence-stats, .premium-rcp-status-grid, .premium-insights-row, .premium-admin-kpi-grid, .rcp-detail-summary-grid) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 480px) {
    body :where(.module-stats-grid, .summary-grid, .summary-grid-colored, .users-top-stats, .comm-top-stats, .stats-grid, .settlement-stats-grid, .mini-stats-grid, .report-summary-grid, .rcp-presence-stats, .premium-rcp-status-grid, .premium-insights-row, .premium-admin-kpi-grid, .rcp-detail-summary-grid) {
        grid-template-columns: 1fr !important;
    }
}


/* =========================================================
   PUNKT 6: GŁÓWNA ZAWARTOŚĆ I ZAKŁADKI MODUŁÓW
   Cel: listy, tabele, panele szczegółów, kalendarze i główne karty treści
   mają ten sam rytm: nagłówek sekcji, przewidywalny kontener, bezpieczne
   przewijanie tabel i responsywny układ lista + panel boczny.
   ========================================================= */
:root {
    --module-content-side: 380px;
    --module-table-min: 760px;
    --module-list-gap: var(--module-gap-sm);
}

body :where(.module-content-card, .module-card-content, .dashboard-content-card, .rcp-content-card, .requests-list-card, .communications-content-card, .schedule-content-card, .settlements-content-card, .users-content-card, .list-shell, .users-list-card, .users-form-card, .comm-layout-card, .settlement-list-card, .settlement-main-card, .monthly-schedule-card, .assign-quick-card, .premium-section-card, .premium-admin-system-tools, .glass-card) {
    display: grid !important;
    gap: var(--module-gap-sm) !important;
    align-content: start !important;
    min-width: 0 !important;
}

body .module-content-head,
body :where(.module-content-card > .section-header, .module-content-card > .module-titlebar, .list-shell > .section-header, .settlement-list-header, .monthly-schedule-card > .section-header-schedule, .users-list-card > .section-header, .users-form-card > .section-header, .comm-list-wrap > .section-header, .premium-panel-head) {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: var(--module-gap-sm) !important;
    flex-wrap: wrap !important;
    margin-bottom: 2px !important;
}

body .module-content-title,
body :where(.module-content-head > div, .section-header > div, .section-header-inline > div, .section-header-schedule > div, .settlement-list-header > div, .premium-panel-head > div) {
    min-width: min(100%, 300px);
    display: grid;
    gap: 4px;
}

body .module-content-kicker,
body :where(.module-content-head .section-kicker, .module-content-head .module-content-kicker) {
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 850;
    opacity: .72;
}

body :where(.module-content-head h2, .module-content-head h3, .module-content-card .section-header h2, .module-content-card .section-header h3, .module-content-card .module-titlebar h2, .settlement-list-header h3, .premium-panel-head .section-title) {
    margin: 0 !important;
    font-size: clamp(1.08rem, 1.45vw, 1.35rem) !important;
    line-height: 1.14 !important;
    letter-spacing: -0.025em;
}

body :where(.module-content-head p, .module-content-card .section-subcopy, .module-content-card .module-muted, .settlement-list-header .settlement-subcopy, .premium-panel-head .section-subtitle) {
    margin: 0 !important;
    max-width: 74ch;
    opacity: .78;
}

body .module-content-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

body :where(.module-content-grid, .dashboard-content-grid, .premium-dashboard-section-grid) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)) !important;
    gap: var(--module-gap) !important;
    width: 100% !important;
    align-items: start !important;
}

body :where(.module-content-split, .users-layout, .comm-layout-balanced, .request-modal-layout, .comments-layout, .settlement-detail-grid, .settlement-detail-grid--summary, .settlement-detail-grid--v4, .premium-dashboard-main-grid, .premium-admin-main-grid) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(min(100%, var(--module-content-side)), .42fr) !important;
    gap: var(--module-gap) !important;
    align-items: start !important;
    width: 100% !important;
}

body :where(.module-content-single, .comm-layout-single) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: var(--module-gap-sm) !important;
    width: 100% !important;
}

body :where(.module-list-panel, .comm-list-wrap, .comm-list-wrap-compact, .users-list-card, .settlement-list-card, .list-shell, .premium-section-wide) {
    min-width: 0 !important;
    width: 100% !important;
}

body :where(.module-side-panel, .users-form-card, .premium-side-panel, .premium-admin-today-card, .premium-admin-communications-card) {
    min-width: 0 !important;
    width: 100% !important;
}

body :where(.module-list-stack, .request-list, .comm-list, .history-timeline, .activity-list, .attention-list, .rcp-history-list, .rcp-presence-list, .component-list, .discrepancy-list, .assign-shift-list, .assign-candidates-list) {
    display: grid !important;
    gap: var(--module-list-gap) !important;
    width: 100% !important;
    min-width: 0 !important;
}

body :where(.module-record-card, .request-row, .comm-card, .settlement-employee-card, .history-item, .activity-item, .attention-item, .portal-card, .component-row, .component-list > *, .discrepancy-item, .assign-candidate-card, .assigned-slot-current-card) {
    min-width: 0 !important;
    width: 100%;
    box-sizing: border-box;
}

body :where(.module-table-wrap, .table-wrap, .profile-style-table-wrap, .monthly-schedule-wrap, .report-table-wrap) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    border-radius: 20px;
    -webkit-overflow-scrolling: touch;
}

body :where(.module-table, .users-table, .schedule-table, .schedule-table-modern, .profile-style-table, .report-table, .mini-table) {
    width: 100% !important;
    min-width: min(100%, var(--module-table-min));
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

body :where(.module-table th, .module-table td, .users-table th, .users-table td, .schedule-table th, .schedule-table td, .profile-style-table th, .profile-style-table td, .report-table th, .report-table td) {
    vertical-align: middle !important;
    box-sizing: border-box;
}

body :where(.module-table th, .users-table th, .schedule-table th, .profile-style-table th, .report-table th) {
    white-space: nowrap;
}

body :where(.module-content-card .assign-empty, .module-content-card .empty-box, .module-content-card .empty-state, .list-shell .empty-box, .comm-list .assign-empty, .request-list + .assign-empty) {
    width: 100%;
    min-height: 96px;
    display: grid;
    place-items: center;
    text-align: center;
    border-radius: 20px;
    background: rgba(255,255,255,0.055);
    border: 1px dashed rgba(255,255,255,0.16);
    padding: 18px;
    box-sizing: border-box;
}

body :where(.schedule-mobile-cards, .mobile-shift-list, .settlement-excluded-list, .template-grid, .admin-queue-grid) {
    min-width: 0 !important;
}

body :where(.comm-card-main, .request-row-main) {
    min-width: 0 !important;
    width: 100%;
    text-align: left;
}

body :where(.comm-card-footer, .request-main-right, .settlement-card-actions, .quick-actions-bar, .inline-actions) {
    min-width: 0;
    flex-wrap: wrap;
}

body :where(.module-content-card + .module-content-card, .module-content-card + .module-card, .module-card + .module-content-card) {
    margin-top: 0 !important;
}

@media (max-width: 1180px) {
    body :where(.module-content-split, .users-layout, .comm-layout-balanced, .request-modal-layout, .comments-layout, .settlement-detail-grid, .settlement-detail-grid--summary, .settlement-detail-grid--v4, .premium-dashboard-main-grid, .premium-admin-main-grid) {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 760px) {
    body .module-content-head,
    body :where(.module-content-card > .section-header, .module-content-card > .module-titlebar, .list-shell > .section-header, .settlement-list-header, .monthly-schedule-card > .section-header-schedule, .users-list-card > .section-header, .users-form-card > .section-header, .comm-list-wrap > .section-header, .premium-panel-head) {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    body .module-content-meta {
        justify-self: start;
        white-space: normal;
    }

    body :where(.module-table, .users-table, .schedule-table, .schedule-table-modern, .profile-style-table, .report-table, .mini-table) {
        min-width: 720px;
    }

    body :where(.request-row-main, .comm-card-head, .comm-card-footer, .settlement-card-head, .activity-top, .history-head) {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
}


/* =========================================================
   PUNKT 7: ZAKŁADKI W WIĘKSZYCH MODUŁACH
   Cel: większe moduły mają wspólny pasek zakładek/nawigacji,
   bez zmiany backendu ani ukrywania istniejącej treści formularzy.
   Zakładki działają jako bezpieczna nawigacja do sekcji lub jako
   przyciski otwierające już istniejące modale.
   ========================================================= */
body .module-tabs-card {
    display: grid !important;
    gap: var(--module-gap-sm) !important;
    position: sticky;
    top: 10px;
    z-index: 12;
    border-radius: 28px !important;
    backdrop-filter: blur(16px);
}

body .module-tabs-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: var(--module-gap-sm) !important;
    flex-wrap: wrap !important;
}

body .module-tabs-head > div {
    display: grid;
    gap: 4px;
    min-width: min(100%, 300px);
}

body .module-tabs-kicker {
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 850;
    opacity: .72;
}

body .module-tabs-head h3 {
    margin: 0 !important;
    font-size: clamp(1.02rem, 1.25vw, 1.18rem) !important;
    line-height: 1.16 !important;
    letter-spacing: -0.02em;
}

body .module-tabs-head p {
    margin: 0 !important;
    max-width: 76ch;
    opacity: .76;
}

body .module-tabs-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

body .module-tabs {
    display: flex !important;
    align-items: stretch !important;
    gap: 10px !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px !important;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

body .module-tabs-inside {
    position: relative;
    margin-bottom: var(--module-gap-sm) !important;
}

body .module-tab,
body .settlement-tab.module-tab {
    appearance: none;
    border: 1px solid rgba(255,255,255,0.14) !important;
    background: rgba(255,255,255,0.07) !important;
    color: inherit !important;
    min-height: 42px;
    padding: 10px 14px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-size: 13px !important;
    font-weight: 850 !important;
    line-height: 1.1 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

body .module-tab:hover,
body .settlement-tab.module-tab:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.11) !important;
    border-color: rgba(255,255,255,0.24) !important;
}

body .module-tab.is-active,
body .settlement-tab.module-tab.active,
body .settlement-tab.module-tab.is-active {
    background: linear-gradient(135deg, rgba(56,189,248,0.26), rgba(129,140,248,0.20)) !important;
    border-color: rgba(125,211,252,0.42) !important;
    box-shadow: 0 12px 28px rgba(15,23,42,0.22);
}

body .module-tab svg,
body .module-tab .app-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

body .module-tab span {
    display: inline-flex;
    align-items: center;
}

body :where(#scheduleMainView, #schedulePlanningView, #workerAvailabilitySection, #communicationsOverviewSection, #communicationsIncidentsSection, #communicationsInboxSection, #settlementsOverviewSection, #settlementsSharedSection, #settlementsFiltersSection, #settlementsEmployeesSection) {
    scroll-margin-top: 120px;
}

body :where(.schedule-tabs-card, .communications-tabs-card, .settlements-tabs-card) + :where(.module-card, .module-content-card, .settlement-main-card, .settlement-toolbar-card, .settlement-list-card) {
    margin-top: 0 !important;
}

@media (max-width: 900px) {
    body .module-tabs-card {
        position: relative;
        top: auto;
        z-index: 1;
    }
}

@media (max-width: 640px) {
    body .module-tabs-head {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    body .module-tabs-meta {
        justify-self: start;
        white-space: normal;
    }

    body .module-tabs {
        gap: 8px !important;
        padding-bottom: 8px !important;
    }

    body .module-tab,
    body .settlement-tab.module-tab {
        min-height: 40px;
        padding: 9px 12px !important;
        font-size: 12px !important;
    }
}


/* =========================================================
   8. Punkt 8: jeden standard formularzy w modułach
   Cel: formularze mają ten sam rytm, etykiety, pola, stopki akcji,
   zachowanie w modalach i responsywność bez zmiany logiki backendu.
   ========================================================= */
body :where(.module-form, .users-form, .comm-form-grid, .modal-form-grid, .settlement-form-grid, .report-form, .generator-settings-form, .availability-rules-form, [data-manual-record-form], [data-settings-form]) {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

body :where(.module-form-grid, .users-form, .comm-form-grid, .modal-form-grid, .settlement-form-grid, .report-form, [data-manual-record-form] .form-grid, [data-settings-form] .form-grid) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)) !important;
    gap: var(--module-gap-sm) !important;
    align-items: end !important;
}

body :where(.module-form-head, .form-section-head) {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: var(--module-gap-sm) !important;
    flex-wrap: wrap !important;
    margin-bottom: var(--module-gap-sm) !important;
}

body :where(.module-form-title, .form-section-title) {
    display: grid;
    gap: 4px;
    min-width: min(100%, 280px);
}

body :where(.module-form-title h2, .module-form-title h3, .module-form-title h4, .form-section-title h2, .form-section-title h3, .form-section-title h4) {
    margin: 0 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
}

body :where(.module-form-title p, .form-section-title p) {
    margin: 0 !important;
    opacity: .76;
}

body :where(.module-form-kicker, .form-section-kicker) {
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 850;
    opacity: .72;
}

body :where(.module-form-field, .module-form label, .users-form label, .comm-form-grid label, .modal-form-grid label, .settlement-form-grid label, .report-form label, [data-manual-record-form] label, [data-settings-form] label) {
    min-width: 0 !important;
    display: grid !important;
    gap: 7px !important;
    align-content: end !important;
}

body :where(.module-form-field > span, .module-form label > span, .users-form label > span, .comm-form-grid label > span, .modal-form-grid label > span, .settlement-form-grid label > span, .report-form label > span, [data-manual-record-form] label > span, [data-settings-form] label > span) {
    font-size: 11px !important;
    line-height: 1.15 !important;
    letter-spacing: .06em !important;
    text-transform: uppercase !important;
    font-weight: 850 !important;
    opacity: .74;
}

body :where(.module-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .module-form select, .module-form textarea, .users-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .users-form select, .users-form textarea, .comm-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .comm-form-grid select, .comm-form-grid textarea, .modal-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .modal-form-grid select, .modal-form-grid textarea, .settlement-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .settlement-form-grid select, .settlement-form-grid textarea, .report-form textarea, [data-manual-record-form] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), [data-manual-record-form] select, [data-settings-form] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), [data-settings-form] select) {
    width: 100% !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
    border-radius: 16px !important;
    padding: 10px 13px !important;
}

body :where(.module-form textarea, .users-form textarea, .comm-form-grid textarea, .modal-form-grid textarea, .settlement-form-grid textarea, .report-form textarea) {
    min-height: 112px !important;
    resize: vertical !important;
    line-height: 1.45 !important;
}

body :where(.module-form select, .users-form select, .comm-form-grid select, .modal-form-grid select, .settlement-form-grid select, [data-manual-record-form] select) {
    cursor: pointer;
}

body :where(.module-form input:focus, .module-form select:focus, .module-form textarea:focus, .users-form input:focus, .users-form select:focus, .users-form textarea:focus, .comm-form-grid input:focus, .comm-form-grid select:focus, .comm-form-grid textarea:focus, .modal-form-grid input:focus, .modal-form-grid select:focus, .modal-form-grid textarea:focus, .settlement-form-grid input:focus, .settlement-form-grid select:focus, .settlement-form-grid textarea:focus, [data-manual-record-form] input:focus, [data-manual-record-form] select:focus, [data-settings-form] input:focus) {
    outline: 2px solid rgba(125, 211, 252, .48) !important;
    outline-offset: 2px !important;
}

body :where(.field-hint, .module-form-hint, .users-form small, .comm-form-grid small, .modal-form-grid small, .settlement-form-grid small) {
    font-size: 12px !important;
    line-height: 1.35 !important;
    opacity: .68 !important;
}

body :where(.field-span-2, .full-span, .module-form-span-2) {
    grid-column: 1 / -1 !important;
}

body :where(.module-form-footer, .form-actions, .form-actions-end, .settlement-form-actions, .generator-settings-actions, .availability-rules-actions) {
    grid-column: 1 / -1;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-top: 4px !important;
    padding-top: var(--module-gap-sm) !important;
    border-top: 1px solid rgba(255,255,255,0.08);
}

body :where(.module-form-footer .btn, .module-form-footer button, .form-actions .btn, .form-actions button, .settlement-form-actions button, .generator-settings-actions button, .availability-rules-actions button) {
    min-height: 40px;
}

body :where(.check-chip, .generator-setting-card) {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
}

body :where(.check-chip input, .generator-setting-card input) {
    flex: 0 0 auto;
    margin-top: 2px;
}

body :where(.module-form-inline, .inline-form, .compact-form, .publish-state-form) {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
}

body :where(.modal-window .module-form, .modal-panel .module-form, .modal-card .module-form, .modal-window form, .modal-panel form, .modal-card form) {
    margin-top: var(--module-gap-sm) !important;
}

body :where(.modal-window, .modal-panel, .modal-card) :where(.module-form-footer, .form-actions, .settlement-form-actions, .generator-settings-actions) {
    position: sticky;
    bottom: -1px;
    background: linear-gradient(180deg, rgba(15,23,42,0.35), rgba(15,23,42,0.82));
    backdrop-filter: blur(14px);
    margin-left: calc(var(--module-card-pad-sm) * -1);
    margin-right: calc(var(--module-card-pad-sm) * -1);
    padding-left: var(--module-card-pad-sm) !important;
    padding-right: var(--module-card-pad-sm) !important;
}

@media (max-width: 720px) {
    body :where(.module-form-grid, .users-form, .comm-form-grid, .modal-form-grid, .settlement-form-grid, .report-form, [data-manual-record-form] .form-grid, [data-settings-form] .form-grid) {
        grid-template-columns: 1fr !important;
    }

    body :where(.module-form-footer, .form-actions, .form-actions-end, .settlement-form-actions, .generator-settings-actions, .availability-rules-actions) {
        justify-content: stretch !important;
    }

    body :where(.module-form-footer > *, .form-actions > *, .form-actions-end > *, .settlement-form-actions > *, .generator-settings-actions > *, .availability-rules-actions > *) {
        flex: 1 1 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }
}

/* =========================================================
   HR CORE - PUNKT 9: MODALE / POPUPY
   Zakres: jeden standard okien modalnych w modułach.
   Nie zmienia logiki JS/backendu ani nazw istniejących klas.
   ========================================================= */

:root {
    --module-modal-width: min(100vw - 32px, 720px);
    --module-modal-width-wide: min(100vw - 32px, 1120px);
    --module-modal-width-xl: min(100vw - 32px, 1320px);
    --module-modal-max-height: calc(100dvh - 32px);
}

/* Wspólna warstwa tła dla różnych implementacji modali w modułach */
body :where(.modal-shell, .settlement-modal, .ui-modal-root) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1200 !important;
    display: grid !important;
    place-items: center !important;
    padding: 16px !important;
    overflow: auto !important;
}

body :where(.modal-shell.hidden, .modal-shell[hidden], .settlement-modal:not(.is-visible), .ui-modal-root[hidden]) {
    display: none !important;
}

body :where(.modal-backdrop[data-modal], .modal-backdrop[id$="Modal"], .modal-backdrop.modal-xl) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1200 !important;
    display: grid !important;
    place-items: center !important;
    padding: 16px !important;
    overflow: auto !important;
    background: rgba(2, 6, 23, 0.68) !important;
    backdrop-filter: blur(18px) saturate(135%) !important;
}

body :where(.modal-backdrop[data-modal][hidden]) {
    display: none !important;
}

body :where(.modal-shell > .modal-backdrop, .settlement-modal-backdrop, .ui-dialog-backdrop) {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(2, 6, 23, 0.68) !important;
    backdrop-filter: blur(18px) saturate(135%) !important;
}

/* Wspólny wygląd karty okna */
body :where(.modal-window, .modal-panel, .modal-card, .settlement-modal-card, .ui-dialog) {
    position: relative !important;
    z-index: 1 !important;
    width: var(--module-modal-width) !important;
    max-width: var(--module-modal-width) !important;
    max-height: var(--module-modal-max-height) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
    border-radius: 28px !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92)),
        rgba(15, 23, 42, 0.94) !important;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.44) !important;
    color: var(--ui-text, #f8fafc) !important;
}

body :where(.modal-xl, .modal-panel-wide, .modal-panel-report, .modal-panel-calendar, .modal-panel-planner, .settlement-main-card, .history-modal-card) {
    width: var(--module-modal-width-wide) !important;
    max-width: var(--module-modal-width-wide) !important;
}

body :where(.modal-panel-calendar, .modal-panel-planner, .settlement-main-card) {
    width: var(--module-modal-width-xl) !important;
    max-width: var(--module-modal-width-xl) !important;
}

/* Nagłówek modala */
body :where(.modal-header, .modal-card-head, .settlement-modal-header, .ui-dialog-head) {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: var(--module-gap-sm) !important;
    padding: 20px 22px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)) !important;
}

body :where(.modal-header h2, .modal-header h3, .modal-card-head h2, .modal-card-head h3, .settlement-modal-header h2, .settlement-modal-header h3, .ui-dialog-head h2, .ui-dialog-head h3) {
    margin: 0 !important;
    font-size: clamp(1.08rem, 1.6vw, 1.45rem) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
}

body :where(.modal-header p, .modal-card-head p, .settlement-modal-subtitle, .ui-dialog-head p, .dialog-kicker) {
    margin: 6px 0 0 !important;
    color: var(--ui-text-muted, rgba(226, 232, 240, 0.72)) !important;
    font-size: 0.9rem !important;
    line-height: 1.45 !important;
}

/* Przycisk zamykania */
body :where(.modal-close, .icon-chip-btn[data-modal-close], .settlement-close-btn, .js-close-history-modal, .js-close-pin-modal) {
    flex: 0 0 auto !important;
    min-width: 38px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--ui-text, #f8fafc) !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

body :where(.modal-close, .icon-chip-btn[data-modal-close], .settlement-close-btn, .js-close-history-modal, .js-close-pin-modal):hover {
    background: rgba(255, 255, 255, 0.14) !important;
    transform: translateY(-1px);
}

/* Treść modala przewija się wewnątrz okna, nie całą stroną */
body :where(.modal-window, .modal-panel, .modal-card, .settlement-modal-card, .ui-dialog) > :where(:not(.modal-header):not(.modal-card-head):not(.settlement-modal-header):not(.ui-dialog-head)) {
    min-height: 0;
}

body :where(.modal-body, .ui-dialog-body, .modal-planner-grid-wrap, .modal-calendar-scroll, .availability-overview-scroll, .message-detail-body, .history-timeline-modal, .settlement-modal-body, .settlement-modal-content) {
    overflow: auto !important;
    min-height: 0 !important;
}

body :where(.modal-window > form, .modal-window > .module-form, .modal-window > .modal-body, .modal-window > .table-wrap, .modal-panel > form, .modal-panel > .module-form, .modal-panel > .modal-body, .modal-panel > .modal-calendar-scroll, .modal-panel > .modal-planner-grid-wrap, .modal-card > form, .modal-card > .history-timeline, .ui-dialog-body, .settlement-modal-card > .settlement-modal-body, .settlement-modal-card > .settlement-modal-content) {
    padding: 20px 22px !important;
}

/* Stopki i przyciski w modalach */
body :where(.modal-window, .modal-panel, .modal-card, .settlement-modal-card, .ui-dialog) :where(.modal-footer, .module-form-footer, .form-actions, .form-actions-end, .settlement-form-actions, .generator-settings-actions, .availability-rules-actions) {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    padding: 16px 22px !important;
    margin: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.10) !important;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.64), rgba(15, 23, 42, 0.9)) !important;
    backdrop-filter: blur(14px) !important;
}

/* Tabele i rozbudowane widoki w modalach nie rozpychają okna */
body :where(.modal-window, .modal-panel, .modal-card, .settlement-modal-card, .ui-dialog) :where(.table-wrap, .report-table-wrap, .profile-style-table-wrap, table, .modal-planner-grid, .status-calendar-grid, .availability-overview-grid) {
    max-width: 100% !important;
}

body :where(.modal-window, .modal-panel, .modal-card, .settlement-modal-card, .ui-dialog) :where(.table-wrap, .report-table-wrap, .profile-style-table-wrap, .modal-planner-grid-wrap, .modal-calendar-scroll) {
    overflow: auto !important;
}

/* Kompaktowe okna potwierdzeń / PIN */
body :where(#pinModal .modal-card, .modal-panel-assign-picker, .quick-shift-editor-panel) {
    width: min(100vw - 32px, 560px) !important;
    max-width: min(100vw - 32px, 560px) !important;
}

body :where(.modal-user-name) {
    margin: 18px 22px 0 !important;
    padding: 12px 14px !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.07) !important;
    color: var(--ui-text, #f8fafc) !important;
}

@media (max-width: 760px) {
    :root {
        --module-modal-width: calc(100vw - 20px);
        --module-modal-width-wide: calc(100vw - 20px);
        --module-modal-width-xl: calc(100vw - 20px);
        --module-modal-max-height: calc(100dvh - 20px);
    }

    body :where(.modal-shell, .settlement-modal, .ui-modal-root, .modal-backdrop[data-modal], .modal-backdrop[id$="Modal"], .modal-backdrop.modal-xl) {
        padding: 10px !important;
        align-items: end !important;
        place-items: end center !important;
    }

    body :where(.modal-window, .modal-panel, .modal-card, .settlement-modal-card, .ui-dialog) {
        border-radius: 24px 24px 18px 18px !important;
        max-height: calc(100dvh - 20px) !important;
    }

    body :where(.modal-header, .modal-card-head, .settlement-modal-header, .ui-dialog-head) {
        padding: 16px !important;
    }

    body :where(.modal-window > form, .modal-window > .module-form, .modal-window > .modal-body, .modal-window > .table-wrap, .modal-panel > form, .modal-panel > .module-form, .modal-panel > .modal-body, .modal-panel > .modal-calendar-scroll, .modal-panel > .modal-planner-grid-wrap, .modal-card > form, .modal-card > .history-timeline, .ui-dialog-body, .settlement-modal-card > .settlement-modal-body, .settlement-modal-card > .settlement-modal-content) {
        padding: 16px !important;
    }

    body :where(.modal-window, .modal-panel, .modal-card, .settlement-modal-card, .ui-dialog) :where(.modal-footer, .module-form-footer, .form-actions, .form-actions-end, .settlement-form-actions, .generator-settings-actions, .availability-rules-actions) {
        padding: 14px 16px !important;
        justify-content: stretch !important;
    }

    body :where(.modal-window, .modal-panel, .modal-card, .settlement-modal-card, .ui-dialog) :where(.modal-footer, .module-form-footer, .form-actions, .form-actions-end, .settlement-form-actions, .generator-settings-actions, .availability-rules-actions) > * {
        flex: 1 1 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }
}


/* =========================================================
   PUNKT 10: TABELE
   Cel: jeden, spójny wygląd tabel w modułach, bez zmiany
   backendu, nazw pól ani logiki JavaScript.
   ========================================================= */
body {
    --module-table-border: rgba(255, 255, 255, 0.11);
    --module-table-head-bg: rgba(15, 23, 42, 0.86);
    --module-table-row-bg: rgba(255, 255, 255, 0.035);
    --module-table-row-hover: rgba(255, 255, 255, 0.075);
    --module-table-cell-padding-y: 13px;
    --module-table-cell-padding-x: 14px;
}

body :where(.module-table-wrap, .table-wrap, .profile-style-table-wrap, .monthly-schedule-wrap, .report-table-wrap) {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    border: 1px solid var(--module-table-border) !important;
    border-radius: 22px !important;
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.035)) !important;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18) !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin;
}

body :where(.module-table-wrap, .table-wrap, .profile-style-table-wrap, .monthly-schedule-wrap, .report-table-wrap)::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 26px;
    pointer-events: none;
    border-radius: 0 22px 22px 0;
    background: linear-gradient(90deg, rgba(15,23,42,0), rgba(15,23,42,0.18));
    opacity: .7;
}

body :where(.module-table, .users-table, .schedule-table, .schedule-table-modern, .profile-style-table, .report-table, .mini-table) {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent !important;
}

body :where(.module-table thead th, .users-table thead th, .schedule-table thead th, .profile-style-table thead th, .report-table thead th, .mini-table thead th) {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 13px 14px !important;
    color: rgba(248, 250, 252, 0.82) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    text-align: left !important;
    white-space: nowrap !important;
    border-bottom: 1px solid rgba(255,255,255,0.13) !important;
    background: var(--module-table-head-bg) !important;
    backdrop-filter: blur(16px) !important;
}

body :where(.module-table tbody td, .users-table tbody td, .schedule-table tbody td, .profile-style-table tbody td, .report-table tbody td, .mini-table tbody td) {
    padding: var(--module-table-cell-padding-y) var(--module-table-cell-padding-x) !important;
    color: rgba(248, 250, 252, 0.90) !important;
    vertical-align: middle !important;
    border-bottom: 1px solid rgba(255,255,255,0.075) !important;
    background: transparent !important;
}

body :where(.module-table tbody tr, .users-table tbody tr, .schedule-table tbody tr, .profile-style-table tbody tr, .report-table tbody tr, .mini-table tbody tr) {
    transition: background .16s ease, transform .16s ease, opacity .16s ease;
}

body :where(.module-table tbody tr:nth-child(even), .users-table tbody tr:nth-child(even), .profile-style-table tbody tr:nth-child(even), .report-table tbody tr:nth-child(even), .mini-table tbody tr:nth-child(even)) td {
    background: var(--module-table-row-bg) !important;
}

body :where(.module-table tbody tr:hover, .users-table tbody tr:hover, .profile-style-table tbody tr:hover, .report-table tbody tr:hover, .mini-table tbody tr:hover) td {
    background: var(--module-table-row-hover) !important;
}

body :where(.module-table tbody tr:last-child td, .users-table tbody tr:last-child td, .schedule-table tbody tr:last-child td, .profile-style-table tbody tr:last-child td, .report-table tbody tr:last-child td, .mini-table tbody tr:last-child td) {
    border-bottom: 0 !important;
}

/* Kolumny akcji: przyciski zawsze w jednym, przewidywalnym układzie */
body :where(.row-actions, .inline-actions, .table-actions, .module-table-actions) {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    min-width: max-content !important;
}

body :where(.users-table th:last-child, .users-table td:last-child) {
    text-align: right !important;
}

body :where(.users-table td:last-child .row-actions, .users-table td:last-child .inline-actions) {
    justify-content: flex-end !important;
}

/* Statusy, role i małe znaczniki w tabelach mają wspólną geometrię */
body :where(.module-table .status-chip, .module-table .role-badge, .module-table .employment-badge, .module-table .pin-pill, .users-table .status-chip, .users-table .role-badge, .users-table .employment-badge, .users-table .pin-pill, .schedule-table .status-chip, .schedule-table .status-tag, .report-table .status-chip) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 26px !important;
    padding: 5px 10px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
}

body :where(.module-table code, .users-table code, .report-table code) {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 9px;
    color: rgba(248, 250, 252, .9);
    background: rgba(15, 23, 42, .45);
    border: 1px solid rgba(255,255,255,.09);
}

/* Puste wiersze tabel */
body :where(.module-table .empty-state, .module-table-empty-cell, .users-table .module-table-empty-cell, .schedule-table .assign-loading) {
    padding: 22px !important;
    text-align: center !important;
    color: rgba(248, 250, 252, .72) !important;
    background: rgba(255,255,255,.035) !important;
}

body :where(.module-table-empty, .module-table .assign-empty, .module-table .empty-box, .module-table .empty-state) {
    width: 100%;
    min-height: 84px;
    display: grid;
    place-items: center;
    text-align: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px dashed rgba(255, 255, 255, 0.16);
}

/* Tabele grafikowe: zachowanie sticky kolumn i większy minimalny obszar roboczy */
body :where(.monthly-schedule-wrap .schedule-table, .schedule-table-modern) {
    min-width: max(980px, 100%) !important;
}

body :where(.report-table-wrap .report-table) {
    min-width: max(980px, 100%) !important;
}

body :where(.schedule-table .sticky-col, .report-table .sticky-col) {
    position: sticky !important;
    left: 0 !important;
    z-index: 6 !important;
    background: rgba(15, 23, 42, 0.94) !important;
    box-shadow: 10px 0 20px rgba(15, 23, 42, 0.10) !important;
}

body :where(.schedule-table thead .sticky-col, .report-table thead .sticky-col) {
    z-index: 8 !important;
}

/* Kompaktowe tabele w raportach i modalach */
body :where(.mini-table thead th, .mini-table tbody td, .report-table thead th, .report-table tbody td) {
    padding: 10px 11px !important;
    font-size: 12px !important;
}

body :where(.modal-window, .modal-panel, .modal-card, .settlement-modal-card, .ui-dialog) :where(.module-table-wrap, .table-wrap, .report-table-wrap, .profile-style-table-wrap) {
    border-radius: 18px !important;
    box-shadow: none !important;
}

@media (max-width: 760px) {
    body {
        --module-table-cell-padding-y: 11px;
        --module-table-cell-padding-x: 12px;
    }

    body :where(.module-table-wrap, .table-wrap, .profile-style-table-wrap, .monthly-schedule-wrap, .report-table-wrap) {
        border-radius: 18px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body :where(.module-table thead th, .users-table thead th, .schedule-table thead th, .profile-style-table thead th, .report-table thead th, .mini-table thead th) {
        font-size: 10px !important;
        padding: 11px 12px !important;
    }

    body :where(.module-table, .users-table, .profile-style-table, .mini-table) {
        min-width: 680px !important;
    }

    body :where(.monthly-schedule-wrap .schedule-table, .schedule-table-modern, .report-table-wrap .report-table) {
        min-width: 940px !important;
    }

    body :where(.row-actions, .inline-actions, .table-actions, .module-table-actions) {
        justify-content: flex-start !important;
        min-width: 0 !important;
    }

    body :where(.users-table th:last-child, .users-table td:last-child) {
        text-align: left !important;
    }
}

/* =========================================================
   DODATEK: DASHBOARD MOBILE FIX + UKŁAD STRONY GŁÓWNEJ
   Zakres: usuwa osobne kafelki szybkich akcji/narzędzi z dashboardu,
   przenosi karty modułów do statystyk, ustawia RCP i Komunikaty po 1/2
   szerokości na desktopie oraz stabilizuje widok na telefonie.
   ========================================================= */
body .dashboard-mobile-fixed,
body .dashboard-mobile-fixed * {
    box-sizing: border-box;
}

body .dashboard-mobile-fixed {
    overflow-x: hidden !important;
}

body .dashboard-mobile-fixed :where(.premium-dashboard-hero, .module-header-card, .premium-panel, .module-card, .glass-card) {
    min-width: 0 !important;
    max-width: 100% !important;
}

body .dashboard-stats-unified {
    gap: var(--module-gap) !important;
}

body .dashboard-core-stats + .dashboard-stat-insights,
body .dashboard-stat-insights {
    margin-top: 0 !important;
}

body .dashboard-stat-insights .premium-insight-card {
    text-decoration: none;
    min-width: 0 !important;
}

body .dashboard-live-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: var(--module-gap) !important;
    align-items: start !important;
    width: 100% !important;
    min-width: 0 !important;
}

body .dashboard-live-grid > * {
    min-width: 0 !important;
    width: 100% !important;
}

body .dashboard-compact-rcp-card,
body .dashboard-communications-preview,
body .dashboard-user-rcp-card {
    display: grid !important;
    gap: var(--module-gap-sm) !important;
    align-content: start !important;
}

body .dashboard-mini-link,
body .dashboard-mini-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.16);
    color: inherit;
    text-decoration: none;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

body .dashboard-mini-button-muted {
    background: rgba(255,255,255,0.06);
}

body .dashboard-mini-stat-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
}

body .dashboard-mini-stat-grid .rcp-stat {
    min-height: 82px !important;
    padding: 12px !important;
}

body .dashboard-mini-stat-grid .rcp-stat strong {
    font-size: clamp(1.2rem, 1.8vw, 1.65rem) !important;
}

body .dashboard-compact-list,
body .dashboard-last-events-list {
    display: grid;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

body .dashboard-compact-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.065);
    border: 1px solid rgba(255,255,255,0.11);
}

body .dashboard-compact-row.tone-danger { border-color: rgba(255,99,132,.34); }
body .dashboard-compact-row.tone-warning { border-color: rgba(255,193,7,.34); }
body .dashboard-compact-row.tone-info { border-color: rgba(80,170,255,.30); }
body .dashboard-compact-row.tone-success { border-color: rgba(60,210,130,.30); }

body .dashboard-row-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.12);
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

body .dashboard-row-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

body .dashboard-row-main strong,
body .dashboard-row-main small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body .dashboard-row-main small {
    opacity: .72;
    font-size: 12px;
}

body .dashboard-row-time {
    font-size: 12px;
    font-weight: 850;
    opacity: .78;
    white-space: nowrap;
}

body .dashboard-last-events-title {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .07em;
    opacity: .72;
}

body .dashboard-last-event {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 9px 11px;
    border-radius: 14px;
    background: rgba(255,255,255,0.055);
}

body .dashboard-last-event strong,
body .dashboard-last-event span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body .dashboard-last-event span {
    opacity: .72;
    font-size: 12px;
}

body .dashboard-communications-stats {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

body .dashboard-communications-stats > div {
    min-width: 0;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.11);
    display: grid;
    gap: 4px;
}

body .dashboard-communications-stats span {
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .72;
}

body .dashboard-communications-stats strong {
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    line-height: 1;
}

body .dashboard-message-preview {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
}

body .dashboard-message-preview span {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
    opacity: .72;
}

body .dashboard-message-preview strong {
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

body .dashboard-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body .dashboard-rcp-compact-layout {
    grid-template-columns: minmax(0, 1fr) minmax(160px, .34fr) !important;
    gap: var(--module-gap-sm) !important;
    align-items: start !important;
}

body .dashboard-qr-compact .premium-qr-box,
body .dashboard-qr-compact .qr-card-box {
    max-width: 180px;
    margin-inline: auto;
}

body .dashboard-activity-limited .activity-item:nth-child(n+4) {
    display: none !important;
}

body .dashboard-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body .dashboard-secondary-grid .premium-section-wide {
    grid-column: 1 / -1;
}

body .dashboard-info-card {
    max-width: 760px;
}

@media (max-width: 1020px) {
    body .dashboard-live-grid,
    body .dashboard-secondary-grid {
        grid-template-columns: 1fr !important;
    }

    body .dashboard-rcp-compact-layout {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 760px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body .dashboard-mobile-fixed {
        width: 100% !important;
        max-width: 100% !important;
        padding-inline: 0 !important;
        gap: 12px !important;
    }

    body .dashboard-mobile-fixed :where(.premium-dashboard-hero, .module-header-card, .premium-panel, .module-card, .glass-card) {
        padding: 14px !important;
        border-radius: 20px !important;
    }

    body .dashboard-mobile-fixed .premium-dashboard-hero {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    body .dashboard-mobile-fixed .premium-hero-content,
    body .dashboard-mobile-fixed .premium-hero-status {
        min-width: 0 !important;
        width: 100% !important;
    }

    body .dashboard-mobile-fixed .premium-hero-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    body .dashboard-mobile-fixed .premium-hero-action {
        min-height: 76px !important;
        padding: 10px !important;
        border-radius: 16px !important;
    }

    body .dashboard-mobile-fixed .premium-hero-action strong {
        font-size: 12px !important;
        white-space: normal !important;
    }

    body .dashboard-mobile-fixed .module-stats-head,
    body .dashboard-mobile-fixed .premium-panel-head {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    body .dashboard-mobile-fixed .dashboard-stat-insights,
    body .dashboard-mobile-fixed .dashboard-core-stats,
    body .dashboard-mobile-fixed .module-stats-grid,
    body .dashboard-mobile-fixed .premium-admin-kpi-grid,
    body .dashboard-mobile-fixed .premium-insights-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body .dashboard-mini-stat-grid,
    body .dashboard-communications-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body .dashboard-communications-stats > div:last-child {
        grid-column: 1 / -1;
    }

    body .dashboard-compact-row {
        grid-template-columns: 1fr auto;
        gap: 6px 10px;
    }

    body .dashboard-row-status {
        grid-column: 1 / -1;
        justify-self: start;
    }

    body .dashboard-preview-actions,
    body .dashboard-mini-link,
    body .dashboard-mini-button {
        width: 100%;
    }

    body .dashboard-mini-button,
    body .dashboard-mini-link {
        white-space: normal;
        text-align: center;
    }

    body .dashboard-qr-compact .premium-qr-box,
    body .dashboard-qr-compact .qr-card-box {
        max-width: 150px;
    }
}

@media (max-width: 430px) {
    body .dashboard-mobile-fixed .dashboard-stat-insights,
    body .dashboard-mobile-fixed .dashboard-core-stats,
    body .dashboard-mobile-fixed .module-stats-grid,
    body .dashboard-mobile-fixed .premium-admin-kpi-grid,
    body .dashboard-mobile-fixed .premium-insights-row,
    body .dashboard-mini-stat-grid,
    body .dashboard-communications-stats {
        grid-template-columns: 1fr !important;
    }

    body .dashboard-mobile-fixed .premium-hero-actions {
        grid-template-columns: 1fr !important;
    }

    body .dashboard-last-event {
        display: grid;
        justify-content: stretch;
    }
}

/* =========================================================
   DODATEK V2: DASHBOARD PWA + PC
   Cel: te same zmiany strony głównej obowiązują w PWA i na komputerze.
   Sekcje szybkich akcji/narzędzi administracyjnych są usunięte z widoku,
   a karty RCP/Grafik/Wnioski/Komunikaty/Rozliczenia są prowadzone jako statystyki.
   ========================================================= */
body .dashboard-unified-home,
body .dashboard-unified-home * {
    box-sizing: border-box;
}

body .dashboard-unified-home {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
}

body .dashboard-unified-home .premium-dashboard-hero {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px) !important;
    align-items: stretch !important;
}

body .dashboard-unified-home .premium-hero-content {
    align-content: center !important;
}

body .dashboard-unified-home .premium-hero-actions,
body .dashboard-unified-home .dashboard-actions-card,
body .dashboard-unified-home .quick-actions-card,
body .dashboard-unified-home .premium-admin-system-tools {
    display: none !important;
}

body .dashboard-unified-home .dashboard-stats-unified {
    display: grid !important;
    gap: var(--module-gap) !important;
}

body .dashboard-unified-home .dashboard-core-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

body .dashboard-unified-home .dashboard-stat-insights {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: var(--module-gap-sm) !important;
}

body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card {
    min-height: 126px !important;
    height: 100% !important;
    align-content: start !important;
}

body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card strong,
body .dashboard-unified-home .dashboard-core-stats .premium-admin-kpi strong,
body .dashboard-unified-home .stats-grid .stat-card .stat-value {
    overflow-wrap: anywhere;
}

body .dashboard-unified-home .dashboard-live-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: var(--module-gap) !important;
    align-items: stretch !important;
}

body .dashboard-unified-home .dashboard-live-grid > .premium-panel {
    min-width: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

body .dashboard-unified-home .dashboard-compact-rcp-card,
body .dashboard-unified-home .dashboard-communications-preview,
body .dashboard-unified-home .dashboard-user-rcp-card {
    min-height: 100% !important;
}

body .dashboard-unified-home .dashboard-compact-list,
body .dashboard-unified-home .dashboard-last-events-list,
body .dashboard-unified-home .premium-activity-compact {
    max-height: 260px;
    overflow: auto;
    padding-right: 2px;
}

body .dashboard-unified-home .dashboard-communications-preview .dashboard-message-preview {
    min-height: 92px;
}

body .dashboard-unified-home .dashboard-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body .dashboard-unified-home .dashboard-secondary-grid .premium-section-wide {
    grid-column: 1 / -1;
}

@media (max-width: 1280px) {
    body .dashboard-unified-home .dashboard-stat-insights {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 980px) {
    body .dashboard-unified-home .premium-dashboard-hero {
        grid-template-columns: 1fr !important;
    }

    body .dashboard-unified-home .dashboard-core-stats,
    body .dashboard-unified-home .dashboard-stat-insights {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body .dashboard-unified-home .dashboard-secondary-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 720px) {
    body .dashboard-unified-home {
        padding-inline: 0 !important;
    }

    body .dashboard-unified-home .premium-dashboard-hero,
    body .dashboard-unified-home .module-header-card,
    body .dashboard-unified-home .premium-panel,
    body .dashboard-unified-home .module-card,
    body .dashboard-unified-home .glass-card {
        padding: 14px !important;
        border-radius: 20px !important;
        max-width: 100% !important;
    }

    body .dashboard-unified-home .dashboard-live-grid {
        grid-template-columns: 1fr !important;
    }

    body .dashboard-unified-home .dashboard-core-stats,
    body .dashboard-unified-home .dashboard-stat-insights,
    body .dashboard-unified-home .module-stats-grid,
    body .dashboard-unified-home .premium-admin-kpi-grid,
    body .dashboard-unified-home .premium-insights-row,
    body .dashboard-unified-home .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body .dashboard-unified-home .premium-admin-kpi,
    body .dashboard-unified-home .premium-insight-card,
    body .dashboard-unified-home .stat-card {
        min-height: 112px !important;
        padding: 13px !important;
    }

    body .dashboard-unified-home .dashboard-mini-stat-grid,
    body .dashboard-unified-home .dashboard-communications-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body .dashboard-unified-home .dashboard-communications-stats > div:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 430px) {
    body .dashboard-unified-home .dashboard-core-stats,
    body .dashboard-unified-home .dashboard-stat-insights,
    body .dashboard-unified-home .module-stats-grid,
    body .dashboard-unified-home .premium-admin-kpi-grid,
    body .dashboard-unified-home .premium-insights-row,
    body .dashboard-unified-home .stats-grid,
    body .dashboard-unified-home .dashboard-mini-stat-grid,
    body .dashboard-unified-home .dashboard-communications-stats {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================
   DODATEK V3: DASHBOARD STATYSTYKI - RÓWNE KAFELKI
   Cel: identyczna wysokość i układ kart statystyk w PWA oraz na PC.
   ========================================================= */
body .dashboard-unified-home .module-stats-title p,
body .dashboard-unified-home .premium-hero-content p,
body .dashboard-unified-home .section-subtitle:empty {
    display: none !important;
}

body .dashboard-unified-home .dashboard-core-stats,
body .dashboard-unified-home .dashboard-stat-insights,
body .dashboard-unified-home .stats-grid {
    align-items: stretch !important;
    grid-auto-rows: 1fr !important;
}

body .dashboard-unified-home .dashboard-core-stats .premium-admin-kpi,
body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card,
body .dashboard-unified-home .stats-grid .stat-card,
body .dashboard-unified-home .dashboard-stat-tile {
    min-height: 148px !important;
    height: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-rows: 30px minmax(18px, auto) minmax(38px, 1fr) minmax(28px, auto) !important;
    align-items: start !important;
    align-content: stretch !important;
    gap: 8px !important;
    padding: 16px !important;
    overflow: hidden !important;
}

body .dashboard-unified-home .dashboard-stat-icon,
body .dashboard-unified-home .dashboard-core-stats .premium-admin-kpi > span:first-child,
body .dashboard-unified-home .dashboard-stat-insights .premium-insight-icon,
body .dashboard-unified-home .stats-grid .stat-icon {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

body .dashboard-unified-home .dashboard-stat-label,
body .dashboard-unified-home .dashboard-stat-insights .premium-insight-label,
body .dashboard-unified-home .stats-grid .stat-label {
    min-width: 0 !important;
    max-width: 100% !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.18 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: .055em !important;
}

body .dashboard-unified-home .dashboard-core-stats .premium-admin-kpi > strong,
body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card > strong,
body .dashboard-unified-home .stats-grid .stat-value {
    min-width: 0 !important;
    max-width: 100% !important;
    align-self: center !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    font-size: clamp(1.55rem, 2.2vw, 2.05rem) !important;
    font-weight: 950 !important;
}

body .dashboard-unified-home .dashboard-core-stats .premium-admin-kpi > small,
body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card > small,
body .dashboard-unified-home .stats-grid .stat-description {
    min-width: 0 !important;
    max-width: 100% !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.25 !important;
    opacity: .72 !important;
    font-size: 12px !important;
}

body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card > span,
body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card > strong,
body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card > small {
    position: static !important;
}

body .dashboard-unified-home .module-stats-head {
    margin-bottom: 0 !important;
}

body .dashboard-unified-home .premium-panel-head .section-subtitle {
    display: none !important;
}

@media (max-width: 720px) {
    body .dashboard-unified-home .dashboard-core-stats .premium-admin-kpi,
    body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card,
    body .dashboard-unified-home .stats-grid .stat-card,
    body .dashboard-unified-home .dashboard-stat-tile {
        min-height: 132px !important;
        padding: 13px !important;
        grid-template-rows: 28px minmax(17px, auto) minmax(34px, 1fr) minmax(26px, auto) !important;
    }
}

/* =========================================================
   DODATEK V4: DASHBOARD - KOMPAKTOWE KAFELKI STATYSTYK
   Cel: kafelek zawiera tylko ikonę, nazwę i wartość; niższa wysokość
   oraz równe odstępy w oknie Komunikaty.
   ========================================================= */
body .dashboard-unified-home .dashboard-stats-unified .module-stats-head,
body .dashboard-unified-home .dashboard-stats-unified .module-stats-kicker,
body .dashboard-unified-home .dashboard-stats-unified .module-stats-title,
body .dashboard-unified-home .dashboard-stats-unified .module-stats-meta {
    display: none !important;
}

body .dashboard-unified-home .dashboard-stats-unified {
    gap: 10px !important;
}

body .dashboard-unified-home .dashboard-core-stats,
body .dashboard-unified-home .dashboard-stat-insights,
body .dashboard-unified-home .stats-grid {
    gap: 10px !important;
    align-items: stretch !important;
    grid-auto-rows: 1fr !important;
}

body .dashboard-unified-home .dashboard-core-stats .premium-admin-kpi,
body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card,
body .dashboard-unified-home .stats-grid .stat-card,
body .dashboard-unified-home .dashboard-stat-tile {
    min-height: 86px !important;
    height: 100% !important;
    display: grid !important;
    grid-template-columns: 30px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    align-content: center !important;
    gap: 7px 10px !important;
    padding: 11px 12px !important;
    overflow: hidden !important;
}

body .dashboard-unified-home .dashboard-stat-icon,
body .dashboard-unified-home .dashboard-core-stats .premium-admin-kpi > span:first-child,
body .dashboard-unified-home .dashboard-stat-insights .premium-insight-icon,
body .dashboard-unified-home .stats-grid .stat-icon {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
}

body .dashboard-unified-home .dashboard-stat-label,
body .dashboard-unified-home .dashboard-stat-insights .premium-insight-label,
body .dashboard-unified-home .stats-grid .stat-label {
    grid-column: 2 !important;
    grid-row: 1 !important;
    order: 0 !important;
    align-self: center !important;
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.15 !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: .055em !important;
    opacity: .78 !important;
}

body .dashboard-unified-home .dashboard-core-stats .premium-admin-kpi > strong,
body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card > strong,
body .dashboard-unified-home .stats-grid .stat-value {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    order: 0 !important;
    align-self: end !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: .98 !important;
    font-size: clamp(1.35rem, 1.75vw, 1.75rem) !important;
    font-weight: 950 !important;
}

body .dashboard-unified-home .dashboard-core-stats .premium-admin-kpi > small,
body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card > small,
body .dashboard-unified-home .stats-grid .stat-description,
body .dashboard-unified-home .dashboard-stat-tile small {
    display: none !important;
}

body .dashboard-unified-home .dashboard-communications-preview {
    gap: 10px !important;
    align-content: start !important;
}

body .dashboard-unified-home .dashboard-communications-preview > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body .dashboard-unified-home .dashboard-communications-preview .premium-panel-head {
    min-height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
}

body .dashboard-unified-home .dashboard-communications-stats {
    gap: 10px !important;
}

body .dashboard-unified-home .dashboard-communications-stats > div,
body .dashboard-unified-home .dashboard-message-preview {
    padding: 11px 12px !important;
    border-radius: 16px !important;
}

body .dashboard-unified-home .dashboard-message-preview {
    min-height: 74px !important;
    gap: 5px !important;
}

body .dashboard-unified-home .dashboard-preview-actions {
    gap: 10px !important;
    margin-top: 0 !important;
}

@media (max-width: 720px) {
    body .dashboard-unified-home .dashboard-core-stats .premium-admin-kpi,
    body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card,
    body .dashboard-unified-home .stats-grid .stat-card,
    body .dashboard-unified-home .dashboard-stat-tile {
        min-height: 78px !important;
        padding: 10px 11px !important;
        grid-template-columns: 28px minmax(0, 1fr) !important;
        gap: 6px 9px !important;
    }

    body .dashboard-unified-home .dashboard-stat-icon,
    body .dashboard-unified-home .dashboard-core-stats .premium-admin-kpi > span:first-child,
    body .dashboard-unified-home .dashboard-stat-insights .premium-insight-icon,
    body .dashboard-unified-home .stats-grid .stat-icon {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
    }

    body .dashboard-unified-home .dashboard-core-stats .premium-admin-kpi > strong,
    body .dashboard-unified-home .dashboard-stat-insights .premium-insight-card > strong,
    body .dashboard-unified-home .stats-grid .stat-value {
        font-size: clamp(1.25rem, 6vw, 1.55rem) !important;
    }
}


/* =========================================================
   DODATEK V5: DASHBOARD - KAFELKI W RCP I KOMUNIKATACH JAK STATYSTYKI
   Cel: małe kafelki w sekcjach Stan obecności RCP i Komunikaty mają ten sam
   układ co statystyki: ikona + nazwa oraz wartość. Usuwa link "Pełny moduł".
   ========================================================= */
body .dashboard-unified-home .dashboard-mini-link {
    display: none !important;
}

body .dashboard-unified-home .dashboard-mini-stat-grid,
body .dashboard-unified-home .dashboard-communications-stats,
body .dashboard-unified-home .dashboard-live-stat-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 138px), 1fr)) !important;
    gap: 10px !important;
    align-items: stretch !important;
    grid-auto-rows: 1fr !important;
    width: 100% !important;
    margin: 0 !important;
}

body .dashboard-unified-home .dashboard-mini-stat-grid .rcp-stat,
body .dashboard-unified-home .dashboard-communications-stats > div,
body .dashboard-unified-home .dashboard-live-stat-tile {
    min-height: 76px !important;
    height: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    align-content: center !important;
    gap: 6px 9px !important;
    padding: 10px 11px !important;
    border-radius: 16px !important;
    overflow: hidden !important;
}

body .dashboard-unified-home .dashboard-live-stat-icon,
body .dashboard-unified-home .dashboard-mini-stat-grid .rcp-stat > span:first-child:not(.rcp-stat-label),
body .dashboard-unified-home .dashboard-communications-stats > div > span:first-child:not(:last-child) .app-icon {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

body .dashboard-unified-home .dashboard-live-stat-icon .app-icon,
body .dashboard-unified-home .dashboard-live-stat-icon svg {
    width: 18px !important;
    height: 18px !important;
}

body .dashboard-unified-home .dashboard-mini-stat-grid .rcp-stat .rcp-stat-label,
body .dashboard-unified-home .dashboard-communications-stats > div > span:not(.dashboard-live-stat-icon) {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: center !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.14 !important;
    font-size: 10.5px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: .045em !important;
    opacity: .78 !important;
}

body .dashboard-unified-home .dashboard-mini-stat-grid .rcp-stat > strong,
body .dashboard-unified-home .dashboard-communications-stats > div > strong {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: .98 !important;
    font-size: clamp(1.2rem, 1.55vw, 1.55rem) !important;
    font-weight: 950 !important;
}

body .dashboard-unified-home .dashboard-communications-preview .premium-panel-head,
body .dashboard-unified-home .dashboard-compact-rcp-card .premium-panel-head,
body .dashboard-unified-home .dashboard-user-rcp-card .premium-panel-head {
    margin-bottom: 10px !important;
}

body .dashboard-unified-home .dashboard-communications-preview,
body .dashboard-unified-home .dashboard-compact-rcp-card {
    display: grid !important;
    gap: 10px !important;
    align-content: start !important;
}

body .dashboard-unified-home .dashboard-message-preview {
    margin-top: 0 !important;
}

@media (max-width: 720px) {
    body .dashboard-unified-home .dashboard-mini-stat-grid,
    body .dashboard-unified-home .dashboard-communications-stats,
    body .dashboard-unified-home .dashboard-live-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body .dashboard-unified-home .dashboard-mini-stat-grid .rcp-stat,
    body .dashboard-unified-home .dashboard-communications-stats > div,
    body .dashboard-unified-home .dashboard-live-stat-tile {
        min-height: 72px !important;
        padding: 9px 10px !important;
        grid-template-columns: 26px minmax(0, 1fr) !important;
        gap: 5px 8px !important;
    }

    body .dashboard-unified-home .dashboard-live-stat-icon {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        min-height: 26px !important;
    }
}

/* === SYSTEM USERS POPUP FIX v1 ===
   Moduł Użytkownicy: okna modalne nie mogą być widoczne po wejściu w moduł.
   Wspólne reguły modalne z module-layout.css nadpisywały display:none ze style.css,
   dlatego dopinamy jawny stan zamknięty i otwarty tylko dla modali tego modułu. */
body .users-page #pinModal.modal-backdrop,
body .users-page #historyModal.modal-backdrop {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body .users-page #pinModal.modal-backdrop.is-open,
body .users-page #historyModal.modal-backdrop.is-open {
    display: grid !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    place-items: center !important;
}

body .users-page #pinModal .modal-card,
body .users-page #historyModal .modal-card {
    margin: auto !important;
}


/* =========================================================
   DODATEK V6: JEDNOLITY STYL KAFELKÓW W CAŁEJ APLIKACJI
   Cel: wszystkie małe i średnie kafelki mają jeden wspólny styl
   jak na dashboardzie: szkło, cienka linia akcentu u góry,
   ten sam promień, obramowanie i spójny rytm wnętrza.
   ========================================================= */
body {
    --unified-tile-radius: 22px;
    --unified-tile-border: rgba(255,255,255,.13);
    --unified-tile-shadow: 0 18px 38px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.08);
    --unified-tile-bg: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.045));
    --unified-tile-accent: linear-gradient(90deg, #78e8ff 0%, #8ef7e0 100%);
    --unified-tile-accent-success: linear-gradient(90deg, #8de58f 0%, #b6ff9b 100%);
    --unified-tile-accent-warning: linear-gradient(90deg, #ffd95f 0%, #f5b942 100%);
    --unified-tile-accent-danger: linear-gradient(90deg, #ff977d 0%, #ff6f88 100%);
    --unified-tile-accent-violet: linear-gradient(90deg, #9ac7ff 0%, #8b82ff 100%);
    --unified-tile-accent-info: linear-gradient(90deg, #77e0ff 0%, #8adfff 100%);
}

body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
) {
    position: relative !important;
    overflow: hidden !important;
    border-radius: var(--unified-tile-radius) !important;
    border: 1px solid var(--unified-tile-border) !important;
    background:
        radial-gradient(circle at 100% 0%, rgba(136,168,255,.10), transparent 34%),
        var(--unified-tile-bg) !important;
    box-shadow: var(--unified-tile-shadow) !important;
    backdrop-filter: blur(18px) saturate(135%) !important;
}

body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    height: 4px !important;
    border-radius: 999px !important;
    background: var(--unified-tile-accent) !important;
    opacity: .98 !important;
    pointer-events: none !important;
}

/* Warianty akcentu */
body :where(
    .premium-admin-kpi-success,
    .premium-insight-success,
    .stat-card-success,
    .settlement-stat-success,
    .rcp-stat-success,
    .action-tile-success,
    .action-tile-emerald,
    .queue-card-new,
    .premium-small-card-success,
    .dashboard-live-stat-tile-success,
    .success,
    .tone-success
)::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="success"]::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="emerald"]::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="green"]::before {
    background: var(--unified-tile-accent-success) !important;
}

body :where(
    .premium-admin-kpi-warning,
    .premium-insight-warning,
    .stat-card-warning,
    .settlement-stat-warning,
    .rcp-stat-warning,
    .action-tile-warning,
    .action-tile-amber,
    .stat-card-orange,
    .queue-card-needs,
    .warning,
    .tone-warning
)::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="warning"]::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="amber"]::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="orange"]::before {
    background: var(--unified-tile-accent-warning) !important;
}

body :where(
    .premium-admin-kpi-danger,
    .premium-insight-danger,
    .stat-card-danger,
    .settlement-stat-danger,
    .rcp-stat-danger,
    .action-tile-danger,
    .action-tile-rose,
    .queue-card-urgent,
    .danger,
    .tone-danger
)::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="danger"]::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="rose"]::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="critical"]::before {
    background: var(--unified-tile-accent-danger) !important;
}

body :where(
    .premium-admin-kpi-info,
    .premium-insight-info,
    .rcp-stat-info,
    .stat-card-cyan,
    .action-tile-cyan,
    .info,
    .tone-info
)::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="info"]::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="cyan"]::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="primary"]::before {
    background: var(--unified-tile-accent-info) !important;
}

body :where(
    .premium-insight-violet,
    .settlement-stat-violet,
    .action-tile-violet,
    .stat-card-violet,
    .tone-violet
)::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="violet"]::before,
body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
)[class*="purple"]::before {
    background: var(--unified-tile-accent-violet) !important;
}

/* Spójne wnętrze ikon i hover dla wszystkich kafelków */
body :where(
    .dashboard-stat-icon,
    .premium-admin-kpi > span:first-child,
    .premium-insight-icon,
    .dashboard-live-stat-icon,
    .module-stat-icon,
    .summary-icon,
    .stat-icon,
    .action-tile-icon,
    .action-icon,
    .settlement-action-icon,
    .module-action-icon,
    .quick-icon,
    .profile-stat-icon,
    .history-icon
) {
    border-radius: 16px !important;
    background: linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.04)) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 22px rgba(0,0,0,.14) !important;
}

body :where(
    .dashboard-stat-tile,
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .module-stat-card,
    .summary-box,
    .stat-card,
    .settlement-stat-card,
    .rcp-stat,
    .report-card,
    .settlement-status-card,
    .employee-stat-card,
    .profile-stat-card,
    .profile-rcp-mini-card,
    .premium-small-card,
    .premium-rcp-presence-card,
    .availability-overview-stat,
    .module-action-card,
    .action-tile,
    .settlement-action-tile,
    .requests-page .action-card,
    .dashboard-action-card,
    .queue-card,
    .comm-card,
    .info-card,
    .tile-card,
    .quick-card,
    .mobile-shift-card,
    .assign-candidate-card,
    .assign-slot-card,
    .stack-card,
    .compact-card,
    .planner-day-card
):hover {
    border-color: rgba(255,255,255,.18) !important;
    transform: translateY(-2px) !important;
}

/* Delikatne wyrównanie typografii w najczęstszych kafelkach */
body :where(
    .dashboard-stat-label,
    .premium-insight-label,
    .stat-label,
    .summary-label,
    .employee-stat-label,
    .rcp-stat-label,
    .module-stat-label,
    .action-tile-status
) {
    letter-spacing: .045em !important;
    text-transform: uppercase !important;
    font-weight: 900 !important;
}

body :where(
    .dashboard-stat-tile strong,
    .premium-admin-kpi strong,
    .premium-insight-card strong,
    .dashboard-live-stat-tile strong,
    .stat-card strong,
    .settlement-stat-card strong,
    .rcp-stat strong,
    .employee-stat-card strong,
    .profile-stat-card strong,
    .premium-small-card strong
) {
    font-weight: 950 !important;
}

@media (max-width: 720px) {
    body :where(
        .dashboard-stat-tile,
        .premium-admin-kpi,
        .premium-insight-card,
        .dashboard-live-stat-tile,
        .module-stat-card,
        .summary-box,
        .stat-card,
        .settlement-stat-card,
        .rcp-stat,
        .report-card,
        .settlement-status-card,
        .employee-stat-card,
        .profile-stat-card,
        .profile-rcp-mini-card,
        .premium-small-card,
        .premium-rcp-presence-card,
        .availability-overview-stat,
        .module-action-card,
        .action-tile,
        .settlement-action-tile,
        .requests-page .action-card,
        .dashboard-action-card,
        .queue-card,
        .comm-card,
        .info-card,
        .tile-card,
        .quick-card,
        .mobile-shift-card,
        .assign-candidate-card,
        .assign-slot-card,
        .stack-card,
        .compact-card,
        .planner-day-card
    ) {
        border-radius: 18px !important;
    }
}


/* =========================================================
   DODATEK V7: JEDNOLITY STYL DUŻYCH PANELI I SEKCJI
   Cel: wszystkie duże kontenery aplikacji mają jeden wspólny styl:
   nagłówki modułów, główne panele, sekcje tabel, formularzy i podglądów.
   ========================================================= */

body {
    --unified-panel-radius: 30px;
    --unified-panel-border: rgba(255,255,255,.12);
    --unified-panel-border-strong: rgba(255,255,255,.18);
    --unified-panel-bg: linear-gradient(145deg, rgba(255,255,255,.078), rgba(255,255,255,.035));
    --unified-panel-shadow: 0 24px 70px rgba(0,0,0,.31), inset 0 1px 0 rgba(255,255,255,.075);
    --unified-panel-gap: 18px;
    --unified-panel-padding: clamp(18px, 2vw, 26px);
}

body :where(
    .module-header-card,
    .premium-dashboard-hero,
    .premium-panel,
    .module-card,
    .glass-card,
    .hero-card,
    .module-content-card,
    .module-table-card,
    .module-form-card,
    .module-filters-card,
    .module-actions-card,
    .module-stats-card,
    .module-tabs-card,
    .dashboard-compact-rcp-card,
    .dashboard-communications-preview,
    .comm-hero-card,
    .comm-layout-card,
    .comm-filter-card,
    .requests-page .module-panel,
    .filter-box,
    .users-hero-card,
    .users-toolbar-card,
    .users-list-card,
    .users-form-card,
    .settlement-hero,
    .settlement-main-card,
    .settlement-list-card,
    .settlement-summary-card,
    .settlement-panel-card,
    .settlement-toolbar-card,
    .premium-live-panel,
    .premium-modules-panel,
    .premium-section-card,
    .premium-side-panel,
    .premium-detail-panel,
    .premium-backup-panel,
    .premium-login-card,
    .portal-card,
    .profile-account-card,
    .profile-security-card,
    .profile-activity-card,
    .profile-push-card,
    .profile-biometric-card,
    .profile-premium-qr-card,
    .modal-card,
    .modal-window,
    .modal-panel,
    .settlement-modal-card
) {
    border-radius: var(--unified-panel-radius) !important;
    border: 1px solid var(--unified-panel-border) !important;
    background:
        radial-gradient(circle at 100% 0%, rgba(79,140,255,.12), transparent 34%),
        radial-gradient(circle at 0% 100%, rgba(45,212,191,.065), transparent 36%),
        var(--unified-panel-bg) !important;
    box-shadow: var(--unified-panel-shadow) !important;
    backdrop-filter: blur(22px) saturate(140%) !important;
    overflow: hidden;
}

body :where(
    .module-header-card,
    .premium-dashboard-hero,
    .premium-panel,
    .module-content-card,
    .module-table-card,
    .module-form-card,
    .module-filters-card,
    .module-actions-card,
    .module-stats-card,
    .module-tabs-card,
    .comm-layout-card,
    .users-toolbar-card,
    .users-list-card,
    .users-form-card,
    .settlement-main-card,
    .settlement-list-card,
    .settlement-summary-card,
    .settlement-panel-card
) {
    padding: var(--unified-panel-padding) !important;
}

body :where(
    .module-page,
    .premium-dashboard,
    .dashboard-unified-home,
    .users-page,
    .requests-page,
    .communications-page,
    .settlement-page,
    .rcp-page,
    .schedule-page
) {
    gap: var(--unified-panel-gap) !important;
}

/* Nagłówki dużych paneli */
body :where(
    .module-section-head,
    .premium-panel-head,
    .module-card-head,
    .users-card-head,
    .comm-card-head,
    .settlement-card-head,
    .module-form-head,
    .module-table-head,
    .module-filters-head,
    .modal-card-head
) {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 14px !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
}

body :where(
    .module-section-head h2,
    .module-section-head h3,
    .premium-panel-head h2,
    .premium-panel-head h3,
    .module-card-head h2,
    .module-card-head h3,
    .users-card-head h2,
    .users-card-head h3,
    .comm-card-head h2,
    .comm-card-head h3,
    .settlement-card-head h2,
    .settlement-card-head h3,
    .section-title
) {
    margin: 0 !important;
    line-height: 1.1 !important;
    font-weight: 950 !important;
    letter-spacing: -.045em !important;
}

body :where(
    .module-section-head p,
    .premium-panel-head p,
    .module-card-head p,
    .users-card-head p,
    .comm-card-head p,
    .settlement-card-head p,
    .section-subtitle
) {
    margin: 5px 0 0 !important;
    color: rgba(220,231,255,.72) !important;
    line-height: 1.35 !important;
}

/* Jeden rytm odstępów wewnątrz paneli */
body :where(
    .premium-panel,
    .module-content-card,
    .module-table-card,
    .module-form-card,
    .module-filters-card,
    .module-actions-card,
    .module-stats-card,
    .module-tabs-card,
    .dashboard-compact-rcp-card,
    .dashboard-communications-preview,
    .comm-layout-card,
    .users-list-card,
    .users-form-card,
    .settlement-main-card,
    .settlement-list-card,
    .settlement-summary-card,
    .settlement-panel-card
) > * + * {
    margin-top: 14px;
}

/* Kontenery tabel i formularzy bez innego stylu niż panel */
body :where(
    .module-table-wrap,
    .table-wrap,
    .users-table-wrap,
    .settlement-table-wrap,
    .requests-table-wrap,
    .communications-table-wrap
) {
    border-radius: 22px !important;
    border: 1px solid rgba(255,255,255,.09) !important;
    background: rgba(4,10,22,.22) !important;
    overflow: auto !important;
}

body :where(
    .module-form,
    .compact-form,
    .publish-state-form,
    .settlement-form,
    .users-form,
    .filter-form
) {
    border-radius: 22px !important;
}

/* Duże panele w dashboardzie: RCP i Komunikaty ten sam wygląd */
body .dashboard-unified-home :where(
    .dashboard-compact-rcp-card,
    .dashboard-communications-preview
) {
    min-height: 100% !important;
    display: grid !important;
    align-content: start !important;
    gap: 12px !important;
}

/* Usunięcie przypadkowych różnic pomiędzy panelami */
body :where(
    .premium-panel,
    .module-card,
    .glass-card,
    .comm-layout-card,
    .users-list-card,
    .users-form-card,
    .settlement-main-card,
    .settlement-list-card,
    .settlement-summary-card
) :where(.premium-panel, .glass-card, .module-card) {
    box-shadow: 0 14px 34px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.055) !important;
}

/* Mobile/PWA */
@media (max-width: 900px) {
    body {
        --unified-panel-radius: 24px;
        --unified-panel-padding: 16px;
        --unified-panel-gap: 14px;
    }

    body :where(
        .module-section-head,
        .premium-panel-head,
        .module-card-head,
        .users-card-head,
        .comm-card-head,
        .settlement-card-head,
        .module-form-head,
        .module-table-head,
        .module-filters-head
    ) {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
}

@media (max-width: 520px) {
    body {
        --unified-panel-radius: 20px;
        --unified-panel-padding: 14px;
        --unified-panel-gap: 12px;
    }

    body :where(
        .module-header-card,
        .premium-dashboard-hero,
        .premium-panel,
        .module-card,
        .glass-card,
        .hero-card,
        .module-content-card,
        .module-table-card,
        .module-form-card,
        .module-filters-card,
        .module-actions-card,
        .module-stats-card,
        .module-tabs-card,
        .dashboard-compact-rcp-card,
        .dashboard-communications-preview
    ) {
        border-radius: var(--unified-panel-radius) !important;
    }
}


/* =========================================================
   KOMUNIKATY - WIDOK PRACOWNIKA CLEAN v1
   Zmiany tylko dla pracownika:
   - bez przycisków Szybkie akcje/Lista w nagłówku,
   - brak panelu Stan komunikacji,
   - filtr przeniesiony do panelu Widok komunikatów,
   - bez osobnego panelu filtrów w skrzynce odbiorczej.
   ========================================================= */

body .comm-page .employee-shell .module-actions-head {
    align-items: flex-start !important;
}

body .comm-page .employee-shell .module-actions-title h3 {
    margin-bottom: 0 !important;
}

body .comm-page .communications-worker-tabs-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
}

body .comm-page .comm-worker-filter-inline {
    width: min(320px, 100%) !important;
    display: grid !important;
    gap: 6px !important;
    margin: 0 !important;
}

body .comm-page .comm-worker-filter-inline span {
    font-size: 11px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: .055em !important;
    color: rgba(220,231,255,.72) !important;
}

body .comm-page .comm-worker-filter-inline select {
    min-height: 44px !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    background: rgba(5,12,26,.66) !important;
    color: #fff !important;
    padding: 0 14px !important;
    font-weight: 850 !important;
    outline: none !important;
}

body .comm-page .communications-tabs-card .module-tabs {
    margin-top: 14px !important;
}

@media (max-width: 720px) {
    body .comm-page .communications-worker-tabs-head {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    body .comm-page .comm-worker-filter-inline {
        width: 100% !important;
    }
}


/* =========================================================
   KOMUNIKATY - WIDOK PRACOWNIKA: TYLKO FILTR W PANELU WIDOKU
   Usunięte przyciski/zakładki z panelu "Widok komunikatów".
   ========================================================= */

body .comm-page .communications-worker-tabs-head {
    margin-bottom: 0 !important;
}

body .comm-page .communications-tabs-card .communications-worker-tabs-head + .module-tabs {
    display: none !important;
}

body .comm-page .comm-worker-filter-inline {
    margin-left: auto !important;
}

@media (max-width: 720px) {
    body .comm-page .comm-worker-filter-inline {
        margin-left: 0 !important;
    }
}


/* =========================================================
   KOMUNIKATY - WIDOK PRACOWNIKA: FILTR W SKRZYNCE ODBIORCZEJ
   Usunięto osobny panel "Widok komunikatów", filtr jest kompaktowy
   w nagłówku Skrzynki odbiorczej.
   ========================================================= */

body .comm-page .comm-worker-inbox-head {
    align-items: center !important;
    gap: 14px !important;
    margin-bottom: 12px !important;
}

body .comm-page .comm-worker-filter-inbox {
    width: min(260px, 100%) !important;
    min-width: 220px !important;
    display: grid !important;
    gap: 5px !important;
    margin: 0 0 0 auto !important;
}

body .comm-page .comm-worker-filter-inbox span {
    font-size: 10.5px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: .055em !important;
    color: rgba(220,231,255,.72) !important;
}

body .comm-page .comm-worker-filter-inbox select {
    min-height: 40px !important;
    height: 40px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    background: rgba(5,12,26,.66) !important;
    color: #fff !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    font-weight: 850 !important;
    outline: none !important;
}

/* Stare klasy z poprzedniej paczki nie powinny zostawiać pustego miejsca */
body .comm-page .communications-worker-tabs-head,
body .comm-page .communications-tabs-card .communications-worker-tabs-head + .module-tabs {
    margin: 0 !important;
}

@media (max-width: 720px) {
    body .comm-page .comm-worker-inbox-head {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    body .comm-page .comm-worker-filter-inbox {
        width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
    }
}


/* =========================================================
   WNIOSKI - WIDOK PRACOWNIKA PC/PWA JAK KOMUNIKATY
   Zmiany ograniczone do pracownika:
   - bez przycisków Szybkie akcje/Lista w nagłówku,
   - bez osobnego panelu statystyk,
   - filtry w kompaktowym nagłówku listy,
   - osobny panel filtrów zostaje tylko dla administratora.
   ========================================================= */

body .requests-page.requests-worker-clean .module-actions-head {
    align-items: flex-start !important;
}

body .requests-page.requests-worker-clean .module-actions-title h3 {
    margin-bottom: 0 !important;
}

body .requests-page.requests-worker-clean .requests-worker-list-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    margin-bottom: 14px !important;
}

body .requests-page.requests-worker-clean .requests-worker-list-head h2 {
    margin: 0 !important;
    font-size: clamp(22px, 2vw, 30px) !important;
    line-height: 1.1 !important;
    letter-spacing: -.04em !important;
}

body .requests-page.requests-worker-clean .requests-worker-filter-inline {
    width: min(660px, 100%) !important;
    display: grid !important;
    grid-template-columns: minmax(180px, 1.2fr) minmax(150px, .8fr) minmax(150px, .8fr) !important;
    gap: 10px !important;
    margin-left: auto !important;
}

body .requests-page.requests-worker-clean .requests-worker-filter-inline label {
    display: grid !important;
    gap: 5px !important;
    margin: 0 !important;
    min-width: 0 !important;
}

body .requests-page.requests-worker-clean .requests-worker-filter-inline span {
    font-size: 10.5px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: .055em !important;
    color: rgba(220,231,255,.72) !important;
}

body .requests-page.requests-worker-clean .requests-worker-filter-inline input,
body .requests-page.requests-worker-clean .requests-worker-filter-inline select {
    min-height: 40px !important;
    height: 40px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    background: rgba(5,12,26,.66) !important;
    color: #fff !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    font-weight: 850 !important;
    outline: none !important;
    min-width: 0 !important;
}

body .requests-page.requests-worker-clean .requests-worker-filter-inline input::placeholder {
    color: rgba(220,231,255,.48) !important;
}

body .requests-page.requests-worker-clean .requests-list-card {
    padding-top: var(--unified-panel-padding, 22px) !important;
}

body .requests-page.requests-worker-clean .request-list {
    margin-top: 0 !important;
}

@media (max-width: 1100px) {
    body .requests-page.requests-worker-clean .requests-worker-list-head {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    body .requests-page.requests-worker-clean .requests-worker-filter-inline {
        width: 100% !important;
        margin-left: 0 !important;
    }
}

@media (max-width: 720px) {
    body .requests-page.requests-worker-clean .requests-worker-filter-inline {
        grid-template-columns: 1fr !important;
    }
}


/* =========================================================
   WNIOSKI - WIDOK PRACOWNIKA: KOREKTA KAFELKÓW I LISTY
   - brak napisu Panel pracownika,
   - kolorowe kafelki jak w Komunikatach,
   - pusty widok/lista pod nagłówkiem Skrzynka wniosków.
   ========================================================= */

body .requests-page.requests-worker-clean .module-header-meta {
    gap: 8px !important;
}

/* Kolorowe kafelki pracownika */
body .requests-page.requests-worker-clean .requests-worker-action-color {
    border-color: rgba(255,255,255,.18) !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-color::before {
    opacity: 1 !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-green {
    background:
        radial-gradient(circle at 100% 0%, rgba(45, 212, 191, .15), transparent 36%),
        linear-gradient(180deg, rgba(16,185,129,.28), rgba(34,197,94,.13)) !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-green::before {
    background: linear-gradient(90deg, #8de58f 0%, #b6ff9b 100%) !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-blue {
    background:
        radial-gradient(circle at 100% 0%, rgba(125,211,252,.16), transparent 36%),
        linear-gradient(180deg, rgba(59,130,246,.25), rgba(14,165,233,.12)) !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-blue::before {
    background: linear-gradient(90deg, #77e0ff 0%, #8adfff 100%) !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-amber {
    background:
        radial-gradient(circle at 100% 0%, rgba(251,191,36,.18), transparent 36%),
        linear-gradient(180deg, rgba(245,158,11,.28), rgba(251,191,36,.13)) !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-amber::before {
    background: linear-gradient(90deg, #ffd95f 0%, #f5b942 100%) !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-violet {
    background:
        radial-gradient(circle at 100% 0%, rgba(168,85,247,.17), transparent 36%),
        linear-gradient(180deg, rgba(139,92,246,.27), rgba(168,85,247,.12)) !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-violet::before {
    background: linear-gradient(90deg, #9ac7ff 0%, #8b82ff 100%) !important;
}

/* Pusty widok pod nagłówkiem skrzynki */
body .requests-page.requests-worker-clean .requests-worker-empty-under-head {
    margin: 0 0 14px 0 !important;
    min-height: 72px !important;
    display: grid !important;
    place-items: center !important;
    text-align: center !important;
}

/* Gdy nie ma wniosków, lista nie powinna dodawać pustego odstępu */
body .requests-page.requests-worker-clean .requests-worker-empty-under-head + .request-list {
    margin-top: 0 !important;
}


/* =========================================================
   WNIOSKI - WIDOK PRACOWNIKA: UKŁAD KAFELKÓW JAK W KOMUNIKATACH
   Tylko rozmieszczenie zawartości kafelków:
   ikona po lewej, tekst do lewej, przycisk na dole po lewej.
   ========================================================= */

body .requests-page.requests-worker-clean .module-actions-grid {
    align-items: stretch !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-color {
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) !important;
    grid-template-rows: minmax(70px, 1fr) auto !important;
    align-items: start !important;
    justify-items: start !important;
    text-align: left !important;
    gap: 12px 14px !important;
    min-height: 150px !important;
    padding: 18px !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-color .module-action-icon {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: start !important;
    justify-self: start !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    margin: 0 !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-color .module-action-content {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: start !important;
    justify-self: stretch !important;
    display: grid !important;
    gap: 7px !important;
    text-align: left !important;
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-color .module-action-content strong {
    display: block !important;
    text-align: left !important;
    line-height: 1.08 !important;
    margin: 0 !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-color .module-action-content span {
    display: block !important;
    text-align: left !important;
    line-height: 1.28 !important;
    margin: 0 !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-color .module-action-cta {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: start !important;
    align-self: end !important;
    margin: 0 !important;
    text-align: left !important;
}

@media (max-width: 720px) {
    body .requests-page.requests-worker-clean .requests-worker-action-color {
        grid-template-columns: 42px minmax(0, 1fr) !important;
        min-height: 132px !important;
        padding: 15px !important;
        gap: 10px 12px !important;
    }

    body .requests-page.requests-worker-clean .requests-worker-action-color .module-action-icon {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }
}


/* =========================================================
   WNIOSKI - WIDOK PRACOWNIKA: KAFELKI IDENTYCZNE JAK KOMUNIKATY
   Budowa i rozmieszczenie:
   - action-tile jak w module Komunikaty,
   - ikona po lewej,
   - treść po prawej,
   - przycisk na dole po lewej pod treścią,
   - ta sama wysokość, padding, gap i typografia.
   ========================================================= */

body .requests-page.requests-worker-clean .module-actions-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(220px, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-tile {
    min-height: 176px !important;
    height: 100% !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 54px minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    align-items: start !important;
    justify-items: start !important;
    gap: 14px 16px !important;
    padding: 20px !important;
    text-align: left !important;
    overflow: hidden !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-tile .action-tile-icon {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    min-height: 54px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: start !important;
    justify-self: start !important;
    margin: 0 !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-tile .action-tile-icon .app-icon,
body .requests-page.requests-worker-clean .requests-worker-action-tile .action-tile-icon svg {
    width: 25px !important;
    height: 25px !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-tile .action-tile-content {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: start !important;
    justify-self: stretch !important;
    display: grid !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    text-align: left !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-tile .action-tile-content strong {
    margin: 0 !important;
    text-align: left !important;
    line-height: 1.08 !important;
    font-size: clamp(18px, 1.55vw, 24px) !important;
    font-weight: 950 !important;
    letter-spacing: -.035em !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-tile .action-tile-content span {
    margin: 0 !important;
    text-align: left !important;
    line-height: 1.28 !important;
    font-size: clamp(13px, 1vw, 15px) !important;
    font-weight: 750 !important;
    color: rgba(255,255,255,.86) !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-tile .tile-action-btn {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: start !important;
    align-self: end !important;
    min-width: 112px !important;
    min-height: 40px !important;
    padding: 10px 18px !important;
    margin: 0 !important;
    border-radius: 15px !important;
    text-align: center !important;
    font-weight: 950 !important;
}

/* Nadpisuje wcześniejsze reguły module-action-card, które centrowały zawartość */
body .requests-page.requests-worker-clean .requests-worker-action-tile.requests-worker-action-color,
body .requests-page.requests-worker-clean .requests-worker-action-tile .module-action-content,
body .requests-page.requests-worker-clean .requests-worker-action-tile .module-action-cta {
    text-align: left !important;
}

/* Kolory zgodne z komunikatami, ale na klasach kafelków Wniosków */
body .requests-page.requests-worker-clean .requests-worker-action-green {
    background:
        radial-gradient(circle at 100% 0%, rgba(45, 212, 191, .15), transparent 36%),
        linear-gradient(180deg, rgba(16,185,129,.30), rgba(34,197,94,.15)) !important;
}
body .requests-page.requests-worker-clean .requests-worker-action-green::before {
    background: linear-gradient(90deg, #8de58f 0%, #b6ff9b 100%) !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-blue {
    background:
        radial-gradient(circle at 100% 0%, rgba(125,211,252,.16), transparent 36%),
        linear-gradient(180deg, rgba(59,130,246,.30), rgba(14,165,233,.15)) !important;
}
body .requests-page.requests-worker-clean .requests-worker-action-blue::before {
    background: linear-gradient(90deg, #77e0ff 0%, #8adfff 100%) !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-amber {
    background:
        radial-gradient(circle at 100% 0%, rgba(251,191,36,.18), transparent 36%),
        linear-gradient(180deg, rgba(245,158,11,.30), rgba(251,191,36,.15)) !important;
}
body .requests-page.requests-worker-clean .requests-worker-action-amber::before {
    background: linear-gradient(90deg, #ffd95f 0%, #f5b942 100%) !important;
}

body .requests-page.requests-worker-clean .requests-worker-action-violet {
    background:
        radial-gradient(circle at 100% 0%, rgba(168,85,247,.17), transparent 36%),
        linear-gradient(180deg, rgba(139,92,246,.30), rgba(168,85,247,.15)) !important;
}
body .requests-page.requests-worker-clean .requests-worker-action-violet::before {
    background: linear-gradient(90deg, #9ac7ff 0%, #8b82ff 100%) !important;
}

@media (max-width: 1200px) {
    body .requests-page.requests-worker-clean .module-actions-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr)) !important;
    }
}

@media (max-width: 720px) {
    body .requests-page.requests-worker-clean .module-actions-grid {
        grid-template-columns: 1fr !important;
    }

    body .requests-page.requests-worker-clean .requests-worker-action-tile {
        min-height: 150px !important;
        grid-template-columns: 48px minmax(0, 1fr) !important;
        gap: 12px 14px !important;
        padding: 17px !important;
    }

    body .requests-page.requests-worker-clean .requests-worker-action-tile .action-tile-icon {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
    }
}


/* =========================================================
   WNIOSKI - WIDOK PRACOWNIKA: SZEROKIE PRZYCISKI W KAFELKACH
   Przyciski w kafelkach mają szerokość jak w module Komunikaty.
   ========================================================= */

body .requests-page.requests-worker-clean .requests-worker-action-tile .tile-action-btn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    justify-self: stretch !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    padding: 11px 18px !important;
    border-radius: 16px !important;
}

@media (min-width: 721px) {
    body .requests-page.requests-worker-clean .requests-worker-action-tile .tile-action-btn {
        width: 100% !important;
    }
}


/* =========================================================
   WNIOSKI - WIDOK PRACOWNIKA: PRZYCISK NA SZEROKOŚĆ KAFELKA
   Przycisk zajmuje całą szerokość kafelka z zachowaniem marginesów/paddingu.
   ========================================================= */

body .requests-page.requests-worker-clean .requests-worker-action-tile .tile-action-btn {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    justify-self: stretch !important;
    align-self: end !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 46px !important;
    padding: 12px 20px !important;
    margin: 2px 0 0 0 !important;
    border-radius: 17px !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

/* Daje więcej miejsca na przycisk bez zabierania paddingu kafelka */
body .requests-page.requests-worker-clean .requests-worker-action-tile {
    grid-template-rows: minmax(0, 1fr) auto !important;
    padding-bottom: 20px !important;
}

@media (max-width: 720px) {
    body .requests-page.requests-worker-clean .requests-worker-action-tile .tile-action-btn {
        min-height: 44px !important;
        padding: 11px 18px !important;
        border-radius: 16px !important;
    }
}


/* =========================================================
   RCP - WIDOK PRACOWNIKA PC/PWA CLEAN v1
   ========================================================= */

body .rcp-worker-clean[data-role="pracownik"] .rcp-module-header .module-header-meta,
body .rcp-worker-clean[data-role="pracownik"] .rcp-module-header .module-header-actions,
body .rcp-worker-clean[data-role="pracownik"] .rcp-module-header .module-stats-head,
body .rcp-worker-clean[data-role="pracownik"] .rcp-module-header .summary-grid,
body .rcp-worker-clean[data-role="pracownik"] .rcp-module-header .module-note-banner {
    display: none !important;
}

body .rcp-worker-clean[data-role="pracownik"] .module-actions-head {
    align-items: flex-start !important;
}

body .rcp-worker-clean[data-role="pracownik"] .module-actions-title h3 {
    margin-bottom: 0 !important;
}

body .rcp-worker-clean[data-role="pracownik"] .module-actions-title .module-actions-kicker,
body .rcp-worker-clean[data-role="pracownik"] .module-actions-meta {
    display: none !important;
}

body .rcp-worker-clean[data-role="pracownik"] .module-actions-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(240px, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile {
    min-height: 176px !important;
    height: 100% !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 54px minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    align-items: start !important;
    justify-items: start !important;
    gap: 14px 16px !important;
    padding: 20px !important;
    text-align: left !important;
    overflow: hidden !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-icon {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    min-height: 54px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-content {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: grid !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    text-align: left !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-content strong {
    margin: 0 !important;
    text-align: left !important;
    line-height: 1.08 !important;
    font-size: clamp(18px, 1.55vw, 24px) !important;
    font-weight: 950 !important;
    letter-spacing: -.035em !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-content span {
    margin: 0 !important;
    text-align: left !important;
    line-height: 1.28 !important;
    font-size: clamp(13px, 1vw, 15px) !important;
    font-weight: 750 !important;
    color: rgba(255,255,255,.86) !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .tile-action-btn {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    justify-self: stretch !important;
    align-self: end !important;
    width: 100% !important;
    min-height: 46px !important;
    padding: 12px 20px !important;
    border-radius: 17px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    font-weight: 950 !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-green {
    background:
        radial-gradient(circle at 100% 0%, rgba(45, 212, 191, .15), transparent 36%),
        linear-gradient(180deg, rgba(16,185,129,.30), rgba(34,197,94,.15)) !important;
}
body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-green::before {
    background: linear-gradient(90deg, #8de58f 0%, #b6ff9b 100%) !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-blue {
    background:
        radial-gradient(circle at 100% 0%, rgba(125,211,252,.16), transparent 36%),
        linear-gradient(180deg, rgba(59,130,246,.30), rgba(14,165,233,.15)) !important;
}
body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-blue::before {
    background: linear-gradient(90deg, #77e0ff 0%, #8adfff 100%) !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet {
    background:
        radial-gradient(circle at 100% 0%, rgba(168,85,247,.17), transparent 36%),
        linear-gradient(180deg, rgba(139,92,246,.30), rgba(168,85,247,.15)) !important;
}
body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet::before {
    background: linear-gradient(90deg, #9ac7ff 0%, #8b82ff 100%) !important;
}

/* Miesięczny widok */
body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-month-head {
    align-items: center !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-month-table th,
body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-month-table td {
    white-space: nowrap !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-day-row {
    cursor: pointer !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-day-row:hover {
    background: rgba(255,255,255,.045) !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-day-row.is-open {
    background: rgba(79,140,255,.08) !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-day-details td {
    padding: 0 !important;
    background: rgba(3,8,20,.28) !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-day-details-inner {
    padding: 16px !important;
    display: grid !important;
    gap: 12px !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-day-details-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-day-details-head span {
    color: rgba(220,231,255,.72) !important;
    font-size: 12px !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-events-list {
    display: grid !important;
    gap: 8px !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-event-item {
    display: grid !important;
    grid-template-columns: 70px minmax(130px, .6fr) minmax(0, 1fr) auto !important;
    gap: 10px !important;
    align-items: center !important;
    padding: 10px 12px !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    background: rgba(255,255,255,.045) !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-event-item small {
    color: rgba(220,231,255,.72) !important;
}

@media (max-width: 1000px) {
    body .rcp-worker-clean[data-role="pracownik"] .module-actions-grid {
        grid-template-columns: 1fr !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-event-item {
        grid-template-columns: 1fr !important;
        align-items: start !important;
    }
}


/* =========================================================
   RCP - WIDOK PRACOWNIKA: PUSTY WIERSZ NA CAŁĄ TABELĘ
   ========================================================= */

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-month-empty-row {
    width: 100% !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-month-empty-cell {
    width: 100% !important;
    min-width: 100% !important;
    display: table-cell !important;
    text-align: center !important;
    padding: 24px !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-month-table {
    width: 100% !important;
    table-layout: auto !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-month-table-wrap {
    width: 100% !important;
}


/* =========================================================
   RCP - WIDOK PRACOWNIKA: QR POPUP FIX + BEZ HISTORII
   ========================================================= */

body .rcp-worker-clean[data-role="pracownik"] .module-actions-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
}

@media (max-width: 900px) {
    body .rcp-worker-clean[data-role="pracownik"] .module-actions-grid {
        grid-template-columns: 1fr !important;
    }
}

/* W razie gdy główny CSS modalny wymaga klasy otwarcia */
body .modal-backdrop.is-open,
body .modal-backdrop.open {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}


/* =========================================================
   RCP - WIDOK PRACOWNIKA: POPUP QR ZAMYKANIE + GENEROWANIE
   ========================================================= */

body .modal-backdrop[data-modal="my-qr-modal"].is-open,
body .modal-backdrop[data-modal="my-qr-modal"].open {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

body .modal-backdrop[data-modal="my-qr-modal"][hidden] {
    display: none !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] {
    cursor: pointer !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] .modal-window {
    cursor: default !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] .modal-close {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 5 !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] .qr-code-center {
    min-height: 360px !important;
    display: grid !important;
    place-items: center !important;
    padding: 16px !important;
    border-radius: 24px !important;
    background: rgba(255,255,255,.96) !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] .qr-code-center canvas,
body .modal-backdrop[data-modal="my-qr-modal"] .qr-code-center svg,
body .modal-backdrop[data-modal="my-qr-modal"] .qr-code-center img,
body .modal-backdrop[data-modal="my-qr-modal"] .rcp-worker-qr-generated-img {
    width: min(360px, 72vw) !important;
    height: min(360px, 72vw) !important;
    max-width: 100% !important;
    max-height: 70vh !important;
    display: block !important;
    object-fit: contain !important;
}


/* =========================================================
   RCP - WIDOK PRACOWNIKA: QR API FINAL FIX
   ========================================================= */

body .modal-backdrop[data-modal="my-qr-modal"].is-open,
body .modal-backdrop[data-modal="my-qr-modal"].open {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

body .modal-backdrop[data-modal="my-qr-modal"][hidden] {
    display: none !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] {
    cursor: pointer !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] .modal-window {
    cursor: default !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] .modal-close,
body .modal-backdrop[data-modal="my-qr-modal"] [data-close-modal] {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 20 !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] .qr-code-center {
    width: min(420px, 76vw) !important;
    min-height: min(420px, 76vw) !important;
    display: grid !important;
    place-items: center !important;
    padding: 18px !important;
    border-radius: 26px !important;
    background: rgba(255,255,255,.96) !important;
    margin: 14px auto !important;
    box-sizing: border-box !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] .qr-code-center canvas,
body .modal-backdrop[data-modal="my-qr-modal"] .qr-code-center svg,
body .modal-backdrop[data-modal="my-qr-modal"] .qr-code-center img,
body .modal-backdrop[data-modal="my-qr-modal"] .rcp-worker-qr-generated-img {
    width: min(360px, 68vw) !important;
    height: min(360px, 68vw) !important;
    max-width: 100% !important;
    max-height: 68vh !important;
    display: block !important;
    object-fit: contain !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] .rcp-worker-qr-loading,
body .modal-backdrop[data-modal="my-qr-modal"] .rcp-worker-qr-empty {
    color: rgba(15,23,42,.75) !important;
    background: rgba(255,255,255,.86) !important;
    border-radius: 999px !important;
    padding: 12px 18px !important;
    text-align: center !important;
    font-weight: 850 !important;
}


/* =========================================================
   RCP - WIDOK PRACOWNIKA: TYLKO JEDEN QR W POPUPIE
   ========================================================= */

body .modal-backdrop[data-modal="my-qr-modal"] .qr-code-center canvas:not(:last-child),
body .modal-backdrop[data-modal="my-qr-modal"] .qr-code-center svg:not(:last-child),
body .modal-backdrop[data-modal="my-qr-modal"] .qr-code-center img:not(:last-child) {
    display: none !important;
}


/* =========================================================
   RCP - WIDOK PRACOWNIKA: POPUP QR OTWIERANIE FIX
   ========================================================= */

body .rcp-worker-clean[data-role="pracownik"] [data-rcp-worker-open-qr] {
    cursor: pointer !important;
}

body .modal-backdrop[data-modal="my-qr-modal"].is-open,
body .modal-backdrop[data-modal="my-qr-modal"].open {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}


/* =========================================================
   RCP - WIDOK PRACOWNIKA: FINALNE ZAMYKANIE POPUPU QR
   ========================================================= */

body .modal-backdrop[data-modal="my-qr-modal"].is-open,
body .modal-backdrop[data-modal="my-qr-modal"].open {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

body .modal-backdrop[data-modal="my-qr-modal"][hidden] {
    display: none !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] {
    cursor: pointer !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] .modal-window {
    cursor: default !important;
}

body .modal-backdrop[data-modal="my-qr-modal"] [data-close-modal],
body .modal-backdrop[data-modal="my-qr-modal"] .modal-close {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 99999 !important;
    position: relative !important;
}


/* =========================================================
   RCP - WIDOK PRACOWNIKA PWA: BEZPIECZNA POPRAWKA KAFELKÓW
   Zakres wyłącznie:
   body .rcp-worker-clean[data-role="pracownik"]
   Nie wpływa na stronę główną ani inne moduły.
   ========================================================= */

@media (max-width: 720px) {
    body .rcp-worker-clean[data-role="pracownik"] .rcp-actions-card .module-actions-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile {
        min-height: 170px !important;
        height: auto !important;
        width: 100% !important;

        display: grid !important;
        grid-template-columns: 48px minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        align-items: start !important;
        justify-items: start !important;

        gap: 12px 14px !important;
        padding: 17px !important;
        box-sizing: border-box !important;

        text-align: left !important;
        overflow: hidden !important;
        color: #fff !important;
        text-decoration: none !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-icon {
        grid-column: 1 !important;
        grid-row: 1 !important;

        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        align-self: start !important;
        justify-self: start !important;
        margin: 0 !important;

        color: rgba(255,255,255,.92) !important;
        opacity: 1 !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-icon svg,
    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-icon .app-icon {
        width: 24px !important;
        height: 24px !important;
        color: rgba(255,255,255,.92) !important;
        opacity: .95 !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-content {
        grid-column: 2 !important;
        grid-row: 1 !important;

        display: grid !important;
        gap: 8px !important;

        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;

        align-self: start !important;
        justify-self: stretch !important;

        text-align: left !important;
        color: #fff !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-content strong {
        display: block !important;
        margin: 0 !important;

        text-align: left !important;
        line-height: 1.08 !important;
        font-size: clamp(18px, 5vw, 23px) !important;
        font-weight: 950 !important;
        letter-spacing: -.035em !important;

        color: #fff !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-content span {
        display: block !important;
        margin: 0 !important;

        text-align: left !important;
        line-height: 1.28 !important;
        font-size: clamp(13px, 3.4vw, 15px) !important;
        font-weight: 750 !important;

        color: rgba(255,255,255,.86) !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .tile-action-btn {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;

        align-self: end !important;
        justify-self: stretch !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 46px !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        margin: 2px 0 0 0 !important;
        padding: 12px 18px !important;
        border-radius: 17px !important;
        box-sizing: border-box !important;

        text-align: center !important;
        font-size: 16px !important;
        font-weight: 950 !important;
        color: #fff !important;
        text-decoration: none !important;
    }

    /* Kolory tylko dla kafelków RCP pracownika */
    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-green {
        background:
            radial-gradient(circle at 100% 0%, rgba(45, 212, 191, .15), transparent 36%),
            linear-gradient(180deg, rgba(16,185,129,.30), rgba(34,197,94,.15)) !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-green::before {
        background: linear-gradient(90deg, #8de58f 0%, #b6ff9b 100%) !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-blue {
        background:
            radial-gradient(circle at 100% 0%, rgba(125,211,252,.16), transparent 36%),
            linear-gradient(180deg, rgba(59,130,246,.30), rgba(14,165,233,.15)) !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-blue::before {
        background: linear-gradient(90deg, #77e0ff 0%, #8adfff 100%) !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet {
        background:
            radial-gradient(circle at 100% 0%, rgba(168,85,247,.17), transparent 36%),
            linear-gradient(180deg, rgba(139,92,246,.30), rgba(168,85,247,.15)) !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet::before {
        background: linear-gradient(90deg, #9ac7ff 0%, #8b82ff 100%) !important;
    }

    /* Nagłówek sekcji RCP w PWA */
    body .rcp-worker-clean[data-role="pracownik"] .rcp-actions-card .module-actions-title h3 {
        margin-bottom: 6px !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-actions-card .module-actions-title p {
        margin-top: 0 !important;
        line-height: 1.35 !important;
    }
}

/* =========================================================
   2026-05-12 FINAL - ROZDZIELONE STYLE PWA
   BLOK B: RCP PRACOWNIK PWA
   Zakres wyłącznie:
   body .rcp-worker-clean[data-role="pracownik"]
   Nie wpływa na stronę główną i inne moduły.
   ========================================================= */

@media (max-width: 720px) {
    body .rcp-worker-clean[data-role="pracownik"] .rcp-actions-card .module-actions-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile {
        min-height: 170px !important;
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;

        display: grid !important;
        grid-template-columns: 48px minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        align-items: start !important;
        justify-items: start !important;

        gap: 12px 14px !important;
        padding: 17px !important;
        box-sizing: border-box !important;

        text-align: left !important;
        overflow: hidden !important;
        color: #fff !important;
        text-decoration: none !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile,
    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile * {
        color: #fff !important;
        text-shadow: none !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-icon {
        grid-column: 1 !important;
        grid-row: 1 !important;

        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        align-self: start !important;
        justify-self: start !important;
        margin: 0 !important;

        color: rgba(255,255,255,.96) !important;
        opacity: 1 !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-icon svg,
    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-icon svg *,
    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-icon .app-icon {
        width: 24px !important;
        height: 24px !important;
        color: rgba(255,255,255,.96) !important;
        stroke: rgba(255,255,255,.96) !important;
        fill: none !important;
        opacity: 1 !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-content {
        grid-column: 2 !important;
        grid-row: 1 !important;

        display: grid !important;
        gap: 8px !important;

        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;

        align-self: start !important;
        justify-self: stretch !important;

        text-align: left !important;
        color: #fff !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-content strong {
        display: block !important;
        margin: 0 !important;

        text-align: left !important;
        line-height: 1.08 !important;
        font-size: clamp(18px, 5vw, 23px) !important;
        font-weight: 950 !important;
        letter-spacing: -.035em !important;

        color: #fff !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .action-tile-content span {
        display: block !important;
        margin: 0 !important;

        text-align: left !important;
        line-height: 1.28 !important;
        font-size: clamp(13px, 3.4vw, 15px) !important;
        font-weight: 750 !important;

        color: rgba(255,255,255,.88) !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .tile-action-btn {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;

        align-self: end !important;
        justify-self: stretch !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 46px !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        margin: 2px 0 0 0 !important;
        padding: 12px 18px !important;
        border-radius: 17px !important;
        box-sizing: border-box !important;

        text-align: center !important;
        font-size: 16px !important;
        font-weight: 950 !important;
        color: #fff !important;
        text-decoration: none !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .tile-action-btn,
    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-tile .tile-action-btn * {
        color: #fff !important;
    }

    /* Kolory tła tylko dla kafelków RCP pracownika */
    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-green {
        background:
            radial-gradient(circle at 100% 0%, rgba(45, 212, 191, .15), transparent 36%),
            linear-gradient(180deg, rgba(16,185,129,.30), rgba(34,197,94,.15)) !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-green::before {
        background: linear-gradient(90deg, #8de58f 0%, #b6ff9b 100%) !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-blue {
        background:
            radial-gradient(circle at 100% 0%, rgba(125,211,252,.16), transparent 36%),
            linear-gradient(180deg, rgba(59,130,246,.30), rgba(14,165,233,.15)) !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-blue::before {
        background: linear-gradient(90deg, #77e0ff 0%, #8adfff 100%) !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet {
        background:
            radial-gradient(circle at 100% 0%, rgba(168,85,247,.17), transparent 36%),
            linear-gradient(180deg, rgba(139,92,246,.30), rgba(168,85,247,.15)) !important;
    }

    body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet::before {
        background: linear-gradient(90deg, #9ac7ff 0%, #8b82ff 100%) !important;
    }
}


/* FIX Profile: four summary tiles must stay in one horizontal row on desktop */
.profile-account-card .profile-four-tiles-row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
    align-items: stretch !important;
    width: 100% !important;
    margin: 18px 0 0 !important;
}

.profile-account-card .profile-four-tiles-row > .profile-summary-tile {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 104px !important;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 14px !important;
    border-radius: 22px !important;
}

.profile-account-card .profile-four-tiles-row .profile-stat-icon {
    width: 44px !important;
    height: 44px !important;
    border-radius: 16px !important;
}

.profile-account-card .profile-four-tiles-row span,
.profile-account-card .profile-four-tiles-row strong,
.profile-account-card .profile-four-tiles-row small {
    overflow-wrap: anywhere;
}

.profile-account-card .profile-four-tiles-row strong {
    font-size: clamp(15px, 1.1vw, 20px) !important;
}

.profile-account-card .profile-four-tiles-row small {
    font-size: 11px !important;
}

@media (max-width: 1120px) {
    .profile-account-card .profile-four-tiles-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 620px) {
    .profile-account-card .profile-four-tiles-row {
        grid-template-columns: 1fr !important;
    }
}


/* =========================================================
   RCP - POPRAWKA PRAWEGO KAFELKA AKCJI PRACOWNIKA
   Prawy kafelek ma biały przycisk i białą ikonę jak lewy kafelek,
   ale zachowuje osobny fioletowo-niebieski kolor tła.
   ========================================================= */
body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet {
    color: #ffffff !important;
    background:
        radial-gradient(circle at 100% 0%, rgba(255,255,255,.18), transparent 34%),
        linear-gradient(135deg, rgba(99,102,241,.58) 0%, rgba(139,92,246,.48) 46%, rgba(59,130,246,.34) 100%) !important;
    border-color: rgba(255,255,255,.20) !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet::before {
    background: linear-gradient(90deg, #c4b5fd 0%, #93c5fd 100%) !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet .action-tile-icon {
    color: #ffffff !important;
    background: rgba(255,255,255,.18) !important;
    border-color: rgba(255,255,255,.24) !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet .action-tile-icon svg,
body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet .action-tile-icon svg *,
body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet .action-tile-icon .app-icon {
    color: #ffffff !important;
    stroke: #ffffff !important;
    fill: none !important;
    opacity: 1 !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet .action-tile-content,
body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet .action-tile-content strong {
    color: #ffffff !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet .action-tile-content span {
    color: rgba(255,255,255,.88) !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet .tile-action-btn {
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(255,255,255,.26), rgba(255,255,255,.14)) !important;
    border-color: rgba(255,255,255,.26) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 14px 28px rgba(15,23,42,.20) !important;
}

body .rcp-worker-clean[data-role="pracownik"] .rcp-worker-action-violet:hover .tile-action-btn {
    background: linear-gradient(135deg, rgba(255,255,255,.34), rgba(255,255,255,.18)) !important;
}

/* =========================================================
   POPRAWKA 2026-05-12: KOLOROWE WYPEŁNIENIE KAFELKÓW ADMINA
   Cel: kafelki z kolorową górną krawędzią mają mieć także
   delikatne kolorowe tło jak w widoku pracownika.
   Działa dla PC i PWA.
   ========================================================= */
body .dashboard-unified-home :where(
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .dashboard-mini-stat-grid .rcp-stat,
    .dashboard-communications-stats > div,
    .dashboard-stat-tile
) {
    background:
        radial-gradient(circle at 100% 0%, rgba(136,168,255,.10), transparent 34%),
        var(--unified-tile-bg) !important;
}

/* Zielone */
body .dashboard-unified-home :where(
    .premium-admin-kpi-success,
    .premium-insight-success,
    .dashboard-live-stat-tile-success,
    .rcp-stat-success,
    .dashboard-stat-tile
)[class*="success"],
body .dashboard-unified-home .dashboard-compact-row.tone-success,
body .dashboard-unified-home [class*="accepted"],
body .dashboard-unified-home [class*="zaakcept"] {
    background:
        radial-gradient(circle at 100% 0%, rgba(45,212,191,.15), transparent 36%),
        linear-gradient(180deg, rgba(16,185,129,.28), rgba(34,197,94,.13)) !important;
}

/* Niebieskie / info */
body .dashboard-unified-home :where(
    .premium-admin-kpi-info,
    .premium-insight-info,
    .dashboard-live-stat-tile-info,
    .rcp-stat-info,
    .dashboard-stat-tile
)[class*="info"],
body .dashboard-unified-home .dashboard-communications-stats > div:nth-child(1),
body .dashboard-unified-home .dashboard-compact-row.tone-info,
body .dashboard-unified-home [class*="open"],
body .dashboard-unified-home [class*="otwarte"] {
    background:
        radial-gradient(circle at 100% 0%, rgba(125,211,252,.16), transparent 36%),
        linear-gradient(180deg, rgba(59,130,246,.25), rgba(14,165,233,.12)) !important;
}

/* Pomarańczowe / warning */
body .dashboard-unified-home :where(
    .premium-admin-kpi-warning,
    .premium-insight-warning,
    .dashboard-live-stat-tile-warning,
    .rcp-stat-warning,
    .dashboard-stat-tile
)[class*="warning"],
body .dashboard-unified-home .dashboard-communications-stats > div:nth-child(2),
body .dashboard-unified-home .dashboard-compact-row.tone-warning,
body .dashboard-unified-home [class*="pending"],
body .dashboard-unified-home [class*="decision"],
body .dashboard-unified-home [class*="decyz"],
body .dashboard-unified-home [class*="brak"] {
    background:
        radial-gradient(circle at 100% 0%, rgba(251,191,36,.18), transparent 36%),
        linear-gradient(180deg, rgba(245,158,11,.28), rgba(251,191,36,.13)) !important;
}

/* Czerwone / krytyczne */
body .dashboard-unified-home :where(
    .premium-admin-kpi-danger,
    .premium-insight-danger,
    .dashboard-live-stat-tile-danger,
    .rcp-stat-danger,
    .dashboard-stat-tile
)[class*="danger"],
body .dashboard-unified-home .dashboard-communications-stats > div:nth-child(3),
body .dashboard-unified-home .dashboard-compact-row.tone-danger,
body .dashboard-unified-home [class*="urgent"],
body .dashboard-unified-home [class*="critical"],
body .dashboard-unified-home [class*="pilne"],
body .dashboard-unified-home [class*="problem"] {
    background:
        radial-gradient(circle at 100% 0%, rgba(251,113,133,.17), transparent 36%),
        linear-gradient(180deg, rgba(239,68,68,.26), rgba(244,63,94,.12)) !important;
}

/* Fioletowe */
body .dashboard-unified-home :where(
    .premium-insight-violet,
    .dashboard-live-stat-tile-violet,
    .dashboard-stat-tile
)[class*="violet"],
body .dashboard-unified-home [class*="violet"] {
    background:
        radial-gradient(circle at 100% 0%, rgba(168,85,247,.17), transparent 36%),
        linear-gradient(180deg, rgba(139,92,246,.27), rgba(168,85,247,.12)) !important;
}

/* Zachowanie czytelności tekstu na kolorowych kafelkach */
body .dashboard-unified-home :where(
    .premium-admin-kpi,
    .premium-insight-card,
    .dashboard-live-stat-tile,
    .dashboard-mini-stat-grid .rcp-stat,
    .dashboard-communications-stats > div,
    .dashboard-stat-tile
) > :where(span, strong, small),
body .dashboard-unified-home .dashboard-compact-row > :where(span, div, strong, small) {
    color: rgba(255,255,255,.96) !important;
}


/* =========================================================
   POPRAWKA 2026-05-12: MODUŁY - KAFELKI STATYSTYK JAK STRONA GŁÓWNA
   - usuwa potrzebę osobnych przycisków pod hero (widok w EJS)
   - 3 kafelki na pełną szerokość na PC
   - w PWA jeden pod drugim
   - kolorowe wypełnienia jak w widoku pracownika
   ========================================================= */
body .premium-admin-tools-page .modules-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 0 14px !important;
    align-items: stretch !important;
}

body .premium-admin-tools-page .modules-kpi-grid .modules-kpi-card {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 112px !important;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 8px 10px !important;
    align-items: start !important;
    align-content: center !important;
    padding: 14px 16px !important;
    border-radius: 22px !important;
}

body .premium-admin-tools-page .modules-kpi-grid .modules-kpi-card > span:first-child {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

body .premium-admin-tools-page .modules-kpi-grid .modules-kpi-card > div {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    display: grid !important;
    gap: 8px !important;
    min-width: 0 !important;
}

body .premium-admin-tools-page .modules-kpi-grid .modules-kpi-card strong {
    display: block !important;
    margin: 0 !important;
    line-height: 0.98 !important;
    font-size: clamp(1.7rem, 2.5vw, 2.2rem) !important;
    font-weight: 950 !important;
    color: rgba(255,255,255,.98) !important;
}

body .premium-admin-tools-page .modules-kpi-grid .modules-kpi-card small {
    display: block !important;
    margin: 0 !important;
    line-height: 1.14 !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: rgba(255,255,255,.92) !important;
}

body .premium-admin-tools-page .modules-kpi-grid .modules-kpi-card.modules-kpi-card-info {
    background:
        radial-gradient(circle at 100% 0%, rgba(125,211,252,.17), transparent 36%),
        linear-gradient(180deg, rgba(59,130,246,.24), rgba(14,165,233,.11)) !important;
    border-color: rgba(147,197,253,.24) !important;
}

body .premium-admin-tools-page .modules-kpi-grid .modules-kpi-card.modules-kpi-card-success {
    background:
        radial-gradient(circle at 100% 0%, rgba(45,212,191,.16), transparent 36%),
        linear-gradient(180deg, rgba(16,185,129,.24), rgba(34,197,94,.11)) !important;
    border-color: rgba(134,239,172,.24) !important;
}

body .premium-admin-tools-page .modules-kpi-grid .modules-kpi-card.modules-kpi-card-warning {
    background:
        radial-gradient(circle at 100% 0%, rgba(251,191,36,.18), transparent 36%),
        linear-gradient(180deg, rgba(245,158,11,.26), rgba(251,191,36,.12)) !important;
    border-color: rgba(253,230,138,.24) !important;
}

/* Hero bez przycisków: ciaśniejszy, spójny układ */
body .premium-admin-tools-page .premium-dashboard-hero .premium-hero-content {
    display: grid !important;
    align-content: center !important;
    gap: 8px !important;
}

body .premium-admin-tools-page .premium-dashboard-hero .premium-hero-content p {
    margin-bottom: 0 !important;
}

@media (max-width: 900px) {
    body .premium-admin-tools-page .modules-kpi-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (display-mode: standalone) and (max-width: 1180px) {
    body .premium-admin-tools-page .modules-kpi-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================
   POPRAWKA 2026-05-14: POPUPY PC / PWA
   Zakres: tylko układ i przewijanie istniejących modali.
   Nie zmienia logiki JS, nazw pól ani zawartości formularzy.
   ========================================================= */
:root {
    --module-modal-safe-padding: clamp(10px, 2vw, 22px);
    --module-modal-safe-width: min(calc(100vw - (var(--module-modal-safe-padding) * 2)), 760px);
    --module-modal-safe-width-wide: min(calc(100vw - (var(--module-modal-safe-padding) * 2)), 1120px);
    --module-modal-safe-width-xl: min(calc(100vw - (var(--module-modal-safe-padding) * 2)), 1320px);
    --module-modal-safe-height: min(900px, calc(100dvh - (var(--module-modal-safe-padding) * 2)));
}

body :where(.modal-shell, .settlement-modal, .ui-modal-root, .ui-modal, .modal-backdrop[data-modal], .modal-backdrop[id$="Modal"], .modal-backdrop.modal-xl, .documents-modal, .documents-viewer-modal, .rz-modal) {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    min-width: 0 !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    z-index: 1200 !important;
    display: grid !important;
    place-items: center !important;
    align-items: center !important;
    justify-items: center !important;
    padding: var(--module-modal-safe-padding) !important;
    overflow: auto !important;
    overscroll-behavior: contain !important;
    box-sizing: border-box !important;
}

body :where(.modal-shell.hidden, .modal-shell[hidden], .settlement-modal:not(.is-visible), .ui-modal-root[hidden], .ui-modal.hidden, .ui-modal[hidden], .modal-backdrop[data-modal][hidden], .documents-modal[aria-hidden="true"], .documents-viewer-modal[aria-hidden="true"], .rz-modal[hidden]) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body :where(.modal-shell:not(.hidden), .settlement-modal.is-visible, .ui-modal-root:not([hidden]), .ui-modal:not(.hidden), .modal-backdrop[data-modal]:not([hidden]), .modal-backdrop[id$="Modal"].is-open, .documents-modal[aria-hidden="false"], .documents-viewer-modal[aria-hidden="false"], .rz-modal:not([hidden])) {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

body :where(.ui-backdrop, .modal-shell > .modal-backdrop, .settlement-modal-backdrop, .ui-dialog-backdrop, .documents-modal::before, .documents-viewer-modal::before) {
    position: fixed !important;
    inset: 0 !important;
}

body :where(.modal-window, .modal-panel, .modal-card, .settlement-modal-card, .ui-dialog, .documents-modal-panel, .documents-viewer-panel, .rz-modal-card, .rz-modal-panel) {
    position: relative !important;
    z-index: 2 !important;
    width: var(--module-modal-safe-width) !important;
    max-width: 100% !important;
    max-height: var(--module-modal-safe-height) !important;
    margin: auto !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

body :where(.modal-xl, .modal-panel-wide, .modal-panel-report, .message-detail-popup, .history-modal-card, .documents-viewer-panel) {
    width: var(--module-modal-safe-width-wide) !important;
    max-width: 100% !important;
}

body :where(.modal-panel-calendar, .modal-panel-planner, .modal-panel-availability-overview, .settlement-main-card) {
    width: var(--module-modal-safe-width-xl) !important;
    max-width: 100% !important;
}

body :where(.modal-body, .ui-dialog-body, .modal-panel > form, .modal-window > form, .modal-card > form, .settlement-modal-body, .settlement-modal-content, .documents-modal-panel > form, .documents-viewer-body, .rz-modal-card > form, .rz-modal-panel > form) {
    min-height: 0 !important;
    max-width: 100% !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

body :where(.modal-header, .modal-card-head, .settlement-modal-header, .ui-dialog-head, .documents-modal-head, .rz-modal-head) {
    flex: 0 0 auto !important;
    min-width: 0 !important;
}

body :where(.modal-header > div, .modal-card-head > div, .settlement-modal-header > div, .ui-dialog-head > div, .documents-modal-head > div, .rz-modal-head > div) {
    min-width: 0 !important;
}

body :where(.modal-header h2, .modal-header h3, .modal-card-head h2, .modal-card-head h3, .settlement-modal-header h2, .settlement-modal-header h3, .ui-dialog-head h2, .ui-dialog-head h3, .documents-modal-head h2, .documents-modal-head h3, .rz-modal-head h2, .rz-modal-head h3) {
    overflow-wrap: anywhere !important;
}

body :where(.modal-close, .close-btn, .icon-chip-btn[data-modal-close], .settlement-close-btn, .js-close-history-modal, .js-close-pin-modal) {
    flex: 0 0 auto !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

body.modal-open,
body.qr-modal-open,
body:has(.modal-shell:not(.hidden)),
body:has(.ui-modal:not(.hidden)),
body:has(.settlement-modal.is-visible),
body:has(.modal-backdrop[data-modal]:not([hidden])) {
    overflow: hidden !important;
}

@media (max-width: 760px), (display-mode: standalone) and (max-width: 920px) {
    :root {
        --module-modal-safe-padding: max(10px, env(safe-area-inset-left));
        --module-modal-safe-width: calc(100vw - 20px);
        --module-modal-safe-width-wide: calc(100vw - 20px);
        --module-modal-safe-width-xl: calc(100vw - 20px);
        --module-modal-safe-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }

    body :where(.modal-shell, .settlement-modal, .ui-modal-root, .ui-modal, .modal-backdrop[data-modal], .modal-backdrop[id$="Modal"], .modal-backdrop.modal-xl, .documents-modal, .documents-viewer-modal, .rz-modal) {
        place-items: center !important;
        align-items: center !important;
        justify-items: center !important;
        padding: 10px !important;
    }

    body :where(.modal-window, .modal-panel, .modal-card, .settlement-modal-card, .ui-dialog, .documents-modal-panel, .documents-viewer-panel, .rz-modal-card, .rz-modal-panel) {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
        border-radius: 22px !important;
    }

    body :where(.modal-header, .modal-card-head, .settlement-modal-header, .ui-dialog-head, .documents-modal-head, .rz-modal-head) {
        padding: 15px 16px !important;
    }

    body :where(.modal-window > form, .modal-window > .module-form, .modal-window > .modal-body, .modal-window > .table-wrap, .modal-panel > form, .modal-panel > .module-form, .modal-panel > .modal-body, .modal-panel > .modal-calendar-scroll, .modal-panel > .modal-planner-grid-wrap, .modal-card > form, .modal-card > .history-timeline, .ui-dialog-body, .settlement-modal-card > .settlement-modal-body, .settlement-modal-card > .settlement-modal-content, .documents-modal-panel > form, .documents-viewer-body, .rz-modal-card > form, .rz-modal-panel > form) {
        padding: 15px 16px !important;
    }
}


/* ===== INLINE: public/css/dashboard-worker-home-pwa-only.css ===== */

/* =========================================================
   HR CORE - STRONA GŁÓWNA PRACOWNIKA PWA
   UNIKALNE KLASY: hr-worker-home-*
   Ten plik NIE używa klas modułów RCP/Wnioski/Grafik/Komunikaty.
   ========================================================= */

@media (max-width: 720px) {
    body .hr-worker-home-pwa-root {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        margin: 0 !important;
        padding-bottom: calc(160px + env(safe-area-inset-bottom)) !important;

        overflow-x: hidden !important;
        position: relative !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
    }

    body .hr-worker-home-pwa-root,
    body .hr-worker-home-pwa-root * {
        box-sizing: border-box !important;
    }

    body .hr-worker-home-pwa-root > * {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        position: relative !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
    }

    /* Stosy sekcji - tylko po nowych klasach */
    body .hr-worker-home-info-stack,
    body .hr-worker-home-last-stack {
        display: flex !important;
        flex-direction: column !important;
        gap: 18px !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important;

        position: relative !important;
        clear: both !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
    }

    body .hr-worker-home-info-stack {
        order: 20 !important;
        z-index: 2 !important;
        margin-bottom: 20px !important;
    }

    body .hr-worker-home-last-stack {
        order: 999 !important;
        z-index: 1 !important;
        margin-top: 22px !important;
        margin-bottom: calc(34px + env(safe-area-inset-bottom)) !important;
    }

    body .hr-worker-home-attention-panel,
    body .hr-worker-home-last-activity-panel {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        position: relative !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        clear: both !important;
    }

    body .hr-worker-home-attention-panel {
        z-index: 2 !important;
        margin-bottom: 0 !important;
    }

    body .hr-worker-home-last-activity-panel {
        z-index: 1 !important;
        margin-top: 0 !important;
    }

    /* QR na stronie głównej */
    body .hr-worker-home-qr-panel {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: block !important;
        overflow: hidden !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
    }

    body .hr-worker-home-qr-body {
        width: 100% !important;
        max-width: 100% !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        padding: 10px 0 4px !important;
        margin: 0 auto !important;

        text-align: center !important;
        overflow: hidden !important;

        transform: none !important;
        left: auto !important;
        right: auto !important;
    }

    body .hr-worker-home-qr-button {
        width: min(300px, 82vw) !important;
        max-width: min(300px, 82vw) !important;
        min-width: 0 !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;

        gap: 8px !important;
        padding: 14px !important;

        margin: 0 auto !important;
        float: none !important;

        position: relative !important;
        inset: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;

        text-align: center !important;
        overflow: hidden !important;
    }

    body .hr-worker-home-qr-source,
    body .hr-worker-home-qr-button img,
    body .hr-worker-home-qr-button svg {
        width: min(240px, 68vw) !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 240px !important;

        display: block !important;
        margin: 0 auto !important;
        float: none !important;
        position: static !important;
        transform: none !important;
        object-fit: contain !important;
    }

    body .hr-worker-home-qr-source svg {
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    body .hr-worker-home-qr-hint {
        display: none !important;
    }

    body .hr-worker-home-last-activity-panel .empty-box {
        width: 100% !important;
        min-height: 74px !important;
        display: grid !important;
        place-items: center !important;
        text-align: center !important;
        padding: 18px !important;
    }
}

/* Popup QR - tylko nowe klasy hr-worker-home-* */
body .hr-worker-home-qr-modal {
    position: fixed !important;
    inset: 0 !important;

    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100vh !important;

    z-index: 999999 !important;

    display: none !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 22px !important;
    margin: 0 !important;

    box-sizing: border-box !important;
    overflow: hidden !important;

    transform: none !important;
    left: 0 !important;
    top: 0 !important;
}

body .hr-worker-home-qr-modal:not([hidden]) {
    display: flex !important;
}

body .hr-worker-home-qr-modal-backdrop {
    position: absolute !important;
    inset: 0 !important;

    width: 100% !important;
    height: 100% !important;

    background: rgba(2, 6, 23, .78) !important;
    backdrop-filter: blur(12px) !important;
}

body .hr-worker-home-qr-modal-card {
    position: relative !important;
    z-index: 2 !important;

    width: min(92vw, 560px) !important;
    max-height: min(88dvh, 720px) !important;

    margin: 0 auto !important;
    display: grid !important;
    gap: 16px !important;

    overflow: auto !important;
    transform: none !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
}

body .hr-worker-home-qr-modal-box {
    width: 100% !important;
    display: grid !important;
    place-items: center !important;
    padding: 18px !important;
    overflow: hidden !important;
}

body .hr-worker-home-qr-modal-box svg,
body .hr-worker-home-qr-modal-box img {
    width: min(80vw, 420px) !important;
    height: auto !important;
    max-height: 70dvh !important;
    display: block !important;
    margin: 0 auto !important;
    object-fit: contain !important;
}

@media (max-width: 420px) {
    body .hr-worker-home-qr-button {
        width: min(270px, 84vw) !important;
        max-width: min(270px, 84vw) !important;
        padding: 12px !important;
    }

    body .hr-worker-home-qr-source,
    body .hr-worker-home-qr-source svg,
    body .hr-worker-home-qr-button img,
    body .hr-worker-home-qr-button svg {
        width: min(220px, 66vw) !important;
        max-height: 220px !important;
    }

    body .hr-worker-home-qr-modal {
        padding: 14px !important;
    }

    body .hr-worker-home-qr-modal-card {
        width: 94vw !important;
        max-height: 88dvh !important;
    }
}


/* =========================================================
   HR CORE - DASHBOARD PRACOWNIKA
   FIX v4: QR + OSTATNIA AKTYWNOŚĆ / WYMAGA UWAGI
   Tylko nowe klasy hr-worker-home-*
   ========================================================= */

/* PC / szeroki widok pracownika */
@media (min-width: 721px) {
    body .hr-worker-home-pwa-root .hr-worker-home-top-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr) !important;
        gap: 18px !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-qr-panel {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: grid !important;
        grid-template-rows: auto 1fr !important;
        overflow: hidden !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-qr-body {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 12px !important;
        overflow: hidden !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-qr-button {
        width: min(260px, 100%) !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        float: none !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        overflow: hidden !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-qr-button svg,
    body .hr-worker-home-pwa-root .hr-worker-home-qr-button img,
    body .hr-worker-home-pwa-root .hr-worker-home-qr-source {
        width: min(190px, 100%) !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 190px !important;
        display: block !important;
        margin: 0 auto !important;
        object-fit: contain !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-qr-source svg {
        width: 100% !important;
        height: auto !important;
    }

    /* komunikaty + wymaga uwagi */
    body .hr-worker-home-pwa-root .hr-worker-home-info-stack {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 18px !important;
        align-items: start !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 22px 0 !important;
        position: relative !important;
        clear: both !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-attention-panel {
        position: relative !important;
        z-index: 2 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ostatnia aktywność zawsze osobny rząd pod Wymaga uwagi */
    body .hr-worker-home-pwa-root .hr-worker-home-last-stack {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 24px 0 34px 0 !important;
        padding: 0 !important;
        position: relative !important;
        clear: both !important;
        z-index: 1 !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-last-activity-panel {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        position: relative !important;
        clear: both !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
    }
}

/* PWA / wąski widok */
@media (max-width: 720px) {
    body .hr-worker-home-pwa-root .hr-worker-home-top-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-qr-panel,
    body .hr-worker-home-pwa-root .hr-worker-home-qr-body {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-qr-body {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 10px 0 4px !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-qr-button {
        width: min(300px, 82vw) !important;
        max-width: min(300px, 82vw) !important;
        margin: 0 auto !important;
        float: none !important;
        position: relative !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-info-stack {
        display: flex !important;
        flex-direction: column !important;
        gap: 18px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 20px 0 !important;
        clear: both !important;
        position: relative !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-last-stack {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 24px 0 calc(34px + env(safe-area-inset-bottom)) 0 !important;
        clear: both !important;
        position: relative !important;
        z-index: 1 !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-last-activity-panel {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        clear: both !important;
        position: relative !important;
        transform: none !important;
    }
}

/* Wspólne zabezpieczenia przed nachodzeniem */
body .hr-worker-home-pwa-root .hr-worker-home-info-stack,
body .hr-worker-home-pwa-root .hr-worker-home-last-stack,
body .hr-worker-home-pwa-root .hr-worker-home-attention-panel,
body .hr-worker-home-pwa-root .hr-worker-home-last-activity-panel {
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    float: none !important;
    box-sizing: border-box !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-last-activity-panel .empty-box {
    width: 100% !important;
    min-height: 74px !important;
}


/* =========================================================
   HR CORE - DASHBOARD PRACOWNIKA
   FIX v5: STRUKTURA QR + AKTYWNOŚĆ POD WYMAGA UWAGI
   Tylko strona główna: klasy hr-worker-home-*
   ========================================================= */

/* QR: niezależnie od starego grida/flexa, wrapper zawsze centruje */
body .hr-worker-home-pwa-root .hr-worker-home-qr-panel {
    overflow: hidden !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-qr-center-wrap {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    text-align: center !important;
    overflow: hidden !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-qr-inner-center {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
    padding: 0 !important;
    text-align: center !important;
    overflow: hidden !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-qr-button {
    flex: 0 1 auto !important;
    width: min(300px, 82vw) !important;
    max-width: min(300px, 82vw) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: none !important;
    left: auto !important;
    right: auto !important;
    float: none !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-qr-source,
body .hr-worker-home-pwa-root .hr-worker-home-qr-source svg,
body .hr-worker-home-pwa-root .hr-worker-home-qr-button img,
body .hr-worker-home-pwa-root .hr-worker-home-qr-button > svg {
    display: block !important;
    width: min(240px, 68vw) !important;
    max-width: 100% !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Układ: Wymaga uwagi i Ostatnia aktywność jedna pod drugą w tym samym stosie */
body .hr-worker-home-pwa-root .hr-worker-home-info-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 24px !important;
    overflow: visible !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-attention-panel,
body .hr-worker-home-pwa-root .hr-worker-home-last-activity-panel,
body .hr-worker-home-pwa-root .hr-worker-home-last-stack-inline {
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    display: block !important;
    margin: 0 !important;
    clear: both !important;
    float: none !important;
    transform: none !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-last-stack {
    display: none !important;
}

/* PC także wymuszamy kolumnę dla sekcji uwagę/aktywność, żeby nie nachodziły */
@media (min-width: 721px) {
    body .hr-worker-home-pwa-root .hr-worker-home-info-stack {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        margin-bottom: 34px !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-qr-button {
        width: min(260px, 100%) !important;
        max-width: min(260px, 100%) !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-qr-source,
    body .hr-worker-home-pwa-root .hr-worker-home-qr-source svg,
    body .hr-worker-home-pwa-root .hr-worker-home-qr-button img,
    body .hr-worker-home-pwa-root .hr-worker-home-qr-button > svg {
        width: min(190px, 100%) !important;
        max-height: 190px !important;
    }
}


/* =========================================================
   HR CORE - DASHBOARD PRACOWNIKA
   FIX v6: TWARDY WRAPPER QR + AKTYWNOŚĆ POD UWAGĄ
   ========================================================= */

body .hr-worker-home-pwa-root .hr-worker-home-qr-inner-center {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    text-align: center !important;
    clear: both !important;
    float: none !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-qr-inner-center > .hr-worker-home-qr-button,
body .hr-worker-home-pwa-root .hr-worker-home-qr-inner-center > .empty-box {
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-info-stack {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 20px !important;
    align-items: stretch !important;
    overflow: visible !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-info-stack > section {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    position: relative !important;
    transform: none !important;
    float: none !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-last-stack-inline {
    margin-top: 0 !important;
    clear: both !important;
}


/* =========================================================
   HR CORE - DASHBOARD PRACOWNIKA
   FIX v7: QR INNER CENTER + STACK SECTIONS
   ========================================================= */

body .hr-worker-home-pwa-root .hr-worker-home-qr-center-wrap {
    width: 100% !important;
    display: block !important;
    text-align: center !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-qr-inner-center {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    padding: 0 !important;
    clear: both !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-qr-inner-center .hr-worker-home-qr-button,
body .hr-worker-home-pwa-root .hr-worker-home-qr-inner-center .empty-box {
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-info-stack {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 20px !important;
    align-items: stretch !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-info-stack > section {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    position: relative !important;
    transform: none !important;
    float: none !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-last-stack {
    display: none !important;
}


/* =========================================================
   HR CORE - DASHBOARD PRACOWNIKA
   FIX v8: ODSTĘPY PANELI + QR CENTER + POPUP CENTER
   Tylko strona główna: klasy hr-worker-home-*
   ========================================================= */

/* Równe odstępy między panelami Komunikaty / Wymaga uwagi / Ostatnia aktywność */
body .hr-worker-home-pwa-root .hr-worker-home-info-stack {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 22px !important;
    row-gap: 22px !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 26px 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    clear: both !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-info-stack > section,
body .hr-worker-home-pwa-root .hr-worker-home-communications-panel,
body .hr-worker-home-pwa-root .hr-worker-home-attention-panel,
body .hr-worker-home-pwa-root .hr-worker-home-last-activity-panel,
body .hr-worker-home-pwa-root .hr-worker-home-last-stack-inline {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    position: relative !important;
    clear: both !important;
    float: none !important;
    transform: none !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    z-index: auto !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-last-stack {
    display: none !important;
}

/* QR w karcie "Kod QR" - twarde centrowanie */
body .hr-worker-home-pwa-root .hr-worker-home-qr-panel {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-qr-center-wrap,
body .hr-worker-home-pwa-root .hr-worker-home-qr-body {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    text-align: center !important;
    overflow: hidden !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-qr-inner-center {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    padding: 0 !important;
    text-align: center !important;
    clear: both !important;
    float: none !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-qr-button {
    flex: 0 1 auto !important;
    width: min(300px, 82vw) !important;
    max-width: min(300px, 82vw) !important;
    margin: 0 auto !important;
    float: none !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

body .hr-worker-home-pwa-root .hr-worker-home-qr-source,
body .hr-worker-home-pwa-root .hr-worker-home-qr-source svg,
body .hr-worker-home-pwa-root .hr-worker-home-qr-button img,
body .hr-worker-home-pwa-root .hr-worker-home-qr-button > svg {
    display: block !important;
    width: min(240px, 68vw) !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 240px !important;
    margin: 0 auto !important;
    float: none !important;
    position: static !important;
    transform: none !important;
    object-fit: contain !important;
}

/* Popup QR - zawsze środek ekranu, nie dół strony */
html body .hr-worker-home-qr-modal,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal,
html body .dashboard-user-qr-modal[data-user-qr-modal] {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;

    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100vh !important;

    z-index: 2147483647 !important;

    display: none !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 22px !important;
    margin: 0 !important;

    overflow: hidden !important;
    box-sizing: border-box !important;
    transform: none !important;
}

html body .hr-worker-home-qr-modal:not([hidden]),
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal:not([hidden]),
html body .dashboard-user-qr-modal[data-user-qr-modal]:not([hidden]) {
    display: flex !important;
}

html body .hr-worker-home-qr-modal-backdrop,
html body .hr-worker-home-qr-modal .dashboard-user-qr-modal-backdrop,
html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    background: rgba(2, 6, 23, .78) !important;
    backdrop-filter: blur(12px) !important;
    z-index: 1 !important;
}

html body .hr-worker-home-qr-modal-card,
html body .hr-worker-home-qr-modal .dashboard-user-qr-modal-card,
html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-card {
    position: relative !important;
    z-index: 2 !important;

    width: min(92vw, 560px) !important;
    max-height: min(88dvh, 720px) !important;

    margin: auto !important;
    display: grid !important;
    gap: 16px !important;

    overflow: auto !important;
    transform: none !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
}

html body .hr-worker-home-qr-modal-box,
html body .hr-worker-home-qr-modal .dashboard-user-qr-modal-box,
html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box {
    width: 100% !important;
    display: grid !important;
    place-items: center !important;
    padding: 18px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

html body .hr-worker-home-qr-modal-box svg,
html body .hr-worker-home-qr-modal-box img,
html body .hr-worker-home-qr-modal .dashboard-user-qr-modal-box svg,
html body .hr-worker-home-qr-modal .dashboard-user-qr-modal-box img,
html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box svg,
html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box img {
    width: min(80vw, 420px) !important;
    height: auto !important;
    max-height: 70dvh !important;
    display: block !important;
    margin: 0 auto !important;
    object-fit: contain !important;
}

@media (min-width: 721px) {
    body .hr-worker-home-pwa-root .hr-worker-home-info-stack {
        gap: 24px !important;
        row-gap: 24px !important;
        margin-bottom: 36px !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-qr-button {
        width: min(260px, 100%) !important;
        max-width: min(260px, 100%) !important;
    }

    body .hr-worker-home-pwa-root .hr-worker-home-qr-source,
    body .hr-worker-home-pwa-root .hr-worker-home-qr-source svg,
    body .hr-worker-home-pwa-root .hr-worker-home-qr-button img,
    body .hr-worker-home-pwa-root .hr-worker-home-qr-button > svg {
        width: min(190px, 100%) !important;
        max-height: 190px !important;
    }
}

@media (max-width: 420px) {
    html body .hr-worker-home-qr-modal,
    html body .dashboard-user-qr-modal[data-user-qr-modal] {
        padding: 14px !important;
    }

    html body .hr-worker-home-qr-modal-card,
    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-card {
        width: 94vw !important;
        max-height: 88dvh !important;
    }
}

/* =========================================================
   HR CORE - DASHBOARD PRACOWNIKA
   FIX v9: QR + ODSTĘPY PANELI PC/PWA
   Zakres tylko: strona główna pracownika (.dashboard-user-home.hr-worker-home-pwa-root)
   ========================================================= */

body .dashboard-user-home.hr-worker-home-pwa-root {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 22px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

body .dashboard-user-home.hr-worker-home-pwa-root > :where(section, div) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-top-grid {
    margin: 0 !important;
    gap: 22px !important;
}

body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-info-stack {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 24px !important;
    row-gap: 24px !important;
    margin: 0 0 34px 0 !important;
    padding: 0 !important;
    clear: both !important;
    overflow: visible !important;
}

body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-info-stack > section,
body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-communications-panel,
body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-attention-panel,
body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-last-activity-panel,
body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-last-stack-inline {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    clear: both !important;
    float: none !important;
    position: relative !important;
    transform: none !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    z-index: auto !important;
}

body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-panel {
    display: grid !important;
    grid-template-rows: auto 1fr !important;
    place-items: stretch !important;
    overflow: hidden !important;
}

body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-body,
body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-center-wrap,
body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-inner-center {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    overflow: hidden !important;
    margin: 0 auto !important;
    float: none !important;
    clear: both !important;
    transform: none !important;
}

body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-button {
    width: min(300px, 82vw) !important;
    max-width: min(300px, 82vw) !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 14px !important;
    margin: 0 auto !important;
    float: none !important;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    overflow: hidden !important;
}

body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-source,
body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-source svg,
body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-button img,
body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-button > svg {
    display: block !important;
    width: min(240px, 68vw) !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 240px !important;
    margin: 0 auto !important;
    object-fit: contain !important;
    float: none !important;
    position: static !important;
    transform: none !important;
}

html body .dashboard-user-qr-modal.hr-worker-home-qr-modal,
html body .dashboard-user-qr-modal[data-user-qr-modal] {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    z-index: 2147483647 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 22px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    transform: none !important;
}

html body .dashboard-user-qr-modal.hr-worker-home-qr-modal:not([hidden]),
html body .dashboard-user-qr-modal[data-user-qr-modal]:not([hidden]) {
    display: flex !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-card {
    position: relative !important;
    z-index: 2 !important;
    width: min(92vw, 560px) !important;
    max-height: min(88dvh, 720px) !important;
    margin: auto !important;
    display: grid !important;
    gap: 16px !important;
    overflow: auto !important;
    transform: none !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box .hr-worker-home-qr-source {
    width: auto !important;
    max-width: 100% !important;
    display: grid !important;
    place-items: center !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box svg,
html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box img {
    width: min(80vw, 420px) !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 70dvh !important;
    display: block !important;
    margin: 0 auto !important;
    object-fit: contain !important;
}

body.qr-modal-open {
    overflow: hidden !important;
    touch-action: none !important;
}

@media (min-width: 721px) {
    body .dashboard-user-home.hr-worker-home-pwa-root {
        gap: 24px !important;
    }

    body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-top-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr) !important;
        gap: 24px !important;
        align-items: stretch !important;
    }

    body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-info-stack {
        gap: 26px !important;
        row-gap: 26px !important;
        margin-bottom: 38px !important;
    }

    body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-button {
        width: min(260px, 100%) !important;
        max-width: min(260px, 100%) !important;
    }

    body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-source,
    body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-source svg,
    body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-button img,
    body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-button > svg {
        width: min(190px, 100%) !important;
        max-height: 190px !important;
    }
}

@media (max-width: 720px) {
    body .dashboard-user-home.hr-worker-home-pwa-root {
        gap: 18px !important;
        padding-bottom: calc(150px + env(safe-area-inset-bottom)) !important;
    }

    body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-top-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 18px !important;
    }

    body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-info-stack {
        gap: 22px !important;
        row-gap: 22px !important;
        margin-bottom: calc(34px + env(safe-area-inset-bottom)) !important;
    }

    body .dashboard-user-home.hr-worker-home-pwa-root .hr-worker-home-qr-hint {
        display: none !important;
    }

    html body .dashboard-user-qr-modal[data-user-qr-modal] {
        padding: 14px !important;
    }

    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-card {
        width: 94vw !important;
        max-height: 88dvh !important;
    }
}


/* =========================================================
   HR CORE - DASHBOARD PRACOWNIKA
   FIX v10: POPUP QR PWA/PC - normalny modal, bez rozciągniętego X i bez ucinania QR
   Zakres tylko: popup QR strony głównej pracownika
   ========================================================= */
html body .dashboard-user-qr-modal[data-user-qr-modal],
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)) 14px !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    background: transparent !important;
    z-index: 2147483647 !important;
    transform: none !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal]:not([hidden]),
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal:not([hidden]) {
    display: flex !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-backdrop,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    margin: 0 !important;
    background: rgba(2, 6, 23, .82) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    z-index: 0 !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-card,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-card {
    position: relative !important;
    z-index: 1 !important;
    width: min(430px, calc(100vw - 28px)) !important;
    max-width: min(430px, calc(100vw - 28px)) !important;
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 28px) !important;
    min-height: 0 !important;
    margin: auto !important;
    padding: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 30px !important;
    background: rgba(15, 23, 42, .94) !important;
    border: 1px solid rgba(255, 255, 255, .16) !important;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .52), inset 0 1px 0 rgba(255,255,255,.10) !important;
    transform: none !important;
    inset: auto !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-card::before,
html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-card::after,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-card::before,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-card::after {
    content: none !important;
    display: none !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-close,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    background: rgba(255, 255, 255, .12) !important;
    color: #fff !important;
    font-size: 28px !important;
    line-height: 1 !important;
    font-weight: 400 !important;
    text-align: center !important;
    box-shadow: none !important;
    transform: none !important;
    z-index: 3 !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-title,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-title {
    width: 100% !important;
    max-width: 100% !important;
    padding: 5px 48px 0 4px !important;
    margin: 0 !important;
    color: rgba(255,255,255,.96) !important;
    font-size: clamp(18px, 4.6vw, 23px) !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 24px !important;
    background: #fff !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box .hr-worker-home-qr-source,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box .hr-worker-home-qr-source {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: grid !important;
    place-items: center !important;
    margin: 0 !important;
    padding: 14px !important;
    box-sizing: border-box !important;
    background: #fff !important;
    border-radius: 24px !important;
    overflow: hidden !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box svg,
html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box img,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box svg,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box img {
    display: block !important;
    width: min(100%, 360px, calc(100vw - 70px)) !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 150px) !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
    float: none !important;
}

@media (max-width: 420px) {
    html body .dashboard-user-qr-modal[data-user-qr-modal],
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal {
        padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)) 10px !important;
    }

    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-card,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-card {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        padding: 14px !important;
        gap: 12px !important;
        border-radius: 26px !important;
    }

    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-title,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-title {
        padding: 4px 46px 0 2px !important;
        font-size: 19px !important;
    }

    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box .hr-worker-home-qr-source,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box .hr-worker-home-qr-source {
        padding: 12px !important;
        border-radius: 22px !important;
    }

    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box svg,
    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box img,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box svg,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box img {
        width: min(100%, calc(100vw - 56px)) !important;
        max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 134px) !important;
    }
}


/* =========================================================
   HR CORE - DASHBOARD PRACOWNIKA
   FIX v11: POPUP QR 90% EKRANU + QR 90% SZEROKOŚCI POPUPU
   Zakres tylko: popup QR strony głównej pracownika
   ========================================================= */
html body .dashboard-user-qr-modal[data-user-qr-modal],
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal {
    padding: calc(5dvh + env(safe-area-inset-top)) 5vw calc(5dvh + env(safe-area-inset-bottom)) 5vw !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-card,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-card {
    width: 90vw !important;
    max-width: 90vw !important;
    max-height: 90dvh !important;
    padding: 18px !important;
    gap: 16px !important;
    overflow: hidden !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-title,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-title {
    padding: 6px 54px 0 4px !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    padding: 0 !important;
    overflow: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box .hr-worker-home-qr-source,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box .hr-worker-home-qr-source {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    padding: 18px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    background: #fff !important;
}

html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box svg,
html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box img,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box svg,
html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box img {
    width: 90% !important;
    max-width: 90% !important;
    min-width: 90% !important;
    height: auto !important;
    max-height: calc(90dvh - 150px) !important;
    object-fit: contain !important;
    aspect-ratio: auto !important;
    overflow: visible !important;
}

@media (max-width: 420px) {
    html body .dashboard-user-qr-modal[data-user-qr-modal],
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal {
        padding: calc(5dvh + env(safe-area-inset-top)) 5vw calc(5dvh + env(safe-area-inset-bottom)) 5vw !important;
    }

    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-card,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-card {
        width: 90vw !important;
        max-width: 90vw !important;
        max-height: 90dvh !important;
        padding: 16px !important;
        border-radius: 28px !important;
    }

    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box .hr-worker-home-qr-source,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box .hr-worker-home-qr-source {
        padding: 14px 0 !important;
    }

    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box svg,
    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box img,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box svg,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box img {
        width: 90% !important;
        max-width: 90% !important;
        min-width: 90% !important;
        max-height: calc(90dvh - 142px) !important;
    }
}


/* =========================================================
   HR CORE - DASHBOARD PRACOWNIKA
   FIX v12: PWA - wyższy popup QR
   Zakres tylko: aplikacja PWA / standalone
   ========================================================= */
@media (display-mode: standalone) {
    html body .dashboard-user-qr-modal[data-user-qr-modal],
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal {
        padding: calc(2dvh + env(safe-area-inset-top)) 5vw calc(2dvh + env(safe-area-inset-bottom)) 5vw !important;
    }

    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-card,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-card {
        width: 90vw !important;
        max-width: 90vw !important;
        height: 96dvh !important;
        max-height: 96dvh !important;
    }

    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box svg,
    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box img,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box svg,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box img {
        width: 90% !important;
        max-width: 90% !important;
        min-width: 90% !important;
        max-height: calc(96dvh - 140px) !important;
    }
}

@media (display-mode: standalone) and (max-width: 420px) {
    html body .dashboard-user-qr-modal[data-user-qr-modal],
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal {
        padding: calc(2dvh + env(safe-area-inset-top)) 5vw calc(2dvh + env(safe-area-inset-bottom)) 5vw !important;
    }

    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-card,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-card {
        height: 96dvh !important;
        max-height: 96dvh !important;
    }

    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box svg,
    html body .dashboard-user-qr-modal[data-user-qr-modal] .dashboard-user-qr-modal-box img,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box svg,
    html body .dashboard-user-qr-modal.hr-worker-home-qr-modal .dashboard-user-qr-modal-box img {
        max-height: calc(96dvh - 132px) !important;
    }
}


/* =========================================================
   HR CORE - STRONA GŁÓWNA PRACOWNIKA
   FIX v15: pełne kolorowe tła kafelków bez dodatkowych pasków
   Zakres tylko: widok pracownika PC + PWA
   ========================================================= */
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .premium-insight-card,
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .dashboard-stat-tile {
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    border-radius: 18px !important;

    color: #ffffff !important;
    background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, .26), transparent 34%),
        linear-gradient(135deg, var(--worker-tile-bg-a), var(--worker-tile-bg-b) 54%, var(--worker-tile-bg-c)) !important;

    border: 1px solid rgba(255, 255, 255, .18) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .18),
        inset 0 -1px 0 rgba(255, 255, 255, .07),
        0 16px 36px rgba(0, 0, 0, .22) !important;

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease,
        filter .18s ease !important;
}



body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .premium-insight-card:hover,
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .dashboard-stat-tile:hover {
    transform: translateY(-3px) !important;
    border-color: rgba(255, 255, 255, .34) !important;
    filter: saturate(1.08) brightness(1.04) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .22),
        inset 0 -1px 0 rgba(255, 255, 255, .09),
        0 22px 50px rgba(0, 0, 0, .28) !important;
}

body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .premium-insight-card:active,
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .dashboard-stat-tile:active {
    transform: translateY(-1px) scale(.99) !important;
}

body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .premium-insight-card .premium-insight-icon,
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .premium-insight-card .premium-insight-icon svg,
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .premium-insight-card .app-icon,
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .premium-insight-card .premium-insight-label,
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .premium-insight-card strong,
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .dashboard-stat-tile .premium-insight-icon,
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .dashboard-stat-tile .premium-insight-icon svg,
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .dashboard-stat-tile .app-icon,
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .dashboard-stat-tile .premium-insight-label,
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .dashboard-stat-tile strong {
    color: #ffffff !important;
    fill: none !important;
    stroke: currentColor !important;
}

body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .premium-insight-card .premium-insight-icon,
body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > .dashboard-stat-tile .premium-insight-icon {
    background: rgba(255, 255, 255, .14) !important;
    border: 1px solid rgba(255, 255, 255, .22) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .24),
        0 10px 24px rgba(0, 0, 0, .18) !important;
}

body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > :nth-child(1) {
    --worker-tile-bg-a: rgba(41, 126, 82, .95);
    --worker-tile-bg-b: rgba(31, 101, 72, .90);
    --worker-tile-bg-c: rgba(19, 86, 110, .86);
}

body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > :nth-child(2) {
    --worker-tile-bg-a: rgba(41, 156, 178, .95);
    --worker-tile-bg-b: rgba(24, 122, 154, .90);
    --worker-tile-bg-c: rgba(38, 91, 195, .84);
}

body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > :nth-child(3) {
    --worker-tile-bg-a: rgba(84, 96, 212, .95);
    --worker-tile-bg-b: rgba(62, 75, 187, .90);
    --worker-tile-bg-c: rgba(34, 96, 168, .84);
}

body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > :nth-child(4) {
    --worker-tile-bg-a: rgba(23, 146, 141, .95);
    --worker-tile-bg-b: rgba(18, 112, 119, .90);
    --worker-tile-bg-c: rgba(21, 92, 112, .84);
}

body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > :nth-child(5) {
    --worker-tile-bg-a: rgba(44, 108, 198, .95);
    --worker-tile-bg-b: rgba(33, 86, 170, .90);
    --worker-tile-bg-c: rgba(28, 66, 150, .86);
}

body .dashboard-user-home.dashboard-unified-home .dashboard-stats-card .dashboard-stat-insights > :nth-child(n+6) {
    --worker-tile-bg-a: rgba(14, 116, 144, .94);
    --worker-tile-bg-b: rgba(15, 82, 116, .90);
    --worker-tile-bg-c: rgba(30, 64, 175, .82);
}


/* =========================================================
   HR CORE - STRONA GŁÓWNA PRACOWNIKA
   FIX v16: komunikaty - kolory kafelków i niższy podgląd
   Zakres tylko: widok pracownika PC + PWA
   ========================================================= */
body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel {
    align-content: start !important;
}

body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-communications-stats {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: stretch !important;
    margin-bottom: 18px !important;
}

body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-live-stat-tile {
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    min-height: 72px !important;
    padding: 13px 14px 12px !important;
    border-radius: 17px !important;

    color: #ffffff !important;
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 255, 255, .20), transparent 34%),
        linear-gradient(135deg, var(--comm-tile-bg-a), var(--comm-tile-bg-b) 56%, var(--comm-tile-bg-c)) !important;

    border: 1px solid rgba(255, 255, 255, .17) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .18),
        inset 0 -1px 0 rgba(255, 255, 255, .07),
        0 14px 32px rgba(0, 0, 0, .20) !important;

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease,
        filter .18s ease !important;
}

body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-live-stat-tile::before {
    content: "" !important;
    position: absolute !important;
    left: 12px !important;
    right: 12px !important;
    top: 7px !important;
    height: 3px !important;
    border-radius: 999px !important;
    background: var(--comm-tile-edge) !important;
    box-shadow: 0 0 16px var(--comm-tile-edge-glow) !important;
    pointer-events: none !important;
}

body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-live-stat-tile:hover {
    transform: translateY(-2px) !important;
    border-color: rgba(255, 255, 255, .30) !important;
    filter: saturate(1.07) brightness(1.04) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .22),
        inset 0 -1px 0 rgba(255, 255, 255, .09),
        0 20px 44px rgba(0, 0, 0, .28) !important;
}

body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-live-stat-tile:nth-child(1) {
    --comm-tile-bg-a: rgba(42, 136, 108, .90);
    --comm-tile-bg-b: rgba(24, 103, 105, .84);
    --comm-tile-bg-c: rgba(22, 78, 99, .78);
    --comm-tile-edge: rgba(107, 255, 219, .92);
    --comm-tile-edge-glow: rgba(107, 255, 219, .30);
}

body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-live-stat-tile:nth-child(2) {
    --comm-tile-bg-a: rgba(44, 123, 178, .90);
    --comm-tile-bg-b: rgba(37, 95, 159, .84);
    --comm-tile-bg-c: rgba(49, 70, 164, .78);
    --comm-tile-edge: rgba(125, 211, 252, .92);
    --comm-tile-edge-glow: rgba(125, 211, 252, .30);
}

body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-live-stat-tile:nth-child(3) {
    --comm-tile-bg-a: rgba(82, 92, 176, .90);
    --comm-tile-bg-b: rgba(59, 76, 153, .84);
    --comm-tile-bg-c: rgba(31, 87, 134, .78);
    --comm-tile-edge: rgba(196, 181, 253, .92);
    --comm-tile-edge-glow: rgba(196, 181, 253, .28);
}

body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-live-stat-icon,
body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-live-stat-icon svg,
body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-live-stat-tile span,
body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-live-stat-tile strong {
    color: #ffffff !important;
    stroke: currentColor !important;
}

body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-live-stat-icon {
    background: rgba(255, 255, 255, .14) !important;
    border: 1px solid rgba(255, 255, 255, .22) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .22),
        0 8px 20px rgba(0, 0, 0, .16) !important;
}

body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-message-preview {
    margin-top: 6px !important;
    min-height: 58px !important;
    padding: 15px 16px !important;
    border-radius: 16px !important;
    display: grid !important;
    align-content: center !important;
}

body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-preview-actions {
    margin-top: 14px !important;
    display: flex !important;
    justify-content: flex-start !important;
}

body .dashboard-user-home.dashboard-unified-home .hr-worker-home-communications-panel .dashboard-mini-button {
    padding: 11px 18px !important;
    border-radius: 999px !important;
    min-height: 38px !important;
}



/* =========================================================
   HR CORE - PWA PRACOWNIKA
   FIX v17: komunikaty w PWA - 3 kolorowe kafelki w jednym rzędzie
   Zakres tylko: widok pracownika PWA / telefon
   ========================================================= */
@media (max-width: 720px) {
    body .dashboard-user-home.dashboard-unified-home.hr-worker-home-pwa-root .hr-worker-home-communications-panel .dashboard-communications-stats,
    body .dashboard-user-home.dashboard-unified-home.hr-worker-home-pwa-root .hr-worker-home-communications-panel .dashboard-live-stat-grid {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-auto-flow: column !important;
        grid-auto-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        align-items: stretch !important;
        overflow: visible !important;
    }

    body .dashboard-user-home.dashboard-unified-home.hr-worker-home-pwa-root .hr-worker-home-communications-panel .dashboard-live-stat-tile {
        grid-column: auto !important;
        grid-row: 1 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: 112px !important;
        padding: 14px 10px 12px !important;
        border-radius: 18px !important;
        display: grid !important;
        grid-template-columns: 34px minmax(0, 1fr) !important;
        grid-template-rows: auto 1fr !important;
        gap: 8px !important;
        align-content: start !important;
        align-items: start !important;
    }

    body .dashboard-user-home.dashboard-unified-home.hr-worker-home-pwa-root .hr-worker-home-communications-panel .dashboard-live-stat-tile:nth-child(1),
    body .dashboard-user-home.dashboard-unified-home.hr-worker-home-pwa-root .hr-worker-home-communications-panel .dashboard-live-stat-tile:nth-child(2),
    body .dashboard-user-home.dashboard-unified-home.hr-worker-home-pwa-root .hr-worker-home-communications-panel .dashboard-live-stat-tile:nth-child(3) {
        grid-column: auto !important;
        width: 100% !important;
    }

    body .dashboard-user-home.dashboard-unified-home.hr-worker-home-pwa-root .hr-worker-home-communications-panel .dashboard-live-stat-icon {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        margin: 0 !important;
    }

    body .dashboard-user-home.dashboard-unified-home.hr-worker-home-pwa-root .hr-worker-home-communications-panel .dashboard-live-stat-tile > span:not(.dashboard-live-stat-icon) {
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-self: center !important;
        min-width: 0 !important;
        font-size: 10px !important;
        line-height: 1.08 !important;
        letter-spacing: .08em !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    body .dashboard-user-home.dashboard-unified-home.hr-worker-home-pwa-root .hr-worker-home-communications-panel .dashboard-live-stat-tile > strong {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        align-self: end !important;
        font-size: 2rem !important;
        line-height: .9 !important;
        margin-top: 4px !important;
    }

    body .dashboard-user-home.dashboard-unified-home.hr-worker-home-pwa-root .hr-worker-home-communications-panel .dashboard-message-preview {
        margin-top: 18px !important;
    }

    body .dashboard-user-home.dashboard-unified-home.hr-worker-home-pwa-root .hr-worker-home-communications-panel .dashboard-preview-actions {
        margin-top: 16px !important;
    }
}


/* =========================================================
   HR CORE - PANEL ADMINISTRATORA W STYLU PRACOWNIKA
   Zakres: wyłącznie strona główna administratora, PC + PWA.
   Nie zmienia logiki modułów, nazw pól ani zawartości formularzy.
   ========================================================= */
body .dashboard-admin-home.dashboard-user-home.hr-worker-home-pwa-root {
    display: grid !important;
    gap: clamp(16px, 1.7vw, 24px) !important;
    align-content: start !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
}

body .dashboard-admin-home .dashboard-admin-stats-card,
body .dashboard-admin-home .dashboard-admin-rcp-card,
body .dashboard-admin-home .dashboard-admin-requests-panel,
body .dashboard-admin-home .dashboard-admin-communications-panel,
body .dashboard-admin-home .dashboard-admin-modules-panel {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

body .dashboard-admin-home .dashboard-admin-top-grid,
body .dashboard-admin-home .dashboard-admin-info-row {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

body .dashboard-admin-home .dashboard-admin-stats-card .dashboard-stat-insights {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)) !important;
    gap: 10px !important;
}

body .dashboard-admin-home .dashboard-admin-stats-card .premium-insight-card small {
    display: none !important;
}

body .dashboard-admin-home .dashboard-admin-top-grid {
    align-items: stretch !important;
}

body .dashboard-admin-home .dashboard-admin-top-grid > .premium-panel,
body .dashboard-admin-home .dashboard-admin-info-row > .premium-panel {
    height: 100% !important;
    display: grid !important;
    gap: 14px !important;
    align-content: start !important;
}

body .dashboard-admin-home .dashboard-admin-requests-panel .dashboard-live-stat-grid,
body .dashboard-admin-home .dashboard-admin-module-counters.dashboard-live-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr)) !important;
}

body .dashboard-admin-home .dashboard-admin-module-counters.dashboard-live-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body .dashboard-admin-home .dashboard-admin-module-row {
    color: inherit !important;
    text-decoration: none !important;
}

body .dashboard-admin-home .dashboard-admin-modules-list {
    max-height: 262px !important;
    overflow: auto !important;
    padding-right: 2px !important;
}

body .dashboard-admin-home .dashboard-admin-communications-panel .dashboard-communications-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body .dashboard-admin-home .dashboard-admin-communications-panel .dashboard-live-stat-tile,
body .dashboard-admin-home .dashboard-admin-stats-card .premium-insight-card {
    position: relative !important;
    isolation: isolate !important;
}

@media (min-width: 721px) {
    body .dashboard-admin-home.dashboard-user-home.hr-worker-home-pwa-root {
        gap: 24px !important;
    }

    body .dashboard-admin-home .dashboard-admin-top-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1.18fr) minmax(320px, .82fr) !important;
        gap: 24px !important;
        align-items: stretch !important;
    }

    body .dashboard-admin-home .dashboard-admin-info-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr) !important;
        gap: 26px !important;
        align-items: stretch !important;
        margin-bottom: 38px !important;
    }
}

@media (max-width: 980px) {
    body .dashboard-admin-home .premium-dashboard-hero {
        grid-template-columns: 1fr !important;
    }

    body .dashboard-admin-home .dashboard-admin-top-grid,
    body .dashboard-admin-home .dashboard-admin-info-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 18px !important;
    }
}

@media (max-width: 720px) {
    body .dashboard-admin-home.dashboard-user-home.hr-worker-home-pwa-root {
        display: flex !important;
        flex-direction: column !important;
        gap: 18px !important;
        padding-bottom: calc(150px + env(safe-area-inset-bottom)) !important;
    }

    body .dashboard-admin-home .dashboard-admin-stats-card .dashboard-stat-insights {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body .dashboard-admin-home .dashboard-admin-communications-panel .dashboard-communications-stats,
    body .dashboard-admin-home .dashboard-admin-communications-panel .dashboard-live-stat-grid {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 10px !important;
        overflow: visible !important;
    }

    body .dashboard-admin-home .dashboard-admin-communications-panel .dashboard-live-stat-tile {
        min-height: 112px !important;
        padding: 14px 10px 12px !important;
        grid-template-columns: 34px minmax(0, 1fr) !important;
        grid-template-rows: auto 1fr !important;
        gap: 8px !important;
        align-content: start !important;
        align-items: start !important;
    }

    body .dashboard-admin-home .dashboard-admin-communications-panel .dashboard-live-stat-icon {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
    }

    body .dashboard-admin-home .dashboard-admin-communications-panel .dashboard-live-stat-tile > span:not(.dashboard-live-stat-icon) {
        font-size: 10px !important;
        line-height: 1.08 !important;
        letter-spacing: .08em !important;
    }

    body .dashboard-admin-home .dashboard-admin-communications-panel .dashboard-live-stat-tile > strong {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        align-self: end !important;
        font-size: 2rem !important;
        line-height: .9 !important;
        margin-top: 4px !important;
    }

    body .dashboard-admin-home .dashboard-admin-module-counters.dashboard-live-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 430px) {
    body .dashboard-admin-home .dashboard-admin-stats-card .dashboard-stat-insights {
        grid-template-columns: 1fr !important;
    }

    body .dashboard-admin-home .dashboard-admin-communications-panel .dashboard-communications-stats,
    body .dashboard-admin-home .dashboard-admin-communications-panel .dashboard-live-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}


/* =========================================================
   MASTER v2 — wspólne komponenty modułów
   Używane przez: RCP, grafik, komunikaty i pozostałe moduły.
   ========================================================= */
.hidden { display: none !important; }

body :where(.module-page, .module-shell) {
    max-width: var(--master-page-max, 1560px);
    margin-inline: auto;
    padding: 8px 0 0;
    color: var(--master-text, #eef3ff);
}

body :where(.module-breadcrumb) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--master-muted, #9fb0d0);
    margin-bottom: 8px;
    font-size: 14px;
}
body :where(.module-breadcrumb a) {
    color: #8ee7ff;
    text-decoration: none;
}

body :where(.module-alert, .alert) {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.12);
    overflow-wrap: anywhere;
}
body :where(.module-alert, .alert.success) {
    background: rgba(34,197,94,.15);
    color: #bbffd1;
    border-color: rgba(34,197,94,.18);
}
body :where(.alert.info) {
    background: rgba(59,130,246,.14);
    color: #dbeafe;
    border-color: rgba(59,130,246,.18);
}
body :where(.alert.error) {
    background: rgba(239,68,68,.16);
    color: #ffd5d5;
    border-color: rgba(239,68,68,.20);
}

body :where(.module-muted, .muted, .small, .muted-small, .publish-info) {
    color: var(--master-muted, #9fb0d0);
}
.publish-info { margin-top: 8px; }

body :where(.profile-style-card, .module-card, .toolbar-card) {
    background: var(--master-card-bg, linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.045)));
    border: 1px solid var(--master-card-border, rgba(255,255,255,.08));
    border-radius: var(--master-card-radius, 24px);
    padding: var(--master-card-padding, 24px);
    margin-bottom: 18px;
    box-shadow: var(--master-card-shadow, inset 0 1px 0 rgba(255,255,255,.04), 0 14px 40px rgba(0,0,0,.18));
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
}
body :where(.profile-style-card h2) {
    margin: 0 0 14px;
    font-size: 18px;
    line-height: 1.2;
}
.toolbar-card { display: grid; gap: 16px; }
.module-intro-card { padding-top: 20px; }

body :where(.module-intro-row, .module-header-row, .module-titlebar, .module-actions-head, .module-filters-head) {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
body :where(.module-page-title-row, .module-header-title-row) {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
body :where(.module-page-icon, .module-header-icon, .action-tile-icon) {
    width: 58px;
    height: 58px;
    min-width: 58px;
    min-height: 58px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    background: var(--master-role-chip-bg, linear-gradient(135deg, rgba(56,189,248,.22), rgba(129,140,248,.22)));
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
    flex: 0 0 auto;
}
body :where(.module-page-title, .module-header-title) {
    margin: 0;
    font-size: clamp(28px, 2.35vw, 36px);
    line-height: 1.05;
    letter-spacing: -.03em;
}
body :where(.module-subtitle, .module-header-subtitle) {
    color: #aebcda;
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 15px;
    max-width: 760px;
}

body :where(.hero-kicker, .section-kicker, .mini-label, .module-header-kicker, .module-actions-kicker, .module-filters-kicker) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(142,231,255,.10);
    border: 1px solid rgba(142,231,255,.16);
    color: #98eaff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

body :where(.month-switcher, .admin-employee-picker, .admin-actions, .module-actions, .inline-actions, .toolbar-buttons, .form-actions) {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
body :where(.month-switcher label, .admin-employee-picker, .field) {
    display: grid;
    gap: 8px;
    min-width: 140px;
}
body :where(.field span) {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #d9e6fb;
    font-weight: 800;
}

body :where(.month-switcher input, .month-switcher select, .admin-employee-picker select, .field input, .field select, .field textarea, .form-grid input, .form-grid select, .form-grid textarea, .modal-form-grid input, .modal-form-grid select, .modal-form-grid textarea) {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.08);
    color: #eef3ff;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
body :where(.month-switcher input:focus, .month-switcher select:focus, .admin-employee-picker select:focus, .field input:focus, .field select:focus, .field textarea:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus) {
    border-color: rgba(96,165,250,.45);
    box-shadow: 0 0 0 3px rgba(96,165,250,.14);
}
body :where(select option) {
    background: #07111f;
    color: #fff;
}
body :where(textarea) {
    resize: vertical;
}

body :where(button, .button-link, .ghost-btn, .primary-btn, .secondary-btn, .mini-btn) {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 16px;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    box-shadow: 0 8px 22px rgba(56,189,248,.18);
}
body :where(button:hover, .button-link:hover, .ghost-btn:hover, .primary-btn:hover, .secondary-btn:hover, .mini-btn:hover) {
    filter: brightness(1.04);
}
body :where(button:disabled, .button-link[aria-disabled="true"]) {
    opacity: .6;
    cursor: not-allowed;
}
body :where(.ghost-btn, .secondary-btn, button.secondary, .button-link.ghost, .modal-close) {
    background: rgba(255,255,255,.09);
    color: #eef3ff;
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: none;
}
body :where(button.danger, .danger-btn) {
    background: linear-gradient(135deg, rgba(239,68,68,.94), rgba(244,63,94,.88));
}
body :where(button.primary, .primary-btn) {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
}

body :where(.summary-grid, .comm-top-stats) {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
body :where(.summary-box) {
    position: relative;
    display: grid;
    align-content: start;
    min-height: 108px;
    padding: 18px 18px 16px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 18px 38px rgba(0,0,0,.12);
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
}
body :where(.summary-box)::after {
    content: "";
    position: absolute;
    inset: auto -26px -36px auto;
    width: 110px;
    height: 110px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%);
    pointer-events: none;
}
body :where(.summary-box-primary) { background: linear-gradient(180deg, rgba(56,189,248,.18), rgba(129,140,248,.12)); }
body :where(.summary-box-warning) { background: linear-gradient(180deg, rgba(245,158,11,.18), rgba(234,179,8,.12)); }
body :where(.summary-box-danger) { background: linear-gradient(180deg, rgba(239,68,68,.20), rgba(244,63,94,.12)); }
body :where(.summary-box-neutral) { background: linear-gradient(180deg, rgba(148,163,184,.15), rgba(255,255,255,.05)); }
body :where(.summary-value, .summary-box .summary-value) {
    position: relative;
    z-index: 1;
    font-size: clamp(32px, 3vw, 44px);
    line-height: 1;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -.02em;
}
body :where(.summary-label, .summary-box .summary-label) {
    position: relative;
    z-index: 1;
    margin-top: auto;
    color: #d9e6fb;
    font-size: 12px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 800;
}

body :where(.table-wrap, .profile-style-table-wrap, .module-table-wrap, .documents-table-wrap) {
    max-width: 100%;
    overflow: auto;
    border-radius: 22px;
    background: rgba(6,11,23,.22);
    border: 1px solid rgba(255,255,255,.06);
    -webkit-overflow-scrolling: touch;
}
body :where(.module-table) {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
body :where(.module-table th, .module-table td) {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    vertical-align: top;
}
body :where(.module-table th) {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #d9e6fb;
    font-weight: 800;
    background: rgba(255,255,255,.03);
    position: sticky;
    top: 0;
    z-index: 1;
}
body :where(.module-table tr:last-child td) { border-bottom: 0; }

body :where(.status-chip) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    border: 1px solid rgba(255,255,255,.08);
}
body :where(.status-chip.work) { background: rgba(56,189,248,.16); color: #bfefff; }
body :where(.status-chip.break, .status-chip.warn, .status-chip.pending, .status-chip.in_progress) { background: rgba(245,158,11,.16); color: #fde68a; }
body :where(.status-chip.out) { background: rgba(148,163,184,.16); color: #e2e8f0; }
body :where(.status-chip.ok, .status-chip.approved, .status-chip.executed, .status-chip.closed) { background: rgba(34,197,94,.16); color: #bbffd1; }
body :where(.status-chip.danger, .status-chip.rejected) { background: rgba(239,68,68,.16); color: #ffd5d5; }
body :where(.row-severity-danger td, .severity-danger td) { background: rgba(239,68,68,.07); }
body :where(.row-severity-warn td, .severity-warn td) { background: rgba(245,158,11,.06); }
body :where(.empty-state, .empty-box, .premium-empty-state) { text-align: center; color: #9fb0d0; padding: 18px; }

body :where(.form-grid, .modal-form-grid) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

body :where(.modal-shell, .modal-backdrop) {
    position: fixed;
    inset: 0;
}
body :where(.modal-shell) {
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
body :where(.modal-backdrop) {
    background: rgba(2,6,23,.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
body :where(.modal-shell[hidden], .modal-backdrop[hidden]) { display: none !important; }
body :where(.modal-window, .modal-panel) {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    max-height: 90vh;
    overflow: auto;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(12,18,32,.98), rgba(15,23,42,.98));
    border: 1px solid rgba(255,255,255,.08);
    padding: 22px;
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
body :where(.modal-xl, .modal-panel-wide) { width: min(1320px, calc(100vw - 24px)); }
body :where(.modal-header) {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
body :where(.modal-header h2, .modal-header h3) {
    margin: 0;
    line-height: 1.08;
    letter-spacing: -.03em;
}

body :where(.qr-grid) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
body :where(.badge) {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.10);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

@media (max-width: 900px) {
    body :where(.module-page, .module-shell) { padding: 10px; }
    body :where(.profile-style-card, .module-card, .toolbar-card) { padding: 18px; }
    body :where(.module-titlebar h1, .module-page-title, .module-header-title) { font-size: 28px; }
    body :where(.summary-grid, .comm-top-stats) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    body :where(.summary-grid, .comm-top-stats) { grid-template-columns: 1fr; }
    body :where(.module-actions, .inline-actions, .toolbar-buttons, .form-actions) { width: 100%; }
    body :where(.module-actions > *, .inline-actions > *, .toolbar-buttons > *, .form-actions > *) { flex: 1 1 auto; }
    body :where(.modal-shell) { padding: 10px; align-items: stretch; }
    body :where(.modal-window, .modal-panel) { max-height: calc(100vh - 20px); width: 100%; border-radius: 20px; padding: 16px; }
}

/* portal mount compatibility - do not change module look */
body .module-shell {
    max-width: none;
    margin: 0;
}


/* ===== MASTER v1 additions kept for compatibility ===== */


/* =========================================================
   MASTER CSS — wspólny wygląd całej aplikacji
   Tu trzymamy bazę UI, role, układ PC/mobile, karty, formularze,
   tabele, modale i dashboardy. CSS modułów powinien zawierać tylko
   elementy unikatowe dla danego modułu.
   ========================================================= */
:root {
    --master-page-max: 1560px;
    --master-mobile-gap: 12px;
    --master-section-gap: clamp(14px, 1.5vw, 24px);
    --master-card-radius: 28px;
    --master-card-padding: clamp(16px, 1.6vw, 26px);
    --master-card-bg: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.042));
    --master-card-border: rgba(255,255,255,.105);
    --master-card-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 18px 48px rgba(0,0,0,.24);
    --master-text: var(--ui-text, var(--premium-text-main, #f7f9ff));
    --master-muted: var(--ui-muted, var(--premium-text-muted, #9fb0d0));
    --master-accent: var(--premium-accent, #4f8cff);
    --master-accent-soft: rgba(79, 140, 255, .18);
}

body.role-administrator,
body.app-admin-mode {
    --master-accent: #60a5fa;
    --master-accent-soft: rgba(96, 165, 250, .18);
    --master-role-chip-bg: linear-gradient(135deg, rgba(37, 99, 235, .28), rgba(14, 165, 233, .16));
}

body.role-pracownik,
body.app-worker-mode {
    --master-accent: #2dd4bf;
    --master-accent-soft: rgba(45, 212, 191, .16);
    --master-role-chip-bg: linear-gradient(135deg, rgba(20, 184, 166, .24), rgba(34, 197, 94, .13));
}

body.role-guest,
body.auth-body {
    --master-accent: #8b5cf6;
    --master-accent-soft: rgba(139, 92, 246, .16);
}

html,
body {
    width: 100%;
    max-width: 100%;
}

body {
    color: var(--master-text);
}

body :where(a, button, input, select, textarea) {
    -webkit-tap-highlight-color: transparent;
}

body :where(button, .button-link, .btn-primary, .hero-btn, .mini-btn, .tile-action-btn, .premium-hero-action, .premium-mini-link) {
    touch-action: manipulation;
}

.page-width-shell {
    width: min(100%, var(--master-page-max));
    max-width: var(--master-page-max);
    margin-inline: auto;
    min-width: 0;
}

.main-content {
    overflow-x: clip;
}

body :where(.module-page, .module-shell, .premium-dashboard, .dashboard-unified-home) {
    width: min(100%, var(--master-page-max)) !important;
    max-width: var(--master-page-max) !important;
}

body :where(.module-page, .module-shell, .premium-dashboard) > * {
    min-width: 0 !important;
}

body :where(.module-card, .profile-style-card, .premium-panel, .glass-card, .toolbar-shell, .list-shell, .users-hero-card, .users-toolbar-card, .users-list-card, .users-form-card, .settlement-hero, .settlement-list-card, .settlement-summary-card, .settlement-main-card, .comm-layout-card, .comm-hero-card, .admin-shell, .monthly-schedule-card, .assign-quick-card) {
    border-radius: var(--master-card-radius) !important;
    border: 1px solid var(--master-card-border) !important;
    background: var(--master-card-bg) !important;
    box-shadow: var(--master-card-shadow) !important;
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
}

body :where(.module-header-card, .premium-dashboard-hero, .users-hero-card) {
    background:
        radial-gradient(circle at 8% 12%, var(--master-accent-soft), transparent 34%),
        radial-gradient(circle at 94% 18%, rgba(139, 92, 246, .15), transparent 32%),
        var(--master-card-bg) !important;
}

body :where(.module-header-icon, .module-page-icon, .premium-panel-icon, .action-tile-icon, .dashboard-live-stat-icon, .premium-insight-icon, .settlement-action-icon) {
    color: #fff;
    background: var(--master-role-chip-bg, rgba(255,255,255,.12));
    border-color: rgba(255,255,255,.16);
}

body :where(.module-header-row, .users-hero-head, .premium-panel-head, .section-header, .module-titlebar, .module-actions-head, .module-filters-head) {
    min-width: 0 !important;
}

body :where(.module-header-title, .module-page-title, .premium-hero-content h2, .section-title, .topbar h1) {
    overflow-wrap: anywhere;
}

body :where(.module-header-subtitle, .module-subtitle, .section-subtitle, .section-subcopy, .module-muted, .muted, .small) {
    color: var(--master-muted) !important;
}

body :where(.module-header-actions, .premium-hero-actions, .toolbar-buttons, .form-actions, .inline-actions, .module-actions) {
    max-width: 100%;
}

body :where(.module-header-actions > *, .premium-hero-actions > *, .toolbar-buttons > *, .form-actions > *, .inline-actions > *, .module-actions > *) {
    min-width: 0;
}

body :where(.button-link, .btn-primary, .hero-btn, .mini-btn, .tile-action-btn, .premium-mini-link, .premium-hero-action, .login-pwa-gate-primary, .login-pwa-gate-secondary) {
    min-height: 44px;
}

body :where(input, select, textarea) {
    max-width: 100%;
}

body :where(.field input, .field select, .field textarea, .premium-field input, .form-grid input, .form-grid select, .form-grid textarea, .modal-form-grid input, .modal-form-grid select, .modal-form-grid textarea) {
    min-height: 44px;
}

body :where(.table-wrap, .module-table-wrap, .settlement-table-wrap, .documents-table-wrap) {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body :where(table, .module-table) {
    min-width: min(760px, 100%);
}

body :where(.module-alert, .alert) {
    overflow-wrap: anywhere;
}

body :where(.premium-empty-state, .empty-box, .empty-state) {
    border-radius: 22px;
}

/* Wspólny rytm desktopu */
@media (min-width: 981px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }

    .main-content {
        padding: clamp(24px, 2vw, 34px);
    }

    .topbar {
        align-items: center;
    }

}

/* Telefon / PWA: bez poziomego przewijania, pełne przyciski, czytelne karty */
@media (max-width: 980px) {
    body {
        background-attachment: scroll;
    }

    .mobile-header {
        min-height: calc(58px + env(safe-area-inset-top));
    }

    .main-content {
        width: 100%;
        max-width: 100%;
        padding: 14px max(12px, env(safe-area-inset-left)) calc(112px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right)) !important;
        overflow-x: hidden;
    }

    .page-width-shell {
        width: 100%;
        max-width: 100%;
    }

    body :where(.module-page, .module-shell, .premium-dashboard) {
        width: 100% !important;
        max-width: 100% !important;
        gap: var(--master-mobile-gap) !important;
    }

    body :where(.module-card, .profile-style-card, .premium-panel, .glass-card, .toolbar-shell, .list-shell, .users-hero-card, .users-toolbar-card, .users-list-card, .users-form-card, .settlement-hero, .settlement-list-card, .settlement-summary-card, .settlement-main-card, .comm-layout-card, .comm-hero-card, .admin-shell, .monthly-schedule-card, .assign-quick-card) {
        padding: 16px !important;
        border-radius: 22px !important;
    }

    body :where(.module-header-row, .users-hero-head, .premium-panel-head, .section-header, .module-titlebar, .module-actions-head, .module-filters-head, .premium-dashboard-hero) {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    body :where(.module-header-title-row, .module-page-title-row) {
        align-items: flex-start !important;
        gap: 12px !important;
    }

    body :where(.module-header-icon, .module-page-icon, .premium-panel-icon, .action-tile-icon, .settlement-action-icon) {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 16px !important;
    }

    body :where(.module-header-title, .module-page-title, .premium-hero-content h2) {
        font-size: clamp(24px, 8vw, 34px) !important;
        line-height: 1.03 !important;
    }

    body :where(.module-header-subtitle, .module-subtitle, .section-subtitle, .section-subcopy) {
        font-size: 14px !important;
        line-height: 1.45 !important;
    }

    body :where(.module-header-actions, .premium-hero-actions, .toolbar-buttons, .form-actions, .form-actions-end, .inline-actions, .module-actions) {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    body :where(.module-header-actions > *, .premium-hero-actions > *, .toolbar-buttons > *, .form-actions > *, .form-actions-end > *, .inline-actions > *, .module-actions > *, .button-link, .btn-primary, .hero-btn, .mini-btn, .tile-action-btn) {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }

    body :where(.summary-grid, .summary-grid-colored, .stats-grid, .users-top-stats, .comm-top-stats, .settlement-stats-grid, .mini-stats-grid, .dashboard-live-stat-grid, .premium-insights-row, .actions-grid, .action-grid, .module-actions, .settlement-actions-grid, .admin-actions-grid, .worker-actions-grid, .qr-grid, .open-swaps-grid, .template-grid, .assign-quick-grid) {
        grid-template-columns: 1fr !important;
    }

    body :where(.form-grid, .modal-form-grid, .settlement-form-grid, .comm-form-grid, .filter-row, .filter-row-main, .users-filters, .settlement-filter-grid, .module-filters-grid, .module-filter-row) {
        grid-template-columns: 1fr !important;
    }

    body :where(.mobile-bottom-nav) {
        z-index: 1100;
    }

    body :where(.sidebar) {
        max-width: calc(100vw - 26px);
    }
}

@media (max-width: 520px) {
    :root {
        --master-mobile-gap: 10px;
    }

    body :where(.module-card, .profile-style-card, .premium-panel, .glass-card, .toolbar-shell, .list-shell, .users-hero-card, .users-toolbar-card, .users-list-card, .users-form-card, .settlement-hero, .settlement-list-card, .settlement-summary-card, .settlement-main-card, .comm-layout-card, .comm-hero-card, .admin-shell, .monthly-schedule-card, .assign-quick-card) {
        padding: 14px !important;
        border-radius: 20px !important;
    }

    .mobile-bottom-nav {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .mobile-bottom-link {
        min-height: 52px !important;
    }

    .mobile-bottom-label {
        font-size: 9.5px !important;
    }

    body :where(.module-header-meta, .mini-stats-inline) {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    body :where(.module-header-pill, .premium-hero-date, .premium-hero-status-label) {
        min-width: 0 !important;
        overflow-wrap: anywhere !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}

/* =========================================================
   FIX v3: SZEROKOŚĆ POPUPÓW I FORMULARZY MODALNYCH
   Cel: formularze w popupach nie mają zajmować tylko ok. 50% ekranu na PC.
   Nie zmienia logiki JS ani HTML — wyłącznie wymusza spójne szerokości okien.
   ========================================================= */
:root {
    --module-modal-width: min(92vw, 1180px);
    --module-modal-width-wide: min(94vw, 1360px);
    --module-modal-width-xl: min(96vw, 1480px);
    --module-modal-compact-width: min(92vw, 560px);
    --module-modal-side-gap: 32px;
}

/* Kontenery modalne — zawsze centrowane i bez przypadkowego dziedziczenia 50% szerokości. */
html body :where(
    .modal-shell:not(.hidden),
    .ui-modal:not(.hidden),
    .helpdesk-modal[aria-hidden="false"],
    .documents-modal.is-open,
    .documents-viewer-modal.is-open,
    .rz-modal:not([hidden]),
    .settlement-modal.is-visible,
    .modal-backdrop.is-open,
    .modal-backdrop.open,
    .modal-backdrop[data-modal]:not([hidden])
) {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    align-items: center !important;
    justify-content: center !important;
    place-items: center !important;
}

/* Domyślne okna z formularzami — szersze na PC, pełne na mniejszych ekranach. */
html body :where(
    .modal-window,
    .modal-panel,
    .modal-card,
    .ui-dialog,
    .ui-dialog-card,
    .helpdesk-modal-card,
    .documents-modal-panel,
    .rz-modal-box,
    .settlement-modal-card
) {
    box-sizing: border-box !important;
    width: var(--module-modal-width) !important;
    max-width: calc(100vw - var(--module-modal-side-gap)) !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Duże okna: raporty, kalendarze, kreatory, szczegóły komunikatów. */
html body :where(
    .modal-xl .modal-card,
    .history-modal-card,
    .modal-panel-wide,
    .modal-panel-report,
    .modal-panel-calendar,
    .modal-panel-planner,
    .modal-panel-settings,
    .modal-panel-gpt-generator,
    .modal-panel-availability-overview,
    .documents-viewer-panel,
    .settlement-main-card,
    .rz-modal-wide,
    .message-detail-popup
) {
    width: var(--module-modal-width-wide) !important;
    max-width: calc(100vw - var(--module-modal-side-gap)) !important;
}

html body :where(
    .modal-panel-calendar,
    .modal-panel-planner,
    .modal-panel-report,
    .documents-viewer-panel,
    .settlement-main-card
) {
    width: var(--module-modal-width-xl) !important;
    max-width: calc(100vw - var(--module-modal-side-gap)) !important;
}

/* Małe popupy zostają małe: PIN, QR, szybki wybór, publikacja. */
html body :where(
    #pinModal .modal-card,
    .modal-panel-assign-picker,
    .quick-shift-editor-panel,
    .modal-panel-publication,
    .modal-backdrop[data-modal="my-qr-modal"] .modal-window,
    .dashboard-user-qr-modal-card,
    .hr-worker-home-qr-modal-card
) {
    width: var(--module-modal-compact-width) !important;
    max-width: calc(100vw - var(--module-modal-side-gap)) !important;
}

/* Siatki pól w formularzach nie mogą zawężać całego popupa. */
html body :where(
    .modal-window,
    .modal-panel,
    .modal-card,
    .ui-dialog,
    .ui-dialog-card,
    .helpdesk-modal-card,
    .documents-modal-panel,
    .settlement-modal-card,
    .rz-modal-box
) :where(form, .module-form, .modal-body, .ui-dialog-body, .settlement-modal-body, .settlement-modal-content) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

@media (max-width: 760px) {
    :root {
        --module-modal-width: calc(100vw - 20px);
        --module-modal-width-wide: calc(100vw - 20px);
        --module-modal-width-xl: calc(100vw - 20px);
        --module-modal-compact-width: calc(100vw - 20px);
        --module-modal-side-gap: 20px;
    }

    html body :where(
        .modal-shell:not(.hidden),
        .ui-modal:not(.hidden),
        .helpdesk-modal[aria-hidden="false"],
        .documents-modal.is-open,
        .documents-viewer-modal.is-open,
        .rz-modal:not([hidden]),
        .settlement-modal.is-visible,
        .modal-backdrop.is-open,
        .modal-backdrop.open,
        .modal-backdrop[data-modal]:not([hidden])
    ) {
        align-items: flex-end !important;
        place-items: end center !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    html body :where(
        .modal-window,
        .modal-panel,
        .modal-card,
        .ui-dialog,
        .ui-dialog-card,
        .helpdesk-modal-card,
        .documents-modal-panel,
        .rz-modal-box,
        .settlement-modal-card
    ) {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100dvh - 20px) !important;
        margin: 0 auto !important;
    }
}



/* === ETAP 4: mobile tables, role modes, print cleanup === */
:root {
    --app-touch-target: 44px;
    --app-mobile-card-gap: 12px;
    --app-mobile-card-radius: 18px;
    --app-role-worker-card-pad: 18px;
    --app-role-admin-card-pad: 16px;
}

body :where(.app-btn, .primary, .secondary, .danger, .ghost, .mini-btn, .button-link, .soft-action-btn, .documents-btn, .rz-soft-btn, button[type="submit"]) {
    touch-action: manipulation;
}

body.role-pracownik :where(.module-actions, .form-actions, .modal-actions, .comm-card-actions, .document-table-actions, .inline-actions) {
    gap: 10px;
}

body.role-pracownik :where(.module-card, .profile-style-card, .module-content-card, .summary-box, .app-card) {
    border-radius: 24px;
}

body.role-pracownik :where(.primary, .secondary, .danger, .ghost, .mini-btn, .button-link, .soft-action-btn, .documents-btn, .rz-soft-btn) {
    min-height: 46px;
}

body.role-administrator :where(.module-actions, .form-actions, .modal-actions, .inline-actions) {
    gap: 8px;
}

@media (min-width: 981px) {
    body.role-administrator :where(.module-card, .profile-style-card, .module-content-card, .summary-box, .app-card) {
        padding-top: var(--app-role-admin-card-pad);
        padding-bottom: var(--app-role-admin-card-pad);
    }

    body.role-administrator :where(.module-table, .documents-table, .rz-table, .users-table) th,
    body.role-administrator :where(.module-table, .documents-table, .rz-table, .users-table) td {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    body.role-pracownik :where(.module-card, .profile-style-card, .module-content-card, .summary-box, .app-card) {
        padding-top: var(--app-role-worker-card-pad);
        padding-bottom: var(--app-role-worker-card-pad);
    }
}

@media (max-width: 760px) {
    body.role-pracownik :where(.module-actions, .form-actions, .modal-actions, .comm-card-actions, .document-table-actions, .inline-actions),
    body.role-pracownik :where(.module-filters-grid, .filter-row, .filters-row, .helpdesk-toolbar) {
        display: grid !important;
        grid-template-columns: 1fr !important;
        align-items: stretch !important;
    }

    body.role-pracownik :where(.module-actions, .form-actions, .modal-actions, .comm-card-actions, .document-table-actions, .inline-actions) > :where(a, button, input, select) {
        width: 100% !important;
        justify-content: center;
    }

    body.role-pracownik :where(.primary, .secondary, .danger, .ghost, .mini-btn, .button-link, .soft-action-btn, .documents-btn, .rz-soft-btn, button[type="submit"]) {
        min-height: 48px;
        padding-top: 12px;
        padding-bottom: 12px;
        font-size: 0.96rem;
    }

    body.role-pracownik :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
        min-height: 48px;
        font-size: 16px;
    }

    body.role-administrator :where(.module-actions, .form-actions, .modal-actions, .inline-actions) {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }
}

/* Tabele na telefonie: tam gdzie to są listy danych, zamieniamy w czytelne karty. */
@media (max-width: 720px) {
    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) {
        width: 100% !important;
        min-width: 0 !important;
        border: 0 !important;
        background: transparent !important;
        table-layout: auto !important;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) thead {
        display: none !important;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) tbody,
    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) tr,
    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) tr[hidden] {
        display: none !important;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) tbody {
        display: grid;
        gap: var(--app-mobile-card-gap);
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) tbody tr {
        overflow: hidden;
        border: 1px solid rgba(148, 163, 184, 0.24) !important;
        border-radius: var(--app-mobile-card-radius) !important;
        background: rgba(255, 255, 255, 0.92) !important;
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08) !important;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) td {
        position: relative;
        min-height: 42px;
        padding: 10px 12px !important;
        border: 0 !important;
        border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
        color: #111827;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: initial !important;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) td:last-child {
        border-bottom: 0 !important;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) td:not([colspan]) {
        display: grid;
        grid-template-columns: minmax(108px, 42%) minmax(0, 1fr);
        gap: 10px;
        align-items: center;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 0.74rem;
        font-weight: 900;
        line-height: 1.2;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) td:not([data-label])::before {
        content: "";
        display: none;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) td[colspan] {
        display: block;
        text-align: center;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) td[colspan]::before,
    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) td:has(.empty-state)::before,
    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) td.module-table-empty-cell::before,
    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) td.rz-empty-cell::before {
        display: none !important;
        content: "" !important;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) :where(.inline-actions, .document-table-actions, .comm-card-actions) {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table) :where(.inline-actions, .document-table-actions, .comm-card-actions) > :where(a, button) {
        width: 100%;
        justify-content: center;
    }

    /* Etykiety dla tabel bez data-label, generowanych przez EJS/JS. */
    .users-table td:nth-child(1)::before { content: "ID" !important; display: block !important; }
    .users-table td:nth-child(2)::before { content: "Imię i nazwisko" !important; display: block !important; }
    .users-table td:nth-child(3)::before { content: "Login" !important; display: block !important; }
    .users-table td:nth-child(4)::before { content: "PIN" !important; display: block !important; }
    .users-table td:nth-child(5)::before { content: "Rola" !important; display: block !important; }
    .users-table td:nth-child(6)::before { content: "Status pracy" !important; display: block !important; }
    .users-table td:nth-child(7)::before { content: "Akcje" !important; display: block !important; }

    .rcp-worker-month-table .rcp-worker-day-row td:nth-child(1)::before { content: "Data" !important; display: block !important; }
    .rcp-worker-month-table .rcp-worker-day-row td:nth-child(2)::before { content: "Początek" !important; display: block !important; }
    .rcp-worker-month-table .rcp-worker-day-row td:nth-child(3)::before { content: "Koniec" !important; display: block !important; }
    .rcp-worker-month-table .rcp-worker-day-row td:nth-child(4)::before { content: "Przerwa płatna" !important; display: block !important; }
    .rcp-worker-month-table .rcp-worker-day-row td:nth-child(5)::before { content: "Przerwa bezpłatna" !important; display: block !important; }
    .rcp-worker-month-table .rcp-worker-day-row td:nth-child(6)::before { content: "Suma pracy" !important; display: block !important; }
    .rcp-worker-month-table .rcp-worker-day-row td:nth-child(7)::before { content: "Suma płatnej" !important; display: block !important; }
    .rcp-worker-month-table .rcp-worker-day-row td:nth-child(8)::before { content: "Suma bezpłatnej" !important; display: block !important; }

    .rcp-table tbody[data-live-body] td:nth-child(1)::before { content: "Pracownik" !important; display: block !important; }
    .rcp-table tbody[data-live-body] td:nth-child(2)::before { content: "Status live" !important; display: block !important; }
    .rcp-table tbody[data-live-body] td:nth-child(3)::before { content: "Status dnia" !important; display: block !important; }
    .rcp-table tbody[data-live-body] td:nth-child(4)::before { content: "Grafik" !important; display: block !important; }
    .rcp-table tbody[data-live-body] td:nth-child(5)::before { content: "Czas od–do" !important; display: block !important; }
    .rcp-table tbody[data-live-body] td:nth-child(6)::before { content: "Przerwy" !important; display: block !important; }
    .rcp-table tbody[data-live-body] td:nth-child(7)::before { content: "Suma godzin" !important; display: block !important; }
    .rcp-table tbody[data-live-body] td:nth-child(8)::before { content: "Odchylenie" !important; display: block !important; }
    .rcp-table tbody[data-live-body] td:nth-child(9)::before { content: "Uwagi" !important; display: block !important; }
    .rcp-table tbody[data-live-body] td:nth-child(10)::before { content: "Akcja" !important; display: block !important; }

    body.role-pracownik .rcp-table tbody[data-history-body] td:nth-child(1)::before { content: "Data" !important; display: block !important; }
    body.role-pracownik .rcp-table tbody[data-history-body] td:nth-child(2)::before { content: "Godzina" !important; display: block !important; }
    body.role-pracownik .rcp-table tbody[data-history-body] td:nth-child(3)::before { content: "Typ" !important; display: block !important; }
    body.role-pracownik .rcp-table tbody[data-history-body] td:nth-child(4)::before { content: "Źródło" !important; display: block !important; }
    body.role-pracownik .rcp-table tbody[data-history-body] td:nth-child(5)::before { content: "Grafik" !important; display: block !important; }

    body.role-administrator .rcp-table tbody[data-history-body] td:nth-child(1)::before { content: "Pracownik" !important; display: block !important; }
    body.role-administrator .rcp-table tbody[data-history-body] td:nth-child(2)::before { content: "Data" !important; display: block !important; }
    body.role-administrator .rcp-table tbody[data-history-body] td:nth-child(3)::before { content: "Godzina" !important; display: block !important; }
    body.role-administrator .rcp-table tbody[data-history-body] td:nth-child(4)::before { content: "Typ" !important; display: block !important; }
    body.role-administrator .rcp-table tbody[data-history-body] td:nth-child(5)::before { content: "Źródło" !important; display: block !important; }
    body.role-administrator .rcp-table tbody[data-history-body] td:nth-child(6)::before { content: "Grafik" !important; display: block !important; }
    body.role-administrator .rcp-table tbody[data-history-body] td:nth-child(7)::before { content: "Akcje" !important; display: block !important; }

    .rcp-table tbody[data-anomalies-body] td:nth-child(1)::before { content: "Pracownik" !important; display: block !important; }
    .rcp-table tbody[data-anomalies-body] td:nth-child(2)::before { content: "Typ" !important; display: block !important; }
    .rcp-table tbody[data-anomalies-body] td:nth-child(3)::before { content: "Waga" !important; display: block !important; }
    .rcp-table tbody[data-anomalies-body] td:nth-child(4)::before { content: "Opis" !important; display: block !important; }
    .rcp-table tbody[data-anomalies-body] td:nth-child(5)::before { content: "Akcja" !important; display: block !important; }

    .rcp-table tbody[data-report-day-body] td:nth-child(1)::before { content: "Pracownik" !important; display: block !important; }
    .rcp-table tbody[data-report-day-body] td:nth-child(2)::before { content: "Wejście" !important; display: block !important; }
    .rcp-table tbody[data-report-day-body] td:nth-child(3)::before { content: "Wyjście" !important; display: block !important; }
    .rcp-table tbody[data-report-day-body] td:nth-child(4)::before { content: "Grafik" !important; display: block !important; }
    .rcp-table tbody[data-report-day-body] td:nth-child(5)::before { content: "Status" !important; display: block !important; }
    .rcp-table tbody[data-report-day-body] td:nth-child(6)::before { content: "Przerwy" !important; display: block !important; }
    .rcp-table tbody[data-report-day-body] td:nth-child(7)::before { content: "Suma godzin" !important; display: block !important; }

    .rcp-table tbody[data-report-month-body] td:nth-child(1)::before { content: "Pracownik" !important; display: block !important; }
    .rcp-table tbody[data-report-month-body] td:nth-child(2)::before { content: "Rola" !important; display: block !important; }
    .rcp-table tbody[data-report-month-body] td:nth-child(3)::before { content: "Plan" !important; display: block !important; }
    .rcp-table tbody[data-report-month-body] td:nth-child(4)::before { content: "Praca" !important; display: block !important; }
    .rcp-table tbody[data-report-month-body] td:nth-child(5)::before { content: "Zamiany" !important; display: block !important; }
    .rcp-table tbody[data-report-month-body] td:nth-child(6)::before { content: "Korekty" !important; display: block !important; }
    .rcp-table tbody[data-report-month-body] td:nth-child(7)::before { content: "Spóźn." !important; display: block !important; }
    .rcp-table tbody[data-report-month-body] td:nth-child(8)::before { content: "Nieob." !important; display: block !important; }
    .rcp-table tbody[data-report-month-body] td:nth-child(9)::before { content: "Czas od–do" !important; display: block !important; }
    .rcp-table tbody[data-report-month-body] td:nth-child(10)::before { content: "Przerwy" !important; display: block !important; }
    .rcp-table tbody[data-report-month-body] td:nth-child(11)::before { content: "Przerwy bezpł." !important; display: block !important; }
    .rcp-table tbody[data-report-month-body] td:nth-child(12)::before { content: "Suma godzin" !important; display: block !important; }
    .rcp-table tbody[data-report-month-body] td:nth-child(13)::before { content: "Uwagi" !important; display: block !important; }

    .modal-backdrop[data-modal="audit-modal"] .rcp-table td:nth-child(1)::before { content: "Czas" !important; display: block !important; }
    .modal-backdrop[data-modal="audit-modal"] .rcp-table td:nth-child(2)::before { content: "Akcja" !important; display: block !important; }
    .modal-backdrop[data-modal="audit-modal"] .rcp-table td:nth-child(3)::before { content: "Kto" !important; display: block !important; }
    .modal-backdrop[data-modal="audit-modal"] .rcp-table td:nth-child(4)::before { content: "Rola" !important; display: block !important; }
    .modal-backdrop[data-modal="audit-modal"] .rcp-table td:nth-child(5)::before { content: "Meta" !important; display: block !important; }

    .report-table td:nth-child(1)::before { content: "Pracownik" !important; display: block !important; }
    .report-table td:nth-child(2)::before { content: "Godz." !important; display: block !important; }
    .report-table td:nth-child(3)::before { content: "Δ godz." !important; display: block !important; }
    .report-table td:nth-child(4)::before { content: "Zmiany" !important; display: block !important; }
    .report-table td:nth-child(5)::before { content: "S1" !important; display: block !important; }
    .report-table td:nth-child(6)::before { content: "S2" !important; display: block !important; }
    .report-table td:nth-child(7)::before { content: "S3" !important; display: block !important; }
    .report-table td:nth-child(8)::before { content: "S4" !important; display: block !important; }
    .report-table td:nth-child(9)::before { content: "Sob." !important; display: block !important; }
    .report-table td:nth-child(10)::before { content: "Niedz." !important; display: block !important; }
    .report-table td:nth-child(11)::before { content: "Niehand." !important; display: block !important; }
    .report-table td:nth-child(12)::before { content: "Święta" !important; display: block !important; }
    .report-table td:nth-child(13)::before { content: "Weekendy" !important; display: block !important; }
    .report-table td:nth-child(14)::before { content: "Week. wiecz." !important; display: block !important; }
    .report-table td:nth-child(15)::before { content: "Św. wiecz." !important; display: block !important; }
    .report-table td:nth-child(16)::before { content: "W" !important; display: block !important; }
    .report-table td:nth-child(17)::before { content: "U" !important; display: block !important; }
    .report-table td:nth-child(18)::before { content: "CH" !important; display: block !important; }
    .report-table td:nth-child(19)::before { content: "NU" !important; display: block !important; }
    .report-table td:nth-child(20)::before { content: "NNU" !important; display: block !important; }
    .report-table td:nth-child(21)::before { content: "Blok." !important; display: block !important; }
    .report-table td:nth-child(22)::before { content: "Seria dni" !important; display: block !important; }
}

/* =========================================================
   ETAP 5 — UI polish + ciemne tabele PC/mobile
   Tylko wygląd: zmienne, nagłówki, alerty, loadingi, focus, PWA/mobile i tabele.
   ========================================================= */

:root {
    --app-bg: #050816;
    --app-bg-soft: #071024;
    --app-surface: rgba(10, 18, 36, 0.86);
    --app-surface-2: rgba(15, 26, 50, 0.78);
    --app-surface-3: rgba(20, 34, 62, 0.72);
    --app-border: rgba(148, 163, 184, 0.22);
    --app-border-strong: rgba(203, 213, 225, 0.34);
    --app-text: #f8fafc;
    --app-text-soft: #dbeafe;
    --app-muted: #9fb0d0;
    --app-muted-2: #7f8da8;
    --app-primary: #38bdf8;
    --app-primary-2: #818cf8;
    --app-danger: #fb7185;
    --app-warning: #fbbf24;
    --app-success: #34d399;
    --app-info: #60a5fa;
    --app-radius-sm: 12px;
    --app-radius-md: 18px;
    --app-radius-lg: 24px;
    --app-shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.25);
    --app-shadow-strong: 0 28px 80px rgba(0, 0, 0, 0.34);
    --app-focus: 0 0 0 3px rgba(56, 189, 248, 0.22);

    --app-table-bg: rgba(4, 11, 27, 0.92);
    --app-table-bg-2: rgba(8, 18, 38, 0.90);
    --app-table-head-bg: linear-gradient(180deg, rgba(15, 32, 64, 0.98), rgba(8, 18, 40, 0.98));
    --app-table-row-bg: rgba(10, 20, 42, 0.88);
    --app-table-row-alt-bg: rgba(13, 26, 52, 0.88);
    --app-table-row-hover-bg: rgba(21, 43, 82, 0.92);
    --app-table-card-bg: linear-gradient(180deg, rgba(10, 22, 48, 0.96), rgba(6, 14, 32, 0.98));
    --app-table-border: rgba(148, 163, 184, 0.22);
    --app-table-border-soft: rgba(148, 163, 184, 0.15);
    --app-table-text: #f8fafc;
    --app-table-muted: #a7b7d5;
}

/* Wspólne nagłówki modułów — działa też dla istniejących nazw klas. */
:where(.app-module-header, .module-header-card, .module-titlebar, .module-page-header, .hero-shell) {
    border-color: var(--app-border) !important;
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.13), transparent 30%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(7, 12, 26, 0.78)) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), var(--app-shadow-soft) !important;
}

:where(.app-module-title, .module-page-title, .module-titlebar h1, .module-titlebar h2, .hero-shell h1) {
    color: var(--app-text) !important;
    letter-spacing: -0.035em;
}

:where(.app-module-subtitle, .module-subtitle, .module-titlebar p, .hero-shell p) {
    color: var(--app-muted) !important;
}

:where(.app-module-actions, .module-header-actions, .module-actions, .hero-actions) {
    gap: 10px !important;
}

/* Alerty i komunikaty — wspólna warstwa bez zmiany klas w widokach. */
:where(.app-alert, .module-alert, .flash-message, .alert, .notice) {
    border-radius: var(--app-radius-md) !important;
    border: 1px solid var(--app-border) !important;
    background: rgba(15, 23, 42, 0.78) !important;
    color: var(--app-text-soft) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 12px 30px rgba(0,0,0,0.18) !important;
}

:where(.app-alert-success, .module-alert-success, .alert-success, .notice-success) {
    border-color: rgba(52, 211, 153, 0.30) !important;
    background: linear-gradient(180deg, rgba(52, 211, 153, 0.16), rgba(15, 23, 42, 0.78)) !important;
    color: #d1fae5 !important;
}

:where(.app-alert-danger, .module-alert-danger, .module-alert-error, .alert-danger, .alert-error, .notice-error) {
    border-color: rgba(251, 113, 133, 0.32) !important;
    background: linear-gradient(180deg, rgba(251, 113, 133, 0.16), rgba(15, 23, 42, 0.80)) !important;
    color: #ffe4e6 !important;
}

:where(.app-alert-warning, .module-alert-warning, .alert-warning, .notice-warning) {
    border-color: rgba(251, 191, 36, 0.34) !important;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.15), rgba(15, 23, 42, 0.80)) !important;
    color: #fef3c7 !important;
}

:where(.app-alert-info, .module-alert-info, .alert-info, .notice-info) {
    border-color: rgba(96, 165, 250, 0.32) !important;
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.15), rgba(15, 23, 42, 0.80)) !important;
    color: #dbeafe !important;
}

/* Stany loading / saving — gotowe pod obecne i przyszłe klasy. */
:where(.app-loading, .loading-state, .saving-state, .is-loading, [data-loading="true"]) {
    position: relative;
}

:where(.app-loading, .loading-state, .saving-state)::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.24);
    border-top-color: var(--app-primary);
    display: inline-block;
    margin-right: 8px;
    vertical-align: -3px;
    animation: appSpin .85s linear infinite;
}

@keyframes appSpin { to { transform: rotate(360deg); } }

/* Focus i dostępność na telefonie/PC. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: none !important;
    box-shadow: var(--app-focus) !important;
}

:where(button, .btn, .mini-btn, .app-btn, .button-link, .tile-action-btn, .soft-action-btn, .documents-btn) {
    touch-action: manipulation;
}

/* PWA/mobile polish — bez zmiany układu logiki. */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    :where(.mobile-bottom-nav, .bottom-nav, .mobile-footer-actions) {
        padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    }

    :where(.modal-panel, .modal-card, .ui-dialog, .rz-modal-card, .documents-viewer-panel) {
        max-height: calc(100dvh - max(22px, env(safe-area-inset-top)) - max(22px, env(safe-area-inset-bottom))) !important;
    }
}

/* =========================================================
   Ciemne tabele — PC
   ========================================================= */
:where(.table-wrap, .module-table-wrap, .documents-table-wrap, .rz-table-wrap, .rcp-table-wrap, .report-table-wrap, .profile-style-table-wrap, .table-container) {
    border-color: var(--app-table-border) !important;
    background: var(--app-table-bg) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 18px 46px rgba(0,0,0,0.25) !important;
}

:where(.app-table, .module-table, .users-table, .documents-table, .rz-table, .rcp-table, .report-table, .schedule-table, .mini-table, .schedule-table-modern, .settlement-report-table, .requests-table, .data-table) {
    color: var(--app-table-text) !important;
    background: var(--app-table-bg) !important;
}

:where(.app-table, .module-table, .users-table, .documents-table, .rz-table, .rcp-table, .report-table, .schedule-table, .mini-table, .schedule-table-modern, .settlement-report-table, .requests-table, .data-table) :where(thead, thead tr) {
    background: transparent !important;
}

:where(.app-table, .module-table, .users-table, .documents-table, .rz-table, .rcp-table, .report-table, .schedule-table, .mini-table, .schedule-table-modern, .settlement-report-table, .requests-table, .data-table) th {
    background: var(--app-table-head-bg) !important;
    color: var(--app-table-muted) !important;
    border-color: var(--app-table-border) !important;
}

:where(.app-table, .module-table, .users-table, .documents-table, .rz-table, .rcp-table, .report-table, .schedule-table, .mini-table, .schedule-table-modern, .settlement-report-table, .requests-table, .data-table) td {
    background: var(--app-table-row-bg) !important;
    color: var(--app-table-text) !important;
    border-color: var(--app-table-border-soft) !important;
}

:where(.app-table, .module-table, .users-table, .documents-table, .rz-table, .rcp-table, .report-table, .schedule-table, .mini-table, .schedule-table-modern, .settlement-report-table, .requests-table, .data-table) tbody tr:nth-child(even) td {
    background: var(--app-table-row-alt-bg) !important;
}

:where(.app-table, .module-table, .users-table, .documents-table, .rz-table, .rcp-table, .report-table, .schedule-table, .mini-table, .schedule-table-modern, .settlement-report-table, .requests-table, .data-table) tbody tr:hover td {
    background: var(--app-table-row-hover-bg) !important;
}

:where(.sticky-col, .report-table .sticky-col, .schedule-table .sticky-col, .schedule-table-modern .sticky-col) {
    background: rgba(6, 14, 32, 0.98) !important;
}

:where(.app-table, .module-table, .users-table, .documents-table, .rz-table, .rcp-table, .report-table, .schedule-table, .mini-table, .schedule-table-modern, .settlement-report-table, .requests-table, .data-table) :where(small, .muted, .text-muted) {
    color: var(--app-table-muted) !important;
}

/* =========================================================
   Ciemne tabele — telefon/karty
   ========================================================= */
@media (max-width: 720px) {
    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table, .settlement-report-table, .requests-table, .module-table) {
        background: transparent !important;
        color: var(--app-table-text) !important;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table, .settlement-report-table, .requests-table, .module-table) tbody tr {
        border: 1px solid var(--app-table-border) !important;
        background: var(--app-table-card-bg) !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 14px 34px rgba(0,0,0,0.28) !important;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table, .settlement-report-table, .requests-table, .module-table) td {
        background: transparent !important;
        color: var(--app-table-text) !important;
        border-bottom: 1px solid var(--app-table-border-soft) !important;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table, .settlement-report-table, .requests-table, .module-table) td::before {
        color: var(--app-table-muted) !important;
    }

    body :where(.documents-table, .rz-table, .users-table, .rcp-table, .report-table, .settlement-report-table, .requests-table, .module-table) td:last-child {
        border-bottom: 0 !important;
    }

    body.role-pracownik :where(.module-card, .profile-style-card, .app-card, .hero-shell, .toolbar-shell, .list-shell) {
        border-radius: 22px !important;
    }

    body.role-pracownik :where(.btn, .mini-btn, .app-btn, .button-link, .documents-btn, .tile-action-btn, .soft-action-btn) {
        min-height: 48px !important;
    }
}

@media (min-width: 981px) {
    body.role-administrator :where(.table-wrap, .module-table-wrap, .documents-table-wrap, .rz-table-wrap, .rcp-table-wrap, .report-table-wrap) {
        border-radius: 20px !important;
    }

    body.role-administrator :where(.users-table, .documents-table, .rz-table, .rcp-table, .report-table, .schedule-table, .mini-table, .schedule-table-modern) th,
    body.role-administrator :where(.users-table, .documents-table, .rz-table, .rcp-table, .report-table, .schedule-table, .mini-table, .schedule-table-modern) td {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
}

/* =========================================================
   ETAP 6 — premium UI: nawigacja, dashboard, popupy, ciemne formularze
   Tylko wygląd. Bez zmian w logice, trasach, JS i zapisie danych.
   ========================================================= */

:root {
    --app-nav-bg: linear-gradient(180deg, rgba(6, 13, 31, .98), rgba(3, 7, 18, .98));
    --app-nav-card: rgba(15, 23, 42, .68);
    --app-nav-active: linear-gradient(135deg, rgba(56, 189, 248, .22), rgba(129, 140, 248, .20));
    --app-form-bg: rgba(6, 14, 32, .88);
    --app-form-bg-focus: rgba(8, 20, 46, .96);
    --app-form-border: rgba(148, 163, 184, .24);
    --app-form-border-focus: rgba(56, 189, 248, .58);
    --app-modal-bg: linear-gradient(180deg, rgba(11, 21, 43, .98), rgba(5, 11, 26, .99));
    --app-modal-head-bg: rgba(8, 17, 36, .96);
    --app-panel-bg: linear-gradient(180deg, rgba(13, 24, 48, .84), rgba(7, 13, 28, .88));
    --app-panel-bg-strong: linear-gradient(180deg, rgba(15, 28, 56, .96), rgba(5, 11, 26, .98));
    --app-ring-soft: inset 0 1px 0 rgba(255,255,255,.06), 0 18px 50px rgba(0,0,0,.26);
}

body {
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, .11), transparent 34vw),
        radial-gradient(circle at 85% 8%, rgba(129, 140, 248, .10), transparent 30vw),
        linear-gradient(180deg, #050816, #030712 70%, #020617) !important;
}

/* Nawigacja PC + mobile */
.sidebar {
    background: var(--app-nav-bg) !important;
    border-right: 1px solid rgba(148, 163, 184, .16) !important;
    box-shadow: 20px 0 70px rgba(0,0,0,.26) !important;
}

.logo-card,
.sidebar-user-card {
    background: var(--app-nav-card) !important;
    border: 1px solid rgba(148, 163, 184, .18) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 14px 35px rgba(0,0,0,.18) !important;
    backdrop-filter: blur(18px);
}

.sidebar-user-avatar {
    background: linear-gradient(135deg, rgba(56,189,248,.32), rgba(129,140,248,.28)) !important;
    color: #fff !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18) !important;
}

.sidebar-user-role-pill {
    display: inline-flex !important;
    width: max-content;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(56,189,248,.24);
    background: rgba(56,189,248,.10);
    color: #bae6fd !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.menu-section-label {
    color: rgba(203, 213, 225, .72) !important;
    letter-spacing: .12em !important;
}

.menu-link {
    position: relative;
    border: 1px solid transparent !important;
    min-height: 46px;
    color: rgba(226, 232, 240, .82) !important;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.menu-link:hover {
    transform: translateX(2px);
    background: rgba(255,255,255,.055) !important;
    color: #fff !important;
    border-color: rgba(148,163,184,.16) !important;
}

.menu-link.active {
    background: var(--app-nav-active) !important;
    color: #fff !important;
    border-color: rgba(56,189,248,.34) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 12px 28px rgba(56,189,248,.10) !important;
}

.menu-link.active::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #38bdf8, #818cf8);
}

.menu-link-icon,
.mobile-bottom-icon {
    color: inherit !important;
}

.topbar {
    border: 1px solid rgba(148,163,184,.14) !important;
    background: linear-gradient(180deg, rgba(8,16,34,.72), rgba(8,16,34,.42)) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
    backdrop-filter: blur(18px);
}

.mobile-header,
.mobile-bottom-nav {
    background: rgba(3, 7, 18, .88) !important;
    border-color: rgba(148,163,184,.16) !important;
    box-shadow: 0 -18px 45px rgba(0,0,0,.24) !important;
    backdrop-filter: blur(20px);
}

.mobile-bottom-link {
    border-radius: 17px !important;
    color: rgba(203, 213, 225, .78) !important;
}

.mobile-bottom-link.active {
    background: rgba(56,189,248,.14) !important;
    color: #e0f2fe !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08) !important;
}

/* Dashboard admin/pracownik — bardziej gotowy panel. */
.premium-dashboard,
.dashboard-admin-home,
.dashboard-user-home {
    gap: 18px !important;
    animation: appStage6FadeUp .26s ease both;
}

@keyframes appStage6FadeUp {
    from { opacity: .82; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.premium-dashboard-hero,
.module-header-card-dashboard {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148,163,184,.20) !important;
    background:
        radial-gradient(circle at top right, rgba(56,189,248,.18), transparent 35%),
        radial-gradient(circle at bottom left, rgba(129,140,248,.13), transparent 36%),
        linear-gradient(135deg, rgba(15, 23, 42, .94), rgba(6, 12, 28, .96)) !important;
    box-shadow: var(--app-ring-soft) !important;
}

.premium-dashboard-hero::after,
.module-header-card-dashboard::after {
    content: "";
    position: absolute;
    inset: auto -12% -42% 45%;
    height: 180px;
    pointer-events: none;
    background: radial-gradient(circle, rgba(56,189,248,.13), transparent 70%);
}

.premium-hero-content h1,
.premium-hero-content h2,
.premium-dashboard-hero h1,
.premium-dashboard-hero h2 {
    color: #fff !important;
    letter-spacing: -.055em !important;
}

.premium-hero-status,
.dashboard-live-stat-tile,
.dashboard-stat-tile,
.premium-insight-card,
.rcp-stat,
.settlement-stat-card {
    background: linear-gradient(180deg, rgba(15, 28, 55, .82), rgba(7, 14, 31, .86)) !important;
    border: 1px solid rgba(148,163,184,.18) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 12px 30px rgba(0,0,0,.18) !important;
}

.premium-panel,
.module-stats-card,
.dashboard-stats-card,
.portal-card,
.module-card,
.profile-style-card,
.toolbar-shell,
.list-shell {
    background: var(--app-panel-bg) !important;
    border: 1px solid rgba(148,163,184,.18) !important;
    box-shadow: var(--app-ring-soft) !important;
}

@media (hover:hover) {
    .premium-panel:hover,
    .module-card:hover,
    .portal-card:hover,
    .dashboard-stat-tile:hover,
    .premium-insight-card:hover {
        transform: translateY(-1px);
        border-color: rgba(56,189,248,.26) !important;
    }
}

.dashboard-compact-row,
.activity-item,
.attention-item,
.dashboard-last-event {
    background: rgba(5, 13, 31, .72) !important;
    border: 1px solid rgba(148,163,184,.14) !important;
    color: var(--app-text) !important;
}

.dashboard-row-status,
.attention-tag,
.tile-live-badge {
    border: 1px solid rgba(255,255,255,.12) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08) !important;
}

body.role-administrator .premium-dashboard,
body.role-administrator .dashboard-admin-home {
    --admin-card-gap: 14px;
}

@media (min-width: 981px) {
    body.role-administrator .premium-dashboard,
    body.role-administrator .dashboard-admin-home {
        gap: var(--admin-card-gap) !important;
    }

    body.role-administrator .premium-panel,
    body.role-administrator .module-card,
    body.role-administrator .profile-style-card {
        border-radius: 18px !important;
    }

    body.role-administrator .dashboard-live-stat-tile,
    body.role-administrator .dashboard-stat-tile,
    body.role-administrator .premium-insight-card {
        padding-top: 13px !important;
        padding-bottom: 13px !important;
    }
}

body.role-pracownik .premium-dashboard-hero,
body.role-pracownik .module-header-card-dashboard {
    border-radius: 28px !important;
}

body.role-pracownik .dashboard-live-stat-tile,
body.role-pracownik .premium-insight-card,
body.role-pracownik .portal-card {
    min-height: 64px;
}

/* Ciemne formularze — globalnie + moduły. */
:where(input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"], input[type="tel"], input[type="url"], input[type="month"], select, textarea, .form-control, .field-control) {
    background: var(--app-form-bg) !important;
    color: var(--app-text) !important;
    border-color: var(--app-form-border) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
    caret-color: var(--app-primary) !important;
}

:where(input, select, textarea, .form-control, .field-control)::placeholder {
    color: rgba(159, 176, 208, .72) !important;
}

:where(input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"], input[type="tel"], input[type="url"], input[type="month"], select, textarea, .form-control, .field-control):focus {
    background: var(--app-form-bg-focus) !important;
    border-color: var(--app-form-border-focus) !important;
    box-shadow: var(--app-focus), inset 0 1px 0 rgba(255,255,255,.05) !important;
}

:where(select option) {
    background: #0f172a !important;
    color: #f8fafc !important;
}

:where(input[disabled], select[disabled], textarea[disabled], input[readonly], textarea[readonly]) {
    background: rgba(15, 23, 42, .56) !important;
    color: rgba(203, 213, 225, .72) !important;
    border-color: rgba(148, 163, 184, .15) !important;
}

:where(label, .field-label, .form-label, .premium-field label, .documents-field label, .rz-field label, .helpdesk-field label) {
    color: rgba(226, 232, 240, .86) !important;
}

:where(.field-hint, .form-hint, .input-hint, .help-text) {
    color: rgba(159, 176, 208, .78) !important;
}

:where(input[type="file"]) {
    color: rgba(226,232,240,.86) !important;
}

:where(input[type="file"])::file-selector-button {
    border: 1px solid rgba(56,189,248,.26);
    border-radius: 12px;
    background: rgba(56,189,248,.14);
    color: #e0f2fe;
    font-weight: 800;
    padding: 8px 12px;
    margin-right: 12px;
}

/* Popupy i formularze w modalach — nagłówek i akcje zostają widoczne. */
:where(.modal-panel, .modal-card, .ui-dialog-card, .documents-modal-panel, .documents-viewer-panel, .rz-modal-box, .rz-modal-card, .mswk-modal-card, .helpdesk-modal-card, .hd-modal-card) {
    background: var(--app-modal-bg) !important;
    color: var(--app-text) !important;
    border: 1px solid rgba(148,163,184,.22) !important;
    box-shadow: 0 34px 90px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.07) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

:where(.modal-header, .modal-card-head, .ui-dialog-head, .documents-modal-head, .rz-modal-head, .mswk-modal-head) {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--app-modal-head-bg) !important;
    border-bottom: 1px solid rgba(148,163,184,.16) !important;
    backdrop-filter: blur(18px);
}

:where(.modal-body, .ui-dialog-body, .documents-modal-body, .rz-modal-body, .mswk-modal-body, .modal-calendar-scroll, .availability-overview-scroll) {
    min-height: 0;
    overflow: auto;
}

:where(.modal-actions, .modal-footer, .ui-dialog-actions, .documents-modal-actions, .rz-modal-actions, .form-actions-end, .comm-card-actions-detail) {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin-top: auto;
    border-top: 1px solid rgba(148,163,184,.16) !important;
    background: rgba(6, 14, 32, .94) !important;
    backdrop-filter: blur(18px);
}

:where(.modal-backdrop, .ui-dialog-backdrop, .documents-modal, .helpdesk-modal, .rz-modal-overlay) {
    backdrop-filter: blur(7px);
}

:where(.modal-close, .icon-chip-btn, .close-btn, .documents-modal-close) {
    background: rgba(15, 23, 42, .78) !important;
    color: #f8fafc !important;
    border: 1px solid rgba(148,163,184,.22) !important;
}

/* Przyciski i mikrointerakcje */
:where(.btn, .mini-btn, .app-btn, .button-link, .documents-btn, .tile-action-btn, .soft-action-btn, .dashboard-mini-button, .module-tab, .action-tile) {
    transition: transform .15s ease, filter .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease !important;
}

@media (hover:hover) {
    :where(.btn, .mini-btn, .app-btn, .button-link, .documents-btn, .tile-action-btn, .soft-action-btn, .dashboard-mini-button, .module-tab, .action-tile):hover {
        transform: translateY(-1px);
        filter: brightness(1.04);
    }
}

:where(.btn:active, .mini-btn:active, .app-btn:active, .button-link:active, .documents-btn:active, .tile-action-btn:active, .soft-action-btn:active, .dashboard-mini-button:active, .module-tab:active, .action-tile:active) {
    transform: translateY(0) scale(.985) !important;
}

/* Puste stany i komunikaty — jeden wygląd. */
:where(.empty-box, .premium-empty-state, .app-empty-state, .documents-empty, .rz-empty, .helpdesk-empty, .hd-empty) {
    background: linear-gradient(180deg, rgba(15,23,42,.72), rgba(5,11,26,.78)) !important;
    border: 1px dashed rgba(148,163,184,.26) !important;
    color: rgba(226,232,240,.86) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}

/* Mobile refinement */
@media (max-width: 760px) {
    .main-content {
        padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .topbar {
        border-radius: 18px !important;
        padding: 12px 14px !important;
    }

    .premium-dashboard,
    .dashboard-admin-home,
    .dashboard-user-home {
        gap: 14px !important;
    }

    .premium-panel,
    .module-card,
    .portal-card,
    .toolbar-shell,
    .list-shell {
        border-radius: 22px !important;
    }

    :where(.modal-panel, .modal-card, .ui-dialog-card, .documents-modal-panel, .documents-viewer-panel, .rz-modal-box, .rz-modal-card, .helpdesk-modal-card, .hd-modal-card) {
        border-radius: 24px !important;
        max-height: calc(100dvh - 18px - env(safe-area-inset-bottom, 0px)) !important;
    }

    :where(.modal-actions, .modal-footer, .ui-dialog-actions, .documents-modal-actions, .rz-modal-actions, .form-actions-end) {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
    }

    :where(.modal-actions, .modal-footer, .ui-dialog-actions, .documents-modal-actions, .rz-modal-actions, .form-actions-end) > * {
        width: 100% !important;
        justify-content: center !important;
    }

    :where(input, select, textarea, .btn, .mini-btn, .app-btn, .button-link, .documents-btn, .tile-action-btn, .soft-action-btn) {
        min-height: 48px !important;
    }
}

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

/* =========================================================
   ETAP 7 — final UX: puste stany, loadingi, błędy formularzy,
   popupy, akcje/ikony i końcowe wygładzenie panelu.
   Tylko wygląd. Bez zmian w logice, trasach, API i JS.
   ========================================================= */

:root {
    --app-empty-bg: linear-gradient(180deg, rgba(15, 23, 42, .86), rgba(2, 6, 23, .94));
    --app-empty-border: rgba(148, 163, 184, .20);
    --app-empty-icon-bg: rgba(56, 189, 248, .12);
    --app-error-bg: rgba(239, 68, 68, .12);
    --app-error-border: rgba(248, 113, 113, .36);
    --app-warning-bg: rgba(245, 158, 11, .12);
    --app-warning-border: rgba(251, 191, 36, .34);
    --app-success-bg: rgba(34, 197, 94, .12);
    --app-success-border: rgba(74, 222, 128, .34);
    --app-info-bg: rgba(56, 189, 248, .12);
    --app-info-border: rgba(56, 189, 248, .34);
    --app-sticky-bg: rgba(3, 7, 18, .88);
    --app-danger-glow: 0 14px 30px rgba(239, 68, 68, .14);
    --app-success-glow: 0 14px 30px rgba(34, 197, 94, .13);
    --app-primary-glow: 0 14px 30px rgba(56, 189, 248, .14);
}

/* Puste stany — jeden wygląd dla całego systemu. */
.app-empty-state,
.app-empty,
.empty-state,
.empty-box,
.documents-empty,
.assign-empty,
.no-data,
.no-results,
.no-items,
.blank-state,
.zero-state,
.queue-empty,
.table-empty,
td.empty-state,
tr.empty-state td {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 138px;
    width: 100%;
    padding: 28px 22px !important;
    border-radius: 24px !important;
    border: 1px dashed var(--app-empty-border) !important;
    background: var(--app-empty-bg) !important;
    color: rgba(226, 232, 240, .84) !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.45;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 18px 50px rgba(0,0,0,.18);
}

.app-empty-state::before,
.app-empty::before,
.empty-state::before,
.empty-box::before,
.documents-empty::before,
.assign-empty::before,
.no-data::before,
.no-results::before,
.no-items::before,
.blank-state::before,
.zero-state::before,
.queue-empty::before,
.table-empty::before {
    content: "";
    width: 42px;
    height: 42px;
    border-radius: 16px;
    border: 1px solid rgba(56, 189, 248, .22);
    background:
        radial-gradient(circle at 32% 28%, rgba(255,255,255,.20), transparent 16px),
        var(--app-empty-icon-bg);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 14px 35px rgba(56,189,248,.08);
}

.app-empty-title,
.empty-title,
.documents-empty strong,
.assign-empty strong,
.blank-state strong,
.zero-state strong {
    color: #f8fafc !important;
    font-size: 17px !important;
    font-weight: 950 !important;
    letter-spacing: -.02em;
}

.app-empty-text,
.empty-text,
.documents-empty p,
.assign-empty p,
.blank-state p,
.zero-state p {
    max-width: 540px;
    margin: 0 auto;
    color: rgba(203, 213, 225, .72) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

/* Wiersze "brak danych" w ciemnych tabelach bez rozbijania layoutu tabeli. */
table .empty-state,
table .empty-box,
table .no-data,
table .no-results,
table .assign-empty,
table .documents-empty {
    display: table-cell !important;
    min-height: 0;
    border-radius: 18px !important;
}

table .empty-state::before,
table .empty-box::before,
table .no-data::before,
table .no-results::before,
table .assign-empty::before,
table .documents-empty::before {
    display: none !important;
}

/* Loading, zapisywanie, skeletony. */
.app-loading,
.loading,
.loader,
.assign-loading,
.saving,
.is-saving,
.fetching,
[data-loading="true"],
.rcp-worker-qr-loading {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid rgba(56, 189, 248, .22);
    background: rgba(8, 20, 42, .72);
    color: #bae6fd !important;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .01em;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.app-loading::before,
.loading::before,
.loader::before,
.assign-loading::before,
.saving::before,
.is-saving::before,
.fetching::before,
[data-loading="true"]::before,
.rcp-worker-qr-loading::before {
    content: "";
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 2px solid rgba(186, 230, 253, .28);
    border-top-color: #38bdf8;
    animation: appSpin .78s linear infinite;
}

.app-skeleton,
.skeleton,
.skeleton-card,
.skeleton-row,
.skeleton-line {
    position: relative;
    overflow: hidden;
    color: transparent !important;
    border-radius: 16px;
    background: linear-gradient(90deg, rgba(30,41,59,.62), rgba(51,65,85,.78), rgba(30,41,59,.62)) !important;
    background-size: 220% 100% !important;
    animation: appSkeleton 1.2s ease-in-out infinite;
}

.skeleton-line,
.app-skeleton-line {
    min-height: 12px;
    width: 100%;
}

@keyframes appSpin { to { transform: rotate(360deg); } }
@keyframes appSkeleton { 0% { background-position: 220% 0; } 100% { background-position: -220% 0; } }

/* Alerty i komunikaty — spójny, ciemny styl. */
.app-alert,
.alert,
.module-alert,
.notice,
.message,
.flash,
.toast,
.system-message,
.form-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin: 10px 0 14px;
    padding: 13px 15px;
    border-radius: 18px;
    border: 1px solid var(--app-info-border);
    background: var(--app-info-bg);
    color: #e0f2fe !important;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.42;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 14px 35px rgba(0,0,0,.16);
}

.app-alert::before,
.alert::before,
.module-alert::before,
.notice::before,
.message::before,
.flash::before,
.toast::before,
.system-message::before,
.form-message::before {
    content: "";
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 999px;
    flex: 0 0 auto;
    background: #38bdf8;
    box-shadow: 0 0 0 5px rgba(56,189,248,.12);
}

.app-alert-success,
.alert.success,
.alert-success,
.module-alert-success,
.flash-success,
.notice-success,
.message-success,
.toast-success {
    border-color: var(--app-success-border) !important;
    background: var(--app-success-bg) !important;
    color: #dcfce7 !important;
}
.app-alert-success::before,
.alert.success::before,
.alert-success::before,
.module-alert-success::before,
.flash-success::before,
.notice-success::before,
.message-success::before,
.toast-success::before {
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34,197,94,.12);
}

.app-alert-danger,
.app-alert-error,
.alert.error,
.alert.danger,
.alert-danger,
.alert-error,
.module-alert-danger,
.flash-error,
.notice-error,
.message-error,
.toast-error,
.error-message {
    border-color: var(--app-error-border) !important;
    background: var(--app-error-bg) !important;
    color: #fee2e2 !important;
}
.app-alert-danger::before,
.app-alert-error::before,
.alert.error::before,
.alert.danger::before,
.alert-danger::before,
.alert-error::before,
.module-alert-danger::before,
.flash-error::before,
.notice-error::before,
.message-error::before,
.toast-error::before,
.error-message::before {
    background: #ef4444;
    box-shadow: 0 0 0 5px rgba(239,68,68,.12);
}

.app-alert-warning,
.alert.warning,
.alert-warning,
.module-alert-warning,
.flash-warning,
.notice-warning,
.message-warning,
.toast-warning {
    border-color: var(--app-warning-border) !important;
    background: var(--app-warning-bg) !important;
    color: #fef3c7 !important;
}
.app-alert-warning::before,
.alert.warning::before,
.alert-warning::before,
.module-alert-warning::before,
.flash-warning::before,
.notice-warning::before,
.message-warning::before,
.toast-warning::before {
    background: #f59e0b;
    box-shadow: 0 0 0 5px rgba(245,158,11,.12);
}

/* Błędy formularzy, walidacja i pola wymagające uwagi. */
.form-error,
.field-error,
.input-error,
.validation-error,
.error-text,
.invalid-feedback,
.help-error,
label.error {
    display: block;
    margin-top: 6px;
    color: #fecaca !important;
    font-size: 12px !important;
    font-weight: 850 !important;
    line-height: 1.35;
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid,
input.invalid,
select.invalid,
textarea.invalid,
input.error,
select.error,
textarea.error,
[aria-invalid="true"] {
    border-color: rgba(248, 113, 113, .70) !important;
    background: rgba(127, 29, 29, .18) !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .14), inset 0 1px 0 rgba(255,255,255,.04) !important;
}

input:required:invalid:not(:placeholder-shown),
textarea:required:invalid:not(:placeholder-shown),
select:required:invalid {
    border-color: rgba(251, 146, 60, .48);
}

.form-row.has-error,
.form-group.has-error,
.field.has-error,
.input-group.has-error {
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(248,113,113,.22);
    background: rgba(127,29,29,.09);
}

/* Finalne popupy: stały nagłówek i stopka, przewijana treść. */
.modal-panel,
.modal-window,
.modal-content,
.popup,
.popup-card,
.dialog,
.dialog-card,
.documents-modal-content,
.documents-viewer-content {
    display: flex !important;
    flex-direction: column !important;
    max-height: min(86vh, 940px) !important;
    overflow: hidden !important;
}

.modal-header,
.popup-header,
.dialog-header,
.documents-modal-header,
.documents-viewer-header {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 3;
    background: linear-gradient(180deg, rgba(8,17,36,.98), rgba(8,17,36,.90)) !important;
    border-bottom: 1px solid rgba(148,163,184,.16) !important;
    backdrop-filter: blur(18px);
}

.modal-body,
.popup-body,
.dialog-body,
.documents-modal-body,
.documents-viewer-body,
.modal-content-body,
.form-modal-body {
    flex: 1 1 auto !important;
    min-height: 0;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(56,189,248,.42) rgba(15,23,42,.34);
}

.modal-actions,
.modal-footer,
.popup-actions,
.popup-footer,
.dialog-actions,
.dialog-footer,
.documents-modal-actions,
.form-actions,
.form-footer {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 3;
    padding-top: 14px !important;
    border-top: 1px solid rgba(148,163,184,.16) !important;
    background: linear-gradient(0deg, rgba(3,7,18,.98), rgba(8,17,36,.90)) !important;
    backdrop-filter: blur(18px);
}

.modal-close,
.icon-chip-btn,
.documents-modal-close,
.close-btn,
.popup-close,
.dialog-close,
button[aria-label="Zamknij"] {
    min-width: 42px !important;
    min-height: 42px !important;
    border-radius: 15px !important;
    border: 1px solid rgba(148,163,184,.20) !important;
    background: rgba(15,23,42,.76) !important;
    color: rgba(226,232,240,.92) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.modal-close:hover,
.icon-chip-btn:hover,
.documents-modal-close:hover,
.close-btn:hover,
.popup-close:hover,
.dialog-close:hover,
button[aria-label="Zamknij"]:hover {
    transform: translateY(-1px);
    border-color: rgba(248,113,113,.35) !important;
    background: rgba(127,29,29,.30) !important;
    color: #fecaca !important;
}

/* Akcje i przyciski — konsekwentne kolory i ikony. */
.app-action-row,
.action-row,
.table-actions,
.card-actions,
.row-actions,
.module-actions,
.toolbar-actions,
.quick-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.app-btn,
.btn,
.button-link,
.mini-btn,
.ghost-btn,
.soft-action-btn,
.documents-btn,
.action-btn,
.module-action-btn,
button[type="submit"],
a.button,
a.btn {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border-radius: 14px;
    font-weight: 900;
    line-height: 1.1;
    text-decoration: none !important;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, border-color .15s ease, background .15s ease;
}

.app-btn:hover,
.btn:hover,
.button-link:hover,
.mini-btn:hover,
.ghost-btn:hover,
.soft-action-btn:hover,
.documents-btn:hover,
.action-btn:hover,
.module-action-btn:hover,
button[type="submit"]:hover,
a.button:hover,
a.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.app-btn:active,
.btn:active,
.button-link:active,
.mini-btn:active,
.ghost-btn:active,
.soft-action-btn:active,
.documents-btn:active,
.action-btn:active,
.module-action-btn:active,
button[type="submit"]:active,
a.button:active,
a.btn:active {
    transform: translateY(0) scale(.985);
}

/* Semantyczne przyciski według tekstu/klas — bez zmiany HTML. */
.app-btn-primary,
.btn-primary,
.button-link.primary,
.action-primary,
.save-btn,
.submit-btn,
button[name="save"],
button[value="save"],
button[type="submit"] {
    box-shadow: var(--app-primary-glow), inset 0 1px 0 rgba(255,255,255,.10) !important;
}

.app-btn-danger,
.btn-danger,
.button-link.danger,
.action-danger,
.delete-btn,
.remove-btn,
.documents-btn-danger,
button.danger,
button[data-action="delete"],
a[data-action="delete"] {
    border-color: rgba(248,113,113,.34) !important;
    background: linear-gradient(135deg, rgba(239,68,68,.94), rgba(185,28,28,.92)) !important;
    color: #fff !important;
    box-shadow: var(--app-danger-glow), inset 0 1px 0 rgba(255,255,255,.12) !important;
}

.app-btn-success,
.btn-success,
.action-success,
.accept-btn,
.approve-btn,
button[data-action="accept"],
button[data-action="approve"] {
    border-color: rgba(74,222,128,.34) !important;
    background: linear-gradient(135deg, rgba(34,197,94,.94), rgba(21,128,61,.92)) !important;
    color: #fff !important;
    box-shadow: var(--app-success-glow), inset 0 1px 0 rgba(255,255,255,.12) !important;
}

/* Sticky filtry i nagłówki tabel — szczególnie dla administratora na PC. */
body.role-administrator .app-toolbar,
body.app-admin-mode .app-toolbar,
body.role-administrator .filter-bar,
body.app-admin-mode .filter-bar,
body.role-administrator .filters,
body.app-admin-mode .filters,
body.role-administrator .module-filters,
body.app-admin-mode .module-filters,
body.role-administrator .toolbar,
body.app-admin-mode .toolbar {
    position: sticky;
    top: 10px;
    z-index: 12;
    background: linear-gradient(180deg, rgba(8,17,36,.90), rgba(8,17,36,.76)) !important;
    border: 1px solid rgba(148,163,184,.16) !important;
    border-radius: 20px;
    box-shadow: 0 16px 35px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.05) !important;
    backdrop-filter: blur(16px);
}

@media (min-width: 901px) {
    .app-table thead th,
    table.app-table thead th,
    .table thead th,
    .data-table thead th,
    .documents-table thead th,
    .users-table thead th,
    .settlements-table thead th,
    .rcp-table thead th,
    .schedule-table thead th,
    .requests-table thead th {
        position: sticky;
        top: 0;
        z-index: 4;
        background: linear-gradient(180deg, rgba(15,23,42,.98), rgba(8,17,36,.98)) !important;
        box-shadow: inset 0 -1px 0 rgba(148,163,184,.16), 0 8px 18px rgba(0,0,0,.12);
    }

    body.role-administrator .app-card,
    body.app-admin-mode .app-card,
    body.role-administrator .module-card,
    body.app-admin-mode .module-card,
    body.role-administrator .panel-card,
    body.app-admin-mode .panel-card,
    body.role-administrator .stat-card,
    body.app-admin-mode .stat-card {
        border-radius: 20px;
    }
}

/* Tryb pracownika na telefonie: akcje bardziej aplikacyjne. */
@media (max-width: 900px) {
    body.role-pracownik,
    body.app-worker-mode {
        --worker-bottom-safe: calc(env(safe-area-inset-bottom, 0px) + 84px);
    }

    body.role-pracownik .main-content,
    body.app-worker-mode .main-content,
    body.role-pracownik .content,
    body.app-worker-mode .content {
        padding-bottom: var(--worker-bottom-safe) !important;
    }

    body.role-pracownik .app-card,
    body.app-worker-mode .app-card,
    body.role-pracownik .module-card,
    body.app-worker-mode .module-card,
    body.role-pracownik .panel-card,
    body.app-worker-mode .panel-card,
    body.role-pracownik .action-tile,
    body.app-worker-mode .action-tile {
        border-radius: 24px !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 16px 40px rgba(0,0,0,.20) !important;
    }

    body.role-pracownik .app-action-row,
    body.app-worker-mode .app-action-row,
    body.role-pracownik .action-row,
    body.app-worker-mode .action-row,
    body.role-pracownik .table-actions,
    body.app-worker-mode .table-actions,
    body.role-pracownik .card-actions,
    body.app-worker-mode .card-actions,
    body.role-pracownik .module-actions,
    body.app-worker-mode .module-actions,
    body.role-pracownik .form-actions,
    body.app-worker-mode .form-actions,
    body.role-pracownik .modal-actions,
    body.app-worker-mode .modal-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100%;
    }

    body.role-pracownik .app-btn,
    body.app-worker-mode .app-btn,
    body.role-pracownik .btn,
    body.app-worker-mode .btn,
    body.role-pracownik .button-link,
    body.app-worker-mode .button-link,
    body.role-pracownik .mini-btn,
    body.app-worker-mode .mini-btn,
    body.role-pracownik .documents-btn,
    body.app-worker-mode .documents-btn,
    body.role-pracownik button[type="submit"],
    body.app-worker-mode button[type="submit"] {
        width: 100%;
        min-height: 50px !important;
        border-radius: 17px !important;
        font-size: 14px !important;
    }

    .modal-panel,
    .modal-window,
    .modal-content,
    .popup,
    .popup-card,
    .dialog,
    .dialog-card,
    .documents-modal-content,
    .documents-viewer-content {
        width: calc(100vw - 18px) !important;
        max-width: calc(100vw - 18px) !important;
        max-height: calc(100dvh - 18px) !important;
        border-radius: 24px !important;
    }

    .modal-body,
    .popup-body,
    .dialog-body,
    .documents-modal-body,
    .documents-viewer-body,
    .modal-content-body,
    .form-modal-body {
        max-height: calc(100dvh - 184px) !important;
    }

    .modal-actions,
    .modal-footer,
    .popup-actions,
    .popup-footer,
    .dialog-actions,
    .dialog-footer,
    .documents-modal-actions,
    .form-actions,
    .form-footer {
        padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)) !important;
    }

    .app-empty-state,
    .app-empty,
    .empty-state,
    .empty-box,
    .documents-empty,
    .assign-empty,
    .no-data,
    .no-results,
    .no-items,
    .blank-state,
    .zero-state,
    .queue-empty,
    .table-empty {
        min-height: 120px;
        padding: 22px 16px !important;
        border-radius: 22px !important;
    }
}

/* Scrollbar w ciemnym UI. */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, .40) rgba(15, 23, 42, .35);
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: rgba(15, 23, 42, .32); border-radius: 999px; }
*::-webkit-scrollbar-thumb { background: rgba(56, 189, 248, .34); border-radius: 999px; border: 2px solid rgba(15, 23, 42, .50); }
*::-webkit-scrollbar-thumb:hover { background: rgba(56, 189, 248, .52); }

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


/* ETAP 9 — HR Core: centrum administratora i karta pracownika */
.hr-core-page { display: grid; gap: 18px; }
.hr-core-hero .premium-hero-content p { margin: 6px 0 0; color: rgba(226,232,240,.72); }
.hr-core-toolbar-panel { padding: 18px; }
.hr-core-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.hr-core-toolbar label { display: grid; gap: 7px; min-width: min(260px, 100%); color: rgba(226,232,240,.78); font-size: .86rem; font-weight: 800; }
.hr-core-toolbar input { min-height: 46px; border-radius: 14px; border: 1px solid rgba(148,163,184,.24); background: rgba(15,23,42,.82); color: #f8fafc; padding: 0 13px; }
.hr-admin-center-panel { border: 1px solid rgba(59,130,246,.18); background: linear-gradient(135deg, rgba(15,23,42,.96), rgba(2,6,23,.94)); }
.hr-admin-center-head { gap: 12px; }
.hr-admin-center-stats { margin-top: 12px; }
.hr-admin-center-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.25fr); gap: 16px; margin-top: 16px; }
.hr-admin-mini-title { color: #f8fafc; font-weight: 900; letter-spacing: -.01em; margin-bottom: 10px; }
.hr-admin-alert-feed, .hr-admin-employee-strip { min-width: 0; }
.hr-admin-alert-row { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 10px; align-items: center; padding: 12px; border-radius: 16px; text-decoration: none; color: #e5e7eb; background: rgba(15,23,42,.72); border: 1px solid rgba(148,163,184,.14); margin-bottom: 8px; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.hr-admin-alert-row:hover { transform: translateY(-1px); border-color: rgba(96,165,250,.42); background: rgba(30,41,59,.86); }
.hr-admin-alert-row strong { display: block; color: #fff; font-size: .94rem; }
.hr-admin-alert-row small { display: block; color: rgba(226,232,240,.72); margin-top: 2px; line-height: 1.35; }
.hr-admin-alert-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 14px; background: rgba(59,130,246,.16); color: #93c5fd; }
.hr-admin-alert-row.tone-danger .hr-admin-alert-icon { background: rgba(239,68,68,.16); color: #fecaca; }
.hr-admin-alert-row.tone-warning .hr-admin-alert-icon { background: rgba(245,158,11,.16); color: #fde68a; }
.hr-employee-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.hr-employee-card-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hr-employee-mini-card, .hr-employee-card { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px; align-items: center; text-decoration: none; color: #e5e7eb; border: 1px solid rgba(148,163,184,.16); background: rgba(15,23,42,.84); transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.hr-employee-card { grid-template-columns: auto minmax(0,1fr); padding: 16px; }
.hr-employee-mini-card { padding: 12px; border-radius: 18px; }
.hr-employee-mini-card:hover, .hr-employee-card:hover { transform: translateY(-2px); border-color: rgba(96,165,250,.42); background: rgba(30,41,59,.9); }
.hr-employee-avatar { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg, rgba(59,130,246,.85), rgba(14,165,233,.62)); color: #fff; font-weight: 950; letter-spacing: -.04em; box-shadow: 0 14px 32px rgba(15,23,42,.34); }
.hr-employee-avatar.large { width: 56px; height: 56px; border-radius: 20px; font-size: 1.1rem; }
.hr-employee-avatar.xl { width: 76px; height: 76px; border-radius: 26px; font-size: 1.35rem; }
.hr-employee-mini-main strong, .hr-employee-card-main strong { display: block; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-employee-mini-main small, .hr-employee-card-main small { display: block; color: rgba(226,232,240,.68); margin-top: 3px; line-height: 1.3; }
.hr-mini-badge { position: absolute; top: 10px; right: 10px; min-width: 24px; height: 24px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: rgba(245,158,11,.2); color: #fde68a; font-weight: 900; font-size: .76rem; }
.hr-employee-card-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-top: 6px; }
.hr-employee-card-stats span { padding: 10px; border-radius: 14px; background: rgba(2,6,23,.48); border: 1px solid rgba(148,163,184,.12); }
.hr-employee-card-stats b { display: block; color: #f8fafc; font-size: .93rem; }
.hr-employee-card-stats small { color: rgba(226,232,240,.62); font-size: .74rem; }
.hr-employee-profile-title { display: flex; gap: 16px; align-items: center; }
.hr-employee-profile-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr); gap: 16px; align-items: start; }
.hr-employee-profile-grid.secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hr-employee-side-stack { display: grid; gap: 16px; }
.hr-dark-table-wrap { overflow: auto; border-radius: 18px; border: 1px solid rgba(148,163,184,.16); }
.hr-dark-table { width: 100%; border-collapse: collapse; background: rgba(2,6,23,.84); }
.hr-dark-table th { position: sticky; top: 0; z-index: 1; background: rgba(15,23,42,.98); color: #bfdbfe; text-align: left; padding: 12px; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.hr-dark-table td { padding: 12px; border-top: 1px solid rgba(148,163,184,.12); color: #e5e7eb; vertical-align: top; }
.hr-dark-table td small { display: block; color: rgba(226,232,240,.62); margin-top: 4px; }
.hr-dark-table tr.has-long-break td { background: rgba(245,158,11,.08); }
.hr-inline-warning { color: #fde68a !important; font-weight: 800; }
.hr-settlement-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.hr-settlement-mini-grid div { padding: 13px; border-radius: 16px; background: rgba(15,23,42,.78); border: 1px solid rgba(148,163,184,.14); }
.hr-settlement-mini-grid span { display: block; color: rgba(226,232,240,.64); font-size: .8rem; }
.hr-settlement-mini-grid strong { color: #fff; font-size: 1.05rem; }
.sidebar .menu-link[href="/admin/employees"] .menu-link-icon { color: #bfdbfe; }
@media (max-width: 960px) {
  .hr-admin-center-grid, .hr-employee-profile-grid, .hr-employee-profile-grid.secondary { grid-template-columns: 1fr; }
  .hr-employee-card-grid.compact { grid-template-columns: 1fr; }
  .hr-core-toolbar { display: grid; grid-template-columns: 1fr; }
  .hr-core-toolbar .app-btn { width: 100%; }
}
@media (max-width: 720px) {
  .hr-employee-profile-title { align-items: flex-start; }
  .hr-employee-avatar.xl { width: 58px; height: 58px; border-radius: 20px; }
  .hr-employee-card-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hr-dark-table-wrap { border: 0; overflow: visible; }
  .hr-dark-table, .hr-dark-table thead, .hr-dark-table tbody, .hr-dark-table tr, .hr-dark-table th, .hr-dark-table td { display: block; }
  .hr-dark-table thead { display: none; }
  .hr-dark-table tr { margin-bottom: 12px; border-radius: 18px; overflow: hidden; border: 1px solid rgba(148,163,184,.16); background: rgba(2,6,23,.9); }
  .hr-dark-table td { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 10px; border-top: 1px solid rgba(148,163,184,.1); }
  .hr-dark-table td::before { content: attr(data-label); color: #93c5fd; font-weight: 900; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
}


/* ETAP 10 — miesięczne rozliczenie RCP + grafik */
.hr-month-summary-panel { border-color: rgba(96,165,250,.22); }
.hr-month-summary-panel.tone-danger { border-color: rgba(248,113,113,.36); box-shadow: 0 0 0 1px rgba(248,113,113,.08), 0 24px 60px rgba(127,29,29,.16); }
.hr-month-summary-panel.tone-warning { border-color: rgba(251,191,36,.36); box-shadow: 0 0 0 1px rgba(251,191,36,.08), 0 24px 60px rgba(120,53,15,.16); }
.hr-report-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.hr-month-status-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 10px 0 14px; color: rgba(226,232,240,.78); }
.hr-month-status-row small strong { color: #fff; }
.hr-month-summary-grid,
.hr-month-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; }
.hr-month-summary-grid div,
.hr-month-kpi-grid div { padding: 13px; border-radius: 16px; background: rgba(2,6,23,.52); border: 1px solid rgba(148,163,184,.14); }
.hr-month-summary-grid span,
.hr-month-kpi-grid span { display: block; color: rgba(226,232,240,.64); font-size: .78rem; font-weight: 800; }
.hr-month-summary-grid strong,
.hr-month-kpi-grid strong { display: block; margin-top: 4px; color: #fff; font-size: 1.08rem; }
.hr-month-report-page { color: #e5e7eb; }
.hr-month-report-summary { gap: 14px; }
.hr-month-report-table tr.has-problem td { background: rgba(239,68,68,.065); }
.hr-month-report-table tr.has-long-break td { background: rgba(245,158,11,.085); }
.hr-month-report-table tr.tone-success td { background: rgba(34,197,94,.035); }
.hr-month-report-table .hr-diff { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border-radius: 999px; background: rgba(148,163,184,.14); color: #e5e7eb; }
.hr-month-report-table .hr-diff.negative { background: rgba(239,68,68,.16); color: #fecaca; }
.hr-month-report-table .hr-diff.positive { background: rgba(34,197,94,.16); color: #bbf7d0; }
.hr-inline-info { color: #bfdbfe !important; font-weight: 900; }
.hr-settlement-mini-grid.wide { grid-template-columns: repeat(3, minmax(0,1fr)); }
.hr-report-signatures { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin: 18px 0 0; }
.hr-report-signatures div { min-height: 86px; border-radius: 18px; border: 1px dashed rgba(148,163,184,.38); background: rgba(2,6,23,.32); display: flex; align-items: end; padding: 14px; color: rgba(226,232,240,.68); font-weight: 800; }
@media (max-width: 1100px) {
  .hr-month-summary-grid, .hr-month-kpi-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .hr-settlement-mini-grid.wide { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .hr-report-actions { width: 100%; justify-content: stretch; }
  .hr-report-actions .dashboard-mini-button { flex: 1 1 auto; text-align: center; }
  .hr-month-summary-grid, .hr-month-kpi-grid, .hr-settlement-mini-grid.wide, .hr-report-signatures { grid-template-columns: 1fr; }
  .hr-month-report-table .hr-diff { justify-self: start; }
}
@media print {
  body { background: #fff !important; color: #111827 !important; }
  .no-print, .sidebar, .mobile-bottom-nav, .topbar, .app-header, .mobile-nav { display: none !important; }
  .main-content, .content, .page-content { margin: 0 !important; padding: 0 !important; width: 100% !important; }
  .premium-panel, .premium-dashboard-hero, .module-header-card { box-shadow: none !important; border: 1px solid #d1d5db !important; background: #fff !important; color: #111827 !important; break-inside: avoid; }
  .hr-dark-table-wrap { overflow: visible !important; border: 1px solid #d1d5db !important; }
  .hr-dark-table, .hr-dark-table thead, .hr-dark-table tbody, .hr-dark-table tr, .hr-dark-table th, .hr-dark-table td { display: revert !important; }
  .hr-dark-table thead { display: table-header-group !important; }
  .hr-dark-table tr { display: table-row !important; border: 0 !important; background: transparent !important; }
  .hr-dark-table th, .hr-dark-table td { display: table-cell !important; color: #111827 !important; background: #fff !important; border: 1px solid #e5e7eb !important; padding: 6px 7px !important; font-size: 10px !important; }
  .hr-dark-table td::before { content: none !important; }
  .hr-dark-table th { background: #f3f4f6 !important; }
  .app-status { border: 1px solid #9ca3af !important; background: #f9fafb !important; color: #111827 !important; }
  .hr-report-signatures div { background: #fff !important; color: #111827 !important; }
}

/* ===== INLINE CLEANUP: MODULE THEME — przeniesiony do master.css ===== */
/* ============================================================================
   module-theme.css  —  WSPÓLNA WARSTWA UI DLA WSZYSTKICH MODUŁÓW
   ----------------------------------------------------------------------------
   Cel: każdy moduł (RCP, Grafik, Wnioski, Komunikaty, Dokumenty, Helpdesk,
   Rozliczenia, Strefy, Użytkownicy) ma WYGLĄDAĆ IDENTYCZNIE w warstwie
   wspólnych komponentów: nagłówek modułu, karty, przyciski, alerty, taby,
   tabele, formularze, statystyki.

   Zasada: ten plik korzysta WYŁĄCZNIE ze zmiennych motywu zdefiniowanych
   w master.css (--premium-*, --portal-*). Nie wprowadza własnej palety.
   Dzięki temu zmiana motywu w master.css automatycznie obejmuje wszystkie
   moduły.

   Ładowany RAZ, globalnie, w views/partials/top.ejs — zaraz po master.css.
   Plik modułowy (modules/<slug>/public/css/style.css) powinien zawierać już
   TYLKO style specjalistyczne danego modułu (np. siatka grafiku, kalendarz),
   a NIE redefinicje poniższych komponentów.
   ============================================================================ */

/* ---- Fallbacky zmiennych (gdyby moduł ładował się bez master.css) -------- */
:root {
    --mt-bg-main: var(--premium-bg-main, #070b14);
    --mt-surface: var(--portal-surface, linear-gradient(145deg, rgba(255,255,255,.092), rgba(255,255,255,.042)));
    --mt-surface-soft: var(--portal-surface-soft, linear-gradient(145deg, rgba(255,255,255,.072), rgba(255,255,255,.032)));
    --mt-surface-hover: var(--portal-surface-hover, linear-gradient(145deg, rgba(255,255,255,.118), rgba(255,255,255,.052)));
    --mt-border: var(--portal-border, rgba(255,255,255,.12));
    --mt-border-strong: var(--portal-border-strong, rgba(255,255,255,.19));
    --mt-text: var(--portal-text, #f7f9ff);
    --mt-muted: var(--portal-muted, rgba(199,215,239,.78));
    --mt-muted-strong: var(--portal-muted-strong, rgba(220,231,255,.88));
    --mt-accent: var(--portal-accent, linear-gradient(135deg, #4f8cff 0%, #7c5cff 54%, #2dd4bf 100%));
    --mt-accent-soft: var(--portal-accent-soft, linear-gradient(135deg, rgba(79,140,255,.20), rgba(45,212,191,.11)));
    --mt-danger: var(--portal-danger, linear-gradient(135deg, rgba(239,68,68,.94), rgba(244,63,94,.86)));
    --mt-warning: var(--portal-warning, linear-gradient(135deg, rgba(245,158,11,.92), rgba(249,115,22,.84)));
    --mt-success: var(--portal-success, linear-gradient(135deg, rgba(16,185,129,.92), rgba(34,197,94,.84)));
    --mt-radius-sm: var(--portal-radius-sm, 16px);
    --mt-radius-md: var(--portal-radius-md, 22px);
    --mt-radius-lg: var(--premium-radius-lg, 28px);
    --mt-shadow: var(--premium-shadow-soft, 0 18px 48px rgba(0,0,0,.26));
    --mt-shadow-card: var(--premium-shadow-card, 0 24px 70px rgba(0,0,0,.32));
    --mt-input-bg: var(--portal-input-bg, rgba(6,13,27,.58));
    --mt-input-bg-focus: var(--portal-input-bg-focus, rgba(8,18,38,.78));
    --mt-input-border: var(--portal-input-border, rgba(255,255,255,.13));
    --mt-danger-solid: var(--premium-danger, #ef4444);
    --mt-warning-solid: var(--premium-warning, #f59e0b);
    --mt-success-solid: var(--premium-success, #22c55e);
    --mt-accent-solid: var(--premium-accent, #4f8cff);
}

/* ====================  POWŁOKA / SIATKA STRONY MODUŁU  ==================== */
.module-shell,
.module-page {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(14px, 2vw, 26px);
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 1.6vw, 22px);
    color: var(--mt-text);
}

/* ====================  KARTA MODUŁU (uniwersalna)  ======================== */
.module-card {
    background: var(--mt-surface);
    border: 1px solid var(--mt-border);
    border-radius: var(--mt-radius-md);
    box-shadow: var(--mt-shadow);
    padding: clamp(16px, 1.8vw, 24px);
    color: var(--mt-text);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.module-card + .module-card { margin-top: 0; }

.module-card-soft { background: var(--mt-surface-soft); }

/* ====================  NAGŁÓWEK MODUŁU  ================================== */
.module-header-card {
    background: var(--mt-surface);
    border: 1px solid var(--mt-border-strong);
    border-radius: var(--mt-radius-lg);
    box-shadow: var(--mt-shadow-card);
    padding: clamp(18px, 2vw, 28px);
    position: relative;
    overflow: hidden;
}
.module-header-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--mt-accent-soft);
    opacity: .5;
    pointer-events: none;
}
.module-header-card > * { position: relative; z-index: 1; }

.module-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.module-header-main { min-width: 0; flex: 1 1 320px; }
.module-header-kicker {
    display: inline-block;
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--mt-muted);
    margin-bottom: 6px;
}
.module-header-title-row { display: flex; align-items: center; gap: 14px; }
.module-header-icon {
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border-radius: 14px;
    background: var(--mt-accent);
    color: #fff;
    flex: 0 0 auto;
    box-shadow: 0 10px 26px rgba(79,140,255,.32);
}
.module-header-icon svg { width: 24px; height: 24px; }
.module-header-title {
    margin: 0;
    font-size: clamp(20px, 2.4vw, 28px);
    font-weight: 700;
    color: var(--mt-text);
    line-height: 1.15;
}
.module-header-subtitle {
    margin: 4px 0 0;
    color: var(--mt-muted);
    font-size: 14px;
    line-height: 1.5;
}
.module-header-meta {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.module-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* ====================  PIGUŁKI / ZNACZNIKI  ============================= */
.module-header-pill,
.module-pill,
.badge,
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--mt-surface-soft);
    border: 1px solid var(--mt-border);
    color: var(--mt-muted-strong);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.module-pill.is-danger,  .badge.is-danger  { background: var(--mt-danger);  color: #fff; border-color: transparent; }
.module-pill.is-warning, .badge.is-warning { background: var(--mt-warning); color: #1a1206; border-color: transparent; }
.module-pill.is-success, .badge.is-success { background: var(--mt-success); color: #04210f; border-color: transparent; }

/* ====================  SIATKA STATYSTYK / KPI  ========================= */
.module-stat-grid,
.dashboard-live-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}
.module-stat {
    background: var(--mt-surface-soft);
    border: 1px solid var(--mt-border);
    border-radius: var(--mt-radius-sm);
    padding: 14px 16px;
}
.module-stat-value {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    color: var(--mt-text);
    line-height: 1;
}
.module-stat-label {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--mt-muted);
}

/* ====================  PRZYCISKI  ====================================== */
.module-btn,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid var(--mt-border-strong);
    background: var(--mt-surface-soft);
    color: var(--mt-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.module-btn:hover,
.btn:hover {
    background: var(--mt-surface-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0,0,0,.22);
}
.module-btn:active, .btn:active { transform: translateY(0); }
.module-btn:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.module-btn-primary, .btn-primary, .btn.is-primary {
    background: var(--mt-accent);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 30px rgba(79,140,255,.32);
}
.module-btn-danger,  .btn-danger,  .btn.is-danger  { background: var(--mt-danger);  border-color: transparent; color: #fff; }
.module-btn-warning, .btn-warning, .btn.is-warning { background: var(--mt-warning); border-color: transparent; color: #1a1206; }
.module-btn-success, .btn-success, .btn.is-success { background: var(--mt-success); border-color: transparent; color: #04210f; }
.module-btn-ghost,   .btn-ghost   { background: transparent; }

/* ====================  ALERTY / KOMUNIKATY  ============================ */
.module-alert,
.alert {
    border-radius: var(--mt-radius-sm);
    padding: 12px 16px;
    border: 1px solid var(--mt-border);
    background: var(--mt-surface-soft);
    color: var(--mt-text);
    font-size: 14px;
    line-height: 1.5;
}
.module-alert.success, .alert.success { border-color: rgba(34,197,94,.4);  background: rgba(34,197,94,.12); }
.module-alert.danger,  .alert.danger  { border-color: rgba(239,68,68,.42); background: rgba(239,68,68,.12); }
.module-alert.warning, .alert.warning { border-color: rgba(245,158,11,.42);background: rgba(245,158,11,.12); }
.module-alert.info,    .alert.info    { border-color: rgba(79,140,255,.4); background: rgba(79,140,255,.12); }

/* ====================  ZAKŁADKI (TABY)  =============================== */
.module-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    background: var(--mt-surface-soft);
    border: 1px solid var(--mt-border);
    border-radius: 999px;
}
.module-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--mt-muted);
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.module-tab:hover { color: var(--mt-text); }
.module-tab.is-active,
.module-tab[aria-selected="true"] {
    background: var(--mt-accent);
    color: #fff;
    box-shadow: 0 8px 20px rgba(79,140,255,.3);
}

/* ====================  FORMULARZE  ==================================== */
.module-field { display: flex; flex-direction: column; gap: 6px; }
.module-label,
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--mt-muted-strong);
}
.module-input,
.module-select,
.module-textarea,
.form-control,
input[type="text"].module-control,
input[type="number"].module-control,
input[type="date"].module-control,
input[type="time"].module-control,
input[type="search"].module-control,
select.module-control,
textarea.module-control {
    width: 100%;
    background: var(--mt-input-bg);
    border: 1px solid var(--mt-input-border);
    border-radius: 12px;
    color: var(--mt-text);
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.module-input:focus,
.module-select:focus,
.module-textarea:focus,
.form-control:focus,
.module-control:focus {
    outline: none;
    background: var(--mt-input-bg-focus);
    border-color: var(--mt-accent-solid);
    box-shadow: 0 0 0 3px rgba(79,140,255,.18);
}

/* ====================  TABELE  ======================================= */
.module-table,
table.module-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: var(--mt-text);
}
.module-table th,
.module-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--mt-border);
}
.module-table th {
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--mt-muted);
    font-weight: 700;
}
.module-table tbody tr:hover { background: var(--mt-surface-soft); }

/* ====================  PUSTE STANY  ================================== */
.module-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--mt-muted);
    border: 1px dashed var(--mt-border);
    border-radius: var(--mt-radius-sm);
    background: var(--mt-surface-soft);
}

/* ====================  RESPONSYWNOŚĆ  =============================== */
@media (max-width: 720px) {
    .module-header-row { flex-direction: column; }
    .module-header-actions { width: 100%; }
    .module-stat-grid,
    .dashboard-live-stat-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
}


/* ===== INLINE CLEANUP: UNIFIED POPUPS — przeniesiony do master.css ===== */
/* =========================================================
   WSPÓLNY WYGLĄD POPUPÓW / FORMULARZY — 2026-05-22
   Tylko warstwa UI. Bez zmian w logice modułów, endpointach i zapisach.
   ========================================================= */

:root {
    --ui-modal-overlay: rgba(2, 6, 23, .74);
    --ui-modal-bg: linear-gradient(180deg, rgba(12, 23, 46, .985), rgba(4, 10, 24, .995));
    --ui-modal-header-bg: linear-gradient(180deg, rgba(10, 22, 45, .985), rgba(7, 16, 35, .955));
    --ui-modal-footer-bg: linear-gradient(0deg, rgba(3, 7, 18, .985), rgba(8, 17, 36, .955));
    --ui-modal-border: rgba(148, 163, 184, .22);
    --ui-modal-border-soft: rgba(148, 163, 184, .15);
    --ui-modal-text: #f8fafc;
    --ui-modal-muted: rgba(203, 213, 225, .74);
    --ui-form-bg: rgba(8, 18, 40, .90);
    --ui-form-bg-focus: rgba(11, 26, 56, .96);
    --ui-form-border: rgba(148, 163, 184, .25);
    --ui-form-focus: rgba(56, 189, 248, .58);
    --ui-danger-soft: rgba(127, 29, 29, .28);
    --ui-radius-lg: 28px;
    --ui-radius-md: 18px;
    --ui-shadow-modal: 0 34px 100px rgba(0, 0, 0, .56), inset 0 1px 0 rgba(255, 255, 255, .07);
}

/* Warstwa tła popupu — działa dla różnych modułów i różnych nazw klas. */
body :is(.modal-shell:not(.hidden), .documents-modal.is-open, .documents-viewer-modal.is-open, .hd-modal-backdrop, .ui-dialog-backdrop, .rz-modal-overlay, #settlementModal) {
    background: var(--ui-modal-overlay) !important;
    backdrop-filter: blur(10px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(120%) !important;
}

body :is(.modal-backdrop[data-modal]:not([hidden]), .users-page .modal-backdrop.is-open) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 3000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: clamp(12px, 2.2vw, 28px) !important;
    background: var(--ui-modal-overlay) !important;
    backdrop-filter: blur(10px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(120%) !important;
    overflow: hidden !important;
}

/* Karta popupu — jeden rozmiar, jeden cień, jedna logika przewijania. */
body :is(
    .modal-panel,
    .modal-window,
    .modal-card,
    .ui-dialog,
    .ui-dialog-card,
    .documents-modal-panel,
    .documents-viewer-panel,
    .helpdesk-modal-card,
    .hd-modal-card,
    .settlement-modal-card,
    .rz-modal-card,
    .rz-modal-box,
    .message-detail-popup
) {
    width: min(1120px, calc(100vw - 28px)) !important;
    max-width: calc(100vw - 28px) !important;
    max-height: min(88dvh, 940px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border-radius: var(--ui-radius-lg) !important;
    border: 1px solid var(--ui-modal-border) !important;
    background: var(--ui-modal-bg) !important;
    color: var(--ui-modal-text) !important;
    box-shadow: var(--ui-shadow-modal) !important;
}

body :is(.modal-panel-wide, .modal-xl .modal-card, .history-modal-card, .modal-window.modal-xl, .message-detail-popup) {
    width: min(1280px, calc(100vw - 28px)) !important;
}

body :is(.modal-window:not(.modal-xl), .modal-card:not(.history-modal-card), .ui-dialog-card, .helpdesk-modal-card, .hd-modal-card) {
    width: min(760px, calc(100vw - 28px)) !important;
}

body :is(.documents-modal-panel, .settlement-modal-card) {
    width: min(1180px, calc(100vw - 28px)) !important;
}

/* Nagłówek popupu — wspólne miejsce na tytuł i przycisk Zamknij. */
body :is(
    .modal-header,
    .modal-card-head,
    .ui-dialog-head,
    .documents-modal-head,
    .documents-modal-header,
    .settlement-modal-header,
    .rz-modal-head,
    .mswk-modal-head,
    .message-popup-topline
) {
    flex: 0 0 auto !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 14px !important;
    min-height: 66px !important;
    margin: 0 !important;
    padding: 16px 18px !important;
    border-bottom: 1px solid var(--ui-modal-border-soft) !important;
    background: var(--ui-modal-header-bg) !important;
    color: var(--ui-modal-text) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
}

body :is(
    .modal-header,
    .modal-card-head,
    .ui-dialog-head,
    .documents-modal-head,
    .documents-modal-header,
    .settlement-modal-header,
    .rz-modal-head,
    .mswk-modal-head,
    .message-popup-topline
) :is(h1, h2, h3) {
    margin: 0 !important;
    color: #fff !important;
    font-size: clamp(20px, 2.2vw, 28px) !important;
    line-height: 1.08 !important;
    letter-spacing: -.035em !important;
    font-weight: 950 !important;
}

body :is(
    .modal-header,
    .modal-card-head,
    .ui-dialog-head,
    .documents-modal-head,
    .documents-modal-header,
    .settlement-modal-header,
    .rz-modal-head,
    .mswk-modal-head,
    .message-popup-topline
) :is(p, small, .section-kicker, .documents-modal-head p, .modal-user-name) {
    color: var(--ui-modal-muted) !important;
}

/* Przycisk zamknięcia — ikona + stały napis „Zamknij”. */
body :is(.modal-close, .icon-chip-btn[data-modal-close], .close-btn, .documents-modal-close, .ui-unified-close, button[aria-label="Zamknij"], button[aria-label="Zamknij okno"]) {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 108px !important;
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 13px !important;
    border-radius: 15px !important;
    border: 1px solid rgba(148, 163, 184, .24) !important;
    background: rgba(15, 23, 42, .80) !important;
    color: #e5e7eb !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06) !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    letter-spacing: -.01em !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease !important;
}

body :is(.modal-close, .icon-chip-btn[data-modal-close], .close-btn, .documents-modal-close, .ui-unified-close, button[aria-label="Zamknij"], button[aria-label="Zamknij okno"]):hover {
    transform: translateY(-1px) !important;
    border-color: rgba(248, 113, 113, .42) !important;
    background: var(--ui-danger-soft) !important;
    color: #fecaca !important;
}

body .ui-close-label {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
}

body .ui-close-icon {
    display: inline-grid !important;
    place-items: center !important;
    width: 18px !important;
    height: 18px !important;
    font-size: 20px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
}

body :is(.modal-close, .icon-chip-btn[data-modal-close], .close-btn, .documents-modal-close, .ui-unified-close) :is(svg, .app-icon) {
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 auto !important;
}

/* Przewijana zawartość popupu. */
body :is(
    .modal-body,
    .ui-dialog-body,
    .documents-modal-body,
    .documents-viewer-body,
    .rz-modal-body,
    .mswk-modal-body,
    .comm-detail-body,
    .modal-calendar-scroll,
    .availability-overview-scroll,
    .history-timeline-modal
) {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

body :is(.modal-window, .modal-card, .modal-panel, .ui-dialog, .ui-dialog-card, .documents-modal-panel, .helpdesk-modal-card, .hd-modal-card, .settlement-modal-card) > :is(.table-wrap, .module-table-wrap, .rcp-table-wrap, .qr-grid, .qr-card, .history-timeline, .ui-dialog-body, .documents-viewer-frame, .documents-viewer-body) {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: auto !important;
}

body :is(.modal-window, .modal-card, .modal-panel, .ui-dialog, .ui-dialog-card, .documents-modal-panel, .helpdesk-modal-card, .hd-modal-card, .settlement-modal-card) > form,
body :is(.modal-window, .modal-card, .modal-panel, .ui-dialog, .ui-dialog-card, .documents-modal-panel, .helpdesk-modal-card, .hd-modal-card, .settlement-modal-card) form.module-form {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

body :is(.modal-window, .modal-card, .modal-panel, .ui-dialog, .ui-dialog-card, .documents-modal-panel, .helpdesk-modal-card, .hd-modal-card, .settlement-modal-card) form :is(.form-grid, .module-form-grid, .modal-form-grid, .comm-form-grid, .documents-form-grid, .settlement-form-grid, .request-modal-layout) {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: auto !important;
    padding: 18px !important;
}

body :is(.modal-window, .modal-card, .modal-panel, .ui-dialog, .ui-dialog-card, .documents-modal-panel, .helpdesk-modal-card, .hd-modal-card, .settlement-modal-card) > :is(.module-actions, .action-row, .filter-row) {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 14px 18px !important;
    border-bottom: 1px solid var(--ui-modal-border-soft) !important;
    background: rgba(5, 12, 28, .70) !important;
}

/* Stopka popupu — wspólny pasek akcji. */
body :is(
    .modal-window,
    .modal-card,
    .modal-panel,
    .ui-dialog,
    .ui-dialog-card,
    .documents-modal-panel,
    .documents-viewer-panel,
    .helpdesk-modal-card,
    .hd-modal-card,
    .settlement-modal-card,
    .rz-modal-card,
    .rz-modal-box
) :is(.modal-actions, .modal-footer, .ui-dialog-actions, .documents-modal-actions, .module-form-footer, .form-actions, .form-actions-end, .settlement-form-actions, .rz-modal-actions, .comm-card-actions-detail) {
    flex: 0 0 auto !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 9 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 10px !important;
    margin: auto 0 0 !important;
    padding: 14px 18px !important;
    border-top: 1px solid var(--ui-modal-border-soft) !important;
    background: var(--ui-modal-footer-bg) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
}

body :is(.modal-window, .modal-card, .modal-panel, .ui-dialog, .ui-dialog-card, .documents-modal-panel, .helpdesk-modal-card, .hd-modal-card, .settlement-modal-card) :is(.module-note-banner, .form-note, .documents-help, .help-text) {
    margin: 0 18px 14px !important;
}

/* Formularze w popupach — wspólny ciemny styl. */
body :is(
    .modal-window,
    .modal-card,
    .modal-panel,
    .ui-dialog,
    .ui-dialog-card,
    .documents-modal-panel,
    .documents-viewer-panel,
    .helpdesk-modal-card,
    .hd-modal-card,
    .settlement-modal-card,
    .rz-modal-card,
    .rz-modal-box
) :is(label, .field, .form-field, .documents-field, .helpdesk-field, .premium-field) {
    min-width: 0 !important;
}

body :is(
    .modal-window,
    .modal-card,
    .modal-panel,
    .ui-dialog,
    .ui-dialog-card,
    .documents-modal-panel,
    .documents-viewer-panel,
    .helpdesk-modal-card,
    .hd-modal-card,
    .settlement-modal-card,
    .rz-modal-card,
    .rz-modal-box
) label > span,
body :is(
    .modal-window,
    .modal-card,
    .modal-panel,
    .ui-dialog,
    .ui-dialog-card,
    .documents-modal-panel,
    .documents-viewer-panel,
    .helpdesk-modal-card,
    .hd-modal-card,
    .settlement-modal-card,
    .rz-modal-card,
    .rz-modal-box
) :is(.field-label, .form-label) {
    display: block !important;
    margin: 0 0 7px !important;
    color: rgba(226, 232, 240, .86) !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    letter-spacing: .045em !important;
    text-transform: uppercase !important;
}

body :is(
    .modal-window,
    .modal-card,
    .modal-panel,
    .ui-dialog,
    .ui-dialog-card,
    .documents-modal-panel,
    .documents-viewer-panel,
    .helpdesk-modal-card,
    .hd-modal-card,
    .settlement-modal-card,
    .rz-modal-card,
    .rz-modal-box
) :is(input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"], input[type="tel"], input[type="url"], input[type="month"], select, textarea) {
    width: 100% !important;
    min-height: 46px !important;
    padding: 11px 13px !important;
    border-radius: 15px !important;
    border: 1px solid var(--ui-form-border) !important;
    background: var(--ui-form-bg) !important;
    color: #f8fafc !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
    outline: none !important;
}

body :is(
    .modal-window,
    .modal-card,
    .modal-panel,
    .ui-dialog,
    .ui-dialog-card,
    .documents-modal-panel,
    .documents-viewer-panel,
    .helpdesk-modal-card,
    .hd-modal-card,
    .settlement-modal-card,
    .rz-modal-card,
    .rz-modal-box
) :is(input, select, textarea):focus {
    border-color: var(--ui-form-focus) !important;
    background: var(--ui-form-bg-focus) !important;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, .14), inset 0 1px 0 rgba(255,255,255,.05) !important;
}

body :is(
    .modal-window,
    .modal-card,
    .modal-panel,
    .ui-dialog,
    .ui-dialog-card,
    .documents-modal-panel,
    .documents-viewer-panel,
    .helpdesk-modal-card,
    .hd-modal-card,
    .settlement-modal-card,
    .rz-modal-card,
    .rz-modal-box
) textarea {
    min-height: 118px !important;
    resize: vertical !important;
}

body :is(
    .modal-window,
    .modal-card,
    .modal-panel,
    .ui-dialog,
    .ui-dialog-card,
    .documents-modal-panel,
    .documents-viewer-panel,
    .helpdesk-modal-card,
    .hd-modal-card,
    .settlement-modal-card,
    .rz-modal-card,
    .rz-modal-box
) :is(input[readonly], textarea[readonly], input[disabled], select[disabled], textarea[disabled]) {
    background: rgba(15, 23, 42, .55) !important;
    color: rgba(203, 213, 225, .74) !important;
    border-color: rgba(148, 163, 184, .15) !important;
}

body :is(.modal-window, .modal-card, .modal-panel, .ui-dialog, .ui-dialog-card, .documents-modal-panel, .helpdesk-modal-card, .hd-modal-card, .settlement-modal-card) :is(input[type="file"])::file-selector-button {
    margin-right: 12px !important;
    padding: 9px 13px !important;
    border: 1px solid rgba(56, 189, 248, .28) !important;
    border-radius: 13px !important;
    background: rgba(56, 189, 248, .14) !important;
    color: #e0f2fe !important;
    font-weight: 900 !important;
}

/* Tabele/listy w popupach — czytelniejsze wyświetlanie. */
body :is(.modal-window, .modal-card, .modal-panel, .ui-dialog, .ui-dialog-card, .documents-modal-panel, .settlement-modal-card) :is(.table-wrap, .module-table-wrap, .rcp-table-wrap, .documents-table-wrap) {
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    background: rgba(2, 6, 23, .42) !important;
}

body :is(.modal-window, .modal-card, .modal-panel, .ui-dialog, .ui-dialog-card, .documents-modal-panel, .settlement-modal-card) :is(table) {
    min-width: 720px;
}

body :is(.modal-window, .modal-card, .modal-panel, .ui-dialog, .ui-dialog-card, .documents-modal-panel, .settlement-modal-card) :is(th) {
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
    background: rgba(15, 23, 42, .98) !important;
}

body :is(.modal-window, .modal-card, .modal-panel, .ui-dialog, .ui-dialog-card, .documents-modal-panel, .settlement-modal-card) :is(td, th) {
    vertical-align: top !important;
}

/* Przyciski akcji w popupach — wspólne rozmiary. */
body :is(
    .modal-window,
    .modal-card,
    .modal-panel,
    .ui-dialog,
    .ui-dialog-card,
    .documents-modal-panel,
    .documents-viewer-panel,
    .helpdesk-modal-card,
    .hd-modal-card,
    .settlement-modal-card,
    .rz-modal-card,
    .rz-modal-box
) :is(button, .btn, .app-btn, .button-link, .documents-btn, .soft-action-btn, .tile-action-btn, .mini-btn) {
    min-height: 42px !important;
    border-radius: 15px !important;
}

body :is(
    .modal-window,
    .modal-card,
    .modal-panel,
    .ui-dialog,
    .ui-dialog-card,
    .documents-modal-panel,
    .documents-viewer-panel,
    .helpdesk-modal-card,
    .hd-modal-card,
    .settlement-modal-card,
    .rz-modal-card,
    .rz-modal-box
) :is(button[type="submit"], .primary, .btn-primary, .button-link.primary) {
    font-weight: 950 !important;
    box-shadow: 0 16px 34px rgba(37, 99, 235, .20), inset 0 1px 0 rgba(255,255,255,.16) !important;
}

/* Detal komunikatu i podgląd dokumentów — lepsze wykorzystanie wysokości. */
body .message-detail-popup .detail-panel-inner,
body .documents-viewer-panel {
    min-height: 0 !important;
}

body .documents-viewer-frame,
body .message-detail-popup .comm-detail-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: auto !important;
}

body .documents-viewer-frame :is(iframe, img, object) {
    max-width: 100% !important;
}

/* Mobile — popup jako wygodny panel na prawie cały ekran. */
@media (max-width: 760px) {
    body :is(.modal-backdrop[data-modal]:not([hidden]), .users-page .modal-backdrop.is-open) {
        align-items: flex-end !important;
        padding: 8px !important;
    }

    body :is(
        .modal-panel,
        .modal-window,
        .modal-card,
        .ui-dialog,
        .ui-dialog-card,
        .documents-modal-panel,
        .documents-viewer-panel,
        .helpdesk-modal-card,
        .hd-modal-card,
        .settlement-modal-card,
        .rz-modal-card,
        .rz-modal-box,
        .message-detail-popup
    ) {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        max-height: calc(100dvh - 16px - env(safe-area-inset-bottom, 0px)) !important;
        border-radius: 24px !important;
    }

    body :is(.modal-header, .modal-card-head, .ui-dialog-head, .documents-modal-head, .documents-modal-header, .settlement-modal-header, .rz-modal-head, .mswk-modal-head, .message-popup-topline) {
        padding: 14px !important;
        min-height: 60px !important;
    }

    body :is(.modal-header, .modal-card-head, .ui-dialog-head, .documents-modal-head, .documents-modal-header, .settlement-modal-header, .rz-modal-head, .mswk-modal-head, .message-popup-topline) :is(h1, h2, h3) {
        font-size: 21px !important;
    }

    body :is(.modal-close, .icon-chip-btn[data-modal-close], .close-btn, .documents-modal-close, .ui-unified-close, button[aria-label="Zamknij"], button[aria-label="Zamknij okno"]) {
        min-width: 98px !important;
        min-height: 40px !important;
        padding-inline: 11px !important;
    }

    body :is(.modal-window, .modal-card, .modal-panel, .ui-dialog, .ui-dialog-card, .documents-modal-panel, .helpdesk-modal-card, .hd-modal-card, .settlement-modal-card) form :is(.form-grid, .module-form-grid, .modal-form-grid, .comm-form-grid, .documents-form-grid, .settlement-form-grid, .request-modal-layout) {
        grid-template-columns: 1fr !important;
        padding: 14px !important;
    }

    body :is(
        .modal-window,
        .modal-card,
        .modal-panel,
        .ui-dialog,
        .ui-dialog-card,
        .documents-modal-panel,
        .documents-viewer-panel,
        .helpdesk-modal-card,
        .hd-modal-card,
        .settlement-modal-card,
        .rz-modal-card,
        .rz-modal-box
    ) :is(.modal-actions, .modal-footer, .ui-dialog-actions, .documents-modal-actions, .module-form-footer, .form-actions, .form-actions-end, .settlement-form-actions, .rz-modal-actions, .comm-card-actions-detail) {
        display: grid !important;
        grid-template-columns: 1fr !important;
        padding: 12px 14px max(14px, env(safe-area-inset-bottom, 0px)) !important;
    }

    body :is(
        .modal-window,
        .modal-card,
        .modal-panel,
        .ui-dialog,
        .ui-dialog-card,
        .documents-modal-panel,
        .documents-viewer-panel,
        .helpdesk-modal-card,
        .hd-modal-card,
        .settlement-modal-card,
        .rz-modal-card,
        .rz-modal-box
    ) :is(.modal-actions, .modal-footer, .ui-dialog-actions, .documents-modal-actions, .module-form-footer, .form-actions, .form-actions-end, .settlement-form-actions, .rz-modal-actions, .comm-card-actions-detail) > * {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }

    body :is(.modal-window, .modal-card, .modal-panel, .ui-dialog, .ui-dialog-card, .documents-modal-panel, .settlement-modal-card) :is(table) {
        min-width: 680px;
    }
}

@media (max-width: 460px) {
    body :is(.modal-close, .icon-chip-btn[data-modal-close], .close-btn, .documents-modal-close, .ui-unified-close, button[aria-label="Zamknij"], button[aria-label="Zamknij okno"]) {
        min-width: 44px !important;
        width: 44px !important;
        padding: 0 !important;
    }

    body .ui-close-label {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        clip: rect(0 0 0 0) !important;
        white-space: nowrap !important;
    }
}

