/* Shared work-page structure */
.app-work-page {
    font-size: 0.86rem;
    padding-bottom: 0.75rem !important;
    padding-top: 0.45rem !important;
}

.app-work-page-narrow {
    max-width: 980px;
}

.app-form-page {
    max-width: 64rem;
}

.app-form-page-narrow {
    max-width: 42rem;
}

.app-user-editor {
    max-width: 60rem;
}

.app-user-editor-section {
    border-top: 1px solid var(--bs-border-color);
    padding: 0.55rem 0 0.65rem;
}

.app-user-editor-section:last-of-type {
    border-bottom: 1px solid var(--bs-border-color);
}

.app-user-editor-title {
    font-size: 0.9rem;
    font-weight: 650;
    margin: 0 0 0.45rem;
}

.app-user-editor-grid {
    display: grid;
    gap: 0.45rem 0.7rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-user-editor-field {
    min-width: 0;
}

.app-user-editor-field.is-wide {
    grid-column: 1 / -1;
}

.app-user-editor .form-label {
    color: var(--bs-secondary-color);
    font-size: 0.76rem;
    line-height: 1.15;
    margin-bottom: 0.18rem;
}

.app-user-editor .form-control,
.app-user-editor .form-select {
    font-size: 0.82rem;
    min-height: 2rem;
    padding: 0.28rem 0.55rem;
}

.app-user-editor textarea.form-control {
    min-height: 3.65rem;
    resize: vertical;
}

.app-user-editor .form-text {
    font-size: 0.72rem;
    margin-top: 0.12rem;
}

.app-user-editor-actions {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    padding-top: 0.55rem;
}

.app-work-form {
    border-bottom: 1px solid var(--bs-border-color);
    border-top: 1px solid var(--bs-border-color);
    padding-bottom: 0.55rem;
    padding-top: 0.55rem;
}

.app-waiting-overlay {
    z-index: 2000;
}

.app-work-page > .app-compact-breadcrumb {
    margin-bottom: 0.55rem !important;
}

.app-page-heading {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.55rem;
}

.app-page-title {
    font-size: 1.05rem;
    line-height: 1.1;
    margin: 0;
}

.app-page-subtitle {
    color: var(--bs-secondary-color);
    font-size: 0.76rem;
    line-height: 1.25;
    width: 100%;
}

.app-page-search {
    font-size: 0.78rem;
    min-height: 1.7rem;
    padding-bottom: 0.18rem;
    padding-top: 0.18rem;
}

.app-result-meta {
    align-items: center;
    border-bottom: 1px solid var(--bs-border-color);
    border-top: 1px solid var(--bs-border-color);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.78rem;
    gap: 0.3rem 1rem;
    margin-bottom: 0.55rem;
    padding: 0.45rem 0;
}

.app-result-meta-field {
    min-width: 0;
    white-space: nowrap;
}

.app-result-meta-field.is-truncated {
    max-width: 28rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-result-meta-label {
    color: var(--bs-secondary-color);
    margin-right: 0.4rem;
}

.app-result-meta-value {
    font-weight: 600;
}

.app-export-result-field.is-inline {
    display: block;
    white-space: normal;
}

.app-export-result-field.is-inline .app-export-result-label {
    display: inline-block;
    margin-right: 0.4rem;
}

.app-export-result-field.is-inline .app-export-result-value {
    display: inline;
}

.app-section-heading {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.22rem;
}

.app-section-title,
.designer-section-title {
    font-size: 0.92rem;
    font-weight: 650;
    margin: 0;
}

.app-square-action,
.app-document-row-action {
    align-items: center;
    display: inline-flex;
    height: 1.65rem;
    justify-content: center;
    padding: 0;
    width: 1.65rem;
}

.app-admin-table {
    font-size: 0.78rem;
}

.app-admin-table thead th {
    background: var(--bs-tertiary-bg);
    white-space: nowrap;
}

/* Platform documentation */
.platform-contract-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(13rem, 18rem) minmax(0, 1fr);
}

.platform-contract-list {
    border: 1px solid var(--bs-border-color);
    height: fit-content;
}

.platform-contract-list a {
    border-bottom: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
    display: block;
    padding: 0.55rem 0.7rem;
    text-decoration: none;
}

.platform-contract-list a:last-child {
    border-bottom: 0;
}

.platform-contract-list a:hover,
.platform-contract-list a.is-active {
    background: var(--bs-secondary-bg);
}

.platform-contract-document {
    border: 1px solid var(--bs-border-color);
    min-width: 0;
    padding: 1rem 1.15rem;
}

.platform-contract-document h1 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.platform-contract-document h2 {
    border-top: 1px solid var(--bs-border-color);
    font-size: 1.05rem;
    margin-top: 1.4rem;
    padding-top: 1rem;
}

.platform-contract-document p,
.platform-contract-document li {
    font-size: 0.88rem;
}

.platform-contract-document pre {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    font-size: 0.78rem;
    overflow: auto;
    padding: 0.7rem;
}

.platform-contract-document code {
    color: var(--bs-body-color);
}

.platform-contract-document :not(pre) > code {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    padding: 0.05rem 0.25rem;
}

.platform-contract-document table {
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 1rem;
    width: 100%;
}

.platform-contract-document th,
.platform-contract-document td {
    border: 1px solid var(--bs-border-color);
    padding: 0.35rem 0.5rem;
    text-align: left;
    vertical-align: top;
}

.platform-contract-plain {
    margin: 0;
    white-space: pre-wrap;
}

/* System datasheets */
.app-system-datasheet-frame,
.app-system-datasheet-frame > form,
.app-system-datasheet-frame .app-datasheet-wrap {
    max-width: 100%;
    width: 100%;
}

.app-system-datasheet-frame .app-datasheet-navigator {
    width: 100%;
}

.app-system-datasheet-frame .app-dynamic-datasheet {
    margin-left: 0;
    margin-right: 0;
    table-layout: fixed;
    width: 100%;
}

/* Dynamic document */
.app-document-header-master .app-datasheet-wrap {
    max-height: 14rem;
    overflow: auto;
}

.app-document-header-master {
    margin-bottom: 0.55rem;
}

.app-document-detail {
    margin-bottom: 0.7rem;
    margin-top: 0.45rem;
    max-width: 100%;
    width: 100%;
}

.app-document-detail .app-datasheet-wrap {
    max-width: 100%;
    width: 100%;
}

.app-document-detail .app-dynamic-datasheet {
    font-size: inherit;
    table-layout: fixed;
    width: 100%;
}

.app-document-detail .app-dynamic-datasheet th,
.app-document-detail .app-dynamic-datasheet td {
    height: 1.35rem;
    line-height: 1.15;
}

.app-document-detail .app-dynamic-datasheet input.form-control,
.app-document-detail .app-dynamic-datasheet select.form-select {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: inherit;
    height: 1.08rem;
    line-height: 1.1;
    max-width: 100%;
    min-height: 0;
    min-width: 0;
    outline: 0;
    padding: 0 0.12rem;
    width: 100%;
}

.app-document-header-table-wrap {
    max-height: 14rem;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
}

.app-document-header-table {
    margin-left: 0 !important;
    margin-right: 0 !important;
    table-layout: fixed;
    width: 100%;
}

.app-document-header-table th,
.app-document-header-table td {
    height: 1.35rem;
    line-height: 1.15;
    max-width: var(--app-document-header-col-width, auto);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: var(--app-document-header-col-width, auto);
}

.app-document-header-master .app-datasheet-navigator,
.app-document-detail .app-datasheet-navigator {
    width: 100%;
}

.app-document-header-table tr.is-selected > td {
    background: #eef5ff;
}

.app-document-detail .app-dynamic-datasheet tbody tr.is-selected > td,
.app-document-detail .app-dynamic-datasheet tbody tr.is-selected:hover > td {
    background: #eef5ff;
}

.app-document-header-input {
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-sizing: border-box;
    display: block;
    font-size: inherit;
    height: 1.08rem;
    inline-size: 100%;
    line-height: 1.1;
    max-width: 100%;
    min-inline-size: 0;
    min-width: 0;
    outline: 0;
    overflow: hidden;
    padding: 0 0.12rem;
    text-overflow: ellipsis;
    width: 100%;
}

.app-document-header-input:focus {
    box-shadow: inset 0 0 0 1px var(--bs-primary);
}

.app-document-header-table .app-datasheet-new-placeholder {
    font-size: 0.66rem;
    font-weight: 600;
    left: 0.22rem;
}

.app-document-header-table tr[data-new-row="1"]:not(.has-value) td.position-relative .app-document-header-input {
    padding-left: 1.9rem;
}

.app-document-row-actions {
    align-items: center;
    display: flex;
    gap: 0.2rem;
    margin-left: auto;
}

.app-document-primary-action {
    margin-left: 0.55rem;
}

#documentSubmitStatus {
    z-index: 1060;
}

#documentSubmitStatus.is-error {
    align-items: center;
    min-height: 1.7rem;
    padding-bottom: 0.25rem;
    padding-top: 0.25rem;
}

#documentSubmitStatus span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-dynamic-document form > .app-field-help.app-window-statusbar {
    display: none !important;
}

/* Form designer */
.designer-page {
    font-size: 0.82rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.designer-page .form-label {
    margin-bottom: 0.12rem;
}

.designer-section {
    border-top: 1px solid var(--bs-border-color);
    padding-top: 0.65rem;
}

.designer-field-table {
    font-size: 0.72rem;
    min-width: 1180px;
}

.designer-language-table {
    min-width: 820px;
}

.designer-field-table th,
.designer-field-table td {
    padding: 0.16rem 0.25rem;
    vertical-align: top;
}

.designer-field-table .form-control,
.designer-field-table .form-select,
.designer-page .form-control-sm,
.designer-page .form-select-sm {
    font-size: 0.76rem;
    min-height: 1.55rem;
    padding-bottom: 0.08rem;
    padding-top: 0.08rem;
}

.designer-checks {
    display: grid;
    gap: 0.35rem 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(9rem, max-content));
}

.designer-toolbar {
    display: block;
}

.designer-title-row {
    justify-content: space-between;
}

.designer-action-menu {
    bottom: 2.4rem;
    position: fixed;
    right: 0.8rem;
    z-index: 1070;
}

.designer-action-menu > .btn {
    background: var(--bs-body-bg);
    font-size: 1.25rem;
    height: 4rem;
    width: 4rem;
}

.designer-action-menu .dropdown-item {
    align-items: center;
    display: flex;
    font-size: 0.78rem;
    gap: 0.45rem;
}

.designer-action-menu .dropdown-item .bi {
    flex: 0 0 1rem;
    text-align: center;
}

.designer-menu-row {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
}

.designer-menu-toggle {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    margin: 0 0 0.12rem;
    min-height: 1.55rem;
}

.designer-menu-group {
    flex: 0 1 20rem;
}

.designer-menu-order {
    flex: 0 0 7rem;
}

.designer-menu-hint {
    flex: 0 1 27rem;
    padding-bottom: 0.15rem;
}

.designer-load-form {
    width: min(34rem, 100%);
}

.designer-form-lookup-wrap {
    flex: 1 1 22rem;
    position: relative;
}

.designer-load-form .form-control {
    min-width: 12rem;
}

.designer-form-dropdown {
    background: #fff;
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 0.35rem 0.9rem rgba(15, 23, 42, 0.14);
    color: var(--bs-body-color);
    display: none;
    left: 0;
    max-height: 17rem;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 0.18rem);
    z-index: 1080;
}

.designer-form-dropdown.is-open {
    display: block;
}

.designer-form-option {
    border-bottom: 1px solid var(--bs-border-color-translucent);
    cursor: pointer;
    padding: 0.32rem 0.55rem;
}

.designer-form-option:last-child {
    border-bottom: 0;
}

.designer-form-option:hover,
.designer-form-option.is-active {
    background: #eaf2ff;
}

.designer-form-option-title {
    font-weight: 650;
    line-height: 1.2;
}

.designer-form-option-meta {
    color: var(--bs-secondary-color);
    font-size: 0.7rem;
    line-height: 1.2;
    margin-top: 0.1rem;
}

.designer-form-option-empty {
    color: var(--bs-secondary-color);
    cursor: default;
    padding: 0.4rem 0.55rem;
}

.designer-session-param-select {
    max-width: 28rem;
}

.designer-lookup-cell.is-hidden {
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    text-align: center;
}

.designer-lookup-cell.is-hidden > * {
    display: none;
}

.designer-lookup-cell.is-hidden::after {
    content: "\2014";
}

.designer-lookup-param-grid {
    display: grid;
    gap: 0.12rem;
    min-width: 30rem;
}

.designer-source-params-cell .designer-lookup-param-grid {
    max-width: 42rem;
}

.designer-lookup-param-row {
    display: grid;
    gap: 0.12rem;
    grid-template-columns: minmax(4.8rem, 0.8fr) minmax(6.2rem, 0.9fr) minmax(7rem, 1.2fr) minmax(4.6rem, 0.65fr) 1.6rem;
}

.designer-lookup-param-row.is-heading {
    color: var(--bs-secondary-color);
    font-size: 0.68rem;
    font-weight: 650;
}

.designer-default-config {
    display: flex;
    gap: 0.12rem;
    min-width: 12rem;
}

.designer-default-config [data-default-source] {
    flex: 0 0 5.5rem;
}

.designer-default-config [data-default-input] {
    min-width: 6rem;
}

.designer-field-flags {
    display: grid;
    gap: 0.08rem 0.55rem;
    grid-template-columns: repeat(2, max-content);
    min-width: 10.5rem;
}

.designer-field-flags .form-check {
    align-items: center;
    display: inline-flex;
    margin: 0;
    min-height: 1.2rem;
    white-space: nowrap;
}

.designer-field-flags .form-check-input {
    flex: 0 0 auto;
    margin-bottom: 0;
    margin-top: 0;
}

.designer-field-actions {
    min-width: 5.4rem;
    white-space: nowrap;
}

.designer-field-actions .btn {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-width: 1.7rem;
}

[data-designer-mode].is-hidden {
    display: none;
}

@media (max-width: 768px) {
    .app-work-page {
        padding-top: 0.9rem !important;
    }

    .app-work-page > .app-compact-breadcrumb {
        height: 1.7rem;
        max-height: 1.7rem;
    }

    .app-page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .app-page-title {
        font-size: 1rem;
    }

    .app-page-search {
        margin-bottom: 0.65rem !important;
    }

    .app-user-editor-grid {
        grid-template-columns: 1fr;
    }

    .app-user-editor-field.is-wide {
        grid-column: auto;
    }

    .app-document-header-master {
        margin-bottom: 0.5rem;
    }

    .app-document-detail {
        margin-top: 0.4rem;
    }

    .platform-contract-layout {
        grid-template-columns: 1fr;
    }
}
