/* Edycja pracownika – zakładki zamiast jednej długiej strony */
.employee-editor {
    display: grid;
    gap: 14px;
}

.employee-identity {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 4px 4px 0;
}

.employee-identity-avatar {
    display: grid;
    flex: 0 0 48px;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(145deg, #3b82f6, #6366f1);
    box-shadow: 0 10px 22px rgba(79, 70, 229, .25);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .02em;
}

.employee-identity-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.employee-identity-copy > strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 16px;
    letter-spacing: -.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-identity-copy > span {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.employee-identity-copy em {
    padding: 2px 8px;
    border-radius: 999px;
    color: #475569;
    background: #f1f5f9;
    box-shadow: inset 0 0 0 1px #e2e8f0;
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
}

.employee-identity-copy em.is-active { color: #047857; background: #ecfdf5; box-shadow: inset 0 0 0 1px #a7f3d0; }
.employee-identity-copy em.is-inactive { color: #b91c1c; background: #fef2f2; box-shadow: inset 0 0 0 1px #fecaca; }

/* Pasek zakładek */
.employee-tabs {
    position: sticky;
    z-index: 20;
    top: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    border: 1px solid #dce5f1;
    border-radius: 20px;
    background: rgba(238, 242, 248, .92);
    box-shadow: 0 14px 36px rgba(31, 58, 108, .1), inset 0 1px 0 rgba(255, 255, 255, .7);
    backdrop-filter: blur(16px) saturate(1.4);
}

.employee-tabs button {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
    min-height: 58px;
    padding: 9px 11px;
    border: 0;
    border-radius: 15px;
    color: #475569;
    background: rgba(255, 255, 255, .55);
    box-shadow: inset 0 0 0 1px #e1e8f2;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.employee-tabs button:hover {
    color: #1d4ed8;
    background: #fff;
    box-shadow: inset 0 0 0 1px #c7d7ee, 0 8px 18px rgba(31, 58, 108, .08);
    transform: translateY(-1px);
}

.employee-tabs button[aria-selected="true"] {
    color: #1d4ed8;
    background: #fff;
    box-shadow: 0 0 0 1.5px #3b82f6, 0 12px 26px rgba(37, 99, 235, .18);
    transform: none;
}

.employee-tabs button[aria-selected="true"]::after {
    position: absolute;
    right: 18px;
    bottom: -1px;
    left: 18px;
    height: 3px;
    border-radius: 999px 999px 0 0;
    content: "";
    background: linear-gradient(90deg, #60a5fa, #2563eb, #7c3aed);
}

.employee-tabs button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .25);
    outline-offset: 2px;
}

.employee-tabs button.has-error::before {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    content: "";
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .18);
}

.employee-tab-icon {
    display: grid;
    flex: 0 0 36px;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    color: #64748b;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e2e8f0;
    transition: .2s ease;
}

.employee-tab-icon .icon { width: 16px; height: 16px; }

.employee-tabs button:hover .employee-tab-icon {
    color: #2563eb;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #bfdbfe;
}

.employee-tabs button[aria-selected="true"] .employee-tab-icon {
    color: #fff;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    box-shadow: 0 7px 16px rgba(37, 99, 235, .3);
}

.employee-tab-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.employee-tab-copy strong,
.employee-tab-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-tab-copy strong {
    color: inherit;
    font-size: 11.5px;
    line-height: 1.3;
}

.employee-tab-copy small {
    margin-top: 2px;
    color: #8794a6;
    font-size: 9px;
}

.employee-tab-badge {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    color: #475569;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e2e8f0;
    font-size: 8.5px;
    font-weight: 750;
    white-space: nowrap;
}

.employee-tabs button[aria-selected="true"] .employee-tab-badge {
    color: #1d4ed8;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #bfdbfe;
}

/* Panele */
.employee-tab-panel {
    display: contents;
}

.employee-tab-panel.is-tabbed {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-content: start;
    animation: employee-tab-enter .2s ease;
}

.employee-tab-panel.is-tabbed[hidden] {
    display: none !important;
}

.employee-tab-panel.is-tabbed > .full {
    grid-column: 1 / -1;
}

.employee-tab-panel.is-tabbed .employee-form-section-number {
    display: none;
}

.employee-form-panel.is-tabbed {
    overflow: clip;
}

.employee-status-field .check-row {
    margin-bottom: 8px;
}

/* Przyklejony pasek zapisu */
.employee-form-panel .employee-save-bar {
    position: sticky;
    z-index: 6;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    gap: 12px 16px;
    align-items: center;
    justify-content: space-between;
    margin: 6px -30px -30px;
    padding: 14px 30px;
    border-top: 1px solid #e3eaf3;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 -12px 28px rgba(15, 23, 42, .06);
    backdrop-filter: blur(14px) saturate(1.3);
}

.employee-save-nav {
    display: flex;
    gap: 6px;
    align-items: center;
}

.employee-save-step {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid #dce5f1;
    border-radius: 10px;
    color: #334155;
    background: #fff;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s ease;
}

.employee-save-step:hover:not(:disabled) {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #f5f9ff;
}

.employee-save-step:disabled {
    opacity: .4;
    cursor: default;
}

.employee-save-step .icon { width: 13px; height: 13px; }

.employee-save-progress {
    min-width: 40px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.employee-save-progress b { color: #1d4ed8; }

.employee-save-hint {
    flex: 1 1 auto;
    color: #94a3b8;
    font-size: 9.5px;
}

.employee-form-panel .employee-save-bar .button {
    min-height: 42px;
    padding: 0 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8 60%, #4338ca);
    box-shadow: 0 12px 26px rgba(37, 99, 235, .28);
}

@keyframes employee-tab-enter {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
    .employee-tabs {
        position: relative;
        top: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .employee-tab-panel.is-tabbed { grid-template-columns: 1fr; }
    .employee-save-hint { display: none; }
}

@media (max-width: 640px) {
    .employee-form-panel .employee-save-bar { margin: 6px -20px -20px; padding: 12px 20px; }
}

@media (max-width: 620px) {
    .employee-tabs {
        display: flex;
        margin-right: -16px;
        margin-left: -16px;
        padding: 6px 16px;
        overflow-x: auto;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        scrollbar-width: none;
    }

    .employee-tabs button { flex: 0 0 180px; }
    .employee-tab-badge { display: none; }
    .employee-form-panel .employee-save-bar { flex-direction: column; align-items: stretch; }
    .employee-save-nav { justify-content: space-between; }
    .employee-form-panel .employee-save-bar .button { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .employee-tab-panel.is-tabbed { animation: none; }
    .employee-tabs button { transition: none; }
}
