/* Employee editor tabs: isolated from the legacy modal fieldset constraints. */

.employee-modal {
    overflow: hidden;
    align-content: start;
}

.employee-modal .employee-form-tabs {
    overflow: visible;
}

.employee-modal .employee-form-tab {
    white-space: normal;
    line-height: 1.45;
}

.employee-modal fieldset.employee-form-group {
    display: block;
    width: 100%;
    max-height: none;
    overflow: visible;
}

.employee-modal .employee-form-group__grid {
    width: 100%;
}

.employee-modal .employee-form-group__grid > label {
    min-width: 0;
    width: 100%;
}

.employee-modal .employee-form-group__grid input,
.employee-modal .employee-form-group__grid select,
.employee-modal .employee-form-group__grid textarea,
.employee-modal .employee-form-group__grid .searchable-select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

@media (min-width: 1001px) {
    .employee-modal {
        width: min(1500px, calc(100vw - 32px));
        max-height: none;
    }
}

@media (max-width: 1000px) {
    .employee-modal {
        overflow: auto;
    }

    .employee-modal .employee-form-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .employee-modal .employee-form-tabs {
        grid-template-columns: 1fr;
    }
}

/* Keep employee fields aligned when inline validation messages appear. */

.employee-modal .employee-form-group__grid {
    align-items: start;
}

.employee-modal .employee-form-group__grid > label:not(.check) {
    position: relative;
    align-content: start;
    min-height: 78px;
    padding-bottom: 20px;
}

.employee-modal .employee-form-group__grid > label:not(.check) > .field-validation {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 16px;
    margin: 0;
    overflow: hidden;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-modal .employee-form-group__grid > label.check {
    margin-top: 19px;
}

/* Unified segmented tab rail for the employee editor. */

.employee-modal .employee-form-tabs {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    grid-template-columns: none;
    gap: 0;
    width: 100%;
    padding: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface, #f7faf8);
    box-shadow: 0 5px 16px rgba(30, 58, 45, 0.06);
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.employee-modal .employee-form-tab {
    flex: 1 0 180px;
    width: auto;
    min-width: 180px;
    min-height: 42px;
    border: 0;
    border-inline-end: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    scroll-snap-align: center;
}

[dir='rtl'] .employee-modal .employee-form-tab:last-child,
[dir='ltr'] .employee-modal .employee-form-tab:last-child {
    border-inline-end: 0;
}

.employee-modal .employee-form-tab:hover {
    color: var(--primary);
    background: var(--selection);
}

.employee-modal .employee-form-tab.is-active,
.employee-modal .employee-form-tab.is-active:hover {
    color: var(--primary);
    border-block-end: 2px solid var(--primary);
    border-radius: 0;
    background: var(--selection);
}

@media (min-width: 1100px) {
    .employee-modal .employee-form-tab {
        flex-basis: 0;
        min-width: 0;
    }
}

@media (max-width: 1099px) {
    .employee-modal .employee-form-tabs {
        display: flex;
        grid-template-columns: none;
    }
}

/* The active tab already names the section; keep its panel visually frameless. */

.employee-modal fieldset.employee-form-group {
    padding: 12px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.employee-modal fieldset.employee-form-group > legend {
    display: none;
}

html[data-theme='dark'] .employee-modal fieldset.employee-form-group {
    border: 0;
    background: transparent;
}

.employee-import-panel {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 20px;
}

.employee-import-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.employee-import-results {
    margin-top: 12px;
    max-height: 300px;
    overflow: auto;
}

.employee-import-results table {
    width: 100%;
    border-collapse: collapse;
}

.employee-import-results :is(th, td) {
    padding: 8px;
    border-bottom: 1px solid var(--line);
    text-align: start;
}
