/* One set of rules for every form and filter bar. Loaded after the other stylesheets. */

/* Labels above their field, except next to a checkbox or a radio. */
.stack-form.stack-form label:not(.checkbox-row):not(.checkbox-card):not(:has(> input:is([type="checkbox"], [type="radio"]))) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    align-content: start;
    gap: 0.35rem;
    min-width: 0;
}

.stack-form.stack-form label:not(.checkbox-row):not(.checkbox-card):not(:has(> input:is([type="checkbox"], [type="radio"]))) > *,
.stack-form.stack-form .employee-sensitive-field__meta,
.stack-form.stack-form .employee-sensitive-field__reveal {
    grid-column: 1;
    min-width: 0;
}

.stack-form.stack-form label[hidden],
.stack-form.stack-form label > [hidden] {
    display: none !important;
}

.stack-form.stack-form :is(.two-up, .three-up, .address-grid):not([hidden]) {
    align-items: start;
    gap: 0.8rem 1rem;
}

/* Actions at the end of the form: reset and delete on the left, save on the right. */
.form-actions.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.form-actions__start {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-right: auto;
}

.form-actions .button {
    min-height: 38px;
}

/* Framed forms. */
.admin-page .punch-station-admin > .punch-station-form,
.admin-page .generated-document-builder__form,
.admin-page .role-configurator__editor {
    padding: 16px;
    border-radius: 10px;
}

/* Filters on one line: wide search, then the lists. */
.admin-page .admin-table-toolbar__main:has(> label + label) {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.6rem 0.8rem;
}

.admin-page .admin-table-toolbar__main:has(> label + label) > label {
    flex: 1 1 8rem;
    min-width: 0;
}

.admin-page .admin-table-toolbar__main:has(> label + label) > label:has(> input[type="search"]) {
    flex: 3 1 12rem;
}

.admin-page .admin-table-toolbar__main:has(> label + label) > label > * {
    width: 100%;
}

.admin-page .admin-table-toolbar__main > .button {
    min-height: 38px;
}

#partsCatalogImportForm.stack-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.6rem;
}

#partsCatalogImportForm.stack-form > label {
    flex: 1 1 22rem;
}

@media (max-width: 720px) {
    .stack-form.stack-form :is(.two-up, .three-up, .address-grid):not([hidden]) {
        gap: 0.7rem;
    }
}

.admin-page .admin-table-toolbar:has(> .admin-table-toolbar__main > label + label) {
    align-items: end;
}

.role-configurator__editor .integration-actions {
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.4rem;
}
